/* Flex-RSI — frosted glass, quiet palette, smooth motion */

:root {
  /* One accent, Texas A&M maroon (#500000), used sparingly; surfaces stay neutral. */
  --accent-1: #500000;
  --accent-2: #9a5a5a;
  --accent-3: #dcbcbc;
  --accent-ink: #500000;

  --bg: #f8f7f5;                       /* solid page colour */
  --ink: #241c1a;
  --ink-2: #5f5551;
  --ink-3: #9b8f8a;
  --line: rgba(36, 28, 26, 0.08);

  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.90);
  --glass-edge: rgba(36, 28, 26, 0.07);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 16px 40px -26px rgba(40, 30, 25, 0.18);
  --tint: rgba(36, 28, 26, 0.04);      /* neutral fill for buttons and chips */
  --tint-strong: rgba(36, 28, 26, 0.07);

  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }
::selection { background: color-mix(in srgb, var(--accent-1) 28%, transparent); }

/* ---------- ambient background ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bands { position: absolute; inset: 0; background: var(--bg); }
.grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.025; mix-blend-mode: soft-light;
}

/* ---------- glass ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border-radius: var(--radius);
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; z-index: 20;
  width: min(calc(100% - 32px), var(--maxw));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 24px;
  padding: 10px 12px 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease), backdrop-filter 0.5s var(--ease);
}
.nav.scrolled {
  background: var(--glass-strong);
  border-color: var(--glass-edge);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(80, 0, 0, 0.12);
}
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  position: relative; padding: 6px 12px; border-radius: 999px;
  font-size: 14px; color: var(--ink-2);
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--tint); }
.nav-links a.active { color: var(--ink); background: var(--tint-strong); }
.nav-cta { padding: 7px 16px; font-size: 14px; }
@media (min-width: 821px) { .nav-cta { display: none; } }   /* the nav already links the leaderboard; the button stands in for it on phones */

/* ---------- buttons ---------- */
.pill {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  border: 1px solid var(--glass-edge);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}
.pill svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pill::after {   /* soft sheen that sweeps across on hover */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.9s var(--ease);
}
.pill:hover { transform: translateY(-2px); }
.pill:hover::after { transform: translateX(120%); }
.pill-solid { background: var(--ink); color: #fff; border-color: transparent; box-shadow: 0 10px 26px -16px rgba(36, 28, 26, 0.5); }
.pill-glass, .pill-ghost {
  background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--glass-shadow);
}
.pill-glass:hover, .pill-ghost:hover { background: var(--glass-strong); }
.pill-ghost { background: var(--tint); box-shadow: none; }
.pill[aria-disabled="true"] { cursor: default; }
.soon {
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; opacity: 0.75;
  background: var(--tint);
}

/* ---------- layout ---------- */
main { width: min(calc(100% - 32px), var(--maxw)); margin: 0 auto; }
.section { padding: 96px 0 0; scroll-margin-top: 90px; }
.section-head { margin-bottom: 28px; }
.kicker {
  font-size: 13px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(28px, 4vw, 42px); line-height: 1.12; }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-tracks { grid-template-columns: repeat(4, 1fr); }
.card { padding: 28px; }
.card h3 { font-size: 19px; margin: 14px 0 8px; }
.card p { color: var(--ink-2); font-size: 15px; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1.47fr) minmax(0, 1fr); align-items: center; gap: 84px;
  padding: 120px 0 40px;
}
.eyebrow {
  display: inline-block; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-2); padding: 6px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.title {
  margin: 22px 0 14px;
  font-size: clamp(64px, 11vw, 132px); line-height: 0.95; font-weight: 600; letter-spacing: -0.05em;
}
.title-flex { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.title-dash { color: var(--ink-3); font-weight: 300; margin: 0 0.02em; }
.title-rsi { color: var(--accent-1); }
@keyframes hue-flow { to { background-position: 100% 0; } }
.subtitle { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.4; color: var(--ink-2); max-width: 46ch; text-wrap: balance; }
.subtitle strong { font-weight: 600; color: var(--ink); white-space: nowrap; }
.hero-description { max-width: 48ch; margin-top: 14px; color: var(--ink-2); font-size: clamp(16px, 1.45vw, 19px); line-height: 1.6; }
.authors { margin-top: 18px; font-size: 15px; color: var(--ink-3); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero-stage { position: relative; }
.hero-visual { position: relative; padding: 18px 20px 14px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.chart-title { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.chart-tag {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
}
.curves { display: block; width: 100%; height: auto; aspect-ratio: 220 / 305; overflow: visible; }
/* axes: x = round (ticks light up as the leading run passes them), y = performance */
.curves .axes line { stroke: var(--ink-3); stroke-width: 1; }
.curves .ax-title { font: 500 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; fill: var(--ink-3); }
.curves .rtick line { stroke: var(--ink-3); stroke-width: 1; }
.curves .rtick text { font: 500 11px var(--mono); fill: var(--ink-3); transition: fill 0.35s ease; }
.curves .rtick.on text { fill: var(--accent-1); font-weight: 700; }
.curves .rtick.on line { stroke: var(--accent-1); }
/* hero chart: the agent mark in one half, the curves in the other. The mark turns a quarter per round. */
.hero-chart { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.agent-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding-right: 18px; }
.agent-mark { display: block; width: 100%; max-width: 150px; height: auto; overflow: visible; }
.agent-mark .mark-sq { fill: none; stroke: var(--accent-1); stroke-width: 4; }
.agent-mark .mark-agent { font: 800 15px var(--sans); letter-spacing: 0.04em; text-transform: uppercase; fill: var(--ink); }
.agent-round { margin: 0; display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); color: var(--ink-3); }
.agent-round .ar-label { font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.agent-round .ar-n { font: 800 36px/1 var(--sans); color: var(--ink); min-width: 0.7em; text-align: right; display: inline-block; }
.agent-round .ar-n.bump { animation: ar-bump 0.35s var(--ease); }
.agent-round .ar-of { font-size: 14px; }
@keyframes ar-bump { 0% { transform: translateY(-6px); color: var(--accent-1); opacity: 0.4; } 100% { transform: none; opacity: 1; } }
.gridlines line { stroke: var(--line); stroke-width: 1; }
/* each curve: the whole path faint; the stretch a runner has passed lit with a gradient that peaks at the runner (main.js) */
.curve { fill: none; stroke-width: 2; stroke-linecap: round; opacity: 0.26; }
.curve-lit { fill: none; stroke-width: 2.8; stroke-linecap: round; opacity: 0; }
.c1 { stroke: var(--accent-1); }
.c2 { stroke: #c9c1bd; }
.c3 { stroke: #e2dcd9; }
.g1 stop { stop-color: var(--accent-line, var(--accent-1)); }
.g2 stop { stop-color: var(--ink); }
.g3 stop { stop-color: var(--ink-3); }
.runner, .halo { opacity: 0; }
.t1, .h1 { fill: var(--accent-1); } .t2, .h2 { fill: #c9c1bd; } .t3, .h3 { fill: #e2dcd9; }
.chart-axis {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
}
/* the tracks as a numbered index under the chart; live ones (with tasks) are filled in by results.js */
.hero-index { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: -1px; border: 1px solid var(--glass-edge); }
.hero-index a {
  display: flex; align-items: baseline; gap: 12px; min-width: 0; padding: 9px 14px;
  border-bottom: 1px solid var(--glass-edge);
  color: var(--ink-3); transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.hero-index a:nth-child(odd) { border-right: 1px solid var(--glass-edge); }
.hero-index a:nth-child(n + 7) { border-bottom: 0; }
.hero-index .hi-n { font: 500 11px var(--mono); letter-spacing: 0.06em; }
.hero-index .hi-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-index .hi-meta { font: 500 10.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.hero-index a.live .hi-n, .hero-index a.live .hi-meta { color: var(--accent-1); }
.hero-index a.live .hi-name { color: var(--ink); }
.hero-index a:hover { background: var(--ink); color: var(--bg); }
.hero-index a:hover .hi-name, .hero-index a:hover .hi-n, .hero-index a:hover .hi-meta { color: var(--bg); }

/* ---------- overview ---------- */
.overview .lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.7; color: var(--ink); max-width: 68ch; }
.overview .mission { margin-top: 16px; max-width: 68ch; color: var(--ink-2); line-height: 1.65; }
.community-invite { margin-top: 28px; padding: 18px 20px; border-left: 2px solid var(--accent-1); background: var(--tint); }
.community-invite h3 { margin: 0 0 6px; font-size: 16px; }
.community-invite p { margin: 0; max-width: 68ch; color: var(--ink-2); line-height: 1.6; }
.section-lede { max-width: 72ch; margin: -8px 0 24px; color: var(--ink-2); font-size: 16px; line-height: 1.65; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.f-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.feature h4 { font-size: 15px; margin: 10px 0 6px; }
.feature p { font-size: 14px; color: var(--ink-3); line-height: 1.55; }
.f-icon {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  color: var(--ink); background: var(--tint); border: 1px solid var(--glass-edge);
}

/* ---------- timeline ---------- */
.timeline {
  list-style: none; margin: 0; padding: 34px 28px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px;
  position: relative;
}
.timeline::before {   /* the line that draws itself when revealed */
  content: ""; position: absolute; left: 44px; right: 44px; top: 47px; height: 1px;
  background: var(--line);
  transform: scaleX(0); transform-origin: left; transition: transform 1.6s var(--ease) 0.2s;
}
.timeline.in::before { transform: scaleX(1); }
.timeline li { position: relative; }
.timeline .dot {
  display: block; width: 26px; height: 26px; border-radius: 50%; margin-bottom: 16px;
  background: var(--glass-strong); border: 1px solid var(--glass-edge);
  box-shadow: none;
  position: relative; z-index: 1;
}
.timeline .dot::after {
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  background: var(--accent-1);
}
.timeline h4 { font-size: 16px; margin-bottom: 6px; }
.timeline p { font-size: 14px; color: var(--ink-2); line-height: 1.55; }

/* ---------- tracks ---------- */
.track { position: relative; transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.track:hover { transform: translateY(-4px); }
.track svg { width: 28px; height: 28px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.status {
  position: absolute; top: 22px; right: 22px;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
  padding: 3px 9px; border-radius: 999px; color: var(--ink-3);
  border: 1px solid var(--line);
}
.status.live { color: var(--ink-2); border-color: var(--line); background: transparent; }
.status.live::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px;
  background: var(--accent-1); animation: pulse 2.4s ease-in-out infinite;
}
@keyframes draw { to { stroke-dashoffset: 0; } }   /* results curves (results.css) */
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- leaderboard ---------- */
.board { position: relative; padding: 10px 10px 4px; overflow: hidden; }
.board-scroll { overflow-x: auto; }
/* scrollbars in the page's flat style: thin, square, a grey thumb on a clear track. Chromium and Safari
   take the ::-webkit-scrollbar rules (setting scrollbar-width/-color there would switch them to their own
   rounded thumbs); only browsers without them (Firefox) get the standard properties. */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; } }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: 0; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
th, td { text-align: left; padding: 15px 18px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
tbody tr:last-child td { border-bottom: none; }
td:first-child { width: 48px; color: var(--ink-3); font-family: var(--mono); }
.sk {
  display: block; height: 10px; width: 48px; border-radius: 999px;
  background: linear-gradient(90deg, var(--line) 0%, color-mix(in srgb, var(--ink) 14%, transparent) 50%, var(--line) 100%);
  background-size: 200% 100%; animation: shimmer 2.2s ease-in-out infinite;
}
.sk.w-40 { width: 96px; } .sk.w-50 { width: 120px; } .sk.w-60 { width: 144px; } .sk.w-70 { width: 168px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.board-veil {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 35%, transparent));
}

/* ---------- citation ---------- */
.cite { position: relative; padding: 24px 24px 22px; }
pre { margin: 0; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.copy {
  position: absolute; top: 16px; right: 16px; z-index: 1;
  font: 500 13px var(--sans); color: var(--ink); cursor: pointer;
  padding: 6px 14px; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--glass-edge);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.copy:hover { transform: translateY(-1px); }
.copy.done { background: var(--tint-strong); }

/* ---------- footer ---------- */
.footer {
  width: min(calc(100% - 32px), var(--maxw)); margin: 110px auto 0; padding: 28px 0 48px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); font-size: 14px;
}
.muted { color: var(--ink-3); }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0; transform: translateY(18px); filter: blur(6px);
  transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid-tracks { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(3, 1fr); row-gap: 30px; }
  .timeline::before { display: none; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 110px; min-height: auto; }
  .hero-stage { max-width: 520px; width: 100%; justify-self: center; }
  .grid-3 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
}
@media (max-width: 560px), (min-width: 821px) and (max-width: 1000px) {
  .hero-index { grid-template-columns: 1fr; }
  .hero-index a:nth-child(odd) { border-right: 0; }
  .hero-index a:nth-child(n + 7) { border-bottom: 1px solid var(--glass-edge); }
  .hero-index a:last-child { border-bottom: 0; }
}
@media (max-width: 560px) {
  .grid-tracks { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; padding: 26px 20px; }
  .features { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .section { padding-top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  html { scroll-behavior: auto; }
}

/* overview: the work-in-progress line in the accent */
.overview .wip { color: var(--accent-1); font-weight: 600; }
.contribute-note { margin-top: 18px; font: 600 15px var(--sans); color: var(--accent-1); }
/* footer contact: addresses keep their own case under the uppercase footer */
.footer .contact a { text-transform: none; color: var(--accent-1); }
.footer .contact a:hover { text-decoration: underline; }
