/* flapfit.com — the app's own look, carried to the web.
 *
 * Every value here is a token from app/lib/screens/theme.dart (S, G) or
 * app/lib/design/brand.dart, under the same name, so a change to the app's
 * palette has one obvious place to land here too. The rules that travel:
 *   - the ground is near-black, cooled a touch green (S.paper);
 *   - the shell has no accent of its own: colour belongs to the five games;
 *   - green appears only where it means alive (the streak);
 *   - Big Shoulders is the game talking (headlines, names, numbers),
 *     Archivo is everything you read.
 */

@font-face { font-family: "Archivo"; font-weight: 400; font-display: swap; src: url(fonts/archivo-400.woff) format("woff"); }
@font-face { font-family: "Archivo"; font-weight: 600; font-display: swap; src: url(fonts/archivo-600.woff) format("woff"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-display: swap; src: url(fonts/archivo-800.woff) format("woff"); }
@font-face { font-family: "Archivo"; font-weight: 900; font-display: swap; src: url(fonts/archivo-900.woff) format("woff"); }
@font-face { font-family: "Big Shoulders"; font-weight: 800; font-display: swap; src: url(fonts/bigshoulders-800.woff) format("woff"); }
@font-face { font-family: "Big Shoulders"; font-weight: 900; font-display: swap; src: url(fonts/bigshoulders-900.woff) format("woff"); }

:root {
  /* S — the shell */
  --paper: #0B0F0D;
  --paper2: #161D1A;
  --ink: #EAF0EC;
  --ink-mid: #A2AFA8;
  --ink-dim: #6B7873;
  --hair: #28322D;
  --ok: #3DD68C;

  /* G — one colour per game, from the game's own world */
  --flappy: #1F6FEB;
  --limbo: #D1442F;
  --avalanche: #1F9EB0;
  --swerve: #6F52F0;
  --pulse: #E8307A;

  --body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Big Shoulders", "Archivo", system-ui, sans-serif;

  --wrap: 1120px;
  --gutter: 16px;
  --radius: 14px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---- type ------------------------------------------------------------ */

/* The arcade voice: condensed caps, tight, the store screenshots' headline. */
.display {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: .005em;
  margin: 0;
}
h1.display { font-size: clamp(54px, 11vw, 112px); }
h2.display { font-size: clamp(40px, 7vw, 72px); }

/* The short bar under a headline, in the colour of what the section is about. */
.bar { display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--c, var(--flappy)); margin: 18px 0 0; }

.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-mid); max-width: 34em; margin: 22px 0 0; }
.lede strong { color: var(--ink); font-weight: 600; }

/* Sentence case labels: a tracked-out caps line over everything is template chrome. */
.eyebrow { font-weight: 700; font-size: 14px; color: var(--ink-mid); margin: 0 0 14px; }

section { padding: 72px 0; }
@media (min-width: 900px) { section { padding: 112px 0; } }

/* ---- header ---------------------------------------------------------- */

.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--hair); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }

/* The lockup: the bird a sixth taller than the name's caps, as in AppLockup. */
.lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.lockup img { width: 34px; height: 34px; border-radius: 9px; }
.lockup span { font-family: var(--display); font-weight: 900; font-size: 25px; letter-spacing: .01em; line-height: 1; }

.top nav { display: flex; align-items: center; gap: 22px; font-weight: 600; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--ink-mid); }
.top nav a:hover { color: var(--ink); }
.top nav .navlink { display: none; }
@media (min-width: 760px) { .top nav .navlink { display: inline; } }

/* An inked block, the same object as the app's LaunchButton. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 9px; background: var(--ink); color: var(--paper) !important; font-weight: 800; font-size: 15px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #fff; }
.btn.ghost { background: transparent; color: var(--ink) !important; box-shadow: inset 0 0 0 1.5px var(--hair); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink-dim); }

/* ---- hero ------------------------------------------------------------ */

.hero { padding: 40px 0 72px; position: relative; isolation: isolate; }
.hero::before { /* the sky the bird flies through, barely */
  content: ""; position: absolute; z-index: -1; inset: -64px 0 auto; height: 760px;
  background: radial-gradient(60% 55% at 72% 38%, color-mix(in srgb, var(--flappy) 22%, transparent), transparent 70%);
  pointer-events: none;
}
.hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 72px 0 112px; }
  .hero .wrap { grid-template-columns: 1.15fr .85fr; gap: 64px; }
}

.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 32px; }
/* Google's badge PNG carries its own transparent margin; this cancels it so
   the visible badge lines up with the text above. */
.play { display: inline-block; margin: -10px -11px; line-height: 0; }
.play img { height: 78px; width: auto; }
/* iOS is not out yet: Apple's badge, unlinked, with the date it lands. */
/* The caption hangs below the badge so the two badges stay level. */
.ios { margin: 0; position: relative; }
.ios img { height: 48px; width: auto; display: block; }
.ios figcaption { position: absolute; top: 100%; left: 0; right: 0; margin-top: 7px; text-align: center; color: var(--ink-mid); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.badges:has(.ios) { padding-bottom: 20px; }
.ios figcaption a { color: inherit; text-decoration: none; }
.ios figcaption a:hover { color: var(--ink); }

/* ---- iPhone waitlist ---- */
.waitlist form { margin-top: 32px; max-width: 600px; display: grid; gap: 16px; }
.waitlist .row { display: flex; flex-wrap: wrap; gap: 10px; }
.waitlist input[type=email] { flex: 1 1 240px; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: 9px; border: 1.5px solid var(--hair); background: var(--paper2); color: var(--ink); font: inherit; font-size: 16px; }
.waitlist input[type=email]::placeholder { color: var(--ink-dim); }
.waitlist input[type=email]:focus { outline: none; border-color: var(--flappy); }
.waitlist .btn { min-height: 48px; border: 0; cursor: pointer; font-family: inherit; }
@media (max-width: 520px) { .waitlist .btn { width: 100%; } }
.waitlist .btn[disabled] { opacity: .6; cursor: progress; }
.check { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-mid); font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--flappy); }
.status { margin: 0; min-height: 1.5em; font-weight: 700; color: var(--ink); }
.status.err { color: var(--limbo); }
.fine { margin: 0; color: var(--ink-dim); font-size: 13px; }
.fine a { color: var(--ink-mid); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--ink-mid); font-size: 15px; font-weight: 600; }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

/* The phone: the real first screen of the app, a real set, looping. */
.phone { position: relative; width: min(320px, 78vw); margin-inline: auto; aspect-ratio: 900 / 1616; border-radius: 40px; padding: 10px; background: #050706; box-shadow: 0 0 0 1.5px #2b3631, 0 40px 80px -30px rgba(0,0,0,.8), 0 0 120px -20px color-mix(in srgb, var(--flappy) 45%, transparent); }
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 31px; background: var(--paper2); }
.phone figcaption { position: absolute; left: 0; right: 0; bottom: -40px; text-align: center; font-size: 13px; color: var(--ink-dim); }

/* ---- the rule -------------------------------------------------------- */

.rule .wrap { display: grid; gap: 40px; }
@media (min-width: 900px) { .rule .wrap { grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; } }

.beats { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.beats li { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; background: var(--paper2); border-radius: var(--radius); padding: 18px 20px; }
.beats b { font-family: var(--display); font-weight: 900; font-size: 28px; text-transform: uppercase; line-height: 1; display: block; }
.beats span { color: var(--ink-mid); font-size: 15px; }
.beats canvas { width: 92px; height: 92px; margin: -14px 0; }

/* ---- the five games -------------------------------------------------- */

.games-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px; }
.grid5 { display: grid; gap: 12px; margin-top: 40px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid5 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .grid5 { grid-template-columns: repeat(5, 1fr); } }

.game { position: relative; background: var(--c); border-radius: var(--radius); padding: 18px 18px 20px; color: #fff; overflow: hidden; display: grid; grid-template-columns: 96px 1fr; gap: 6px 14px; align-items: center; min-height: 128px; }
@media (min-width: 1000px) { .game { grid-template-columns: 1fr; align-content: start; min-height: 300px; padding: 20px; } }
.game canvas { width: 96px; height: 96px; grid-row: span 3; }
@media (min-width: 1000px) { .game canvas { width: 100%; height: auto; aspect-ratio: 1; grid-row: auto; margin-bottom: 6px; } }
.game h3 { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 36px; line-height: .9; margin: 0; }
.game .move { font-weight: 800; font-size: 16px; }
.game .works { font-size: 14px; opacity: .82; }
.game .where { position: absolute; top: 14px; right: 16px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }

.note { color: var(--ink-dim); font-size: 14px; margin-top: 18px; }

/* ---- how it works ---------------------------------------------------- */

.steps { display: grid; gap: 12px; margin: 40px 0 0; padding: 0; list-style: none; counter-reset: s; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { background: var(--paper2); border-radius: var(--radius); padding: 24px; counter-increment: s; }
.steps li::before { content: counter(s); display: block; font-family: var(--display); font-weight: 900; font-size: 56px; line-height: .85; color: var(--c); margin-bottom: 14px; }
.steps h3 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.steps p { margin: 0; color: var(--ink-mid); font-size: 15.5px; }

/* ---- streak ---------------------------------------------------------- */

.streak .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .streak .wrap { grid-template-columns: .9fr 1.1fr; gap: 72px; } }
.ring { width: min(340px, 80vw); margin-inline: auto; }
.ring text { font-family: var(--display); font-weight: 900; }
.spot { margin-top: 28px; border: 1.5px solid var(--flappy); border-radius: var(--radius); padding: 20px 22px; }
.spot h3 { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 30px; line-height: .95; color: var(--flappy); margin: 0 0 8px; }
.spot p { margin: 0; color: var(--ink-mid); font-size: 15.5px; }

/* ---- privacy --------------------------------------------------------- */

.cam { display: grid; gap: 12px; margin-top: 40px; }
@media (min-width: 800px) { .cam { grid-template-columns: repeat(3, 1fr); } }
.cam div { background: var(--paper2); border-radius: var(--radius); padding: 24px; }
.cam h3 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.cam p { margin: 0; color: var(--ink-mid); font-size: 15.5px; }

/* ---- faq ------------------------------------------------------------- */

.faq { margin-top: 32px; border-top: 1px solid var(--hair); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--hair); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; font-weight: 800; font-size: 18px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-family: var(--display); font-size: 30px; color: var(--ink-mid); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 20px; color: var(--ink-mid); max-width: 40em; }

/* ---- closing --------------------------------------------------------- */

.close { text-align: center; }
.close .display { font-size: clamp(48px, 9vw, 96px); }
.close .badges { justify-content: center; }
.close .lede { margin-inline: auto; }

/* ---- footer ---------------------------------------------------------- */

footer { border-top: 1px solid var(--hair); padding: 40px 0 56px; color: var(--ink-dim); font-size: 14.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
footer a { text-decoration: none; color: var(--ink-mid); }
footer a:hover { color: var(--ink); }

/* ---- long-form pages (privacy, terms) -------------------------------- */

.doc { padding: 48px 0 96px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(44px, 8vw, 72px); line-height: .92; margin: 0; }
.doc .sub { color: var(--ink-dim); margin: 14px 0 32px; }
.doc h2 { font-size: 21px; font-weight: 800; margin: 44px 0 10px; }
.doc p, .doc li { color: var(--ink-mid); }
.doc strong { color: var(--ink); }
.doc a { color: var(--ink); text-underline-offset: 3px; }
.doc ul { padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc .big { font-size: 19px; color: var(--ink); }
.doc table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--hair); }
.doc th { color: var(--ink); font-weight: 800; }
.doc td { color: var(--ink-mid); }
.doc code { font-size: .9em; background: var(--paper2); padding: 1px 5px; border-radius: 4px; }

/* Everything that moves stands still for anyone who asked it to. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
