/* ==========================================================================
   Clearwater — "Storybook Shore — Bright + Scroll"
   Hand-crafted pastel illustration, lifted to a fresher, more luminous key,
   with a scroll-linked day-to-night colour grade as the headline feature.
   The SUN's own gradients (--gold / --butter / #FFB347 family) are left
   exactly as they were — only the world around it is brightened.
   ========================================================================== */

:root {
  /* palette — soft pastel sunrise, lifted brighter & fresher
     (sky/sea/sand/night tones raised in luminance; sun untouched) */
  --sky-dawn-top: #DCEEF8;   /* pale morning blue, lifted */
  --sky-dawn-mid: #FFE8D4;   /* warmer, lighter peach */
  --sky-dawn-low: #FFE2BC;   /* fresh peach-gold (not the sun gold) */
  --sky-morn-top: #D2EAFB;   /* clean luminous sky-blue */
  --sky-morn-low: #F4FBFD;   /* near-white morning haze */

  --butter: #FFE9A8;         /* sun-family accent — kept as-is */
  --gold: #FFB347;           /* sun / primary action — kept as-is */
  --peach: #FBD6B7;          /* brighter */
  --powder: #D2E6F6;         /* brighter */
  --lavender: #E3D8F3;       /* brighter dusk lilac */
  --sage: #CEDDC6;           /* fresher beach grass / dune green */
  --sage-deep: #5F7D5B;
  --sea: #A6D9E1;            /* fresher, lighter sea */
  --sand: #FBF4E6;           /* lighter cream sand */
  --sand-deep: #F4E7D0;

  --night-top: #2A3A63;      /* deep indigo, lifted toward dusk */
  --night-mid: #4A4D85;      /* lifted */
  --night-low: #6E5FA0;      /* lifted dusk violet (kept AA-safe for paper text) */
  --moonlight: #E8EFF8;      /* brighter moonlight silver */

  --ink: #33312E;
  --ink-soft: #57524A;
  --paper: #F8F4ED;          /* warm off-white, lifted */

  --font-display: "Fraunces", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body: "Nunito Sans", -apple-system, "Segoe UI", Verdana, sans-serif;

  --ease: cubic-bezier(0.45, 0.05, 0.35, 1);
  --slow: 1.1s;

  /* ----------------------------------------------------------------------
     SCROLL-DRIVEN GRADE (live, set by js/main.js as the visitor scrolls).
     These start at the DAWN keyframe; JS interpolates them dawn -> morning
     -> dusk -> early-night across the page. The fixed .sky and the choice
     scene read straight from these so the whole site is one colour grade.
     ---------------------------------------------------------------------- */
  --g-sky-top: var(--sky-dawn-top);
  --g-sky-mid: var(--sky-dawn-mid);
  --g-sky-low: var(--sky-dawn-low);

  --g-sea-1: #B6E0E7;        /* sea light band (dawn) */
  --g-sea-2: #95CDD7;        /* sea deep band (dawn) */

  --g-sun-o: 1;              /* hero sun fades as day turns to dusk */
  --g-stars-o: 0;            /* stars fade up toward night */
  --g-cloud-o: 0.92;         /* clouds thin out toward night */
  --g-gull-o: 1;             /* gulls fade out toward night */
  --g-shim-o: 0.7;           /* sea shimmer calms toward night */
  --g-veil-warm: 0;          /* peach noon warmth over the scene */
  --g-veil-night: 0;         /* dusk/night wash over the scene */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--sand);
  overflow-x: hidden;
}

svg { display: block; }

/* visible, friendly focus everywhere */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
  border-radius: 6px;
}
.page-moon :focus-visible,
body.scene-night :focus-visible {
  outline-color: var(--paper);
}

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

/* ==========================================================================
   Fixed graded sky — scroll-linked day-to-night colour grade (home)
   The base gradient reads the LIVE grade vars (--g-sky-*) that js/main.js
   interpolates as the visitor scrolls. A dusk/night veil washes over it
   toward the bottom of the page so the choice + footer sit in cooler light.
   ========================================================================== */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--g-sky-top) 0%, var(--g-sky-mid) 55%, var(--g-sky-low) 100%);
}
.sky-layer { position: absolute; inset: 0; pointer-events: none; }
/* dawn layer is now the live-graded base; kept as a no-op for static fallback */
.sky-dawn { background: transparent; }
/* the night veil rides on the same fixed sky, fading up toward dusk/night */
.sky-morning {
  background: linear-gradient(180deg, var(--night-top) 0%, var(--night-mid) 52%, var(--night-low) 100%);
  opacity: var(--g-veil-night);
}

/* ==========================================================================
   Header — overlays the scene, no layout space
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 2.6rem);
  pointer-events: none; /* children restore it */
}
.site-header > * { pointer-events: auto; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 253, 248, 0.55);
  border-radius: 999px;
  transition: color var(--slow) var(--ease), background var(--slow) var(--ease);
}

.about-nav { position: relative; }

.about-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  font: 600 1rem var(--font-body);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.55);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.4s var(--ease), color var(--slow) var(--ease);
}
.about-btn:hover { background: rgba(255, 253, 248, 0.9); }
.about-btn .chev { transition: transform 0.35s var(--ease); }
.about-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.about-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  min-width: 13rem;
  list-style: none;
  background: #FFFDF8;
  border-radius: 22px;
  padding: 0.6rem;
  box-shadow: 0 14px 38px rgba(51, 49, 46, 0.16);
}
.about-menu a {
  display: block;
  padding: 0.75rem 1.1rem;
  min-height: 44px;
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.about-menu a:hover { background: var(--butter); }

/* header goes light over night scenes */
body.scene-night .wordmark,
body.scene-night .about-btn,
.page-moon .wordmark,
.page-moon .about-btn {
  color: var(--paper);
}
body.scene-night .about-btn,
.page-moon .about-btn,
body.scene-night .wordmark,
.page-moon .wordmark {
  background: rgba(30, 42, 74, 0.45);
}

/* ==========================================================================
   Hero — sunrise poster
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-text {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem;
  transform: translateY(-9vh);
}

.brand {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(3.4rem, 11vw, 7.5rem);
  letter-spacing: 0.01em;
  line-height: 1.04;
  color: var(--ink);
  animation: fade-up 1.4s var(--ease) 1.1s both;
}

.hero-line {
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  font-weight: 400;
  color: var(--ink-soft);
  animation: fade-up 1.4s var(--ease) 1.7s both;
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.6rem 1.2rem;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-radius: 999px;
  animation: fade-up 1.4s var(--ease) 2.3s both;
}
.scroll-cue svg { animation: cue-drift 3.6s var(--ease) infinite; }
.scroll-cue:hover { color: var(--ink); }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cue-drift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(7px); }
}

/* hero scene elements ride the scroll grade as the hero scrolls past:
   the sun dims toward dusk, clouds & gulls thin, the sea shimmer calms.
   (transitions are short so it tracks scroll smoothly without lag) */
.hero-scene .sun-rise { opacity: var(--g-sun-o); transition: opacity 0.5s linear; }
.hero-scene .cloud-a,
.hero-scene .cloud-b,
.hero-scene .cloud-c { transition: opacity 0.5s linear; }
.hero-scene .cloud-a { opacity: calc(0.92 * var(--g-cloud-o)); }
.hero-scene .cloud-b { opacity: calc(0.85 * var(--g-cloud-o)); }
.hero-scene .cloud-c { opacity: calc(0.75 * var(--g-cloud-o)); }
.hero-scene .gulls { opacity: var(--g-gull-o); transition: opacity 0.5s linear; }

/* hero entrance: the sun lifts, the glow blooms — once */
.sun-rise { animation: sun-rise 2.6s var(--ease) both; }
@keyframes sun-rise {
  from { transform: translateY(54px); }
  to   { transform: translateY(0); }
}

/* ambient micro-motion — barely there */
.cloud-a { animation: drift 26s var(--ease) infinite alternate; }
.cloud-b { animation: drift 34s var(--ease) infinite alternate-reverse; }
.cloud-c { animation: drift 30s var(--ease) 4s infinite alternate; }
@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(34px); }
}

.gull-a { animation: glide 18s var(--ease) infinite alternate; }
.gull-b { animation: glide 22s var(--ease) 2s infinite alternate-reverse; }
@keyframes glide {
  from { transform: translate(0, 0); }
  to   { transform: translate(46px, -14px); }
}

.grass-a, .grass-b {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.grass-a { animation: sway 6.5s var(--ease) infinite alternate; }
.grass-b { animation: sway 7.5s var(--ease) 1.2s infinite alternate-reverse; }
@keyframes sway {
  from { transform: rotate(-2.2deg); }
  to   { transform: rotate(2.2deg); }
}

.shimmer { animation: shimmer 7s var(--ease) infinite alternate; }
@keyframes shimmer {
  from { opacity: 0.35; }
  to   { opacity: 0.8; }
}

/* ==========================================================================
   Support — one breath
   ========================================================================== */

.support {
  position: relative;
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.6rem;
  padding: clamp(5rem, 12vh, 8rem) 1.5rem;
  text-align: center;
}

.support-cloud { animation: drift 28s var(--ease) infinite alternate; }

.breath p {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.4vw, 2.2rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  max-width: 26ch;
  margin: 0 auto 1.4em;
}
.breath p:last-child { margin-bottom: 0; }

/* ==========================================================================
   The Choice — dusk, sun & moon
   ========================================================================== */

.choice {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 5vh, 3.6rem);
  padding: clamp(6rem, 14vh, 9rem) 1.5rem 11rem;
  overflow: hidden;
  text-align: center;
  /* fresher, lifted dusk base */
  background: linear-gradient(180deg, var(--sky-morn-top) 0%, var(--lavender) 46%, #FCE0C6 100%);
  color: var(--ink);
  transition: color var(--slow) var(--ease);
}

/* SCROLL-GRADED dusk wash: as the choice scrolls in, the page-wide grade
   (--g-veil-night) pulls the whole section from bright morning toward dusk,
   so it sits in distinctly cooler light than the support section above. */
.choice .scroll-dusk {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--night-top) 0%, var(--night-mid) 50%, var(--night-low) 100%);
  opacity: calc(var(--g-veil-night) * 0.82);
  pointer-events: none;
  z-index: 0;
}

/* warm + night veils crossfade over the base dusk (the choice hover relight) */
.choice::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #FBD9B0 0%, var(--butter) 52%, #FFD9A8 100%);
  opacity: 0;
  transition: opacity var(--slow) var(--ease);
  pointer-events: none;
  z-index: 1;
}
.night-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--night-top) 0%, var(--night-mid) 55%, var(--night-low) 100%);
  opacity: 0;
  transition: opacity var(--slow) var(--ease);
  pointer-events: none;
  z-index: 1;
}

body.scene-warm .choice::before { opacity: 1; }
body.scene-night .night-veil { opacity: 1; }
body.scene-night .choice { color: var(--paper); }

/* once the dusk grade has substantially arrived, the choice ink flips to
   the warm off-white so the prompt stays legible on the darkened sky.
   js/main.js toggles .choice-dim on <body> at the grade threshold. The
   prompt + copy always sit on a controlled tonal scrim (below) so AA holds
   at EVERY scroll position, including the mid-transition crossover where the
   sky is too dark for charcoal yet too light for off-white. */
body.choice-dim .choice { color: var(--paper); }
body.choice-dim .choice .prompt,
body.choice-dim .choice .copy {
  background: rgba(26, 34, 60, 0.6);   /* dark scrim -> off-white passes AA */
}
body.choice-dim .choice .prompt { text-shadow: 0 1px 14px rgba(16, 22, 44, 0.7); }

/* The hover RELIGHT overrides the scroll grade for the moment it is held:
   sun-hover warms the whole scene bright (dark charcoal + light scrim),
   moon-hover cools it to night (off-white + dark scrim). These come AFTER the
   .choice-dim rules so they win even while scrolled into the dusk grade. */
body.scene-warm.choice-dim .choice,
body.scene-warm .choice { color: var(--ink); }
body.scene-warm .choice .prompt,
body.scene-warm .choice .copy {
  background: rgba(255, 253, 248, 0.55);
}
body.scene-warm .choice .prompt { text-shadow: none; }

body.scene-night.choice-dim .choice,
body.scene-night .choice { color: var(--paper); }
body.scene-night .choice .prompt,
body.scene-night .choice .copy {
  background: rgba(20, 28, 52, 0.6);
}
body.scene-night .choice .prompt { text-shadow: 0 1px 14px rgba(16, 22, 44, 0.7); }

.stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  /* stars fade in with the scroll-driven dusk grade, and fully on hover-night */
  opacity: calc(var(--g-stars-o) * 0.9);
  transition: opacity var(--slow) var(--ease);
  pointer-events: none;
}
body.scene-night .choice .stars,
.page-moon .stars { opacity: 1; }

.tw { animation: twinkle 4.5s var(--ease) infinite alternate; }
.t2 { animation-delay: 1.1s; }
.t3 { animation-delay: 2.3s; }
.t4 { animation-delay: 3.2s; }
@keyframes twinkle {
  from { opacity: 0.35; }
  to   { opacity: 1; }
}

.prompt {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  line-height: 1.15;
  max-width: 16ch;
  /* soft tonal halo so the text always sits on a calm area of sky.
     Light by default (charcoal ink passes); flips dark when .choice-dim. */
  padding: 0.3em 0.7em;
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.42);
  transition: background var(--slow) var(--ease);
}

.orbs {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(2rem, 9vw, 9rem);
  flex-wrap: wrap;
}

.choice-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  border-radius: 32px;
  transition: transform var(--slow) var(--ease);
}
.choice-link:hover { transform: translateY(-8px); }

.orb {
  width: clamp(170px, 24vw, 270px);
  height: auto;
}

.choice-link .copy {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 400;
  opacity: 0;
  transform: translateY(8px);
  /* same tonal-halo treatment so the copy stays legible through the grade */
  padding: 0.25em 0.7em;
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.42);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), background var(--slow) var(--ease);
}
.choice-link:hover .copy,
.choice-link:focus-visible .copy { opacity: 1; transform: translateY(0); }

/* touch / no-hover: copy always visible, stacked, big targets */
@media (hover: none) {
  .choice-link .copy { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
  .orbs { flex-direction: column; align-items: center; gap: 1.6rem; }
  .choice-link .copy { opacity: 1; transform: none; }
}

/* moon's gentle rock + glow breathing */
.moon-rock {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: rock 9s var(--ease) infinite alternate;
}
@keyframes rock {
  from { transform: rotate(-2.4deg); }
  to   { transform: rotate(2.4deg); }
}
.moon-glow { animation: breathe-glow 7s var(--ease) infinite alternate; }
.orb-rays {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}
@keyframes breathe-glow {
  from { opacity: 0.55; }
  to   { opacity: 1; }
}

.choice-shore {
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  width: 100%;
  height: clamp(110px, 16vh, 180px);
  pointer-events: none;
}
.shore-sea, .shore-dune { transition: fill var(--slow) var(--ease); }
body.choice-dim .shore-sea { fill: #2C4A57; }
body.choice-dim .shore-dune { fill: #C8BBA4; }
body.scene-night .shore-sea { fill: #27424E; }
body.scene-night .shore-dune { fill: #C8BBA4; }

/* ==========================================================================
   Story & approach — two small notes on the sand
   ========================================================================== */

.shore-notes {
  background: var(--sand);
  padding: clamp(3rem, 7vh, 4.5rem) 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.4rem;
  text-align: center;
}
.shore-note {
  max-width: 38ch;
  scroll-margin-top: 5.5rem;
}
.shore-note h2 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  margin-bottom: 0.5rem;
}
.shore-note p { color: var(--ink-soft); }

/* ==========================================================================
   Footer — on the sand
   ========================================================================== */

.site-footer {
  position: relative;
  background: var(--sand);
  text-align: center;
  padding: clamp(3.5rem, 8vh, 5.5rem) 1.5rem 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.take {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}
.take-title {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.5rem, 3vw, 2rem);
}
.qr { filter: drop-shadow(0 8px 22px rgba(51, 49, 46, 0.12)); }

.qr-download {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  background: var(--butter);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.4s var(--ease);
}
.qr-download:hover { background: var(--gold); }

.footer-nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--ink-soft);
}
.footer-nav a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  padding: 0.6rem 0.4rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
}
.footer-nav a:hover { border-bottom-color: var(--gold); }

.safety {
  font-size: 1rem;
  color: var(--ink-soft);
}
.fine {
  font-family: var(--font-display);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ==========================================================================
   Quiz page (sun path)
   ========================================================================== */

.page-quiz {
  background: linear-gradient(180deg, var(--sky-morn-top) 0%, #F6E8D2 70%, var(--sand) 100%) fixed;
  min-height: 100svh;
}

.quiz-main {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 6.5rem 1.5rem 4rem;
}

.step {
  width: min(40rem, 100%);
  text-align: center;
  animation: fade-up 0.9s var(--ease) both;
}
.step[hidden] { display: none; }

.step h1, .step h2 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  line-height: 1.2;
  margin-bottom: 1.1rem;
}
.step h1:focus, .step h2:focus,
.step h1:focus-visible, .step h2:focus-visible,
.moon-line:focus, .moon-line:focus-visible { outline: none; }

.step .note {
  color: var(--ink-soft);
  margin-bottom: 2.2rem;
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
}

.answers {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 2.2rem 0 1.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  width: 100%;
  padding: 0.95rem 1.8rem;
  font: 700 1.125rem var(--font-body);
  color: var(--ink);
  background: #FFFDF8;
  border: 2.5px solid rgba(51, 49, 46, 0.16);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.btn:hover { background: var(--butter); border-color: var(--gold); transform: translateY(-2px); }
.btn[aria-pressed="true"] { background: var(--butter); border-color: var(--gold); }

.btn-primary {
  width: auto;
  background: var(--gold);
  border-color: var(--gold);
}
.btn-primary:hover { background: #FFC468; }

.btn-ghost {
  width: auto;
  min-height: 44px;
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  font-weight: 600;
}
.btn-ghost:hover { background: rgba(255, 253, 248, 0.7); border-color: transparent; color: var(--ink); }

/* the sun rises as you go — the quiz's progress */
.progress-sun {
  position: fixed;
  top: 5.2rem;
  right: clamp(1.2rem, 4vw, 2.6rem);
  width: 104px;
  z-index: 40;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
}
.progress-sun.is-up { opacity: 1; }
@media (max-width: 480px) {
  .progress-sun { width: 64px; }
  .quiz-main { padding-top: 9.5rem; }
}
.progress-sun .p-horizon { stroke: var(--ink-soft); opacity: 0.55; }
.progress-sun .p-sun {
  transform: translateY(calc((1 - var(--rise, 0)) * 40px));
  transition: transform 1.1s var(--ease);
}
.progress-sun .p-rays {
  opacity: var(--rise, 0);
  transition: opacity 1.1s var(--ease);
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

/* simple forms */
.form-field {
  text-align: left;
  margin-bottom: 1.2rem;
}
.form-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.45rem;
}
.form-field input {
  width: 100%;
  min-height: 56px;
  padding: 0.8rem 1.3rem;
  font: 400 1.125rem var(--font-body);
  color: var(--ink);
  background: #FFFDF8;
  border: 2.5px solid rgba(51, 49, 46, 0.2);
  border-radius: 999px;
}
.form-field input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.quiz-form { max-width: 26rem; margin: 0 auto; }

/* gentle inline validation messages */
.form-error {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.45rem 0 0 1.3rem;
  color: var(--ink);
}
.page-moon .form-error { color: var(--butter); }
.moon-form .form-error {
  flex-basis: 100%;
  margin: 0;
  text-align: center;
}

.step-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

/* ==========================================================================
   Moon page (night)
   ========================================================================== */

.page-moon {
  background: linear-gradient(180deg, var(--night-top) 0%, var(--night-mid) 52%, var(--night-low) 100%) fixed;
  color: var(--paper);
}

.moon-main {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 6.5rem 1.5rem 4rem;
  overflow: hidden;
}

.moon-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.moon-content {
  position: relative;
  z-index: 2;
  width: min(34rem, 100%);
  text-align: center;
}

.moon-line {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.2;
  margin-bottom: 2.4rem;
}

.moon-form {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.moon-form input {
  flex: 1 1 16rem;
  min-height: 56px;
  padding: 0.8rem 1.4rem;
  font: 400 1.125rem var(--font-body);
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid transparent;
  border-radius: 999px;
}
.moon-form input:focus-visible {
  outline: 3px solid var(--paper);
  outline-offset: 3px;
}
.moon-btn {
  min-height: 56px;
  padding: 0.9rem 1.9rem;
  font: 700 1.125rem var(--font-body);
  color: var(--ink);
  background: var(--moonlight);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.4s var(--ease), transform 0.35s var(--ease);
}
.moon-btn:hover { background: #FFFFFF; transform: translateY(-2px); }

.moon-quiet { font-size: 1.05rem; }
.moon-quiet,
.moon-quiet a {
  color: var(--paper);
}
.moon-quiet a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.4rem 0.2rem;
  display: inline-block;
}
.moon-quiet a:hover { color: #FFFFFF; }

.moon-thanks p {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.45;
}

.moon-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem 2.2rem;
}
.moon-footer .safety { color: var(--paper); }
.moon-footer a { color: var(--paper); }

.quiz-footer .safety { color: var(--ink-soft); }

.window-glow { animation: breathe-glow 6s var(--ease) infinite alternate; }

/* phones: xMidYMax slice crops the viewBox edges, so pull the moon and the
   lit-window house toward the centre band that survives the crop */
@media (max-width: 640px) {
  .moon-scene .m-moon { transform: translate(850px, 150px); }
  .moon-scene .m-house { transform: translate(560px, 700px); }
}

/* ==========================================================================
   Reduced motion — static scene per section, instant everything
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  /* scroll grading fully OFF (js/main.js also skips it): the live-graded
     fixed sky is hidden and each section owns a static, legible scene. */
  .sky { display: none; }
  .hero { background: linear-gradient(180deg, var(--sky-dawn-top) 0%, var(--sky-dawn-mid) 55%, var(--sky-dawn-low) 100%); }
  .support { background: linear-gradient(180deg, var(--sky-morn-top) 0%, var(--sky-morn-low) 100%); }
  /* the choice keeps its own composed dusk base + dark ink (legible); its
     scroll-driven dusk wash stays off so no text is hidden mid-transition. */
  .choice .scroll-dusk { display: none; }
  .page-quiz, .page-moon { background-attachment: scroll; }
}
