/* ============================================================================
   Happy Tihar — style.css
   Palette: crimson, marigold, warm gold and cream on a night sky.
   Everything is drawn with CSS gradients and inline SVG. No images, no web fonts.
   ========================================================================== */

:root {
  --ink: #160a10;
  --ink-soft: #241016;
  --crimson: #a01f38;
  --crimson-deep: #6d1226;
  --marigold: #f7a52b;
  --marigold-light: #ffc85c;
  --gold: #e8c27a;
  --cream: #fff3df;
  --muted: rgba(255, 243, 223, 0.72);
  --line: rgba(232, 194, 122, 0.22);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
  --radius: 28px;
  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
   1. Reset & base
   --------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin-top: 0; }

a { color: inherit; }

button,
input { font: inherit; }

button {
  color: inherit;
  touch-action: manipulation; /* no double-tap zoom when tapping scenes quickly */
  -webkit-tap-highlight-color: transparent;
}

/* The figurines are buttons first — long-press must not select or call out. */
.crow,
.dog,
.lamp,
.portrait {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

img, svg { max-width: 100%; }

::selection {
  background: rgba(247, 165, 43, 0.35);
  color: var(--cream);
}

:focus-visible {
  outline: 2px solid var(--marigold-light);
  outline-offset: 4px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------------------------------------------------------------------------
   2. Ambient night sky
   --------------------------------------------------------------------------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(247, 165, 43, 0.18), transparent 60%),
    radial-gradient(80% 60% at 8% 30%, rgba(160, 31, 56, 0.3), transparent 65%),
    radial-gradient(90% 70% at 95% 60%, rgba(109, 18, 38, 0.38), transparent 65%),
    linear-gradient(180deg, #1b0b12 0%, #13080d 45%, #1a0b12 100%);
}

.stars { position: absolute; inset: 0; }

.stars span {
  position: absolute;
  border-radius: 50%;
  background: #ffe9c4;
  box-shadow: 0 0 6px rgba(255, 233, 196, 0.7);
  animation: twinkle var(--dur, 5s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.glow {
  position: absolute;
  border-radius: 50%;
  opacity: 0.8;
  pointer-events: none;
}
.glow--one {
  top: -30vw;
  left: 50%;
  width: 60vw;
  height: 60vw;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(247, 165, 43, 0.22), transparent 68%);
}
.glow--two {
  top: 35vh;
  left: -18vw;
  width: 46vw;
  height: 46vw;
  background: radial-gradient(circle, rgba(160, 31, 56, 0.3), transparent 68%);
}
.glow--three {
  right: -22vw;
  bottom: -10vw;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, rgba(109, 18, 38, 0.38), transparent 68%);
}

/* ---------------------------------------------------------------------------
   3. Hero
   --------------------------------------------------------------------------- */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6rem 1.25rem 5rem;
  overflow: hidden;
  text-align: center;
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 1000px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.4rem;
  color: var(--marigold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 1.8rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}
.eyebrow--center { justify-content: center; }
.eyebrow--center::after {
  content: "";
  width: 1.8rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.hero__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 0.18em;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 11.5vw, 8.5rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.92;
}

.hero__happy {
  color: var(--cream);
  text-shadow: 0 12px 70px rgba(247, 165, 43, 0.15);
}

.hero__tihar {
  padding-right: 0.04em;
  font-style: italic;
  letter-spacing: -0.04em;
  background: linear-gradient(175deg, #fff2cc 0%, #ffc85c 45%, #ef8f1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 40px rgba(247, 165, 43, 0.25));
}

.hero__lamp {
  display: inline-block;
  font-size: 0.34em;
  line-height: 1;
  transform: translateY(-0.45em);
  animation: flicker 3.4s ease-in-out infinite;
}

.hero__sub {
  max-width: 36ch;
  margin: 1.8rem auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.18rem);
  line-height: 1.8;
}

.hero__for {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem;
  margin: 2.1rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-style: italic;
  color: rgba(255, 243, 223, 0.86);
}

.name-field { display: inline-flex; }

.name-field input {
  width: clamp(7.5rem, 26vw, 13rem);
  padding: 0.1em 0.35em;
  border: 0;
  border-bottom: 1px dashed rgba(232, 194, 122, 0.5);
  border-radius: 3px;
  background: transparent;
  color: var(--marigold-light);
  font: inherit;
  font-style: italic;
  text-align: center;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.name-field input::placeholder {
  color: rgba(255, 243, 223, 0.35);
  font-style: italic;
}
.name-field input:hover { border-bottom-color: rgba(247, 165, 43, 0.8); }
.name-field input:focus {
  border-bottom-color: var(--marigold);
  background: rgba(247, 165, 43, 0.08);
  box-shadow: 0 10px 24px -14px rgba(247, 165, 43, 0.65);
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 3.2rem;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 243, 223, 0.03);
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.scroll-cue:hover {
  border-color: rgba(247, 165, 43, 0.55);
  background: rgba(247, 165, 43, 0.12);
  transform: translateY(2px);
}
.scroll-cue svg { animation: bob 2.4s ease-in-out infinite; }

/* Hanging marigold strings, made from layered radial gradients */
.garland {
  position: absolute;
  top: -2rem;
  z-index: 1;
  width: 30px;
  height: 38vh;
  opacity: 0.9;
  background-image:
    radial-gradient(circle at 50% 35%, #ffc85c 0 4px, transparent 4.5px),
    radial-gradient(circle at 50% 35%, #f7a52b 0 7px, transparent 7.5px),
    radial-gradient(circle at 50% 70%, #3f7a4e 0 4px, transparent 4.5px);
  background-size: 30px 26px, 30px 26px, 30px 26px;
  background-position: 0 0, 0 0, 15px 12px;
  background-repeat: repeat-y;
  filter: drop-shadow(0 0 8px rgba(247, 165, 43, 0.2));
  transform-origin: top center;
  animation: sway 8s ease-in-out infinite;
}
.garland::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: -1;
  width: 1px;
  background: linear-gradient(rgba(232, 194, 122, 0.6), rgba(232, 194, 122, 0.04));
}
.garland--left { left: 5%; }
.garland--right {
  right: 5%;
  animation-duration: 9s;
  animation-direction: alternate-reverse;
}

/* ---------------------------------------------------------------------------
   4. Intro
   --------------------------------------------------------------------------- */
main { position: relative; z-index: 1; }

.intro {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) 1.5rem clamp(2rem, 6vw, 4rem);
  text-align: center;
}

.intro h2 {
  margin-bottom: 1.5rem;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.intro__text {
  max-width: 62ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  line-height: 1.9;
}

.day-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 2.2rem;
}
.day-chips span {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 243, 223, 0.03);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   5. Story scenes
   --------------------------------------------------------------------------- */
.scene {
  position: relative;
  padding: clamp(2.5rem, 7vw, 5.5rem) 0;
}

.scene__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

.scene--flip .scene__copy { order: 2; }
.scene--flip .stage { order: 1; }

.day-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
  color: var(--marigold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.day-tag span {
  padding-right: 0.65rem;
  border-right: 1px solid var(--line);
  color: var(--cream);
  opacity: 0.55;
}

.scene h2 {
  margin-bottom: 1.2rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.scene h2 em {
  color: var(--marigold-light);
  font-style: italic;
}

.scene__copy p {
  max-width: 50ch;
  margin-bottom: 1.1rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.85;
}
.scene__copy p em { color: rgba(255, 243, 223, 0.9); }

.hint {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.7rem !important;
  color: var(--gold) !important;
  font-size: 0.82rem !important;
  line-height: 1.5 !important;
}

.hint__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--marigold);
  box-shadow: 0 0 0 0 rgba(247, 165, 43, 0.55);
  animation: pulse 2.2s ease-out infinite;
}

/* ---------------------------------------------------------------------------
   6. Interactive stage cards
   --------------------------------------------------------------------------- */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 400px;
  padding: clamp(1.2rem, 3vw, 2rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(247, 165, 43, 0.08), transparent 55%),
    linear-gradient(160deg, rgba(255, 243, 223, 0.06), rgba(109, 18, 38, 0.18));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 243, 223, 0.08);
}
.stage::before {
  content: "";
  position: absolute;
  inset: auto -20% -55% -20%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(247, 165, 43, 0.16), transparent 65%);
  pointer-events: none;
}

.stage-note {
  position: relative;
  z-index: 2;
  min-height: 3.4em;
  margin: 0;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(247, 165, 43, 0.5);
  color: rgba(255, 243, 223, 0.8);
  font-size: 0.9rem;
  line-height: 1.65;
  text-align: left;
  transition: color 0.4s ease, border-color 0.4s ease;
}
.stage-note.is-gold {
  border-color: var(--marigold);
  color: var(--marigold-light);
}

.stage-count {
  position: relative;
  z-index: 2;
  align-self: flex-end;
  color: var(--gold);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-align: right;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ---- Scene 1: crows ---- */
.stage--crows { min-height: 420px; }

.wire-scene {
  position: relative;
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: space-around;
  gap: 0.35rem;
  height: 250px;
  padding: 0 0.4rem 1.5rem;
}
.wire-scene::before {
  content: "";
  position: absolute;
  inset: 4% 8% 18%;
  background: radial-gradient(ellipse at 50% 45%, rgba(247, 165, 43, 0.16), transparent 65%);
  pointer-events: none;
}

.wire {
  position: absolute;
  right: -2%;
  bottom: 1.1rem;
  left: -2%;
  width: 104%;
  height: 50px;
  opacity: 0.65;
  pointer-events: none;
}

.crow {
  position: relative;
  z-index: 2;
  flex: 1;
  max-width: 130px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: bottom center;
  transition: transform 0.3s ease, filter 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.crow svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.crow--small { max-width: 115px; }
.crow--flip svg { transform: scaleX(-1); }
.crow:first-of-type { margin-bottom: 1.15rem; }
.crow:last-of-type { margin-bottom: 1.15rem; }
.crow:hover { transform: translateY(-6px); filter: drop-shadow(0 0 12px rgba(247, 165, 43, 0.3)); }
.crow:active { transform: translateY(-2px) scale(0.98); }
.crow.fed { animation: peck 0.6s ease; }
.crow.fed::after {
  content: "✦";
  position: absolute;
  top: 12%;
  right: 8%;
  color: var(--marigold-light);
  text-shadow: 0 0 10px var(--marigold);
  animation: riseFade 1.4s ease forwards;
}

/* ---- Scene 2: dog ---- */
.stage--dog { align-items: center; justify-content: center; }

.dog {
  display: block;
  width: min(300px, 82%);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dog svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.35));
  transition: transform 0.35s ease;
}
.dog:hover svg { transform: translateY(-4px) scale(1.01); }

.dog__garland {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dog__tika {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
}
.dog.garlanded .dog__garland,
.dog.garlanded .dog__tika { opacity: 1; transform: none; }
.dog.garlanded svg { animation: dogHappy 0.9s ease; }
.dog.garlanded .dog__tail {
  animation: wag 1.1s ease-in-out infinite;
  transform-box: view-box;
  transform-origin: 78px 190px;
}

/* ---- Scene 3: diyos + rangoli ---- */
.stage--lamps {
  align-items: center;
  justify-content: center;
  min-height: 460px;
  text-align: center;
}

.mandala {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100%, 430px);
  height: auto;
  color: var(--marigold);
  opacity: 0.32;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: spin-center 100s linear infinite;
  transition: opacity 1s ease, filter 1s ease;
}
.stage--lamps.complete .mandala {
  opacity: 0.72;
  filter: drop-shadow(0 0 20px rgba(247, 165, 43, 0.35));
}

/* The rangoli is "drawn" when the fifth lamp catches light. */
.mandala > g {
  opacity: 0.45;
  transition: opacity 0.9s ease 0.15s;
}
.stage--lamps.complete .mandala > g { opacity: 1; }

.mandala .draw-ring {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.stage--lamps.complete .mandala .draw-ring {
  animation: drawLine 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.lamps {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(0.2rem, 1.2vw, 0.8rem);
  width: 100%;
  max-width: 470px;
  margin-bottom: 1.1rem;
}

.lamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.1rem;
  border: 0;
  border-radius: 16px;
  background: none;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.lamp:hover { background: rgba(255, 243, 223, 0.04); transform: translateY(-4px); }
.lamp:active { transform: translateY(-1px) scale(0.97); }

.diyo {
  width: 100%;
  max-width: 72px;
  height: auto;
  overflow: visible;
  transition: filter 0.5s ease, transform 0.4s ease;
}
.diyo__glow,
.diyo__flame,
.diyo__flame-inner {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-box: fill-box;
  transform-origin: center;
}
.diyo__glow { fill: rgba(255, 180, 60, 0.55); filter: blur(7px); }
.diyo__flame { fill: #ffb547; transform: scale(0.2) translateY(12px); }
.diyo__flame-inner { fill: #fff3cf; }
.diyo__bowl { fill: #b4502f; }
.diyo__rim { fill: #cf6a3b; }
.diyo__base { fill: #8a3a22; }

.lamp.lit .diyo__glow { opacity: 0.9; }
.lamp.lit .diyo__flame,
.lamp.lit .diyo__flame-inner { opacity: 1; transform: none; }
.lamp.lit .diyo__flame { animation: flicker 2.8s ease-in-out infinite; }
.lamp.lit .diyo { filter: drop-shadow(0 0 14px rgba(255, 170, 50, 0.5)); }
.lamp.lit { background: rgba(247, 165, 43, 0.06); }

.lamp-word {
  color: var(--gold);
  font-size: clamp(0.5rem, 1.2vw, 0.64rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.lamp.lit .lamp-word { color: var(--marigold-light); opacity: 1; }

/* ---- Scene 4: tika portrait ---- */
.stage--tika { align-items: center; justify-content: center; }

.portrait {
  position: relative;
  z-index: 2;
  display: block;
  width: min(300px, 86%);
  margin: 0 auto;
  padding: 0 0 2.1rem;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.portrait svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.4));
  transition: transform 0.4s ease;
}
.portrait:hover svg { transform: translateY(-4px); }

.portrait__halo {
  transform-box: view-box;
  transform-origin: 150px 150px;
  animation: spin 45s linear infinite;
  opacity: 0.7;
}

.portrait__tika rect {
  opacity: 0;
  transform: scaleY(0);
  transform-box: fill-box;
  transform-origin: center bottom;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}
.portrait__tika rect:nth-child(2) { transition-delay: 0.05s; }
.portrait__tika rect:nth-child(3) { transition-delay: 0.1s; }
.portrait__tika rect:nth-child(4) { transition-delay: 0.15s; }
.portrait__tika rect:nth-child(5) { transition-delay: 0.2s; }
.portrait__tika rect:nth-child(6) { transition-delay: 0.25s; }
.portrait__tika rect:nth-child(7) { transition-delay: 0.3s; }

.portrait.tikaed .portrait__tika rect { opacity: 1; transform: scaleY(1); }

.portrait__garland {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s;
}
.portrait.tikaed .portrait__garland { opacity: 1; transform: none; }

.portrait__hint {
  position: absolute;
  bottom: 0.15rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90%;
  padding: 0.32rem 0.65rem;
  border: 1px solid rgba(232, 194, 122, 0.25);
  border-radius: 999px;
  background: rgba(22, 10, 16, 0.6);
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0.9;
  animation: breathe 3.2s ease-in-out infinite;
}
.portrait.tikaed .portrait__hint { animation: none; opacity: 0.55; }

/* ---------------------------------------------------------------------------
   7. River of lights
   --------------------------------------------------------------------------- */
.river {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  width: min(1120px, 100% - 2.5rem);
  margin: clamp(2rem, 6vw, 5rem) auto;
}

.river__head h2 {
  margin-bottom: 1.1rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.river__head p:not(.eyebrow) {
  max-width: 42ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
}

.ghost-btn {
  margin-top: 0.9rem;
  padding: 0.8rem 1.35rem;
  border: 1px solid rgba(232, 194, 122, 0.4);
  border-radius: 999px;
  background: rgba(255, 243, 223, 0.03);
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.ghost-btn:hover {
  border-color: var(--marigold);
  background: rgba(247, 165, 43, 0.12);
  transform: translateY(-2px);
}
.ghost-btn:active { transform: translateY(0) scale(0.98); }

.river__wrap {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(100% 70% at 50% 0%, rgba(247, 165, 43, 0.12), transparent 60%),
    linear-gradient(180deg, #111a2b 0%, #0a111c 70%, #080d16 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 243, 223, 0.06);
}

#riverCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: pan-y; /* vertical scroll still works from a touch on the water */
}

.river__caption {
  position: absolute;
  bottom: 1rem;
  left: 1.25rem;
  z-index: 2;
  max-width: 80%;
  margin: 0;
  color: rgba(255, 243, 223, 0.55);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   8. Final wish
   --------------------------------------------------------------------------- */
.final {
  display: grid;
  place-items: center;
  padding: clamp(4rem, 10vw, 8rem) 1.25rem;
}

.wish-card {
  position: relative;
  width: min(780px, 100%);
  padding: clamp(2rem, 6vw, 4rem);
  overflow: hidden;
  border: 1px solid rgba(232, 194, 122, 0.3);
  border-radius: 36px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(247, 165, 43, 0.16), transparent 60%),
    linear-gradient(160deg, rgba(160, 31, 56, 0.35), rgba(40, 13, 20, 0.85));
  box-shadow: 0 50px 120px -50px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 243, 223, 0.12);
  text-align: center;
}
.wish-card::before,
.wish-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 165, 43, 0.18), transparent 65%);
  pointer-events: none;
}
.wish-card::before { top: -110px; left: -80px; }
.wish-card::after { right: -80px; bottom: -120px; }

.wish-card > * {
  position: relative;
  z-index: 1;
}

.wish-card h2 {
  margin-bottom: 1.2rem;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.wish-card h2 .accent {
  color: var(--marigold-light);
  font-style: italic;
}

.wish-text {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 52ch;
  min-height: 4.6em;
  margin: 0 auto 2rem;
  color: rgba(255, 243, 223, 0.92);
  font-family: var(--serif);
  font-size: clamp(1.12rem, 2.6vw, 1.45rem);
  line-height: 1.7;
}
.wish-text.pop { animation: wishPop 0.65s cubic-bezier(0.2, 0.8, 0.2, 1); }

.wish-share { margin-top: 0.6rem; }

.wish-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1rem 2rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd27a 0%, #f7a52b 50%, #ef8f1f 100%);
  box-shadow: 0 18px 40px -18px rgba(247, 165, 43, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #3a1408;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.wish-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 24px 50px -18px rgba(247, 165, 43, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  filter: brightness(1.04);
}
.wish-btn:active { transform: scale(0.97); }

.wish-hint {
  margin: 1rem 0 0;
  color: rgba(255, 243, 223, 0.5);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

/* ---------------------------------------------------------------------------
   9. Footer & celebration canvas
   --------------------------------------------------------------------------- */
.footer {
  padding: 3rem 1.25rem 4rem;
  border-top: 1px solid rgba(232, 194, 122, 0.12);
  color: rgba(255, 243, 223, 0.45);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-align: center;
}
.footer p { margin: 0.35rem 0; }
.footer__line {
  color: rgba(255, 243, 223, 0.7);
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
}

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

/* ---------------------------------------------------------------------------
   10. Reveal on scroll
   --------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.js .reveal.in-view { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------------
   11. Keyframes
   --------------------------------------------------------------------------- */
@keyframes twinkle {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 0.95; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 6px rgba(255, 180, 60, 0.55)); }
  25% { opacity: 0.84; filter: drop-shadow(0 0 11px rgba(255, 180, 60, 0.75)); }
  50% { opacity: 0.96; filter: drop-shadow(0 0 5px rgba(255, 180, 60, 0.45)); }
  75% { opacity: 0.88; filter: drop-shadow(0 0 13px rgba(255, 180, 60, 0.8)); }
}

@keyframes sway {
  0%, 100% { transform: rotate(-1.8deg); }
  50% { transform: rotate(1.8deg); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(247, 165, 43, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(247, 165, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(247, 165, 43, 0); }
}

@keyframes peck {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-9px); }
  60% { transform: translateY(0); }
  80% { transform: translateY(-4px); }
}

@keyframes riseFade {
  0% { opacity: 0; transform: translateY(4px) scale(0.7); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-22px) scale(1.2); }
}

@keyframes dogHappy {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-7px) scale(1.015); }
  70% { transform: translateY(-2px) scale(1.005); }
}

@keyframes wag {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(9deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spin-center {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}

@keyframes wishPop {
  0% { opacity: 0.15; transform: translateY(12px) scale(0.985); }
  100% { opacity: 1; transform: none; }
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* ---------------------------------------------------------------------------
   12. Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .scene__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .scene--flip .scene__copy { order: 1; }
  .scene--flip .stage { order: 2; }
  .scene__copy { max-width: 640px; }

  .river { grid-template-columns: 1fr; }
  .river__wrap { min-height: 300px; }

  .stage--crows { min-height: 400px; }
  .stage--lamps { min-height: 440px; }
}

@media (max-width: 640px) {
  .hero { padding-top: 4.5rem; }
  .hero__title { gap: 0 0.12em; }
  .hero__lamp { font-size: 0.3em; }

  .garland { height: 27vh; opacity: 0.7; }
  .garland--right { display: none; }

  .intro { padding-inline: 1.15rem; }
  .day-chips span { font-size: 0.6rem; padding: 0.4rem 0.7rem; }

  .scene__inner,
  .river { width: min(1120px, 100% - 1.8rem); }

  .stage {
    min-height: 340px;
    padding: 1rem;
    border-radius: 22px;
  }
  .stage--crows { min-height: 350px; }
  .stage--lamps { min-height: 400px; }
  .wire-scene { height: 210px; padding-bottom: 1.2rem; }
  .crow { max-width: 102px; }
  .crow--small { max-width: 92px; }
  .wire { bottom: 0.9rem; }

  .dog { width: min(250px, 86%); }
  .portrait { width: min(260px, 92%); }
  .portrait__hint { font-size: 0.55rem; }

  .lamps { gap: 0.1rem; }
  .diyo { max-width: 58px; }
  .lamp { padding: 0.3rem 0; border-radius: 10px; }
  .lamp-word { letter-spacing: 0.04em; }

  .stage-note { font-size: 0.82rem; }

  .river__wrap { min-height: 260px; }
  .river__caption { bottom: 0.7rem; left: 0.9rem; font-size: 0.58rem; }

  .wish-card { padding: 2rem 1.2rem; border-radius: 26px; }
  .wish-btn { width: 100%; padding: 1rem 1.2rem; }
  .wish-text { min-height: 6em; }

  .footer { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .hero__title { font-size: 2.9rem; }
  .lamp-word { font-size: 0.46rem; }
  .diyo { max-width: 50px; }
}

/* ---------------------------------------------------------------------------
   13. Respect reduced motion
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal { opacity: 1; transform: none; }
  .stars span { opacity: 0.6; }
}

/* ---------------------------------------------------------------------------
   14. Touch screens — hover states go sticky after a tap there
   --------------------------------------------------------------------------- */
@media (hover: none) {
  .crow:hover,
  .lamp:hover,
  .dog:hover svg,
  .portrait:hover svg,
  .scroll-cue:hover,
  .ghost-btn:hover,
  .wish-btn:hover { transform: none; }
}
