:root {
  --bg: #fbf5f0;
  --bg-tint: #f1e8f3;
  --surface: #ffffff;
  --ink: #2a1a3a;
  --ink-soft: #5d4a6b;
  --line: #e6d9e6;
  --ember: #c23d17;
  --ember-hover: #a73212;
  --on-ember: #ffffff;
  --salmon: #cb7b5d;
  --gold: #ffc96b;
  --focus: #6b3e9e;
  --good: #2c8a5a;
  --shadow: 0 10px 30px rgba(74, 36, 80, .16);
  --r: 18px;
  --font-h: "Bricolage Grotesque", system-ui, sans-serif;
  --font-b: "Figtree", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #1a1226;
  --bg-tint: #241936;
  --surface: #2b1f3d;
  --ink: #f8eee8;
  --ink-soft: #cdbfd8;
  --line: #43325a;
  --ember: #ff7a4d;
  --ember-hover: #ff9068;
  --on-ember: #2a1208;
  --focus: #ffc96b;
  --good: #5fd39a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1226; --bg-tint: #241936; --surface: #2b1f3d; --ink: #f8eee8; --ink-soft: #cdbfd8;
    --line: #43325a; --ember: #ff7a4d; --ember-hover: #ff9068; --on-ember: #2a1208;
    --focus: #ffc96b; --good: #5fd39a; --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-b);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-h); line-height: 1.1; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.wrap--narrow { width: min(760px, 100% - 32px); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.4rem var(--font-h); letter-spacing: -.02em; }
.brand__mark { width: 36px; height: 36px; image-rendering: pixelated; }
.nav__links { display: flex; gap: 32px; }
.nav__links a { text-decoration: none; color: var(--ink-soft); font-weight: 500; padding: 8px 2px; }
.nav__links a:hover { color: var(--ink); }
.nav__end { display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--bg-tint); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border-radius: 999px; border: 2px solid transparent; font: 600 1rem var(--font-b); text-decoration: none; cursor: pointer; transition: background-color .2s, transform .2s, border-color .2s; }
.btn--primary { background: var(--ember); color: var(--on-ember); }
.btn--primary:hover { background: var(--ember-hover); }
.btn--ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-soft); }
.btn--sm { min-height: 44px; padding: 0 20px; }
.btn:active { transform: scale(.98); }

/* hero */
.hero-track { position: relative; height: 480vh; }
.hero { position: sticky; top: 68px; overflow: hidden; height: calc(100svh - 68px); min-height: 520px; text-align: center; background: radial-gradient(900px 520px at 50% 85%, color-mix(in srgb, var(--salmon) 26%, transparent), transparent 70%), linear-gradient(180deg, var(--bg), var(--bg-tint)); }
.scene { position: absolute; inset: 0; display: flex; flex-direction: column; padding: clamp(20px, 5vh, 56px) 0 clamp(12px, 3vh, 28px); --p: 0; --f: 0; --g: 0; --e: 1; }
.scene[data-scene="2"] { --e: 0; pointer-events: none; }
.hero__in { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hero h1, .hero__title { font-size: clamp(2.2rem, min(7vw, 9vh), 4.6rem); font-weight: 700; max-width: 14ch; margin-inline: auto; text-wrap: balance; }
.hero h1, .hero__title, .lede { opacity: calc(var(--e) * (1 - var(--g))); }
.lede { max-width: 44ch; margin: clamp(10px, 2vh, 22px) auto 0; color: var(--ink-soft); font-size: clamp(1.05rem, 2.4vh, 1.25rem); }
.stage { --dx: clamp(120px, 30vw, 380px); position: relative; flex: 1; min-height: 0; margin-top: clamp(12px, 3vh, 32px); display: flex; justify-content: center; }
.stage__mascot { position: relative; z-index: 2; height: 100%; width: auto; aspect-ratio: 1; image-rendering: pixelated; filter: drop-shadow(0 12px 20px rgba(74,36,80,.25)); opacity: calc(var(--e) * (1 - var(--f))); transform: scale(calc(1 - var(--f) * .08)); will-change: opacity, transform; }
.glow { position: absolute; inset: 10% 20% 0; background: radial-gradient(circle, var(--gold), transparent 65%); opacity: .5; filter: blur(30px); opacity: calc(.5 * var(--e) * (1 - var(--f))); }
.polaroid { position: absolute; z-index: 1; left: 50%; top: 10%; margin: 0; width: clamp(110px, 17vw, 190px); opacity: calc(var(--p) * (1 - var(--g))); will-change: transform, opacity; }
.polaroid svg { width: 100%; border-radius: 16px; box-shadow: var(--shadow); image-rendering: pixelated; }
.polaroid figcaption { margin-top: 10px; font: 600 clamp(.8rem, 1.6vw, .95rem) var(--font-h); color: var(--ink-soft); letter-spacing: -.01em; }
.polaroid--l { transform: translate(calc(-50% - var(--p) * var(--dx)), calc((1 - var(--p)) * 40px)) rotate(calc(var(--p) * -9deg)) scale(calc(.45 + var(--p) * .55)); }
.polaroid--r { transform: translate(calc(-50% + var(--p) * var(--dx)), calc((1 - var(--p)) * 20px)) rotate(calc(var(--p) * 8deg)) scale(calc(.45 + var(--p) * .55)); }

/* sections */
.section { padding: 96px 0; }
.section--tint { background: var(--bg-tint); }
.section__head { max-width: 640px; margin-bottom: 48px; }
.section__head h2 { font-size: clamp(2rem, 4vw, 3rem); }
.section__head p { margin-top: 16px; color: var(--ink-soft); font-size: 1.15rem; }


/* features */
.feat__title { font-size: clamp(2.2rem, 5vw, 4rem); max-width: 18ch; margin: 0 auto 56px; text-align: center; text-wrap: balance; }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 16px 16px 28px; display: flex; flex-direction: column; }
.fcard h3 { font-size: 1.6rem; margin: 24px 12px 8px; }
.fcard > p { margin: 0 12px; color: var(--ink-soft); }
.panel { height: 320px; padding: 20px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.panel__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.muted { color: var(--ink-soft); font-size: .95rem; }
.tag { padding: 6px 14px; border-radius: 999px; background: var(--bg-tint); border: 1px solid var(--line); font-size: .85rem; font-weight: 500; white-space: nowrap; }
.big { font: 700 clamp(2rem, 3.4vw, 2.6rem) var(--font-h); letter-spacing: -.03em; line-height: 1.1; }
.note { font-size: .875rem; color: var(--ink-soft); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; }
.fields label { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.fields input { min-height: 48px; width: 100%; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: 600 1.05rem var(--font-b); font-variant-numeric: tabular-nums; }
.fields input:focus-visible { border-color: var(--focus); outline-offset: 2px; }
.bars { display: grid; gap: 14px; margin-top: 10px; }
.bars li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; font-size: .95rem; }
.bars i { height: 26px; width: var(--w); border-radius: 8px; background: var(--line); }
.bars .is-you i { background: var(--ember); }
.bars .is-you span, .bars .is-you b { color: var(--ember); font-weight: 700; }
.bars b { font-variant-numeric: tabular-nums; font-weight: 600; }
.chart { width: 100%; flex: 1; min-height: 0; }
.days { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-soft); }
.chart--s { flex: 0 0 90px; }
.stats { display: flex; justify-content: space-between; gap: 8px; margin: auto 0 0; }
.stats dt { font-size: .85rem; color: var(--ink-soft); }
.stats dd { margin: 0; font: 700 1.15rem var(--font-h); font-variant-numeric: tabular-nums; }
.stats--2 { margin-top: 8px; }
.meter { height: 16px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--ember), var(--gold)); border-radius: 999px; }
.rows { display: grid; gap: 18px; margin-top: 8px; }
.rows li { display: grid; grid-template-columns: 14px 1fr auto; gap: 14px; align-items: center; }
.rows i { width: 14px; height: 14px; background: var(--c); }
.rows b { display: block; font-weight: 600; }
.rows span { font-size: .85rem; color: var(--ink-soft); }
.rows em { font: 700 1.1rem var(--font-h); font-style: normal; font-variant-numeric: tabular-nums; }
.feat__fine { margin-top: 32px; text-align: center; margin-inline: auto; }

/* game */
.game { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.game h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 14px 0 16px; }
.game__copy > p:not(.pill) { color: var(--ink-soft); font-size: 1.15rem; max-width: 52ch; }
.pill { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--gold); color: #3a2410; font: 600 .875rem var(--font-b); }
.ticks { margin: 24px 0 32px; display: grid; gap: 12px; }
.ticks li { padding-left: 32px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 14px; background: var(--ember); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ember) 25%, transparent); }
.tower { position: relative; width: min(320px, 100%); margin-inline: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 20px; }
.lvl { height: 64px; border-radius: 10px; display: flex; align-items: center; padding-left: 18px; font: 600 .95rem var(--font-h); background: var(--surface); border: 2px solid var(--line); color: var(--ink-soft); }
.lvl--1 { margin-inline: 0; } .lvl--2 { margin-inline: 14px; } .lvl--3 { margin-inline: 28px; } .lvl--4 { margin-inline: 42px; border-style: dashed; }
.lvl--1, .lvl--2 { border-color: var(--ember); color: var(--ink); }
.tower__me { position: absolute; width: 72px; left: 20px; top: 118px; image-rendering: pixelated; filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); }

/* posts */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post__art { aspect-ratio: 4/3; border-radius: var(--r); margin-bottom: 18px; }
.post__art--1 { background: linear-gradient(180deg, #3a244e, #b65058 60%, #fcb662); }
.post__art--2 { background: linear-gradient(180deg, #703660, #e87c50 70%, #ffd66e); }
.post__art--3 { background: linear-gradient(180deg, #1f3a3a, #5a2f58 55%, #e87c50); }
.post h3 { font-size: 1.3rem; }
.post h3 a { text-decoration: none; }
.post h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.post p { margin-top: 8px; color: var(--ink-soft); }
.meta { display: block; margin-top: 10px; font-size: .9rem; color: var(--ink-soft); }

/* faq */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.faq summary { cursor: pointer; padding: 20px 56px 20px 22px; font: 600 1.1rem var(--font-h); list-style: none; position: relative; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 22px; top: 50%; translate: 0 -50%; font-size: 1.5rem; color: var(--ember); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 22px 22px; color: var(--ink-soft); }

/* cta */
.cta { text-align: center; }
.cta__mark { width: 80px; margin: 0 auto 16px; image-rendering: pixelated; }
.cta h2 { font-size: clamp(2rem, 4vw, 3rem); }
.cta > p { margin-top: 12px; color: var(--ink-soft); font-size: 1.15rem; }
.signup { margin-top: 28px; text-align: left; }
.signup label { display: block; font-weight: 600; margin-bottom: 8px; }
.signup__row { display: flex; gap: 10px; flex-wrap: wrap; }
.signup input { flex: 1 1 240px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.signup input:focus-visible { border-color: var(--focus); outline-offset: 2px; }
.signup__msg { min-height: 1.5em; margin-top: 10px; font-size: .95rem; color: var(--ink-soft); }
.signup__msg.is-err { color: var(--ember); }

/* floating card */
.float { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: 260px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.float { transition: opacity .3s, translate .3s; }
.float[hidden] { display: none; }
.float.is-away { opacity: 0; translate: 0 16px; pointer-events: none; visibility: hidden; }
.float__mark { width: 44px; image-rendering: pixelated; }
.float__t { font: 700 1.1rem var(--font-h); margin: 8px 0 12px; }
.float__x { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; color: var(--ink-soft); cursor: pointer; }
.float__x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.signup--sm { display: grid; gap: 8px; margin: 0; }
.signup--sm input { flex: none; min-height: 44px; }
.signup--sm .signup__msg { margin: 0; min-height: 0; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 48px 0; }
.foot__in { display: grid; gap: 20px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot nav a { text-decoration: none; color: var(--ink-soft); padding: 8px 0; }
.foot nav a:hover { color: var(--ink); }
.fine { font-size: .875rem; color: var(--ink-soft); max-width: 72ch; }

@media (max-width: 900px) {
  .nav__links { display: none; }
  .fgrid, .posts { grid-template-columns: 1fr 1fr; }
  .game { grid-template-columns: 1fr; gap: 40px; }
  .float { display: none; }
  .section { padding: 72px 0; }
}
@media (max-width: 600px) {
  .fgrid, .posts { grid-template-columns: 1fr; }
  .nav__cta { display: none; }
  .stage { --dx: 30vw; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-track { height: auto; }
  .hero { position: relative; top: 0; }
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .stage__mascot { animation: bob 4s ease-in-out infinite; }
  .polaroid--l { animation: bob 5s ease-in-out -1.2s infinite; }
  .polaroid--r { animation: bob 4.4s ease-in-out -2.6s infinite; }
  @keyframes bob { 50% { translate: 0 -7px; } }
}

.flink { text-decoration: none; }
.flink:hover { text-decoration: underline; text-underline-offset: 4px; }
