/* =========================================================
   Smit & Jeel — Shubh Sagai
   "The Woven Atlas": cut paper + raised silk embroidery + sewn-on labels.
   Gate (trishul & damru) → Badrinath landing → one long embroidered linen page
   ========================================================= */
:root {
  --night: #1c2347;
  --night-d: #121733;
  --linen: #efe6d3;
  --paper: #f7f0e1;
  --ink: #2a2f57;        /* indigo thread */
  --maroon: #7a1f33;     /* maroon silk */
  --maroon-d: #5a1426;
  --gold: #b98a3e;
  --gold-l: #e9c98a;
  --rose: #d98ca0;

  --f-caps: "Cinzel", "Times New Roman", serif;
  --f-serif: "Cormorant Garamond", Georgia, serif;
  --f-gu: "Noto Serif Gujarati", serif;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --cw: min(100vw, 600px); /* width of the linen page column */
  --u: var(--cw);            /* type unit on the linen page */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  font-family: var(--f-serif); font-size: 19px; line-height: 1.45;
  color: var(--ink); background: var(--night);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; height: 100svh; }
img { max-width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.gu { font-family: var(--f-gu); }

.w { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; will-change: transform, opacity, filter; }

/* sewn-on fabric label (the "LISBON" tag of the reference) */
.label {
  display: inline-flex; align-items: center; gap: .9em; margin: 0;
  padding: .62em 1.3em .55em; border-radius: 3px;
  font-family: var(--f-caps); font-size: 13px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink);
  background: linear-gradient(180deg, #fbf5e8, #efe4cc);
  box-shadow: inset 0 0 0 4px #f6eddb, inset 0 0 0 5px rgba(42, 47, 87, .18), 0 3px 0 rgba(120, 90, 50, .12), 0 8px 18px rgba(20, 16, 40, .28);
  position: relative;
}
.label::after { /* running stitch inside the edge */
  content: ""; position: absolute; inset: 7px; border-radius: 2px; pointer-events: none;
  border: 1px dashed rgba(42, 47, 87, .35);
}
.label span { font-size: 1.25em; letter-spacing: 0; color: var(--ink); opacity: .85; }
.label-sm { font-size: 11px; }

/* ---------------- LOADER ---------------- */
#loader {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--linen);
  transition: opacity .9s var(--ease), visibility .9s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-logo { width: 120px; animation: breathe 2.4s ease-in-out infinite; }
.loader-bar { width: 140px; height: 2px; background: rgba(122, 31, 51, .15); border-radius: 2px; overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: var(--maroon); transition: width .5s var(--ease); }
@keyframes breathe { 50% { transform: scale(1.05); opacity: .8; } }

/* ---------------- GATE ---------------- */
#gate {
  position: fixed; inset: 0; z-index: 300; overflow: hidden;
  cursor: pointer; outline: none; perspective: 1600px;
}
.gate-half { position: absolute; top: 0; bottom: 0; width: 50.2%; overflow: hidden; will-change: transform; backface-visibility: hidden; }
.gate-l { left: 0; transform-origin: 0 50%; box-shadow: inset -10px 0 18px -12px rgba(0,0,0,.5); }
.gate-r { right: 0; transform-origin: 100% 50%; box-shadow: inset 10px 0 18px -12px rgba(0,0,0,.5); }
.gate-art {
  position: absolute; top: -3%; bottom: -3%; width: 199.2%;
  background: var(--night) url("../assets/img/gate.webp") center 78% / cover no-repeat;
  will-change: transform;
}
@media (min-aspect-ratio: 4/5) { /* wide screens: whole artwork, blurred copy fills the sides */
  .gate-art { background: var(--night); overflow: hidden; }
  .gate-art::before, .gate-art::after { content: ""; position: absolute; inset: 0; }
  .gate-art::before { inset: -40px; background: url("../assets/img/gate.webp") center 70% / cover no-repeat; filter: blur(26px) brightness(.7); }
  .gate-art::after { background: url("../assets/img/gate.webp") center / auto 100% no-repeat; }
}
.gate-l .gate-art { left: 0; }
.gate-r .gate-art { right: 0; }
.gate-top {
  position: absolute; left: 0; right: 0; top: max(17.5svh, 100px); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.gate-sub { margin: 0; font-style: italic; font-size: clamp(22px, 6vw, 30px); color: #f6eddb; text-shadow: 0 2px 14px rgba(6, 8, 30, .7); }

.emblem {
  position: absolute; left: 50%; top: 52%; z-index: 3;
  height: min(46svh, 430px); aspect-ratio: 353 / 1000;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.trishul { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 10px 14px rgba(6, 8, 30, .55)); }
.damru { /* tied just below the paper collar; it twists about its waist */
  position: absolute; left: 50%; top: 61%; width: 132%; z-index: 2;
  transform: translate(-50%, -33%); transform-origin: 50% 33%;
  filter: drop-shadow(0 8px 10px rgba(6, 8, 30, .5)); will-change: transform;
}
.emblem-halo {
  position: absolute; left: 50%; top: 24%; width: 300%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 226, 160, .55) 0%, rgba(240, 190, 100, .22) 32%, transparent 66%);
  animation: halo 3.2s ease-in-out infinite;
}
.emblem-rays {
  position: absolute; left: 50%; top: 24%; width: 400%; aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0;
  border-radius: 50%; mix-blend-mode: screen;
  background: repeating-conic-gradient(from 0deg, rgba(255, 230, 170, .35) 0 4deg, transparent 4deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 62%); mask: radial-gradient(circle, #000 10%, transparent 62%);
}
@keyframes halo { 50% { opacity: .65; transform: translate(-50%, -50%) scale(.92); } }

.gate-tap {
  position: absolute; left: 50%; bottom: max(6svh, 34px); z-index: 3; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; margin: 0; white-space: nowrap;
  padding: 11px 24px; border-radius: 99px; color: var(--ink);
  font-family: var(--f-caps); font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
  background: rgba(247, 240, 225, .92);
  box-shadow: inset 0 0 0 3px rgba(247, 240, 225, .92), inset 0 0 0 4px rgba(42, 47, 87, .25), 0 10px 24px rgba(6, 8, 30, .45);
}
.tap-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--maroon); box-shadow: 0 0 0 0 rgba(122, 31, 51, .6); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 11px rgba(122, 31, 51, 0); } 100% { box-shadow: 0 0 0 0 rgba(122, 31, 51, 0); } }

#blooms { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 250; pointer-events: none; }

/* ---------------- MUSIC ---------------- */
.music-btn {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 260;
  width: 46px; height: 46px; border-radius: 50%;
  display: none; align-items: flex-end; justify-content: center; gap: 3px; padding: 14px 12px;
  background: rgba(247, 240, 225, .88); border: 1px dashed rgba(42, 47, 87, .4);
  box-shadow: 0 6px 16px rgba(6, 8, 30, .3); cursor: pointer;
}
.music-btn.show { display: flex; }
.music-btn span { width: 3px; height: 100%; background: var(--maroon); border-radius: 2px; transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.music-btn span:nth-child(2) { animation-delay: -.3s; } .music-btn span:nth-child(3) { animation-delay: -.6s; } .music-btn span:nth-child(4) { animation-delay: -.15s; }
.music-btn[aria-pressed="false"] span { animation: none; transform: scaleY(.25); }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ---------------- LANDING SCENE (pinned camera pan) ---------------- */
#scene { position: relative; height: 300svh; background: var(--linen); }
/* 100lvh = full screen with the phone's address bar hidden, so the painting never leaves a strip of
   page background under it when the bar slides away (with the bar shown, its bottom sits under the bar) */
.scene-sticky { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; }
.scene-blur {
  position: absolute; inset: -40px;
  background: url("../assets/img/scene.webp") center 40% / cover no-repeat;
  filter: blur(30px) saturate(1.05) brightness(.95);
  transform: scale(1.1);
}
.scene-cam {
  position: absolute; top: 0; left: 50%;
  width: var(--sw, 100vw); margin-left: calc(var(--sw, 100vw) / -2);
  transform-origin: 50% 0; will-change: transform;
  box-shadow: 0 0 70px 20px rgba(60, 50, 40, .25);
}
@media (max-width: 700px) { /* on phones the painting already covers the screen: skip the costly blurred copy + big shadow */
  .scene-blur { display: none; }
  .scene-cam { box-shadow: none; }
}
.scene-img { width: 100%; height: auto; }
.temple-glow { /* warm breathing light in the temple doorway */
  position: absolute; left: 50%; top: 58.5%; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 214, 140, .3), transparent 65%);
  animation: glow 4s ease-in-out infinite;
}
@keyframes glow { 50% { opacity: .4; } }
.ring-spark { position: absolute; left: 51%; top: 74.4%; width: 0; height: 0; pointer-events: none; }
.ring-spark i {
  position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; opacity: 0;
  background: radial-gradient(circle, #fff 0 8%, rgba(255, 246, 210, .9) 14%, transparent 42%),
              linear-gradient(90deg, transparent 46%, rgba(255, 250, 230, .95) 50%, transparent 54%),
              linear-gradient(0deg, transparent 46%, rgba(255, 250, 230, .95) 50%, transparent 54%);
}
.ring-spark.on i { animation: twinkle 1.9s ease-in-out infinite; }
.ring-spark i:nth-child(2) { left: 16px; top: -12px; transform: scale(.6); animation-delay: .5s !important; }
.ring-spark i:nth-child(3) { left: -14px; top: -6px; transform: scale(.45); animation-delay: 1.1s !important; }
@keyframes twinkle { 0%, 100% { opacity: 0; scale: .3; rotate: 0deg; } 45% { opacity: 1; scale: 1.15; rotate: 45deg; } }

.names {
  position: absolute; left: 0; right: 0; top: max(9svh, 54px); z-index: 3;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  will-change: transform, opacity;
}
.names h1 { margin: 16px 0 0; display: flex; flex-direction: column; align-items: center; font-weight: 400; }
.names .nm {
  font-family: var(--f-caps); font-weight: 500; font-size: clamp(50px, 15vw, 116px); line-height: .98; letter-spacing: .06em; color: var(--maroon);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 0 24px rgba(255, 248, 236, .95), 0 0 6px rgba(255, 248, 236, .9);
}
.names .amp { font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: clamp(34px, 9vw, 64px); line-height: 1; color: var(--gold); margin: 2px 0; text-shadow: 0 0 18px rgba(255, 248, 236, .95); }
.scene-date {
  margin: 16px 0 0; padding: 7px 16px 6px; border-radius: 2px;
  background: rgba(250, 244, 230, .88); box-shadow: 0 4px 12px rgba(40, 40, 70, .18);
  outline: 1px dashed rgba(42, 47, 87, .3); outline-offset: -5px; font-family: var(--f-caps); font-size: clamp(12px, 3.3vw, 16px); letter-spacing: .26em; text-transform: uppercase; color: var(--ink);
  text-shadow: 0 0 14px rgba(255, 248, 236, 1), 0 0 4px rgba(255, 248, 236, 1);
}
.scene-caption {
  position: absolute; left: 0; right: 0; top: max(7svh, 44px); z-index: 3; margin: 0 auto; opacity: 0;
  width: max-content; max-width: 88vw;
  padding: 10px 22px 9px; border-radius: 2px; text-align: center;
  font-style: italic; font-size: clamp(19px, 5.2vw, 28px); line-height: 1.25; color: var(--maroon);
  background: rgba(250, 244, 230, .92); box-shadow: 0 8px 20px rgba(40, 40, 70, .22);
  outline: 1px dashed rgba(122, 31, 51, .35); outline-offset: -6px;
}
.scroll-cue {
  position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 3; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--f-caps); font-size: 11px; letter-spacing: .35em; color: #fff8ea;
  text-shadow: 0 1px 8px rgba(40, 10, 20, .8);
}
.scroll-cue span { width: 1px; height: 38px; background: linear-gradient(#fff8ea, transparent); animation: drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 80% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------------- THE STORY : one long embroidered linen page ---------------- */
#story { position: relative; z-index: 4; background: var(--night); }
.story-card {
  position: relative; display: flow-root; width: var(--cw); margin: 0 auto;
  /* anchored to the bottom: hoop-bot.webp's top edge is pre-blended into exactly the linen rows that land behind it */
  background: var(--linen) url("../assets/img/linen.webp") bottom center / 100% auto repeat-y;
}
.band-top {
  position: relative; aspect-ratio: 768 / 560; /* attaches straight under the painting, no overlap */
  background: url("../assets/img/hoop-top.webp") top / 100% 100% no-repeat;
}
.band-bot {
  position: relative; aspect-ratio: 768 / 468; margin-top: calc(var(--cw) * -.06);
  background: url("../assets/img/hoop-bot.webp") bottom / 100% 100% no-repeat;
}
/* the text starts in the plain linen once the hanging vines have ended */
.story-inner { position: relative; z-index: 2; margin-top: calc(var(--cw) * -.4); padding: 0 13%; text-align: center; }
.blk { padding: calc(var(--u) * .04) 0; }
.divider { display: flex; align-items: center; justify-content: center; gap: 12px; margin: calc(var(--u) * .1) auto; width: 70%; }
.divider span { flex: 1; border-top: 1.5px dashed var(--gold); opacity: .8; }
.divider img { width: calc(var(--u) * .085); }
.caps-md { font-family: var(--f-caps); font-weight: 400; font-size: calc(var(--u) * .085); letter-spacing: .05em; line-height: 1.1; margin: 4px 0 0; color: var(--maroon); }

.tiny { font-size: calc(var(--u) * .036); margin: 0 0 10px; color: var(--maroon); opacity: .9; }
.soft { font-style: italic; font-size: calc(var(--u) * .055); line-height: 1.25; margin: 4px 0; color: var(--ink); }
.soft.small { font-size: calc(var(--u) * .045); }
.bless { font-family: var(--f-caps); font-weight: 500; font-size: calc(var(--u) * .066); letter-spacing: .04em; margin: 4px 0 0; color: var(--maroon); line-height: 1.15; }
.elders { font-size: calc(var(--u) * .05); margin: 4px 0 0; line-height: 1.3; }
.ganesha { width: calc(var(--u) * .3); margin: 2px auto 14px; }
.stitch-rule { display: block; width: 90px; height: 0; margin: calc(var(--u) * .045) auto; border-top: 1.5px dashed var(--gold); opacity: .9; }

.caps-xl { font-family: var(--f-caps); font-weight: 400; font-size: calc(var(--u) * .15); line-height: 1; letter-spacing: .06em; margin: 6px 0 8px; color: var(--maroon); }
.caps-sm { font-family: var(--f-caps); font-size: calc(var(--u) * .038); letter-spacing: .3em; text-transform: uppercase; margin: 0 0 6px; color: var(--gold); }
.nm-xl { font-family: var(--f-serif); font-weight: 400; font-size: calc(var(--u) * .2); line-height: .95; margin: calc(var(--u) * .05) 0 0; color: var(--ink); }
.amp-xl { font-family: var(--f-serif); font-style: italic; font-weight: 300; font-size: calc(var(--u) * .1); line-height: 1; margin: 6px 0 0; color: var(--gold); }
.parents { font-size: calc(var(--u) * .043); margin: 6px 0 0; line-height: 1.3; }
.parents em { display: block; font-size: .86em; opacity: .75; }

.rings { width: calc(var(--u) * .27); margin: 0 auto 12px; }
.when-day { font-family: var(--f-caps); font-size: calc(var(--u) * .06); letter-spacing: .2em; text-transform: uppercase; margin: 6px 0 2px; color: var(--ink); }
.when-date { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0; color: var(--maroon); }
.when-date > span:first-child { font-family: var(--f-caps); font-size: calc(var(--u) * .2); line-height: 1; }
.when-mid { text-align: left; font-family: var(--f-caps); font-size: calc(var(--u) * .05); letter-spacing: .14em; line-height: 1.2; text-transform: uppercase; border-left: 1.5px dashed var(--gold); padding-left: 14px; }
.when-time { font-style: italic; font-size: calc(var(--u) * .05); margin: 10px 0 0; }

/* envelope: body < card < pocket; the card rises out of the pocket on scroll */
.envelope {
  position: relative; display: block; width: calc(var(--u) * .6); aspect-ratio: 704 / 834;
  margin: calc(var(--u) * .3) auto 0; text-decoration: none; color: var(--ink);
}
.env-body, .env-pocket { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.env-body { z-index: 1; filter: drop-shadow(0 18px 22px rgba(60, 30, 40, .3)); }
.env-pocket { z-index: 3; }
.env-card {
  position: absolute; left: 7%; right: 7%; top: 37%; height: 60%; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 10px 8px;
  background: var(--paper); border-radius: 3px;
  box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(122, 31, 51, .25), 0 4px 14px rgba(40, 20, 30, .2);
  will-change: transform;
}
.env-card::after { content: ""; position: absolute; inset: 10px; border: 1px dashed rgba(185, 138, 62, .6); border-radius: 2px; pointer-events: none; }
.env-pin { width: 34%; margin-bottom: 2px; }
.card-k { font-family: var(--f-caps); font-size: calc(var(--u) * .045); letter-spacing: .05em; line-height: 1.1; color: var(--maroon); }
.card-v { font-size: calc(var(--u) * .034); line-height: 1.25; }
.card-cta { margin-top: 4px; font-family: var(--f-caps); font-size: calc(var(--u) * .024); letter-spacing: .2em; text-transform: uppercase; color: var(--maroon); border-bottom: 1px solid currentColor; padding-bottom: 1px; }

.end-logo { width: calc(var(--u) * .44); margin: calc(var(--u) * .03) auto calc(var(--u) * .02); filter: drop-shadow(0 6px 10px rgba(60, 30, 40, .15)); }
.hashtag { font-family: var(--f-caps); font-size: calc(var(--u) * .05); letter-spacing: .12em; margin: 0; color: var(--maroon); }
.regards { font-style: italic; font-size: calc(var(--u) * .046); margin: calc(var(--u) * .03) 0 0; line-height: 1.3; }
.end-gu { margin: 10px 0 0; }
.closing { padding-bottom: calc(var(--u) * .1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
