/* AppBrackets — shared styles. Single-accent HUD look, light by default with a dark theme; motion lives in fx.js. */
/* Light is the default; [data-theme="dark"] on <html> (set before paint by the
   layout's head script) swaps in the original dark HUD palette. */
:root {
  --bg: #f6f8fc;
  --bg-2: #eaeff7;
  --panel: rgba(255, 255, 255, .82);
  --panel-solid: #ffffff;
  --line: rgba(28, 48, 88, .12);
  --line-2: rgba(28, 48, 88, .24);
  --text: #111a2e;
  --muted: #47546e;
  --dim: #5e6a82;
  --cyan: #0b7189;
  --cyan-soft: rgba(11, 113, 137, .10);
  --violet: #6a58e0;
  --con: #b4234a;
  --on-accent: #ffffff;
  --nav-bg: rgba(246, 248, 252, .8);
  --field-bg: #ffffff;
  --btn-bg: #ffffff;
  --hover-bg: rgba(17, 26, 46, .04);
  --radius: 14px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Space Grotesk', Inter, system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pad: clamp(18px, 4vw, 56px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #05070c;
  --bg-2: #0a0f1a;
  --panel: rgba(13, 19, 33, .72);
  --panel-solid: #0d1321;
  --line: rgba(140, 170, 220, .13);
  --line-2: rgba(140, 170, 220, .26);
  --text: #e8eefc;
  --muted: #8a97b2;
  --dim: #56627c;
  --cyan: #4de8ff;
  --cyan-soft: rgba(77, 232, 255, .14);
  --violet: #8b7bff;
  --con: #ff8fa3;
  --on-accent: #021016;
  --nav-bg: rgba(5, 7, 12, .72);
  --field-bg: rgba(0, 0, 0, .3);
  --btn-bg: rgba(255, 255, 255, .03);
  --hover-bg: rgba(255, 255, 255, .03);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* Fixed backdrop: two faint glows + a grid that fades out toward the edges. */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; }
body::before {
  background:
    radial-gradient(60vw 40vw at 15% -10%, color-mix(in srgb, var(--cyan) 10%, transparent), transparent 60%),
    radial-gradient(50vw 40vw at 95% 0%, color-mix(in srgb, var(--violet) 10%, transparent), transparent 60%);
}
body::after {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: .55;
}
a { color: inherit; }
::selection { background: var(--cyan); color: var(--bg); }
:focus-visible { outline: 1px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.accent { color: var(--cyan); }

/* ---------- Brace text ---------- */
/* <span class="brace-text"><span class="b">{</span><span class="bw"><span>word</span></span><span class="b">}</span></span>
   fx.js animates .bw width so the braces visibly close and reopen around the new word. */
.brace-text { display: inline-flex; align-items: baseline; white-space: nowrap; }
.brace-text .b { color: var(--cyan); font-family: var(--mono); font-weight: 400; transition: color .3s, text-shadow .3s; }
/* The clip box only needs to hide the word horizontally, but headings set line-height under 1,
   so a box the height of the line cuts off descenders (the g in "budgets"). Padding grows the
   clip box above and below; the matching negative margins keep the layout where it was. */
.brace-text .bw { display: inline-block; overflow: hidden; vertical-align: bottom; padding-block: .15em .3em; margin-block: -.15em -.3em; transition: width .42s cubic-bezier(.7, 0, .2, 1); }
.brace-text .bw > span { display: inline-block; white-space: nowrap; }
.brace-text.is-closed .b { text-shadow: 0 0 18px var(--cyan); }
.caret { display: inline-block; width: .32ch; height: .78em; margin-left: .12em; background: var(--cyan); vertical-align: -.04em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.scramble-glyph { color: var(--cyan); opacity: .8; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px var(--pad);
  background: var(--nav-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { font-family: var(--mono); font-weight: 600; font-size: 18px; text-decoration: none; letter-spacing: -.01em; }
.logo .b { font-weight: 700; }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 14px; padding: 8px 12px; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }

/* Theme switch (site.js): the knob follows [data-theme] so it is right before the script runs. */
.theme-switch {
  display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0;
  min-height: 38px; padding: 6px 12px 6px 8px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--btn-bg); color: var(--muted);
  font: 500 13px/1 var(--body); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.theme-switch:hover { color: var(--text); border-color: var(--cyan); }
.theme-switch .track { position: relative; width: 30px; height: 18px; border-radius: 999px; background: var(--dim); transition: background .2s; }
.theme-switch .knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .2s; }
:root[data-theme="dark"] .theme-switch .track { background: var(--cyan); }
:root[data-theme="dark"] .theme-switch .knob { transform: translateX(12px); background: var(--bg); }

/* Menu button: phones and tablets only (site.js toggles .menu-open on the nav). */
.menu-toggle {
  display: none; align-items: center; gap: 9px; flex-shrink: 0;
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--btn-bg); color: var(--text);
  font: 500 14px/1 var(--body); cursor: pointer;
}
.menu-toggle:hover { border-color: var(--cyan); }
.menu-icon { position: relative; width: 16px; height: 10px; border-block: 2px solid currentColor; }
.menu-icon::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 2px; background: currentColor; }
.menu-toggle[aria-expanded="true"] .menu-icon { border-color: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before, .menu-toggle[aria-expanded="true"] .menu-icon::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 2px; background: currentColor; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: rotate(-45deg); }

/* Hover braces: link text gains { } that slide in from the sides. */
.hb { position: relative; }
.hb::before, .hb::after { font-family: var(--mono); color: var(--cyan); opacity: 0; transition: opacity .2s, transform .25s; display: inline-block; }
.hb::before { content: "{"; content: "{" / ""; transform: translateX(6px); margin-right: 2px; }
.hb::after { content: "}"; content: "}" / ""; transform: translateX(-6px); margin-left: 2px; }
.hb:hover::before, .hb:hover::after, .hb:focus-visible::before, .hb:focus-visible::after, .hb.on::before, .hb.on::after { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--btn-bg); color: var(--text);
  font: 500 15px/1 var(--body); text-decoration: none; cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s, color .2s;
}
.btn:hover { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan-soft), 0 0 24px -6px var(--cyan); }
.btn.primary { background: var(--cyan); border-color: var(--cyan); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { box-shadow: 0 0 32px -4px var(--cyan); }
.btn .arrow { font-family: var(--mono); transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Panels ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
/* HUD corner ticks — use sparingly (hero card, bracket frame). */
.hud::before, .hud::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--cyan); pointer-events: none; }
.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }

/* ---------- Layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; }
.section { padding: clamp(56px, 8vw, 104px) var(--pad); }
.section + .section { border-top: 1px solid var(--line); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); margin: 0 0 18px; }
.eyebrow::before { content: "// "; color: var(--dim); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.035em; margin: 0; }
h1 { font-size: clamp(44px, 7.2vw, 96px); line-height: .98; }
h2 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.02; margin-bottom: 14px; }
h3 { font-size: 22px; line-height: 1.15; }
.lead { font-size: clamp(18px, 1.8vw, 21px); color: var(--muted); max-width: 640px; margin: 22px 0 0; line-height: 1.5; }
.lead strong { color: var(--text); font-weight: 500; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }

.footer { padding: 32px var(--pad); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--dim); font-size: 14px; }

/* Reveal-on-scroll (fx.js adds .in). Content stays visible if JS is off. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Bracket (shared by homepage mini + full page) ---------- */
.bracket { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, .85fr); gap: 0 30px; }
.bracket .round { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; position: relative; z-index: 1; }
.bracket .round-label { position: absolute; top: -28px; left: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.bracket svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.wires path { fill: none; stroke: var(--line-2); stroke-width: 1; }
.wires path.hot { stroke: var(--cyan); stroke-width: 1.5; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--cyan) 70%, transparent)); }
.wires path.draw { animation: wire-draw .55s ease-out both; }
@keyframes wire-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }

.match { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.match-head { display: flex; justify-content: space-between; padding: 6px 10px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; color: var(--dim); text-transform: uppercase; }
.match-head .delta { color: var(--muted); }
.slot { position: relative; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; transition: background .3s, color .3s, opacity .3s; }
.slot + .slot { border-top: 1px solid var(--line); }
.slot .seed { font-family: var(--mono); font-size: 11px; color: var(--dim); text-align: center; }
.slot .name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .score { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.slot .bar { position: absolute; left: 0; bottom: 0; height: 1px; background: var(--cyan); opacity: .0; transition: width .5s ease, opacity .3s; }
.slot.win { background: linear-gradient(90deg, color-mix(in srgb, var(--cyan) 10%, transparent), transparent 70%); }
.slot.win::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); border-radius: 2px; }
.slot.win .seed, .slot.win .score { color: var(--cyan); }
.slot.win .bar { opacity: .55; }
.slot.lose { color: var(--dim); }
.slot.flash { animation: slot-flash .7s ease-out; }
@keyframes slot-flash { 0% { background-color: color-mix(in srgb, var(--cyan) 28%, transparent); } 100% { background-color: transparent; } }

.champ { align-self: center; padding: 22px; text-align: left; }
.champ .label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.champ .champ-name { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 1.9vw, 28px); letter-spacing: -.03em; line-height: 1.08; margin: 10px 0 6px; min-height: 1.08em; overflow-wrap: anywhere; }
.champ .champ-for { font-size: 14px; color: var(--muted); }
.champ .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--cyan); border: 1px solid color-mix(in srgb, var(--cyan) 30%, transparent); border-radius: 999px; padding: 4px 9px; }

/* Mini variant: names only, tighter. */
.bracket.mini { gap: 0 20px; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, .85fr); }
.bracket.mini .match-head { display: none; }
.bracket.mini .slot { padding: 6px 8px; grid-template-columns: 16px 1fr; }
.bracket.mini .slot .score { display: none; }
.bracket.mini .slot .name { font-size: 12.5px; }
.bracket.mini .round { gap: 10px; }
.bracket.mini .champ { padding: 14px; }
.bracket.mini .champ .champ-name { font-size: 20px; }
.bracket.mini .champ .tags { display: none; }

@media (max-width: 900px) {
  .nav { gap: 10px; padding-block: 6px; }
  .logo { padding-block: 9px; margin-right: auto; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0; padding: 4px var(--pad) 12px;
    background: var(--panel-solid); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 32px -24px rgba(17, 26, 46, .35);
  }
  .nav.menu-open .nav-links { display: flex; }
  .nav-links a { display: flex; align-items: center; min-height: 48px; padding: 0; font-size: 17px; color: var(--text); }
  .nav-links a + a { border-top: 1px solid var(--line); }
  .nav-links a.hb::before, .nav-links a.hb::after { content: none; }
  .nav-links a[aria-current] { color: var(--cyan); }
  .menu-toggle { display: inline-flex; }
  /* Switch keeps its "Dark mode" name for screen readers; the track alone shows on small screens. */
  .theme-switch { min-height: 44px; min-width: 44px; padding: 0 12px; justify-content: center; }
  .theme-switch .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

  .bracket, .bracket.mini { grid-template-columns: 1fr; gap: 34px; }
  .bracket svg.wires { display: none; }
  .bracket .round { justify-content: flex-start; }
  .bracket .champ { align-self: stretch; }
  /* Full bracket, winner first: the champion card (#winner) sits above the bracket, then
     final, semifinals, quarterfinals. The homepage mini bracket keeps its order. */
  .bracket:not(.mini) { gap: 28px; }
  .bracket:not(.mini) .round:nth-of-type(1) { order: 3; }
  .bracket:not(.mini) .round:nth-of-type(2) { order: 2; }
  .bracket:not(.mini) .round:nth-of-type(4) { display: none; }
  .bracket .round-label { position: static; font-size: 12px; }
  .match-head { font-size: 12px; }
  .slot .seed, .tag, .champ .label { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .caret { animation: none; }
}

/* Page layouts. Concatenated after site.css by scripts/build.mjs. */

/* ---------- Homepage ---------- */
.hero { padding: clamp(56px, 9vw, 120px) var(--pad) clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(32px, 4vw, 56px); align-items: center; }
.hero-grid.solo { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.hero h1 { font-size: clamp(44px, 6.4vw, 84px); }
.hero h1 .nw { white-space: nowrap; }
.hero h1 .persona { display: inline-flex; }
.hero h1 .persona .b, .head h1 .b { font-weight: 300; }
/* The persona chips are the hero's one instruction: big, in the reading column, and
   the lit chip moves in step with the headline and the board. */
.who { margin-top: 32px; }
.who-label { margin: 0 0 12px; font: 600 15px/1.3 var(--body); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--btn-bg); color: var(--text); font: 500 15px/1 var(--body); text-decoration: none; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.chip:hover { border-color: var(--cyan); }
.chip.on { background: var(--cyan); border-color: var(--cyan); color: var(--on-accent); }
.stage { padding: 20px 20px 22px; }
.stage-top { margin: 0 0 32px; color: var(--dim); font-size: 11px; }
.hero-controls { margin-top: 24px; display: flex; flex-direction: column; gap: 6px; }
.hero-controls > label { font-size: 13px; color: var(--muted); }
.hero-controls > label b { color: var(--text); font-weight: 600; }
.hero-slider { display: flex; align-items: center; gap: 12px; }
.hero-slider input[type=range] { flex: 1; }
.hero-slider output { font-family: var(--mono); font-size: 12px; color: var(--cyan); min-width: 42px; text-align: right; }
/* Result + next step live under the board, where the eye lands after the replay. */
.result { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; }
.result-line { margin: 0; font-size: 17px; color: var(--muted); }
.result-line b { color: var(--text); font-weight: 600; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 40px; }
.bcard { display: flex; flex-direction: column; gap: 14px; padding: 24px; text-decoration: none; transition: border-color .25s, transform .25s; }
.bcard:hover { border-color: color-mix(in srgb, var(--cyan) 45%, transparent); transform: translateY(-2px); }
.bcard .mono { color: var(--cyan); }
.bcard h3 { font-size: 24px; }
.bcard .field { font-family: var(--mono); font-size: 12px; color: var(--dim); line-height: 1.7; }
.bcard .winners { display: grid; gap: 6px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.bcard .winners div { display: flex; justify-content: space-between; gap: 10px; }
.bcard .winners span:first-child { color: var(--muted); }
.bcard .winners span:last-child { color: var(--text); font-weight: 500; }
.bcard .go { font-family: var(--mono); font-size: 13px; color: var(--cyan); }
.ncard { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.ncard .mono { color: var(--cyan); }
.ncard h3 { font-size: 24px; }
.ncard ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--muted); font-size: 15px; }
.ncard li { display: flex; gap: 9px; align-items: baseline; }
.ncard li::before { content: "→"; flex: 0 0 auto; font-family: var(--mono); font-size: 12px; color: var(--cyan); }
.ncard .signup-inline { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.signup-inline form { display: flex; flex-wrap: wrap; gap: 8px; }
.signup-inline input[type=email] { flex: 1 1 180px; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--field-bg); color: var(--text); font: inherit; }
.signup-inline input[type=email]:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.signup-inline .form-status { flex-basis: 100%; margin: 0; font-family: var(--mono); font-size: 13px; color: var(--cyan); }
.signup-inline .form-status:empty { display: none; }
.signup-inline form.is-sent input, .signup-inline form.is-sent button { display: none; }
.signup-inline .fine { margin: 10px 0 0; font-size: 12px; color: var(--dim); }
.signup-inline .fine a { color: inherit; }

@media (max-width: 520px) {
  .ncard { gap: 16px; padding: 20px; }
  .ncard .signup-inline { padding-top: 16px; }
  .signup-inline form { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .signup-inline input[type=email] { width: 100%; min-height: 48px; font-size: 16px; }
  .signup-inline .btn { width: 100%; min-height: 48px; }
  .signup-inline .form-status { width: 100%; }
  .signup-inline .fine { margin-top: 12px; line-height: 1.5; }
}

/* ---------- Newsletter ---------- */
.signup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: clamp(24px, 4vw, 40px); }
.signup h2 { font-size: clamp(26px, 3vw, 38px); margin: 0 0 8px; }
.signup p { margin: 0; color: var(--muted); }
.signup form { display: flex; gap: 10px; flex-wrap: wrap; }
.signup input[type=email] { flex: 1 1 220px; min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--field-bg); color: var(--text); font: inherit; }
.signup input[type=email]:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.signup .fine { flex-basis: 100%; font-size: 12px; color: var(--dim); }
.signup .form-status { flex-basis: 100%; font-family: var(--mono); font-size: 13px; color: var(--cyan); min-height: 1em; }
.signup form.is-sent input, .signup form.is-sent button { display: none; }

/* ---------- Bracket page ---------- */
.head { padding: clamp(40px, 6vw, 72px) var(--pad) 28px; }
.crumb { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-bottom: 22px; }
.crumb a { text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--cyan); }
.head h1 { font-size: clamp(38px, 5.6vw, 76px); }
.head h1 .for { display: block; color: var(--muted); font-weight: 500; }
.meta-line { margin-top: 18px; font-family: var(--mono); font-size: 12px; color: var(--dim); display: flex; gap: 16px; flex-wrap: wrap; }
.meta-line a { color: var(--muted); }

.shell { padding: 12px var(--pad) 40px; }
.grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.main-col { display: grid; gap: 20px; min-width: 0; }
.controls { position: sticky; top: 84px; padding: 20px; }
.controls h2, .panel-title { font-size: 13px; font-family: var(--mono); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.presets { display: grid; gap: 2px; margin-bottom: 22px; }
.presets button { all: unset; cursor: pointer; padding: 9px 10px; border-radius: 8px; font-size: 15px; color: var(--muted); transition: background .2s, color .2s; }
.presets button:hover { color: var(--text); background: var(--hover-bg); }
.presets button.on { color: var(--text); background: var(--cyan-soft); }
.presets button:focus-visible { outline: 1px solid var(--cyan); }
.weights { display: grid; gap: 14px; padding-top: 4px; }
/* Weights toggle (bracket-page.js sets aria-expanded + data-open). Before the script runs,
   the panel follows the viewport: open on desktop, closed below 1101px. */
.tune-toggle {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; border-top: 1px solid var(--line); cursor: pointer;
  font: 600 13px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.tune-toggle:hover { color: var(--text); }
.tune-toggle:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }
/* The second content value gives the glyph empty alt text so it isn't read as part of the button name. */
.tune-toggle::after { content: "+"; content: "+" / ""; margin-left: auto; color: var(--cyan); font-size: 16px; }
.tune-toggle[aria-expanded="true"]::after { content: "−"; content: "−" / ""; }
.tune-note { color: var(--cyan); font-weight: 400; font-size: 12px; }
.tune-note:empty { display: none; }
.tune { padding-top: 8px; }
.tune[data-open="false"] { display: none; }
.tune-live { display: none; }
@media (min-width: 1101px) { .tune-toggle:not([aria-expanded])::after { content: "−"; content: "−" / ""; } }
@media (max-width: 1100px) { .tune:not([data-open]) { display: none; } }
.weight label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.weight output { font-family: var(--mono); font-size: 12px; color: var(--cyan); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan) var(--fill, 50%), var(--line-2) var(--fill, 50%)); }
input[type=range]::-moz-range-track { height: 2px; background: var(--line-2); }
input[type=range]::-moz-range-progress { height: 2px; background: var(--cyan); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 10px color-mix(in srgb, var(--cyan) 60%, transparent); }
input[type=range]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); }
.reset { margin-top: 16px; width: 100%; min-height: 38px; font-size: 13px; }
.share { width: 100%; margin-top: 10px; }

/* Reserve the script-rendered brackets' height on wider screens so the content below doesn't
   jump when they mount (the layout's <noscript> style drops this). Phones render them below the fold. */
@media (min-width: 901px) {
  #board:empty { min-height: 465px; }
  #mini:empty { min-height: 288px; }
}

/* Champion card for phones (bracket-page.js keeps it in step). Wider screens show the
   champion as the bracket's last column instead. */
.winner { display: none; }

.bracket-panel { padding: 22px 22px 26px; }
.bracket-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }
.bracket-top h2 { font-size: 22px; margin: 0; letter-spacing: -.02em; }
.bracket-top .mono { color: var(--muted); }
.champ-link { margin-top: 16px; width: 100%; min-height: 40px; font-size: 14px; }

.log { padding: 20px 22px; }
.log ol { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.log li { padding: 6px 0; color: var(--muted); border-top: 1px dashed var(--line); opacity: 0; transform: translateX(-6px); animation: log-in .35s ease-out forwards; }
.log li:first-child { border-top: 0; }
.log .r { color: var(--dim); }
.log .w { color: var(--cyan); }
.log .l { color: var(--dim); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 40%, transparent); }
@keyframes log-in { to { opacity: 1; transform: none; } }

/* Static, crawlable content below the interactive bracket. */
.content { padding: 24px var(--pad) 80px; }
.content section { margin-top: 56px; }
.content h2 { font-size: clamp(26px, 3vw, 38px); margin-bottom: 18px; }
.persona-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.persona-table th, .persona-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.persona-table th { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.persona-table td:first-child { color: var(--muted); }
.persona-table a { color: var(--cyan); text-decoration: none; }
.persona-table .win { color: var(--text); font-weight: 600; }
.table-wrap { overflow-x: auto; }

.contenders { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.app-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 90px; }
.app-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.app-card h3 { font-size: 22px; }
.app-card .seed-tag { font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; }
.app-card .tagline { color: var(--muted); margin: 0; font-size: 15px; }
.app-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.app-card dt { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding-top: 2px; }
.app-card dd { margin: 0; color: var(--text); }
.app-card dd a { color: var(--muted); font-size: 12px; }
.pc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 14px; }
.pc ul { margin: 6px 0 0; padding-left: 16px; color: var(--muted); }
.pc b { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; }
.pc .pro b { color: var(--cyan); }
.pc .con b { color: var(--con); }
.app-card .actions { margin-top: auto; }
.app-card .btn { min-height: 40px; font-size: 14px; }

details.scores { border-top: 1px solid var(--line); padding-top: 10px; }
details.scores summary { cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--muted); }
details.scores summary:hover { color: var(--cyan); }
.score-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; font-size: 14px; }
.score-list li { display: grid; grid-template-columns: 112px 34px 1fr; gap: 8px; align-items: baseline; }
.score-list .k { color: var(--dim); font-size: 13px; }
.score-list .v { font-family: var(--mono); color: var(--cyan); }
.score-list .why { color: var(--muted); }
.score-list .src { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-left: 4px; }

.criteria-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.criteria-list li { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; }
.criteria-list b { display: block; margin-bottom: 4px; }
.criteria-list span { color: var(--muted); font-size: 14px; }

.links-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.links-list a { color: var(--text); text-decoration: none; display: inline-flex; gap: 8px; }
.links-list a::before { content: "→"; font-family: var(--mono); color: var(--cyan); }
.links-list a:hover { color: var(--cyan); }

.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 500; font-size: 17px; }
.faq summary:hover { color: var(--cyan); }
.faq p { color: var(--muted); margin: 10px 0 0; max-width: 760px; }

.sources { font-size: 13px; color: var(--dim); }
.sources ol { padding-left: 20px; }
.sources a { color: var(--muted); word-break: break-word; }
.disclosure-note { font-size: 13px; color: var(--dim); margin-top: 14px; }
.disclosure-note a { color: var(--muted); }

/* ---------- Matchup page ---------- */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; margin-top: 28px; }
.versus .vs { align-self: center; font-family: var(--mono); color: var(--cyan); }
.versus .panel { padding: 20px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th, .compare-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.compare-table th { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.compare-table .n { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.compare-table .n.win { color: var(--cyan); }
.compare-table .why { color: var(--muted); font-size: 13px; display: block; margin-top: 4px; }
.verdict { max-width: 760px; font-size: 18px; color: var(--text); line-height: 1.6; }

/* ---------- Prose pages ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 26px; margin: 40px 0 12px; }
.prose p, .prose li { color: var(--muted); }
.prose a { color: var(--cyan); }
.prose strong { color: var(--text); font-weight: 500; }

.draft-banner { background: #ffb547; color: #1a1000; font: 600 13px/1.2 var(--mono); padding: 8px var(--pad); text-align: center; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
  .controls { position: relative; top: auto; }
  .presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
  .presets button { box-sizing: border-box; display: inline-flex; align-items: center; min-height: 44px; border: 1px solid var(--line); padding: 7px 12px; font-size: 14px; }
  .presets button.on { border-color: color-mix(in srgb, var(--cyan) 40%, transparent); }
  .reset { min-height: 44px; }
}
@media (max-width: 900px) {
  .hero-grid, .signup { grid-template-columns: 1fr; }
  #mini .round:nth-of-type(1), #mini .round:nth-of-type(2) { display: none; }
  .stage-top { margin-bottom: 18px; font-size: 12px; }
  .result { flex-direction: column; align-items: stretch; }
  .result-actions .btn { flex: 1 1 auto; }
  .versus { grid-template-columns: 1fr; }
  .pc { grid-template-columns: 1fr; }
  .score-list li { grid-template-columns: 1fr auto; }
  .score-list .why { grid-column: 1 / -1; }

  /* Bracket page, phones: champion card first, then the preset picker (weights collapsed), then the bracket. */
  .winner {
    display: grid; gap: 10px; padding: 20px; margin-bottom: 16px;
    border-color: color-mix(in srgb, var(--cyan) 40%, var(--line));
    background: linear-gradient(155deg, color-mix(in srgb, var(--cyan) 13%, var(--panel-solid)), var(--panel-solid) 70%);
  }
  .winner p { margin: 0; }
  .winner-label { display: flex; align-items: baseline; gap: 10px; color: var(--muted); font-size: 15px; }
  .winner-label .mono { color: var(--cyan); font-weight: 600; }
  .winner-name { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 9.4vw, 44px); line-height: 1.05; letter-spacing: -.035em; overflow-wrap: anywhere; }
  .winner-final { color: var(--muted); font-size: 15px; line-height: 1.45; min-height: 2.9em; }
  .winner-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 4px; }
  .winner-actions .btn { min-height: 48px; }
  .winner-actions .btn span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .controls { padding: 16px 16px 4px; }
  .controls .share { display: none; }
  .tune { padding-bottom: 12px; }
  .weights { gap: 6px; }
  .weight label { margin-bottom: 0; font-size: 14px; }
  /* Live champion stays in view while the visitor drags sliders down the open panel. */
  .tune-live {
    display: block; position: sticky; top: 58px; z-index: 2; /* just under the 58px phone nav */
    margin: 0 -16px 6px; padding: 10px 16px;
    background: var(--panel-solid); border-bottom: 1px solid var(--line);
    font-size: 14px; color: var(--muted);
  }
  .tune-live b { color: var(--text); font-weight: 600; }
  .bracket-top { margin-bottom: 20px; }
  .log { padding: 18px 16px; }

  /* Tap targets and small labels. */
  .crumb a, .meta-line a { display: inline-block; padding-block: 13px; margin-block: -13px; }
  .app-card .btn { min-height: 44px; }
  details.scores { padding-top: 0; }
  details.scores summary { padding-block: 13px; }
  .faq details { padding: 4px 0; }
  .faq summary { padding-block: 12px; }
  .links-list { gap: 0; }
  .links-list a { padding-block: 10px; }
  .sources a { display: inline-block; padding-block: 13px; }
  .footer-links a { display: inline-block; padding-block: 13px; }
  .app-card dt, .app-card .seed-tag, .pc b, .score-list .src, .persona-table th, .compare-table th { font-size: 12px; }
}
@media (max-width: 900px) and (pointer: coarse), (max-width: 900px) and (hover: none) {
  input[type=range] { height: 44px; }
  input[type=range]::-webkit-slider-runnable-track { height: 4px; }
  input[type=range]::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; }
  input[type=range]::-moz-range-track, input[type=range]::-moz-range-progress { height: 4px; }
  input[type=range]::-moz-range-thumb { width: 20px; height: 20px; }
}
@media (max-width: 640px) {
  /* Phones: header tightens so the champion card reaches the first screen. */
  .head { padding-top: 26px; padding-bottom: 18px; }
  .crumb { margin-bottom: 14px; }
  .head h1 { font-size: clamp(32px, 9.6vw, 38px); }
  .head .lead { font-size: 17px; margin-top: 14px; }
  .meta-line { margin-top: 10px; gap: 2px 14px; }
  .shell { padding-top: 4px; }

  /* Tables stack into one card per row instead of scrolling sideways. */
  .persona-table thead, .compare-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .persona-table, .persona-table tbody, .persona-table td,
  .compare-table, .compare-table tbody, .compare-table td { display: block; }
  .persona-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .persona-table td { padding: 0; border: 0; }
  .persona-table td:first-child, .persona-table td.wide { grid-column: 1 / -1; }
  .persona-table td:first-child { color: var(--text); font-weight: 500; }
  .persona-table td[data-label]::before, .compare-table td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font: 400 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim);
  }
  .persona-table td a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .persona-table td[data-label] a { min-height: 0; padding-block: 12px; margin-block: -12px; }
  .compare-table tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .compare-table td { padding: 0; border: 0; }
  .compare-table td:first-child { font-weight: 500; font-size: 16px; margin-bottom: 8px; }
  .compare-table td[data-label] { padding: 8px 0 8px 12px; border-left: 2px solid var(--line); }
  .compare-table td[data-label] + td[data-label] { margin-top: 8px; }
  .compare-table td[data-label]::before { display: inline; margin-right: 8px; }
  .compare-table .why { font-size: 14px; }
}

/* ---------- Utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--cyan); }
