/* Chess Coach start page. Brand tokens mirror studio/src/brands/chess.ts (from the app's CoachTokens.swift). */
@font-face { font-family: "Archivo"; src: url("/fonts/Archivo-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/fonts/Archivo-SemiBold.ttf"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/fonts/Archivo-Bold.ttf"); font-weight: 700; font-display: swap; }
:root {
  --bg: #0F1319; --surface: #181E28; --surface-2: #222A36; --ink: #F5F7FA; --muted: #A7B0BE;
  --accent: #2C6BFF; --accent-ink: #FFFFFF;
  --good: #3FB57E; --inacc: #E5C24A; --mistake: #E0893D; --blunder: #F07070;
  --sq-light: #EDD6AB; --sq-dark: #5C4029;
  --font: "Archivo", system-ui, sans-serif;
  --margin: clamp(1.25rem, 2.6vw, 2.5rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 clamp(1.0625rem, 1rem + .25vw, 1.1875rem)/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure, ul, ol, dl, dd, blockquote { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: #fff; }
h1, h2, h3 { text-wrap: balance; font-weight: 700; }
p { text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js [data-rise] { opacity: 0; transform: translateY(20px); animation: rise 900ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* Page */
    :root { --text: #E9EDF2; --raised: #151A22; --blue-action: #2B64FD; }
    html, body { overflow-x: clip; }
    .wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }


    .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px; background: var(--blue-action); color: #fff; font-weight: 600; text-decoration: none; transition: transform 140ms var(--ease-out), background 180ms; }
    .btn:hover { background: #3A72FF; } .btn:active { transform: scale(.97); }

    /* Hero: unchanged composition. One soft glow behind the phones is the page's only gradient. */
    .hero { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; padding: 64px 0 72px; }
    .hero::before { content: ""; position: absolute; right: -12%; top: -8%; width: 70%; height: 120%; background: radial-gradient(closest-side, rgba(44,107,255,.26), transparent); z-index: -1; }
    h1 { font-size: clamp(2.6rem, 4.6vw, 4.1rem); line-height: 1.02; letter-spacing: -.035em; }
    .lead { margin-top: 24px; font-size: 1.22rem; line-height: 1.5; color: var(--text); max-width: 31rem; }

    .phone { position: relative; width: 300px; aspect-ratio: 1206 / 2622; border-radius: 46px; padding: 10px; background: #1B212B; box-shadow: inset 0 0 0 1px #2D3542; }
    .phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 37px; background: #0B0E13; }
    .phones { position: relative; height: 690px; }
    .phones .phone { position: absolute; box-shadow: inset 0 0 0 1px #2D3542, 0 40px 80px -24px rgba(0,0,0,.75); }
    .phones .front { right: 30px; top: 0; z-index: 2; }
    .phones .back { right: 225px; top: 64px; transform: rotate(-6deg) scale(.88); }


    /* Features: same alternating split; the phone sits on a raised panel instead of a glow. */
    .feature { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; padding-top: 150px; }
    .feature.flip .copy { order: 2; }
    .feature h2 { font-size: clamp(2rem, 3.2vw, 2.75rem); line-height: 1.08; letter-spacing: -.025em; }
    .feature p { margin-top: 16px; color: var(--text); font-size: 1.13rem; max-width: 28rem; }
    .stage { display: flex; justify-content: center; padding: 56px 0; background: var(--raised); border-radius: 32px; }
    .stage .phone { width: 280px; }

    /* Close: flat brand blue, no gradient. */
    .final { margin-top: 160px; padding: 80px 40px; border-radius: 32px; text-align: center; background: var(--blue-action); }
    .final h2 { font-size: clamp(2.2rem, 4vw, 3rem); letter-spacing: -.03em; }
    .final p { margin: 12px auto 30px; color: #fff; max-width: 34ch; }
    .final .btn { background: #fff; color: #1D4FD8; }
    .final .btn:hover { background: #EEF3FF; }

    footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 44px 0 100px; color: var(--muted); font-size: 15px; }

    footer nav { display: flex; gap: 24px; }
    footer a { color: var(--muted); text-decoration: none; } footer a:hover { color: var(--ink); }

    @media (max-width: 900px) {
      .hero, .feature { grid-template-columns: 1fr; }
      .hero { padding: 32px 0 48px; gap: 40px; }
      .hero::before { right: -30%; top: 30%; width: 120%; height: 70%; }
      .phones { height: 580px; }
      .phones .front { right: 50%; transform: translateX(50%); width: 250px; }
      .phones .back { display: none; }
      .feature { gap: 32px; padding-top: 104px; }
      .feature.flip .copy { order: 0; }
      .stage { padding: 40px 0; } .stage .phone { width: 230px; }
      .final { margin-top: 112px; padding: 56px 24px; }
    }
    /* Waitlist form. */
    .join { display: flex; gap: 8px; margin-top: 34px; max-width: 31rem; padding: 6px; background: var(--raised); border-radius: 999px; }
    .join input { flex: 1; min-width: 0; height: 52px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: 17px; }
    .join input::placeholder { color: #8A93A3; }
    .join input:focus { outline: none; }
    .join:focus-within { box-shadow: 0 0 0 2px var(--blue-action); }
    .join .btn { flex: none; }
    .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
    .done { margin-top: 34px; font-size: 1.1rem; font-weight: 600; }
    .note { margin-top: 18px; color: var(--muted); font-size: 15px; }
    .icon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 28px; }

    /* The premise: what players usually do, and why it misses. */
    .premise { padding-top: 150px; }
    .premise h2 { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.05; letter-spacing: -.03em; max-width: 24ch; }
    .premise .intro { margin-top: 20px; font-size: 1.2rem; max-width: 36rem; color: var(--text); }
    .analogy { margin: 0 auto; max-width: 30ch; text-align: center; font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.3; font-weight: 600; letter-spacing: -.015em; }
    .bridge { text-align: center; margin: 22px auto 0; color: var(--muted); font-size: 1.1rem; max-width: 40ch; }

    /* Solid navy field on the blue banner: text 12:1, placeholder 8:1. The focus ring is white with a gap (4.9:1 on the banner). */
    .final .join { margin: 30px auto 0; background: #0E2C80; }
    .final .join input { color: #fff; } .final .join input::placeholder { color: #C9D6FF; }
    .final .join .btn { background: #fff; color: #1D4FD8; }
    .final .done { color: #fff; }
    .final .join:focus-within { box-shadow: none; outline: 3px solid #fff; outline-offset: 3px; }
    .consent { margin-top: 14px; max-width: 31rem; color: var(--muted); font-size: 14px; line-height: 1.5; }
    .consent a { color: var(--ink); }
    .final .consent { margin: 16px auto 0; color: #fff; } .final .consent a { color: #fff; }
    .shot-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
    .phones .shot-note { position: absolute; bottom: 0; right: 30px; width: 300px; }
    .stage { flex-direction: column; align-items: center; }
    footer .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
    footer .brand img { width: 26px; height: 26px; border-radius: 7px; }
    @media (max-width: 900px) {
      .join { flex-direction: column; gap: 10px; padding: 0; background: transparent; border-radius: 0; }
      .join input { flex: none; width: 100%; background: var(--raised); height: 56px; }
      .final .join { background: transparent; } .final .join input { background: #0E2C80; }
      .join:focus-within, .final .join:focus-within { box-shadow: none; outline: none; } .join input:focus { box-shadow: 0 0 0 2px var(--blue-action); }
      .final .join input:focus { box-shadow: none; outline: 3px solid #fff; outline-offset: 3px; }
      .phones .shot-note { right: 0; width: auto; left: 0; }
      .join .btn { width: 100%; min-height: 56px; }
      .premise { padding-top: 104px; } .analogy { font-size: 22px; } .premise h2 { font-size: 30px; }
      .hero { padding-top: 40px; }
    }
    /* Premise visuals: drawn from the app's own colours, sample data marked as such. */
    .panel { background: var(--raised); border-radius: 28px; padding: 32px; margin: 0; }
    .premise-top { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; margin-top: 48px; }
    .premise-top .intro { margin-top: 0; font-size: clamp(1.4rem, 2vw, 1.75rem); line-height: 1.3; max-width: 18ch; font-weight: 600; }
    .rank ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
    .rank li { display: grid; grid-template-columns: 14rem 1fr 2ch; gap: 14px; align-items: center; font-size: 16px; color: var(--muted); }
    .rank li i { height: 12px; border-radius: 6px; background: #2E3746; width: calc(var(--v) * 100%); }
    .rank li b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
    .rank li.top { color: var(--ink); font-weight: 600; }
    .rank li.top i { background: var(--mistake); }
    .rank figcaption, .cap { margin-top: 22px; font-size: 15px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
    .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--mistake); flex: none; }

    .premise .habit { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; margin-top: 120px; }
    .premise .habit.flip > figure { order: 2; }
    .habit h3 { font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.1; letter-spacing: -.025em; color: var(--ink); }
    .habit p { margin-top: 14px; font-size: 1.15rem; color: var(--text); max-width: 30rem; }

    .track { position: relative; height: 56px; border-radius: 14px; background: #222A36; overflow: hidden; }
    .track .open { position: absolute; left: 0; top: 0; bottom: 0; width: 16.7%; background: #3A4556; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--ink); }
    .track .m { position: absolute; top: 12px; bottom: 12px; left: calc(var(--x) * 100%); width: 10px; border-radius: 4px; background: var(--mistake); }
    .scale { position: relative; height: 20px; margin-top: 10px; font-size: 14px; color: var(--muted); }
    .scale span { position: absolute; transform: translateX(-50%); }
    .scale span:nth-child(1) { left: 0; transform: none; color: var(--ink); } .scale span:nth-child(2) { left: 50%; } .scale span:nth-child(3) { right: 0; left: auto; transform: none; }

    .chips { display: flex; flex-wrap: wrap; gap: 10px; }
    .chips span { padding: 10px 16px; border-radius: 12px; background: #222A36; color: var(--muted); font-size: 15px; }

    .analogy-band { margin-top: 140px; padding: 64px 40px 72px; border-radius: 32px; background: var(--raised); text-align: center; }
    .lane { display: flex; max-width: 640px; margin: 40px auto 28px; height: 44px; border-radius: 12px; overflow: hidden; font-size: 14px; font-weight: 600; }
    .lane .start { flex: 0 0 22%; background: var(--blue-action); color: #fff; display: flex; align-items: center; justify-content: center; }
    .lane .rest { flex: 1; background: #222A36; color: var(--muted); display: flex; align-items: center; justify-content: center; }
    .analogy-band .analogy { margin: 0 auto; }
    @media (max-width: 900px) {
      .premise-top, .premise .habit { grid-template-columns: 1fr; gap: 28px; }
      .premise .habit { margin-top: 80px; } .premise .habit.flip > figure { order: 0; }
      .rank li { grid-template-columns: 1fr 2ch; } .rank li i { grid-column: 1 / -1; grid-row: 2; }
      .panel { padding: 24px; } .analogy-band { margin-top: 96px; padding: 40px 20px 48px; }
    }
  