/* The landing page at twentyma.com: the app's Night Session Scoreboard world (DESIGN.md) at page scale. */
:root {
  --bg: #050A17; --bg-raised: #081024; --surface-1: #0A142C; --surface-2: #0F1D38; --surface-3: #1E3A5F;
  --cyan: #00F2FE; --on-accent: #04121F; --rgb-cyan: 0, 242, 254;
  --text: #F8FAFC; --text-soft: #CBD5E1; --text-2: #94A3B8;
  --hair: rgba(255, 255, 255, 0.08);
  --gutter: clamp(16px, 4.5vw, 64px);
  --ends: 180px;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-color: var(--surface-3) var(--bg); }
body { background: var(--bg); color: var(--text); font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, sans-serif; -webkit-font-smoothing: antialiased; }
::selection { background: var(--cyan); color: var(--on-accent); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2 { font-family: Outfit, sans-serif; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
h1 span, h2 span { color: var(--cyan); }
.lede { color: var(--text-soft); max-width: 44ch; text-wrap: pretty; }

/* Buttons: one solid cyan action, everything else outlined. */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: background-color .15s ease, transform .15s ease; }
.btn-primary { height: 56px; padding: 0 28px; border-radius: 14px; background: var(--cyan); color: var(--on-accent); font: 800 17px Outfit, sans-serif; box-shadow: 0 8px 25px rgba(var(--rgb-cyan), 0.3); }
.btn-primary:hover { background: color-mix(in srgb, var(--cyan), white 15%); }
.btn-primary:active { background: color-mix(in srgb, var(--cyan), var(--on-accent) 15%); transform: translateY(1px); }
.btn-outline { height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--hair); font: 700 14px Inter, sans-serif; }
.btn-outline:hover { border-color: rgba(var(--rgb-cyan), 0.35); background: rgba(var(--rgb-cyan), 0.08); }

/* Header */
.nav { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 32px; height: 72px; padding: 0 var(--gutter); }
.logo { font: 800 20px Outfit, sans-serif; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.logo b { color: var(--cyan); }
.nav nav { display: flex; gap: 28px; flex: 1; }
.nav nav a { color: var(--text-2); font: 700 12px Outfit, sans-serif; letter-spacing: 1px; text-transform: uppercase; text-decoration: none; }
.nav nav a:hover { color: var(--text); }

/* The year: the chart fills the section. */
.hero { display: flex; flex-direction: column; min-height: max(760px, 100svh); padding: 112px var(--gutter) 24px; background: var(--bg-raised); border-top: 1px solid var(--hair); }
.hero-copy { max-width: 600px; position: relative; z-index: 1; }
h1 { font-size: clamp(44px, 4.7vw, 68px); line-height: 1; }
.hero .lede { margin-top: 20px; }

.chart { flex: 1; display: grid; grid-template-columns: 40px 1fr var(--ends); grid-template-rows: minmax(260px, 1fr) 40px 24px; column-gap: 16px; margin-top: 32px; position: relative; }
.ylabels { grid-area: 1 / 1; position: relative; }
.ylabels span, .axis span { color: var(--text-2); font: 700 12px Outfit, sans-serif; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.ylabels span { position: absolute; right: 0; transform: translateY(-50%); }
.plot { grid-area: 1 / 2; position: relative; touch-action: pan-y; cursor: crosshair; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plot path, .plot line { vector-effect: non-scaling-stroke; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.grid line { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.grid line.base { stroke: rgba(255, 255, 255, 0.2); }
.ln { stroke: rgba(var(--rgb-cyan), 0.5); stroke-width: 2.5; transition: stroke .2s ease, stroke-width .2s ease; }
.chart.active .ln { stroke: rgba(148, 163, 184, 0.18); }
.chart.active .ln.on { stroke: var(--cyan); stroke-width: 4; }
.band.s { fill: rgba(255, 255, 255, 0.045); }
.band.p { fill: rgba(var(--rgb-cyan), 0.1); }
.marks { position: absolute; inset: 0; pointer-events: none; }
.blab { position: absolute; top: 8px; padding-left: 8px; font: 800 11px Outfit, sans-serif; letter-spacing: 1px; color: var(--text-2); white-space: nowrap; }
.blab.p { color: var(--cyan); }
.comp { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid var(--text); background: var(--bg); }
.comp.main { background: var(--text); }
.comp::after { content: ""; position: absolute; left: 50%; top: 10px; height: var(--drop); border-left: 1px dashed rgba(255, 255, 255, 0.35); }

/* Keyboard: the athlete buttons stay hidden until focused, then sit over the plot as a chip. */
.pick button { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.pick button:focus-visible { grid-area: 1 / 2; position: absolute; left: 0; bottom: 12px; width: auto; height: 32px; clip-path: none; padding: 0 12px; border-radius: 9999px; border: 1px solid rgba(var(--rgb-cyan), 0.35); background: var(--surface-2); color: var(--text); font: 600 14px Inter, sans-serif; z-index: 3; }
.pick { grid-area: 1 / 2; position: relative; pointer-events: none; }
.pick button:focus-visible { pointer-events: auto; }

/* Line-end labels and the panel share the right-hand column. */
.ends { grid-area: 1 / 3; position: relative; transition: opacity .2s ease; }
.chart.active .ends { opacity: 0.25; }
.end { position: absolute; left: 0; transform: translateY(-50%); font: 600 14px Inter, sans-serif; color: var(--text-2); white-space: nowrap; }
.end b { display: block; font: 800 20px/1.1 Outfit, sans-serif; color: var(--text); font-variant-numeric: tabular-nums; }
.panel { grid-area: 1 / 3; align-self: start; position: relative; z-index: 2; background: var(--bg-raised); padding-bottom: 8px; }
.panel-title { color: var(--text-2); font: 800 12px Outfit, sans-serif; letter-spacing: 1px; text-transform: uppercase; max-width: 150px; }
.chart.active .panel-title { display: none; }
.who { font: 800 15px/1.3 Outfit, sans-serif; }
.gain { font: 800 28px/1.1 Outfit, sans-serif; color: var(--cyan); font-variant-numeric: tabular-nums; }
.key { list-style: none; margin-top: 8px; display: grid; gap: 2px; color: var(--text-soft); font-size: 14px; }
.key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.k-s { background: rgba(255, 255, 255, 0.14); }
.k-p { background: rgba(var(--rgb-cyan), 0.35); }
.k-c { background: var(--text); border-radius: 50% !important; }

.fatigue { grid-area: 2 / 2; display: flex; align-items: center; }
.fatigue span { width: 100%; height: 3px; background: radial-gradient(circle, var(--text-soft) 1.4px, transparent 1.6px) 0 50% / 10px 3px repeat-x; }
.fatigue-label { grid-area: 2 / 3; align-self: center; font: 600 14px Inter, sans-serif; color: var(--text-2); line-height: 1.2; }
.fatigue-label b { display: block; font: 800 15px Outfit, sans-serif; color: var(--text-soft); }
.axis { grid-area: 3 / 2; display: flex; justify-content: space-between; align-items: end; }

/* The first draw: the year sweeps in left to right, once. */
.chart.pre .plot svg, .chart.pre .ends { clip-path: inset(0 100% 0 0); }
.chart.drawn .plot svg { clip-path: inset(0 0 0 0); transition: clip-path 1.4s cubic-bezier(0.22, 1, 0.36, 1); }
.chart.drawn .ends { clip-path: inset(0 0 0 0); transition: clip-path .4s ease 1.1s, opacity .2s ease; }

/* Opening section: the claim and the main action beside its three facts. */
.how { display: grid; align-items: start; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: clamp(40px, 7vw, 96px); padding: 176px var(--gutter) 120px; }
h2 { font-size: clamp(36px, 3.8vw, 52px); line-height: 1.02; }
.how .lede { margin: 20px 0 28px; }
.facts div:last-child { border-bottom: 1px solid var(--hair); }
.facts div { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--hair); }
.facts dt { font: 800 32px/1 Outfit, sans-serif; font-variant-numeric: tabular-nums; }
.facts dd { color: var(--text-soft); }

/* Testing Days */
.tests { padding: 120px var(--gutter); display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); column-gap: clamp(40px, 7vw, 96px); align-items: start; }
.tests .lede { grid-column: 1; margin-top: 20px; }
.tests h2 { grid-column: 1; }
.test-list { grid-column: 2; grid-row: 1 / span 2; list-style: none; counter-reset: t; }
.test-list li { display: grid; gap: 2px; padding: 20px 0; border-top: 1px solid var(--hair); }
.test-list li:last-child { border-bottom: 1px solid var(--hair); }
.test-list b { font: 800 24px Outfit, sans-serif; }
.test-list span { color: var(--text-soft); }

/* Close and footer */
.close { padding: 120px var(--gutter) 128px; text-align: center; display: grid; justify-items: center; gap: 28px; border-top: 1px solid var(--hair); background: var(--bg-raised); }
.close h2 { font-size: clamp(44px, 6vw, 88px); line-height: 1; }
.close.lost { min-height: 100svh; align-content: center; border: 0; }
.close-note { color: var(--text-2); font-size: 14px; margin-top: -12px; }
.foot { display: flex; align-items: center; gap: 28px; padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair); color: var(--text-2); font-size: 14px; }
.foot .logo { font-size: 16px; color: var(--text); flex: 1; }
.foot a { text-underline-offset: 3px; }
.foot a:hover { color: var(--text); }

@media (max-width: 900px) {
  :root { --ends: 92px; }
  .how, .tests { grid-template-columns: 1fr; }
  .test-list { grid-column: 1; grid-row: auto; margin-top: 32px; }
  .end b { font-size: 17px; }
  .end { font-size: 12px; }
}
@media (max-width: 640px) {
  .nav { gap: 16px; }
  .nav nav { display: none; }
  .nav .logo { margin-right: auto; }
  .hero { min-height: auto; }
  .chart { grid-template-columns: 30px 1fr var(--ends); grid-template-rows: auto 300px 36px 24px; column-gap: 10px; margin-top: 36px; }
  .panel { grid-area: 1 / 2 / 2 / 4; min-height: 96px; margin-bottom: 12px; }
  .pick { grid-area: 2 / 2; }
  .ylabels { grid-area: 2 / 1; } .plot { grid-area: 2 / 2; } .ends { grid-area: 2 / 3; }
  .fatigue { grid-area: 3 / 2; } .fatigue-label { grid-area: 3 / 3; font-size: 12px; } .axis { grid-area: 4 / 2; }
  .axis span:nth-child(even) { visibility: hidden; }
  .panel-title { max-width: none; }
  .panel-who { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; }
  .panel-who .who { grid-column: 1 / -1; }
  .key { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; }
  .key li { white-space: nowrap; }
  .hero, .tests, .close { padding-top: 88px; padding-bottom: 96px; }
  .how { padding-top: 120px; padding-bottom: 88px; }
  .facts div { grid-template-columns: 96px 1fr; gap: 16px; }
  .facts dt { font-size: 26px; }
  .foot { flex-wrap: wrap; gap: 16px 24px; }
  .foot .logo { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
