@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root{
  --night-deep:#0a0614;
  --night-mid:#1a0a20;
  --night-wine:#4a1730;
  --plum-card:#2a1226;

  --lantern-orange:#ffb347;
  --lantern-red:#e85d3f;
  --lantern-deep:#c9432c;

  --cream:#fdf0e4;
  --gold-soft:#e8a86a;
  --lilac:#d9bfd0;
  --dusty-plum:#dcb6c6;

  --display-font:'Playfair Display', serif;
  --body-font:'Space Grotesk', sans-serif;

  --radius-lg:28px;
  --radius-md:18px;
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}

body{
  font-family:var(--body-font);
  color:var(--cream);
  min-height:100vh;
  width:100%;
  overflow-x:hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 100%, var(--night-wine) 0%, var(--night-mid) 55%, var(--night-deep) 100%);
  position:relative;
}

/* twinkling stars, fixed across all pages */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-3;
  pointer-events:none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 60%, #fff, transparent),
    radial-gradient(1px 1px at 40% 80%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 85% 20%, #fff, transparent),
    radial-gradient(1px 1px at 55% 15%, #fff, transparent),
    radial-gradient(1px 1px at 12% 55%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 92% 75%, #fff, transparent);
  background-size:280px 280px;
  opacity:.55;
  animation:twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle{0%{opacity:.4}100%{opacity:.7}}

a{color:inherit;text-decoration:none}
button{font-family:inherit}
::selection{background:var(--lantern-orange);color:var(--night-deep)}

/* ---------------- Floating lanterns (ambient bg, replaces petals) ---------------- */
.lanterns-layer{
  position:fixed;
  inset:0;
  z-index:2;
  overflow:hidden;
  pointer-events:none;
}
.lantern{
  position:absolute;
  bottom:-10vh;
  width:30px;
  height:40px;
  border-radius:9px 9px 5px 5px;
  background:linear-gradient(180deg, var(--lantern-orange), var(--lantern-deep));
  box-shadow:0 0 22px 7px rgba(255,150,60,.45);
  will-change:transform,opacity;
  animation-name:lanternRise;
  animation-timing-function:ease-in-out;
  animation-iteration-count:infinite;
}
.lantern::before{
  content:"";
  position:absolute;
  top:-6px;left:50%;
  transform:translateX(-50%);
  width:12px;height:6px;
  background:#ffe0ae;
  border-radius:2px;
}
.lantern::after{
  content:"";
  position:absolute;
  left:50%;bottom:-9px;
  transform:translateX(-50%);
  width:1px;height:10px;
  background:rgba(255,200,140,.4);
}
@keyframes lanternRise{
  0%{transform:translate(0,0) rotate(0deg);opacity:0;}
  8%{opacity:1;}
  50%{transform:translate(var(--drift1,14px), -55vh) rotate(2deg);}
  92%{opacity:.85;}
  100%{transform:translate(var(--drift2,-10px), -112vh) rotate(-2deg);opacity:0;}
}

/* ---------------- Layout shell ---------------- */
.page-wrap{
  position:relative;
  z-index:3;
  min-height:100vh;
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:80px 24px 70px;
}

.page-wrap.enter{animation:pageIn .8s ease both;z-index:5}
.page-wrap.exit{animation:pageOut .5s ease both;z-index:2}
@keyframes pageIn{from{opacity:0;transform:translateY(24px) scale(.99)}to{opacity:1;transform:none}}
@keyframes pageOut{from{opacity:1;transform:none}to{opacity:0;transform:translateY(-18px) scale(.99)}}

/* first-load center-burst reveal (entrance -> route 1 only) */
@keyframes circleReveal{
  from{clip-path:circle(0% at 50% 50%);}
  to{clip-path:circle(150% at 50% 50%);}
}
.page-wrap.circle-in{
  animation:circleReveal .85s cubic-bezier(.65,.05,.36,1) forwards;
  z-index:6;
}

/* golden burst-flash — a quick pulse of lantern light from the screen's
   center, timed with the circle-reveal above, so the "opening" reads
   clearly instead of getting hidden under the entrance's own fade */
.burst-flash{
  position:fixed;
  inset:0;
  z-index:900;
  pointer-events:none;
  opacity:0;
  background:radial-gradient(circle at 50% 50%, rgba(255,224,174,.95) 0%, rgba(255,179,71,.7) 18%, rgba(232,93,63,.35) 38%, transparent 65%);
}
.burst-flash.burst-active{
  animation:burstFlashPulse .85s cubic-bezier(.25,.7,.4,1) forwards;
}
@keyframes burstFlashPulse{
  0%{opacity:0;transform:scale(.05);}
  18%{opacity:1;transform:scale(.5);}
  100%{opacity:0;transform:scale(2.6);}
}

.card{
  width:min(920px,94vw);
  padding:56px 48px;
  border-radius:var(--radius-lg);
  background:linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.01));
  border:1px solid rgba(232,168,106,.16);
  box-shadow:0 30px 90px rgba(5,2,8,.6), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter:blur(14px);
  text-align:center;
  position:relative;
}

.kicker{
  font-family:var(--body-font);
  letter-spacing:.32em;
  text-transform:uppercase;
  font-size:.72rem;
  font-weight:600;
  color:var(--gold-soft);
  margin-bottom:20px;
}

h1,h2,h3{
  font-family:var(--display-font);
  font-weight:700;
  line-height:1.08;
  color:var(--cream);
}
h1{font-size:clamp(2.6rem,7vw,4.6rem)}
h2{font-size:clamp(2.1rem,5.2vw,3.4rem)}
h3{font-size:clamp(1.5rem,3.5vw,2rem)}

p{
  font-family:var(--body-font);
  font-weight:300;
  color:var(--lilac);
  font-size:clamp(1rem,1.9vw,1.18rem);
  line-height:1.85;
}

.accent{
  background:linear-gradient(90deg,#ffcf8a,#ff9d76);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  font-weight:700;
}

.btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  border:0;
  padding:16px 34px;
  border-radius:999px;
  background:linear-gradient(135deg,var(--lantern-red),var(--lantern-orange));
  color:var(--night-deep);
  font-size:1rem;
  font-weight:700;
  letter-spacing:.02em;
  cursor:pointer;
  box-shadow:0 14px 34px rgba(232,93,63,.35), 0 0 0 1px rgba(255,179,71,.35) inset;
  transition:transform .25s ease, box-shadow .25s ease;
}
.btn:hover{transform:translateY(-3px);box-shadow:0 18px 42px rgba(232,93,63,.5), 0 0 0 1px rgba(255,179,71,.5) inset}
.btn:active{transform:translateY(0)}

/* ---------------- Top bar controls ---------------- */
.topbar{
  position:fixed;
  top:20px;
  left:0;right:0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 22px;
  z-index:40;
  pointer-events:none;
}
.topbar > *{pointer-events:auto}
.progress-tag{
  font-size:.78rem;
  letter-spacing:.14em;
  color:var(--dusty-plum);
  background:rgba(10,6,14,.5);
  border:1px solid rgba(232,168,106,.2);
  padding:8px 14px;
  border-radius:999px;
  backdrop-filter:blur(8px);
}
.music-toggle{
  border:1px solid rgba(232,168,106,.3);
  background:rgba(10,6,14,.55);
  color:var(--cream);
  padding:9px 16px;
  border-radius:999px;
  cursor:pointer;
  font-size:.85rem;
  backdrop-filter:blur(8px);
  transition:.25s;
}
.music-toggle:hover{background:rgba(74,23,48,.6);transform:translateY(-2px)}

/* ---------------- Bottom nav ---------------- */
.bottom-nav{
  display:flex;
  gap:10px;
  margin-top:38px;
  flex-wrap:wrap;
  justify-content:center;
}
.bottom-nav a,.bottom-nav button{
  border:1px solid rgba(232,168,106,.25);
  background:rgba(10,6,14,.55);
  color:var(--cream);
  padding:11px 18px;
  border-radius:999px;
  font-size:.85rem;
  cursor:pointer;
  backdrop-filter:blur(10px);
  transition:.25s;
}
.bottom-nav a:hover,.bottom-nav button:hover{background:rgba(74,23,48,.65);transform:translateY(-2px)}

/* ---------------- Rakhi SVG (main, mounted on route pages) ---------------- */
.rakhi-mount{
  width:min(230px,52vw);
  margin:0 auto 26px;
  position:relative;
}
.rakhi-mount svg{
  width:100%;
  height:auto;
  display:block;
  animation:rakhiFloat 4s ease-in-out infinite;
  filter:drop-shadow(0 0 26px rgba(255,179,71,.45)) drop-shadow(0 18px 30px rgba(0,0,0,.4));
}
.rakhi-glow{
  position:absolute;
  inset:-30%;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,179,71,.35), transparent 65%);
  filter:blur(18px);
  animation:glowPulse 3.4s ease-in-out infinite;
  z-index:-1;
}
@keyframes rakhiFloat{0%,100%{transform:translateY(0) rotate(0deg)}50%{transform:translateY(-10px) rotate(1.5deg)}}
@keyframes glowPulse{0%,100%{opacity:.55;transform:scale(1)}50%{opacity:.9;transform:scale(1.08)}}

/* ---------------- Entrance screen ---------------- */
.entrance{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 100%, var(--night-wine) 0%, var(--night-mid) 55%, var(--night-deep) 100%);
  transition:opacity .6s ease, visibility .6s ease;
}
.entrance.hide{opacity:0;visibility:hidden;pointer-events:none}

/* used on "Let's Go" click: clears near-instantly so the burst/circle-reveal
   underneath is actually visible, instead of being masked by a slow fade */
.entrance.hide-fast{
  transition:opacity .18s ease, visibility .18s ease;
  opacity:0;visibility:hidden;pointer-events:none;
}

.entrance-stars{
  position:absolute;
  inset:0;
  pointer-events:none;
  background-image:
    radial-gradient(1px 1px at 15% 25%, #fff, transparent),
    radial-gradient(1px 1px at 80% 15%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, #fff, transparent),
    radial-gradient(1px 1px at 30% 85%, #fff, transparent),
    radial-gradient(1px 1px at 92% 55%, #fff, transparent);
  background-size:320px 320px;
  opacity:.6;
}

.entrance-lantern{
  position:absolute;
  width:44px;
  height:58px;
  border-radius:12px 12px 6px 6px;
  background:linear-gradient(180deg, var(--lantern-orange), var(--lantern-deep));
  box-shadow:0 0 32px 10px rgba(255,150,60,.5);
  animation:lanternFloat 5s ease-in-out infinite;
}
.entrance-lantern::before{
  content:"";
  position:absolute;top:-8px;left:50%;transform:translateX(-50%);
  width:16px;height:8px;background:#ffe0ae;border-radius:3px;
}
.entrance-lantern.el1{top:12%;left:8%;animation-delay:0s}
.entrance-lantern.el2{top:10%;right:8%;transform:scale(.8);animation-delay:1.2s}
.entrance-lantern.el3{bottom:14%;left:6%;transform:scale(.7);animation-delay:2s}
.entrance-lantern.el4{bottom:16%;right:9%;transform:scale(.85);animation-delay:.6s}
@keyframes lanternFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-16px)}}
.entrance-lantern.el2{animation-name:lanternFloatScaled2}
.entrance-lantern.el3{animation-name:lanternFloatScaled3}
.entrance-lantern.el4{animation-name:lanternFloatScaled4}
@keyframes lanternFloatScaled2{0%,100%{transform:translateY(0) scale(.8)}50%{transform:translateY(-14px) scale(.8)}}
@keyframes lanternFloatScaled3{0%,100%{transform:translateY(0) scale(.7)}50%{transform:translateY(-12px) scale(.7)}}
@keyframes lanternFloatScaled4{0%,100%{transform:translateY(0) scale(.85)}50%{transform:translateY(-14px) scale(.85)}}

.entrance-content{
  position:relative;
  z-index:3;
  text-align:center;
  width:min(640px,90vw);
  padding:20px;
}
.entrance-kicker{
  letter-spacing:.34em;
  text-transform:uppercase;
  font-size:.72rem;
  color:var(--gold-soft);
  margin-bottom:14px;
  font-weight:600;
}
.entrance-title{
  font-family:var(--display-font);
  font-weight:900;
  font-size:clamp(2.2rem,6.5vw,3.6rem);
  line-height:1.12;
  color:var(--cream);
  margin-bottom:10px;
}
.entrance-title .accent{display:inline}
.entrance-line{
  margin-top:18px;
  font-family:var(--body-font);
  font-weight:300;
  color:var(--lilac);
  font-size:clamp(.95rem,2.2vw,1.1rem);
  max-width:480px;
  margin-left:auto;
  margin-right:auto;
  line-height:1.8;
}

/* Let's Go button, with diagonal rakhi + burst-ready */
.lets-go-btn{
  margin-top:34px;
  border:0;
  padding:17px 40px 17px 34px;
  border-radius:999px;
  background:linear-gradient(135deg,var(--lantern-red),var(--lantern-orange));
  color:var(--night-deep);
  font-size:1.02rem;
  font-weight:700;
  letter-spacing:.03em;
  cursor:pointer;
  box-shadow:0 16px 40px rgba(232,93,63,.45), 0 0 0 1px rgba(255,179,71,.4) inset;
  animation:btnPulse 2.4s ease-in-out infinite;
  transition:transform .25s;
  display:inline-flex;
  align-items:center;
  gap:10px;
}
.lets-go-btn:hover{transform:translateY(-3px) scale(1.03)}
@keyframes btnPulse{0%,100%{box-shadow:0 16px 40px rgba(232,93,63,.45),0 0 0 1px rgba(255,179,71,.4) inset}50%{box-shadow:0 20px 55px rgba(232,93,63,.65),0 0 0 1px rgba(255,179,71,.65) inset}}

.btn-rakhi{
  display:inline-flex;
  width:24px;
  height:24px;
  transform:rotate(-28deg);
  flex-shrink:0;
}
.btn-rakhi svg{width:100%;height:100%;display:block}

.entrance-note{
  margin-top:16px;
  font-size:.75rem;
  color:var(--dusty-plum);
  letter-spacing:.03em;
}

/* ---------------- Text reveal (page1) ---------------- */
.reveal-line{
  opacity:0;
  transform:translateY(16px);
  animation:revealUp .9s ease forwards;
}
@keyframes revealUp{to{opacity:1;transform:none}}

/* ---------------- Distance page ---------------- */
.distance-visual{
  width:100%;
  max-width:640px;
  margin:34px auto 14px;
}
.distance-visual svg{width:100%;height:auto;overflow:visible}
.thread-path{
  stroke-dasharray:8 10;
  animation:dashFlow 3.4s linear infinite;
}
@keyframes dashFlow{to{stroke-dashoffset:-180}}
.node-pulse{
  animation:nodePulse 2.6s ease-in-out infinite;
  transform-origin:center;
}
@keyframes nodePulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.25);opacity:.5}}

/* ---------------- Cards grid (page4) — sticky-note style ---------------- */
.say-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:22px 18px;
  margin:40px 0 8px;
  text-align:left;
}
.say-card{
  position:relative;
  padding:26px 22px 22px;
  border-radius:4px 14px 14px 14px;
  background:linear-gradient(155deg, rgba(255,179,71,.1), rgba(255,255,255,.02));
  border:1px solid rgba(232,168,106,.18);
  box-shadow:0 14px 30px rgba(5,2,8,.4);
  font-family:var(--display-font);
  font-weight:700;
  font-size:1.2rem;
  color:var(--cream);
  opacity:0;
  animation:cardIn .7s ease forwards;
}
/* a little pin of "wax" at the top of each note, in the rakhi gold/red tones */
.say-card::before{
  content:"";
  position:absolute;
  top:-9px;
  left:22px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #ffdca8, var(--lantern-red) 70%);
  box-shadow:0 3px 6px rgba(0,0,0,.35);
}
/* alternate tilt so the grid reads as notes pinned up, not a spreadsheet */
.say-card:nth-child(1){transform:rotate(-1.4deg)}
.say-card:nth-child(2){transform:rotate(1.1deg)}
.say-card:nth-child(2)::before{left:auto;right:22px}
.say-card:nth-child(3){transform:rotate(1.6deg)}
.say-card:nth-child(3)::before{left:auto;right:26px}
.say-card:nth-child(4){transform:rotate(-1.2deg)}
@keyframes cardIn{from{opacity:0;transform:translateY(16px) rotate(0deg)}to{opacity:1;transform:none}}
.say-card:nth-child(1).say-card{animation-name:cardIn1}
@keyframes cardIn1{from{opacity:0;transform:translateY(16px) rotate(-1.4deg)}to{opacity:1;transform:rotate(-1.4deg)}}
.say-card:nth-child(2){animation-name:cardIn2}
@keyframes cardIn2{from{opacity:0;transform:translateY(16px) rotate(1.1deg)}to{opacity:1;transform:rotate(1.1deg)}}
.say-card:nth-child(3){animation-name:cardIn3}
@keyframes cardIn3{from{opacity:0;transform:translateY(16px) rotate(1.6deg)}to{opacity:1;transform:rotate(1.6deg)}}
.say-card:nth-child(4){animation-name:cardIn4}
@keyframes cardIn4{from{opacity:0;transform:translateY(16px) rotate(-1.2deg)}to{opacity:1;transform:rotate(-1.2deg)}}

/* the payoff line — set apart as the emotional peak of the page */
.say-final{
  margin-top:34px;
  font-family:var(--display-font);
  font-weight:900;
  font-size:clamp(1.7rem,4.2vw,2.5rem);
  text-shadow:0 4px 24px rgba(255,157,118,.35);
}

/* the single closing line of a longer passage — bigger and warmer than
   the lines leading up to it, so the payoff actually reads as a payoff */
.poem-peak{
  display:inline-block;
  margin-top:6px;
  font-family:var(--display-font);
  font-weight:700;
  font-size:1.25em;
  background:linear-gradient(90deg,#ffcf8a,#ff9d76);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

/* small, quiet back/home links for the reel page — kept separate from the
   reel's own Previous/Next controls so the two pairs never collide */
.reel-topnav{
  display:flex;
  justify-content:center;
  gap:8px;
  margin-bottom:22px;
}
.reel-topnav button{
  border:1px solid rgba(232,168,106,.2);
  background:rgba(10,6,14,.4);
  color:var(--dusty-plum);
  padding:7px 14px;
  border-radius:999px;
  font-size:.76rem;
  cursor:pointer;
  transition:.2s;
}
.reel-topnav button:hover{background:rgba(74,23,48,.55);color:var(--cream)}

/* route 3 has no fixed bottom-nav — the reel controls are the only
   bottom-anchored actions, so page-wrap doesn't need the extra
   bottom padding reserved for it on this route */
.route-section[data-route="3"].page-wrap{padding-bottom:80px}

/* ---------------- Reel player (page3) ---------------- */
.reel-stage{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:18px;
  margin:30px auto 6px;
  width:100%;
}
.reel-video-wrap{
  position:relative;
  width:min(280px,62vw);
  aspect-ratio:9/16;
  border-radius:22px;
  overflow:hidden;
  background:#0c0308;
  box-shadow:0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(232,168,106,.22);
  flex-shrink:0;
}
.reel-video-wrap video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.reel-controls{
  display:flex;
  justify-content:space-between;
  align-items:center;
  width:100%;
  max-width:420px;
  gap:10px;
}
.reel-btn{
  border:1px solid rgba(232,168,106,.3);
  background:rgba(10,6,14,.6);
  color:var(--cream);
  padding:13px 20px;
  border-radius:999px;
  cursor:pointer;
  font-weight:600;
  font-size:.88rem;
  white-space:nowrap;
  backdrop-filter:blur(8px);
  transition:transform .2s, background .2s;
  flex-shrink:0;
}
.reel-btn:hover{transform:translateY(-2px);background:rgba(74,23,48,.7)}
.reel-btn.next{background:linear-gradient(135deg,var(--lantern-red),var(--lantern-orange));color:var(--night-deep);border-color:transparent;font-weight:700}
.reel-counter{
  color:var(--dusty-plum);
  font-size:.9rem;
  letter-spacing:.05em;
}
.reel-note{
  margin-top:14px;
  font-size:.82rem;
  color:var(--dusty-plum);
}

@media(max-width:520px){
  .reel-controls{max-width:100%;padding:0 4px}
  .reel-btn{padding:10px 13px;font-size:.72rem}
  .reel-video-wrap{width:min(220px,58vw)}
  .say-grid{grid-template-columns:1fr}
}
@media(max-width:360px){
  .reel-btn{padding:9px 10px;font-size:.66rem}
}

/* ---------------- Route sections (single-page navigation) ---------------- */
.route-section{
  display:none;
}
.route-section.active{
  display:flex;
  position:fixed;
  inset:0;
  overflow-y:auto;
}

/* ---------------- Responsive base ---------------- */
@media(max-width:700px){
  .card{padding:38px 24px}
  .page-wrap{padding:70px 16px 60px}
  .bottom-nav a{padding:9px 14px;font-size:.8rem}
  .entrance-lantern{width:34px;height:46px}
}

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