/* Defeated — design system v2
   Chalk page, ink type, cobalt for the brand, flare for the one bar that fell.
   Dense by default: no section gets more air than its content earns. */

:root {
  --background: #F4F2EC;
  --foreground: #0B0B10;
  --card: #FFFFFF;
  --muted: #E9E6DD;
  --muted-foreground: #5B5E6E;
  --border: #DAD6CB;
  --input: #FFFFFF;
  --ring: #1B2CC1;
  --cobalt: #1B2CC1;
  --cobalt-deep: #121C8A;
  --cobalt-ink: #0C1466;
  --flare: #FF6A3D;
  --chalk: #F4F2EC;
  --ink: #0B0B10;
  --primary: #0B0B10;
  --primary-foreground: #F4F2EC;
  --destructive: #C8452B;
  --radius: 12px;

  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 4px; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--flare); color: var(--ink); }

/* ---- type ------------------------------------------------------------ */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(42px, 6.4vw, 84px); line-height: 0.96; font-variation-settings: "opsz" 96, "wdth" 90; }
h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.02; font-variation-settings: "opsz" 48, "wdth" 92; }
h3 { font-size: 20px; line-height: 1.2; font-variation-settings: "opsz" 24; letter-spacing: -0.02em; }
p { margin: 0; max-width: 60ch; }
.lede { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.5; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.num { font-variant-numeric: tabular-nums; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
.dim { color: var(--muted-foreground); }
.flare { color: var(--flare); }
.strike { position: relative; display: inline-block; }
.strike::after { content: ""; position: absolute; left: -2%; right: -2%; top: 55%; height: 0.09em; background: var(--flare); transform: rotate(-3deg); border-radius: 2px; }

/* ---- layout ---------------------------------------------------------- */
.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(44px, 6vw, 80px); }
.grid { display: grid; gap: 16px; }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .cols-3, .cols-2 { grid-template-columns: 1fr; } .cols-4 { grid-template-columns: 1fr 1fr; } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* ---- surfaces ---------------------------------------------------------- */
.on-cobalt { background: var(--cobalt); color: var(--chalk); }
.on-cobalt .dim { color: color-mix(in oklab, var(--chalk) 72%, var(--cobalt)); }
.on-cobalt .eyebrow { color: color-mix(in oklab, var(--chalk) 70%, var(--cobalt)); }
.on-ink { background: var(--ink); color: var(--chalk); }
.on-ink .dim { color: #A6A8B5; }
.on-ink .eyebrow { color: #A6A8B5; }

/* ---- nav ------------------------------------------------------------- */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in oklab, var(--background) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -0.03em; font-variation-settings: "wdth" 90; }
.logo svg { width: 26px; height: 26px; color: var(--foreground); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 8px; font-size: 14.5px; font-weight: 500; color: var(--muted-foreground); }
.nav-links a:hover { color: var(--foreground); background: var(--muted); }
@media (max-width: 640px) { .nav-links .hide-sm { display: none; } }

/* ---- components (shadcn-shaped) --------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 9px; font: 600 14.5px/1 var(--font-sans); white-space: nowrap; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s, transform .08s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: #1c1c26; }
.btn-cobalt { background: var(--cobalt); color: var(--chalk); }
.btn-cobalt:hover { background: var(--cobalt-deep); }
.btn-chalk { background: var(--chalk); color: var(--ink); }
.btn-chalk:hover { background: #fff; }
.btn-flare { background: var(--flare); color: var(--ink); }
.btn-flare:hover { background: #FF7F5A; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { background: var(--muted); }
.on-cobalt .btn-outline, .on-ink .btn-outline { border-color: color-mix(in oklab, var(--chalk) 35%, transparent); color: var(--chalk); }
.on-cobalt .btn-outline:hover, .on-ink .btn-outline:hover { background: color-mix(in oklab, var(--chalk) 12%, transparent); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { color: var(--foreground); background: var(--muted); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn-icon { width: 40px; padding: 0; }
.btn svg { width: 16px; height: 16px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted-foreground); font-size: 15px; }
.on-ink .card, .on-cobalt .card { background: color-mix(in oklab, var(--chalk) 7%, transparent); border-color: color-mix(in oklab, var(--chalk) 16%, transparent); }
.on-ink .card p, .on-cobalt .card p { color: inherit; opacity: .78; }

.input { width: 100%; height: 42px; padding: 0 12px; border-radius: 9px; background: var(--input); border: 1px solid var(--border); color: var(--foreground); font: 15px var(--font-sans); }
.input::placeholder { color: #9A9DAA; }
.input:focus { border-color: var(--ring); outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 18%, transparent); }
.label { display: block; font-size: 13.5px; font-weight: 500; color: var(--muted-foreground); margin-bottom: 6px; }
.field { display: flex; flex-direction: column; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font: 500 12px var(--font-mono); letter-spacing: 0.04em; color: var(--muted-foreground); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--flare); }
.on-cobalt .badge { background: color-mix(in oklab, var(--chalk) 10%, transparent); border-color: color-mix(in oklab, var(--chalk) 25%, transparent); color: var(--chalk); }

.pre { background: var(--ink); color: var(--chalk); border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; white-space: pre; font: 13.5px/1.6 var(--font-mono); }
.pre .c { color: #8C8FA0; } .pre .k { color: var(--flare); } .pre .s { color: #9FD0FF; }

.alert { border: 1px solid var(--border); border-left: 3px solid var(--cobalt); background: var(--card); border-radius: 9px; padding: 12px 14px; font-size: 14px; color: var(--muted-foreground); }
.alert.err { border-left-color: var(--destructive); }
.alert.ok { border-left-color: #1E9E6A; }

.footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted-foreground); font-size: 14px; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---- landing -------------------------------------------------------- */
.hero { padding-block: clamp(40px, 6vw, 72px) clamp(36px, 5vw, 64px); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }
.hero-mark { width: 56px; height: 56px; color: var(--chalk); margin-bottom: 20px; }
.hero h1 { color: var(--chalk); }
.hero .cta { margin-top: 26px; }

.verdict { background: var(--ink); color: var(--chalk); border-radius: 16px; padding: 22px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); }
.verdict .hd { display: flex; justify-content: space-between; align-items: center; font: 500 12px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: #A6A8B5; }
.verdict .q { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-top: 12px; }
.verdict .big { font-family: var(--font-display); font-size: 64px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin-top: 14px; }
.verdict .big small { font-size: 22px; letter-spacing: -0.02em; color: #A6A8B5; margin-left: 6px; }
.verdict .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #23232E; }
.verdict .meta b { display: block; font: 600 15px var(--font-mono); }
.verdict .meta span { font: 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #A6A8B5; }
.verdict .tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; background: var(--flare); color: var(--ink); font: 700 12px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats > div { padding: 20px 22px; border-left: 1px solid #23232E; }
.stats > div:first-child { border-left: 0; padding-left: 0; }
.stats b { display: block; font-family: var(--font-display); font-size: clamp(28px, 3vw, 40px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.stats span { display: block; margin-top: 6px; font-size: 13.5px; color: #A6A8B5; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr 1fr; } .stats > div { border-left: 0; padding-left: 0; } }

.figure { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 12px; }
.figure svg { width: 100%; height: auto; }
.figure .cap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font: 12.5px var(--font-mono); color: var(--muted-foreground); }

.ledger { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.ledger .r { display: grid; grid-template-columns: 1.5fr 0.8fr 0.9fr auto; gap: 12px; align-items: center; padding: 13px 18px; border-top: 1px solid var(--border); font-size: 14.5px; }
.ledger .r:first-child { border-top: 0; background: var(--muted); font: 600 11.5px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-foreground); }
.ledger .r .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ledger .r .win { color: var(--flare); font-weight: 600; }
@media (max-width: 640px) { .ledger .r { grid-template-columns: 1fr auto; } .ledger .r > :nth-child(2), .ledger .r > :nth-child(3) { display: none; } }

.step { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.step .n { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1; color: var(--cobalt); letter-spacing: -0.04em; }

/* ---- auth ---------------------------------------------------------------- */
.auth { min-height: calc(100dvh - 60px); display: grid; place-items: center; padding: 32px var(--gutter); }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth h2 { font-size: 30px; margin-bottom: 6px; }
.auth form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.keybox { display: flex; gap: 8px; align-items: center; }
.keybox code { flex: 1; padding: 10px 12px; border-radius: 8px; background: var(--ink); color: var(--chalk); overflow-x: auto; white-space: nowrap; font-size: 13px; }

/* ---- docs ---------------------------------------------------------------- */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 44px; padding-block: 40px 80px; }
.docs nav { position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.docs nav a { padding: 7px 10px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--muted-foreground); }
.docs nav a:hover, .docs nav a.on { color: var(--cobalt); background: var(--muted); }
.docs article { max-width: 720px; }
.docs article h2 { margin-top: 48px; margin-bottom: 10px; font-size: 30px; }
.docs article h2:first-child { margin-top: 0; }
.docs article h3 { margin-top: 28px; margin-bottom: 8px; }
.docs article p { color: var(--muted-foreground); margin-bottom: 12px; }
.docs article .pre { margin: 12px 0 18px; }
.docs table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0 18px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.docs th, .docs td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.docs tr:last-child td, .docs tr:last-child th { border-bottom: 0; }
.docs th { font: 600 11.5px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-foreground); background: var(--muted); }
@media (max-width: 860px) { .docs { grid-template-columns: 1fr; } .docs nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.method { display: inline-block; min-width: 52px; text-align: center; padding: 2px 8px; border-radius: 6px; font: 700 11.5px var(--font-mono); letter-spacing: .06em; background: var(--muted); color: var(--foreground); margin-right: 8px; }
.method.post { background: var(--cobalt); color: var(--chalk); }

@media (max-width: 520px) { .verdict .meta { grid-template-columns: 1fr 1fr; } .verdict .big { font-size: 54px; } }
