/* The first screen: a painted backdrop, a jali railing with the peacock on his post, a flower field,
   jasmine along the top with lanterns hanging from it, and the names in the middle.
   Everything inside is sized in the scene's own units (cqw / cqh), so it scales with the screen. */
.sc { position: relative; overflow: hidden; container-type: size; height: max(600px, calc(100svh - 56px)); background: linear-gradient(#FCFDFB, #EEF4F0 48%, #E1EBE4); }
.sc > .layer { position: absolute; inset: 0; pointer-events: none; }
.art { position: absolute; }
.art > i { position: absolute; inset: 0; display: block; background: var(--a) center / contain no-repeat; }

/* ---------- the backdrop: the three paintings the couple are choosing between (js/main.js switches them) ---------- */
.back {
  position: absolute; inset: 0;
  background: var(--bgart) var(--bgpos) / cover no-repeat;
  -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent);
  translate: 0 calc(var(--sy, 0) * .35px);   /* the sky slides slower than the page as you scroll */
}
body[data-bg="northhead"] { --bgart: var(--a-bg-northhead); --bgpos: 50% 30%; }
body[data-bg="lake"] { --bgart: var(--a-bg-lake); --bgpos: 50% 62%; }
body[data-bg="sunset"] { --bgart: var(--a-bg-sunset); --bgpos: 50% 45%; }
@media (max-width: 820px) {
  .back { background-position: 78% 40%; }
  body[data-bg="lake"] { --bgart: var(--a-bg-lake-m); }   /* a taller crop of the lake for phones */
}
@media (min-width: 821px) {
  /* the two lakes on wide screens: raise the painting so the water shows above the railing.
     The lake's waterline (75% down the painting) sits 42% down the scene; the sunset's horizon (58%) 40% down. */
  body[data-bg="lake"] .back { background-size: 100vw auto; background-position: 50% calc(.42 * (100svh - 56px) - 42vw); background-color: #C8C4B4; }
  body[data-bg="sunset"] .back { background-size: 100vw auto; background-position: 50% calc(.40 * (100svh - 56px) - 32.5vw); background-color: #D9A988; }
}
/* a soft green ground at the foot of the painting */
.mist { position: absolute; inset: 66% 0 0; background: linear-gradient(#DCE7CF00, #CFE0C055 50%, #B9D1A6a6); }

/* ---------- the railing, the birds and the flower field ---------- */
/* the railing's top line is --railtop (set by js/garden.js, where the peacock's feet are); the picture rises 12% above it */
.fg-rail {
  position: absolute; left: 0; right: 0; bottom: 6cqh; height: calc((var(--railtop) - 6cqh) / .88); z-index: 3; pointer-events: none;
  background: var(--a-rail-jali) 0 0 / auto 100% repeat-x; filter: drop-shadow(0 6px 10px #5E74661f);
}
.fg-birds { z-index: 4; }
.fg-rail, .fg-birds { translate: 0 calc(var(--sy, 0) * .1px); }
.fg-field { position: absolute; left: 0; right: 0; bottom: -1.5cqh; height: min(28cqh, 39cqw); z-index: 5; pointer-events: none; background: var(--a-fl3g) 0 0 / auto 100% repeat-x; }
@media (max-width: 820px) {
  .fg-rail { bottom: 4cqh; height: calc((var(--railtop) - 4cqh) / .88); }
  .fg-field { height: 16cqh; }
}

/* ---------- the names ---------- */
.og-t { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 6; width: min(860px, 92cqw); text-align: center; display: grid; justify-items: center; gap: 12px; color: #26402F; }
.og-t .pre { font: 400 1.05rem/1 "Tiro Devanagari Hindi", serif; color: #A67C2E; }
.og-t h1 { font: 500 clamp(3.3rem, 11cqmin, 7.4rem)/1 "Cormorant Garamond", serif; }
.og-t h1 i { color: #A67C2E; font-weight: 400; }
.og-t .when { font: 500 clamp(1.02rem, 2.4cqmin, 1.3rem)/1.4 "Jost", sans-serif; margin-top: 8px; }
.og-t .btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
@media (max-width: 820px) {
  .og-t { top: 33cqh; transform: translateX(-50%); gap: 8px; }
  .og-t h1 { font-size: 2.95rem; }
}

/* ---------- the jasmine vines along the top, moving in a slow breeze ---------- */
.lg-canopy { z-index: 6; }
.fg-vines > .art { transform-origin: 50% 0; animation: fg-breeze 8s ease-in-out infinite alternate; }
.fg-vines > .art:nth-child(2) { animation-duration: 9.5s; animation-delay: -3s; }
.fg-vines > .art:nth-child(3) { animation: fg-swag 7s ease-in-out -2s infinite alternate; }
@keyframes fg-breeze { from { rotate: -.7deg; } to { rotate: .9deg; } }
@keyframes fg-swag { from { translate: 0 -.3cqh; rotate: -.3deg; } to { translate: 0 .5cqh; rotate: .3deg; } }

/* ---------- the lanterns: painted brass on a chain, swinging, with a candle glow that breathes ---------- */
.fg-lamps { z-index: 7; }
.lamp {
  position: absolute; top: 0; pointer-events: none; transform-origin: 50% 0; animation: swing var(--d, 5s) ease-in-out var(--dl, 0s) infinite alternate;
  background: var(--a-lantern1) 50% 100% / 100% auto no-repeat, repeating-linear-gradient(to bottom, #7A6232 0 3px, #C2A15A 3px 6px) 50% 0 / 1.6px 100% no-repeat;
  filter: brightness(1.18) saturate(1.3) contrast(1.06) drop-shadow(0 0 1.2cqh rgba(255, 196, 90, .55));
}
@keyframes swing { from { transform: rotate(var(--a0, -2.2deg)); } to { transform: rotate(var(--a1, 2.2deg)); } }
.lamp::after {
  content: ""; position: absolute; left: -35%; width: 170%; aspect-ratio: 1; bottom: 0; transform: translateY(-38%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 206, 120, .55), rgba(255, 190, 90, .18) 55%, transparent); mix-blend-mode: screen;
  animation: fg-flicker 11s ease-in-out infinite alternate;
}
@keyframes fg-flicker { 0% { opacity: .62; } 30% { opacity: .95; } 55% { opacity: .74; } 80% { opacity: 1; } 100% { opacity: .7; } }

/* ---------- jasmine petals drifting down: each falls in the first 40% of its cycle, then rests ---------- */
.fg-petals { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.fg-petals span { position: absolute; left: var(--x); top: -4cqh; animation: fg-fall var(--dur) linear var(--del) infinite; }
.fg-petals i {
  display: block; width: calc(11px * var(--sc)); height: calc(15px * var(--sc)); border-radius: 55% 55% 50% 50% / 75% 75% 30% 30%;
  background: radial-gradient(ellipse at 40% 30%, #FFFFFF, #FBF4E8 55%, #E8D9C2); box-shadow: 0 1px 2px #5a4a3022;
  animation: fg-flutter calc(var(--dur) / 5) ease-in-out var(--del) infinite alternate;
}
@keyframes fg-fall { 0% { transform: translate(0, 0); opacity: 0; } 3% { opacity: .95; } 36% { opacity: .9; } 40%, 100% { transform: translate(var(--dx), 108cqh); opacity: 0; } }
@keyframes fg-flutter { from { transform: translateX(-1.6cqw) rotate(0deg) scaleX(1); } to { transform: translateX(1.6cqw) rotate(var(--rt)) scaleX(.55); } }

/* ---------- a fine paper grain over the whole scene (not on phones, where it costs too much memory) ---------- */
.grain {
  position: absolute; inset: 0; z-index: 20; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .42 0 0 0 0 .36 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (max-width: 820px) {
  .grain { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fg-petals { display: none; }
  .fg *, .fg *::after { animation: none !important; }
  .back, .fg-rail, .fg-birds { translate: none !important; }
}
