/* Khoteri, "After Dark" (decisions Round 30): slate-first and cinematic in both modes, raspberry
   as light; buttons press down on a colored lip (from the Postcard variation). Mobile first.
   Motion: critically damped springs as CSS easings, transform and opacity only, reduced-motion
   variants throughout. No third-party scripts. */
:root {
  --bg: #12161D; --surface: #1B212B; --well: #0B0E13; --ink: #EEF1F5; --muted: #98A2B3; --line: #2A3240;
  --accent: #C2185B; --accent-deep: #8E1143; --on-accent: #FFFFFF; --tint: #FFE38A;
  --glow: 0 0 40px rgba(194, 24, 91, .35);
  --paper: #12161D; --paper-ink: #EEF1F5; --paper-muted: #98A2B3; --paper-line: #2A3240;
  --spring: linear(0, 0.0317 2.5%, 0.1152 5.5%, 0.2349 9%, 0.3789 13%, 0.5241 17.5%, 0.6588 22.5%, 0.7714 28%, 0.8572 34%, 0.9179 41%, 0.9578 49%, 0.9815 58%, 0.9936 69%, 0.999 83%, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: dark;
}
/* By day the page is mustard paper and the stage stays slate. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --paper: #FFF6D6; --paper-ink: #2B1E0F; --paper-muted: #6B5A3A; --paper-line: #F0E2B0; color-scheme: light; }
}
:root[data-theme="light"] { --paper: #FFF6D6; --paper-ink: #2B1E0F; --paper-muted: #6B5A3A; --paper-line: #F0E2B0; color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--paper-ink); font: 400 17px/1.5 var(--font); letter-spacing: -0.01em; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, a, [role="button"] { touch-action: manipulation; }
button { font: inherit; color: inherit; user-select: none; -webkit-user-select: none; }
:where(a, button, input):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 16px; z-index: 100; }
.wrap { width: min(100%, 640px); margin-inline: auto; padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right)); }
@media (min-width: 960px) { .wrap { width: min(100%, 1000px); } }

/* Chrome: translucent over the paper, content scrolls under it. */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 72%, transparent); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); padding-top: env(safe-area-inset-top); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.logo { font-weight: 800; font-size: 21px; letter-spacing: -0.03em; text-decoration: none; color: inherit; }
.logo span { color: var(--accent); text-shadow: 0 0 18px rgba(194, 24, 91, .8); }
.top nav a { font-size: 15px; font-weight: 600; text-decoration: none; margin-left: 18px; color: var(--paper-muted); }
.chip { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--paper-muted); border: 1px solid var(--paper-line); border-radius: 999px; padding: 6px 10px; }

/* Buttons: a raised pill that presses down onto its lip. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border: 0; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; cursor: pointer; box-shadow: 0 5px 0 var(--accent-deep), var(--glow); transition: transform 120ms ease, box-shadow 120ms ease; position: relative; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-deep), 0 0 16px rgba(194, 24, 91, .3); }
.btn-ghost { background: rgba(255, 255, 255, .12); color: #EEF1F5; box-shadow: 0 5px 0 rgba(0, 0, 0, .35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-ghost:active { box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn-block { width: 100%; }
.btn > span { display: inline-block; transition: opacity 200ms ease, filter 200ms ease; }
.btn.busy > span { opacity: .7; filter: blur(2px); }
.btn[disabled] { cursor: wait; }

/* Hero: full-bleed photograph with the headline on it. */
.hero { position: relative; min-height: 78svh; display: grid; align-items: end; overflow: clip; margin-top: -54px; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1) contrast(1.05); transform: scale(1.04); animation: settle 1400ms var(--spring) both; }
@keyframes settle { from { transform: scale(1.1); } to { transform: scale(1.04); } }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 70% at 50% 100%, rgba(18, 22, 29, .95) 20%, rgba(18, 22, 29, .55) 55%, rgba(18, 22, 29, .05) 85%); }
.hero .wrap { position: relative; z-index: 1; padding: 140px 0 28px; color: #EEF1F5; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: rgba(238, 241, 245, .85); margin-bottom: 12px; }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
h1 { font-size: clamp(40px, 11vw, 72px); line-height: .98; letter-spacing: -0.04em; font-weight: 800; margin: 0 0 14px; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent); text-shadow: 0 0 24px rgba(194, 24, 91, .7); }
.lede { font-size: 18px; color: rgba(238, 241, 245, .82); max-width: 34ch; margin: 0 0 22px; text-wrap: pretty; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* The stage: slate in both modes, holding everything below the hero. */
.stage { background: var(--bg); color: var(--ink); padding-bottom: 24px; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .stage { border-radius: 0 0 28px 28px; } }

/* The board: the live split-flap count. */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px 18px; margin-top: -36px; position: relative; z-index: 2; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.board-head b { font-size: 15px; }
.live { font-size: 13px; color: var(--muted); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.board-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.flaps { display: flex; gap: 5px; }
.flap { position: relative; width: 56px; height: 76px; perspective: 500px; font-weight: 800; font-size: 50px; line-height: 76px; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.flap > span { position: absolute; left: 0; right: 0; overflow: hidden; background: var(--well); color: var(--accent); text-shadow: 0 0 14px rgba(194, 24, 91, .7); backface-visibility: hidden; border: 1px solid var(--line); }
.flap .t, .flap .ft { top: 0; height: 50%; border-radius: 10px 10px 2px 2px; }
.flap .b, .flap .fb { bottom: 0; height: 50%; border-radius: 2px 2px 10px 10px; }
.flap .b i, .flap .fb i { position: absolute; left: 0; right: 0; top: -38px; font-style: normal; }
.flap .ft { transform-origin: bottom; z-index: 2; }
.flap .fb { transform-origin: top; transform: rotateX(90deg); z-index: 2; }
.flap.go .ft { transform: rotateX(-90deg); transition: transform calc(var(--flip, 300ms) / 2) cubic-bezier(0.77, 0, 0.175, 1); }
.flap.go .fb { transform: rotateX(0); transition: transform calc(var(--flip, 300ms) / 2) var(--ease-out) calc(var(--flip, 300ms) / 2); }
.flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--surface); z-index: 3; }
.board-goal { color: var(--muted); font-size: 14px; line-height: 1.25; padding-bottom: 6px; }
.board-goal b { display: block; color: var(--ink); font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.track { height: 8px; border-radius: 999px; background: var(--line); margin-top: 14px; overflow: hidden; }
.fill { height: 100%; width: 100%; border-radius: 999px; background: var(--accent); box-shadow: 0 0 12px var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 600ms var(--spring); }
.board small { display: block; margin-top: 10px; color: var(--muted); font-size: 13.5px; }

section { padding: 36px 0 8px; }
h2 { font-size: 24px; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 4px; text-wrap: balance; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 15.5px; text-wrap: pretty; }

/* Event-style cards. */
.cards { display: grid; gap: 12px; }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.ev { position: relative; display: block; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 10; color: #EEF1F5; text-decoration: none; border: 1px solid var(--line); transition: transform 400ms var(--spring); }
.ev:active { transform: scale(.985); transition-duration: 80ms; }
.ev img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ev::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11, 14, 19, .92), rgba(11, 14, 19, .1) 60%); }
.ev .meta { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.ev h3 { margin: 0 0 2px; font-size: 18px; letter-spacing: -0.02em; line-height: 1.15; }
.ev p { margin: 0; font-size: 13px; color: rgba(238, 241, 245, .75); }
.ev .n { flex: 0 0 auto; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 6px 10px; box-shadow: var(--glow); }
.ev .date { position: absolute; left: 14px; top: 12px; z-index: 1; background: rgba(11, 14, 19, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 10px; padding: 6px 9px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

.steps { display: grid; gap: 10px; }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.step b { font-size: 24px; font-weight: 800; color: var(--accent); letter-spacing: -0.04em; line-height: 1; padding-top: 2px; }
.step h3 { margin: 0 0 2px; font-size: 17px; letter-spacing: -0.02em; }
.step p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* The form. */
.join { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px 18px; }
.field { display: grid; gap: 6px; margin: 12px 0; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input { font: 400 17px/1.3 var(--font); color: var(--ink); background: var(--well); border: 1px solid var(--line); border-radius: 12px; padding: 14px; width: 100%; transition: border-color 150ms ease, box-shadow 150ms ease; }
.field input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194, 24, 91, .25); }
.field input:user-invalid { border-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { min-height: 1.4em; font-size: 15px; margin: 10px 0 0; color: var(--accent); font-weight: 600; }
.form-msg:not(:empty) { opacity: 1; transform: translateY(0); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@starting-style { .form-msg:not(:empty) { opacity: 0; transform: translateY(4px); } }
.fine, .small { font-size: 13px; color: var(--muted); margin: 12px 0 0; line-height: 1.45; }
.fine a, .small a { color: var(--muted); }

.quote { margin: 0; font-size: 20px; line-height: 1.35; letter-spacing: -0.02em; font-weight: 600; text-wrap: pretty; }
.quote footer { font-size: 14px; color: var(--muted); font-weight: 500; margin-top: 10px; }
.rules { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.rules li { font-size: 13px; font-weight: 700; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.areas { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.areas li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.areas b { font-weight: 800; }

/* Scroll entrances, once. */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 500ms ease, transform 600ms var(--spring); }
.reveal.in { opacity: 1; transform: none; }

/* Sticky bottom CTA on phones; tucks away when the form is on screen. */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; padding: 10px max(14px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: color-mix(in srgb, #12161D 78%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line); transform: translateY(0); transition: transform 400ms var(--spring); }
.dock[hidden] { display: block; transform: translateY(110%); }
@media (min-width: 960px) { .dock { display: none !important; } }

footer.site { padding: 24px 0 calc(100px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--paper-muted); }
footer.site .frow { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer.site a { color: inherit; }
@media (min-width: 960px) { footer.site { padding-bottom: 40px; } }

/* Prose pages (check-email, confirmed, unsubscribed, privacy): one card on the stage. */
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px 20px 24px; margin: 20px 0 28px; }
.sheet h1 { font-size: clamp(30px, 8vw, 44px); margin: 0 0 12px; }
.sheet h2 { font-size: 19px; margin: 26px 0 6px; }
.sheet p, .sheet li { margin: 0 0 12px; color: var(--ink); }
.sheet ul { padding-left: 20px; }
.sheet .sticker { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 6px 10px; margin-bottom: 14px; }
.place-row { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.place-row .hash { font-size: 48px; line-height: 1; font-weight: 800; color: var(--accent); text-shadow: 0 0 20px rgba(194, 24, 91, .6); }
.place-row .flap { width: 60px; height: 84px; font-size: 56px; line-height: 84px; }
.place-row .flap .b i, .place-row .flap .fb i { top: -42px; }
.big { font-size: clamp(40px, 9vw, 84px); font-weight: 800; line-height: 1; margin: 6px 0 14px; }
.sheet .progress { margin: 6px 0 4px; }
.sheet .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero img { animation: none; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .flap.go .ft, .flap.go .fb { transition: none; }
  .fill, .btn, .ev, .dock, .form-msg:not(:empty) { transition: none; }
}
