/* ============================================================
   PyroBloom — a night garden in fireworks
   Palette lifted from the game itself.
   ============================================================ */

:root {
  --night-deep: #0a0a20;      /* top of the sky */
  --night: #14142e;           /* base */
  --dusk: #232349;            /* lower sky */
  --horizon: #1c2f45;         /* teal band above the hills */
  --hill-far: #12242a;
  --hill-near: #0a1418;
  --moon: #f2f0ff;            /* headline white */
  --mist: #a9a7c9;            /* body text on night */
  --petal: #ff5f87;           /* pink shells */
  --ember: #ffcf5c;           /* gold shells */
  --frost: #56e8e4;           /* teal shells */

  --display: "Quicksand", "Avenir Next", sans-serif;
  --body: "Nunito Sans", "Avenir", sans-serif;

  --measure: 34rem;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--mist);
  font-family: var(--body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: var(--petal); color: var(--night-deep); }

h1, h2, h3 {
  font-family: var(--display);
  color: var(--moon);
  font-weight: 600;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.7rem, 4.2vw, 2.6rem);
  letter-spacing: .01em;
}

h2 em, .closing-line {
  font-style: normal;
  background: linear-gradient(100deg, var(--petal), var(--ember) 55%, var(--frost));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

a { color: var(--frost); }

img, video { display: block; max-width: 100%; height: auto; }

/* ---------- shared bits ---------- */

.eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 1.1rem;
}

.section-head { text-align: center; max-width: 46rem; margin: 0 auto 3.5rem; padding: 0 1.5rem; }
.section-sub { margin-top: .9rem; }

section { padding: 7rem 1.5rem; }

/* ---------- reveal on scroll ---------- */

/* hidden only when JS is running — no-JS visitors see everything */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  min-height: min(100svh, 68rem);
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(to bottom,
      var(--night-deep) 0%,
      var(--night) 34%,
      var(--dusk) 62%,
      var(--horizon) 86%,
      #16222e 100%);
  cursor: crosshair;
}

#fireworks { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-inner {
  position: relative;
  z-index: 2;
  padding: 4rem 1.5rem 9rem;
  pointer-events: none;           /* the sky itself is the click target */
}
.hero-inner a { pointer-events: auto; }

.wordmark {
  font-size: clamp(2.6rem, 9vw, 5.6rem);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 1.2rem 0 .4rem;
  text-shadow:
    0 0 24px rgba(255, 95, 135, .45),
    0 0 64px rgba(255, 207, 92, .25);
}
.wordmark span { color: var(--petal); }

.tagline {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  letter-spacing: .12em;
  color: var(--moon);
  opacity: .85;
}

.hero-sub {
  max-width: var(--measure);
  margin: 1.6rem auto 2.4rem;
}

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  background: var(--moon);
  color: var(--night-deep);
  text-decoration: none;
  border-radius: 999px;
  padding: .8rem 1.6rem;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.1;
  transition: transform .25s ease, box-shadow .25s ease;
  box-shadow: 0 0 0 rgba(255,255,255,0);
}
.btn-primary small { display: block; font-size: .62rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 32px rgba(242, 240, 255, .35); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  color: var(--moon);
  text-decoration: none;
  border: 1px solid rgba(242, 240, 255, .35);
  border-radius: 999px;
  padding: .8rem 1.6rem;
  font-family: var(--display);
  font-weight: 600;
  transition: border-color .25s ease, background .25s ease;
}
.btn-ghost:hover { border-color: var(--frost); background: rgba(86, 232, 228, .08); }

:focus-visible { outline: 2px solid var(--frost); outline-offset: 3px; border-radius: 4px; }

.touch-hint {
  position: absolute;
  z-index: 2;
  bottom: 7.5rem;
  left: 0; right: 0;
  font-family: var(--display);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: rgba(242, 240, 255, .5);
  animation: hint-breathe 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hint-breathe { 0%,100% { opacity: .35; } 50% { opacity: .85; } }

/* hills */
.hills { position: absolute; z-index: 1; bottom: -2px; left: 0; right: 0; pointer-events: none; }
.hill { display: block; width: 100%; height: 130px; }
.hill-far { fill: var(--hill-far); margin-bottom: -92px; }
.hill-near { fill: var(--hill-near); }

/* ============================================================
   LADDER — Touch / Cascade / Full Bloom
   ============================================================ */

/* rises out of the ground the hero's hills stand on */
.ladder-section { background: linear-gradient(to bottom, var(--hill-near), var(--night) 34%); padding-top: 6rem; }

.ladder {
  list-style: none;
  max-width: 60rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.rung {
  position: relative;
  padding: 2.2rem 1.8rem 2rem;
  border-radius: 20px;
  background: linear-gradient(to bottom, rgba(242,240,255,.045), rgba(242,240,255,.015));
  border: 1px solid rgba(242, 240, 255, .08);
  transition: border-color .4s ease, box-shadow .4s ease;
}
.rung:hover {
  border-color: color-mix(in srgb, var(--glow) 45%, transparent);
  box-shadow: 0 0 44px -12px var(--glow);
}

.rung h3 {
  font-size: 1.15rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  margin-bottom: .7rem;
  color: var(--glow);
}

.rung p { font-size: .98rem; }

.rung-mark { display: flex; gap: .45rem; align-items: center; min-height: 2.4rem; margin-bottom: 1rem; color: var(--glow); }
.rung-mark .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 12px var(--glow);
}
.rung-mark .dot:nth-child(2) { opacity: .7; }
.rung-mark .dot:nth-child(3) { opacity: .45; }
.bloom-mark svg { filter: drop-shadow(0 0 10px var(--glow)); }

/* ============================================================
   MOTION — gameplay loops in device frames
   ============================================================ */

.motion-section {
  background: linear-gradient(to bottom, var(--night), var(--night-deep));
  display: grid;
  justify-items: center;
}

.device { width: min(860px, 100%); margin-bottom: 4rem; }
.device:last-child { margin-bottom: 0; }

.device-frame {
  border-radius: clamp(14px, 2.6vw, 26px);
  padding: clamp(8px, 1.4vw, 14px);
  background: linear-gradient(145deg, #23233f, #101024);
  border: 1px solid rgba(242, 240, 255, .12);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}
.device-frame video { border-radius: clamp(8px, 1.6vw, 16px); width: 100%; }

.device-iphone { width: min(940px, 100%); }
.device-iphone .device-frame { border-radius: clamp(18px, 3.4vw, 34px); }
.device-iphone .device-frame video { border-radius: clamp(12px, 2.4vw, 24px); }

.device figcaption {
  text-align: center;
  margin-top: 1rem;
  font-size: .85rem;
  letter-spacing: .08em;
  color: rgba(169, 167, 201, .8);
}

/* ============================================================
   VIBE — soundtrack + ways to play
   ============================================================ */

.vibe-section { background: var(--night-deep); }

/* a quiet lo-fi equalizer in the game's palette */
.eq {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  height: 44px;
  margin-top: 2.2rem;
}
.eq span {
  width: 5px;
  height: 100%;
  border-radius: 3px;
  transform-origin: bottom;
  animation: eq-bounce 2.4s ease-in-out infinite;
}
.eq span:nth-child(4n+1) { background: var(--petal); }
.eq span:nth-child(4n+2) { background: var(--ember); }
.eq span:nth-child(4n+3) { background: var(--frost); }
.eq span:nth-child(4n+4) { background: var(--moon); opacity: .7; }
.eq span:nth-child(1)  { animation-delay: -.2s; }
.eq span:nth-child(2)  { animation-delay: -1.1s; }
.eq span:nth-child(3)  { animation-delay: -.6s; }
.eq span:nth-child(4)  { animation-delay: -1.7s; }
.eq span:nth-child(5)  { animation-delay: -.9s; }
.eq span:nth-child(6)  { animation-delay: -2.1s; }
.eq span:nth-child(7)  { animation-delay: -.35s; }
.eq span:nth-child(8)  { animation-delay: -1.4s; }
.eq span:nth-child(9)  { animation-delay: -.75s; }
.eq span:nth-child(10) { animation-delay: -1.9s; }
.eq span:nth-child(11) { animation-delay: -.15s; }
.eq span:nth-child(12) { animation-delay: -1.25s; }
.eq span:nth-child(13) { animation-delay: -.55s; }
.eq span:nth-child(14) { animation-delay: -1.6s; }
.eq span:nth-child(15) { animation-delay: -.95s; }
.eq span:nth-child(16) { animation-delay: -2.3s; }
@keyframes eq-bounce {
  0%, 100% { transform: scaleY(.25); }
  50%      { transform: scaleY(1); }
}

/* ---------- tap-to-play soundtrack sample ---------- */

.ost {
  display: none;                       /* JS swaps this in for the native fallback */
  max-width: 40rem;
  margin: 2.6rem auto 3.5rem;
  align-items: center;
  gap: 1.4rem;
  padding: 1.5rem 1.6rem;
  border-radius: 22px;
  background: linear-gradient(to bottom, rgba(242,240,255,.055), rgba(242,240,255,.02));
  border: 1px solid rgba(242, 240, 255, .1);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, .85);
}
.js .ost { display: flex; }

.ost-fallback { max-width: 40rem; margin: 2.6rem auto 3.5rem; text-align: center; }
.ost-fallback audio { width: 100%; }
.js .ost-fallback { display: none; }

.ost-play {
  flex: none;
  position: relative;
  width: 66px; height: 66px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--night-deep);
  background: radial-gradient(circle at 34% 28%, var(--ember), var(--petal) 82%);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 34px -10px rgba(255, 95, 135, .7);
  transition: transform .25s ease, box-shadow .25s ease;
}
.ost-play:hover { transform: translateY(-2px); box-shadow: 0 14px 42px -10px rgba(255, 95, 135, .85); }
.ost-play svg { display: block; }
.ost-play .i-play { margin-left: 3px; }   /* optically center the triangle */
.ost-play .i-pause { display: none; }
.ost-play[aria-pressed="true"] .i-play { display: none; }
.ost-play[aria-pressed="true"] .i-pause { display: block; }

/* a soft pulse invites the first tap; drops away once it's been played */
.ost-play.idle::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--petal);
  animation: ost-pulse 2.6s ease-out infinite;
}
@keyframes ost-pulse {
  0%   { transform: scale(1);    opacity: .55; }
  100% { transform: scale(1.4);  opacity: 0; }
}

.ost-body { flex: 1; min-width: 0; }

.ost-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.ost-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--moon);
  letter-spacing: .02em;
}
.ost-badge {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--night-deep);
  background: var(--frost);
  padding: .14rem .5rem;
  border-radius: 999px;
  margin-left: .6rem;
  vertical-align: middle;
}
.ost-time {
  font-family: var(--display);
  font-size: .8rem;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* the equalizer, shaped to sit inside the player and stretch full-width */
.eq.is-player { height: 34px; margin: .95rem 0 0; gap: 4px; }
.eq.is-player span { flex: 1; width: auto; }

/* while audio plays, JS drives the bars — silence the idle keyframes */
.eq.is-live span { animation: none; transition: transform .09s linear; }

.ost-track {
  height: 5px;
  margin-top: .9rem;
  border-radius: 3px;
  background: rgba(242, 240, 255, .14);
  cursor: pointer;
  overflow: hidden;
}
.ost-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--petal), var(--ember) 55%, var(--frost));
}

.vibe-grid {
  max-width: 56rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem 4rem;
}

.vibe { border-left: 2px solid var(--glow); padding-left: 1.4rem; }
.vibe h3 { font-size: 1.05rem; letter-spacing: .06em; margin-bottom: .5rem; }
.vibe p { font-size: .98rem; }

/* ============================================================
   STILLS
   ============================================================ */

.stills-section { background: var(--night-deep); }

.stills {
  max-width: 68rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem;
}

.still { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid rgba(242,240,255,.09); }
.still.wide { grid-column: span 2; }
.still img { width: 100%; height: 100%; object-fit: cover; }

.still figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2.2rem 1.2rem .9rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--moon);
  background: linear-gradient(to top, rgba(10, 10, 32, .85), transparent);
}

/* ============================================================
   CLOSING + FOOTER
   ============================================================ */

.closing {
  text-align: center;
  background:
    radial-gradient(60% 80% at 50% 110%, rgba(255, 95, 135, .16), transparent 70%),
    var(--night-deep);
  padding-block: 8rem;
}
.closing-line {
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin-bottom: 1.2rem;
}

.closing-sub {
  max-width: var(--measure);
  margin: 0 auto 2.4rem;
}

.site-footer {
  background: var(--night-deep);
  border-top: 1px solid rgba(242, 240, 255, .08);
  padding: 2.2rem 1.5rem;
  text-align: center;
  font-size: .85rem;
  color: rgba(169, 167, 201, .65);
}
.site-footer p + p { margin-top: .4rem; }
.site-footer a { color: rgba(169, 167, 201, .9); }

/* ============================================================
   SUBPAGES — support, privacy
   ============================================================ */

.subpage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(to bottom, var(--night-deep), var(--night) 26rem);
}

.page-header { padding: 2rem 1.5rem; text-align: center; }

.home-link {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--moon);
  text-decoration: none;
}
.home-link span { color: var(--petal); }

.page-main {
  flex: 1;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
}

.page-main h1 {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  margin-bottom: 2rem;
}

.prose h2 {
  font-size: 1.25rem;
  margin: 2.6rem 0 .8rem;
}

.prose h3 {
  font-size: 1.02rem;
  color: var(--moon);
  margin: 1.8rem 0 .4rem;
}

.prose p + p { margin-top: 1rem; }

.prose ul { margin: 1rem 0 1rem 1.2rem; }
.prose li { margin-bottom: .5rem; }

.prose a { color: var(--frost); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.policy-date {
  font-family: var(--display);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(169, 167, 201, .7);
  margin-bottom: 1.6rem;
}

/* ============================================================
   RESPONSIVE + MOTION PREFERENCES
   ============================================================ */

@media (max-width: 780px) {
  .ladder { grid-template-columns: 1fr; max-width: 26rem; }
  .vibe-grid { grid-template-columns: 1fr; max-width: 26rem; gap: 2.2rem; }
  .stills { grid-template-columns: 1fr; }
  .still.wide { grid-column: auto; }
  section { padding: 4.5rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .touch-hint { animation: none; opacity: .6; }
  .eq span { animation: none; }
  .eq span:nth-child(odd) { transform: scaleY(.55); }
  .eq span:nth-child(even) { transform: scaleY(.85); }
  .btn-primary, .btn-ghost, .rung, .ost-play { transition: none; }
  .ost-play.idle::after { animation: none; display: none; }
}
