/* ============================================================
   Path Court — design tokens
   Type scale: 12 / 14 / 16 / 20 / 24 / 32 / 48 / 64
   Spacing: 4-pt base, 8-pt rhythm
   ============================================================ */
:root {
  /* color */
  --bg: #0b0b0c;
  --surface: #121214;
  --surface-2: #18181b;
  --border: #232326;
  --border-strong: #2e2e33;
  --text-1: #f4f4f5;   /* primary: headings, key numbers */
  --text-2: #a1a1aa;   /* secondary: body copy */
  --text-3: #71717a;   /* tertiary: captions, labels */
  --accent: #f7931a;
  --accent-hover: #ffa53d;
  --green: #22c55e;
  --red: #ef4444;

  /* type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* spacing */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  /* radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 999px;

  --container: 1120px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
.accent { color: var(--accent); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-5); }
.narrow { max-width: 760px; }
.center { text-align: center; }

/* ---------- type styles ---------- */
.display {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--text-1);
}
.h2 {
  font-size: clamp(28px, 3.4vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--text-1);
}
.h3 { font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; color: var(--text-1); }
.h4 { font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--text-1); }
.lead { font-size: 20px; line-height: 1.55; color: var(--text-2); }
.body-lg { font-size: 18px; line-height: 1.6; color: var(--text-2); }
.body { font-size: 16px; line-height: 1.6; color: var(--text-2); }
.body-sm { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.caption { font-size: 12px; line-height: 1.5; color: var(--text-3); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 48px; padding: 0 var(--s-5);
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  border-radius: var(--r-sm); border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-sm { height: 36px; padding: 0 var(--s-4); font-size: 14px; }
.btn-primary { background: var(--accent); color: #0b0b0c; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text-1); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--text-3); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text-1); border-color: var(--text-3); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 11, 12, 0.8);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; font-size: 15px; color: var(--text-1); }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent); color: #0b0b0c;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
}
.nav-links { display: flex; gap: var(--s-6); font-size: 14px; color: var(--text-2); }
.nav-links a:hover { color: var(--text-1); }

/* ---------- hero ---------- */
.hero { padding: var(--s-9) 0 var(--s-8); }
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero .display { max-width: 900px; margin-top: var(--s-5); }
.hero .lead { max-width: 640px; margin-top: var(--s-5); }
.cta-row { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; margin-top: var(--s-6); }

.pill {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 32px; padding: 0 var(--s-3);
  border: 1px solid var(--border-strong); border-radius: var(--r-full);
  background: var(--surface);
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.dot.open { background: var(--green); }
.dot.pre { background: var(--accent); }
.dot.closed { background: var(--red); }

/* ---------- countdown ---------- */
.clock-card {
  margin-top: var(--s-8);
  padding: var(--s-7) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-5);
}
.clock {
  display: flex; align-items: flex-start; justify-content: center;
  gap: clamp(var(--s-2), 2vw, var(--s-5));
}
.unit { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.num {
  font-family: var(--font-mono);
  font-size: clamp(56px, 12vw, 160px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
}
.unit:first-child .num { color: var(--accent); }
.colon {
  font-family: var(--font-mono);
  font-size: clamp(40px, 8vw, 112px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--border-strong);
}
.unit-lbl {
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: var(--s-4);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.stat { padding: var(--s-5); border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat dt { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.stat dd { margin-top: var(--s-2); font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; color: var(--text-1); }
.stat p { margin-top: var(--s-1); font-size: 14px; color: var(--text-3); }

/* ---------- sections ---------- */
.section { padding: var(--s-9) 0; border-top: 1px solid var(--border); }
.section-alt { background: var(--surface); }
.section-alt .h2 { margin-top: var(--s-4); }
.section-alt .body-lg { margin-top: var(--s-4); }

.section-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6);
  align-items: end;
  margin-bottom: var(--s-7);
}
.section-head .h2 { margin-top: 0; }
.section-head > .body { max-width: 440px; justify-self: end; }

/* ---------- cards & grids ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.card {
  padding: var(--s-5);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.step-n {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; margin-bottom: var(--s-3);
  border-radius: var(--r-full); border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--accent);
}

.code-card {
  margin-top: var(--s-4);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.code-title { font-weight: 600; color: var(--text-1); }
.clock-label { font-size: 16px; font-weight: 500; color: var(--text-2); }
pre {
  margin: 0; padding: var(--s-5);
  font-family: var(--font-mono); font-size: 14px; line-height: 1.75;
  color: var(--text-1); overflow-x: auto;
}

/* docket */
.piece { gap: 0; }
.piece .h3 { margin-bottom: var(--s-2); }
.piece .q { margin-bottom: var(--s-5); }
.paths { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-5); }
.paths li { display: flex; flex-direction: column; gap: 2px; padding-left: var(--s-3); border-left: 2px solid var(--border-strong); }
.path-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
a.path-name:hover { color: var(--accent); }
.path-note { font-size: 13px; color: var(--text-3); }
.gap { margin-top: auto; padding-top: var(--s-4); border-top: 1px solid var(--border); }
.gap-label { color: var(--text-1); font-weight: 600; }

/* leaderboard */
.table-card { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.table-card table { width: 100%; border-collapse: collapse; }
.table-card th {
  text-align: left; padding: var(--s-3) var(--s-5);
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.table-card td { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); font-size: 15px; color: var(--text-2); vertical-align: top; }
.table-card tr:last-child td { border-bottom: 0; }
.table-card .rank { font-family: var(--font-mono); color: var(--text-3); width: 64px; }
.table-card .who { color: var(--text-1); font-weight: 500; }
.table-card .score { font-family: var(--font-mono); color: var(--text-1); text-align: right; }
.table-card a:hover { color: var(--accent); }
.empty { padding: var(--s-8) var(--s-5); text-align: center; display: flex; flex-direction: column; gap: var(--s-2); align-items: center; }
.empty .h4 { color: var(--text-1); }

/* timeline */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); counter-reset: none; }
.timeline li { position: relative; padding-top: var(--s-5); border-top: 2px solid var(--border-strong); display: flex; flex-direction: column; gap: var(--s-2); }
.timeline li:first-child { border-top-color: var(--accent); }
.tl-t { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--accent); }

/* rules */
.rules { border-top: 1px solid var(--border); }
.rules > div { display: grid; grid-template-columns: 200px 1fr; gap: var(--s-5); padding: var(--s-4) 0; border-bottom: 1px solid var(--border); }
.rules dt { font-size: 14px; font-weight: 600; color: var(--text-1); }
.rules dd { font-size: 15px; color: var(--text-2); }
.fine { margin-top: var(--s-6); max-width: 720px; }

/* footer */
.footer { border-top: 1px solid var(--border); padding: var(--s-6) 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.footer-links { display: flex; gap: var(--s-5); flex-wrap: wrap; font-family: var(--font-mono); }
.footer-links a:hover { color: var(--text-1); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .grid-4, .timeline { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  .hero { padding: var(--s-8) 0 var(--s-7); }
  .section { padding: var(--s-8) 0; }
  .section-head { grid-template-columns: 1fr; gap: var(--s-3); margin-bottom: var(--s-6); }
  .section-head > .body { justify-self: start; }
  .grid-4, .grid-3, .timeline { grid-template-columns: 1fr; }
  .clock-card { padding: var(--s-6) var(--s-3); }
  .clock { gap: var(--s-1); }
  .num { font-size: 11vw; }
  .colon { font-size: 8vw; line-height: 1.1; }
  .unit-lbl { font-size: 10px; letter-spacing: 0.04em; }
  .rules > div { grid-template-columns: 1fr; gap: var(--s-1); }
  .table-card th:nth-child(3), .table-card td:nth-child(3) { display: none; }
  .cta-row .btn { width: 100%; }
}

/* ---------- Pathways additions ---------- */
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.narrow > .h2 { margin-bottom: var(--s-5); }
.sub { margin: calc(-1 * var(--s-3)) 0 var(--s-5); }
.prose { display: flex; flex-direction: column; gap: var(--s-4); }
.prose p { font-size: 18px; line-height: 1.65; color: var(--text-2); }
.prose strong { color: var(--text-1); font-weight: 600; }
pre.wrap { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.7; }
.origin { color: var(--accent); }
.flow { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5) var(--s-6); margin-top: var(--s-7); }
.flow li { display: flex; gap: var(--s-4); align-items: flex-start; }
.flow .step-n { flex: none; margin: 0; }
.flow .h4 { margin-bottom: var(--s-1); }
.case { gap: var(--s-2); }
.case-n { font-family: var(--font-mono); font-size: 14px; color: var(--accent); margin-bottom: var(--s-2); }
.case-ev { margin-top: auto; padding-top: var(--s-4); border-top: 1px solid var(--border); }
.case .body-sm:not(.case-ev) { margin-bottom: var(--s-4); }
.section-head { align-items: end; }
.closing .h3 { margin-bottom: var(--s-3); }
.closing .fine { margin: var(--s-6) auto 0; }
@media (max-width: 640px) {
  .stats-3 { grid-template-columns: 1fr; }
  .stats-3 .stat { border-right: 0; border-bottom: 1px solid var(--border); }
  .stats-3 .stat:last-child { border-bottom: 0; }
  .flow { grid-template-columns: 1fr; }
  .table-card th:nth-child(4), .table-card td:nth-child(4) { display: none; }
}
@media (min-width: 641px) and (max-width: 960px) {
  .stats-3 { grid-template-columns: repeat(3, 1fr); }
  .stats-3 .stat { border-bottom: 0; border-right: 1px solid var(--border); }
  .stats-3 .stat:last-child { border-right: 0; }
}
.subhead { margin: var(--s-7) 0 var(--s-4); }
.mono { font-family: var(--font-mono); font-size: 13px; }
.dim { color: var(--text-3); }
.case-meta { margin-top: var(--s-3); }
.case-meta code { font-family: var(--font-mono); color: var(--text-2); }
@media (max-width: 640px) {
  #board-table th:nth-child(3), #board-table td:nth-child(3) { display: none; }
}

/* bounty link stat */
.stat-link { display: block; color: inherit; text-decoration: none; transition: background 0.15s; }
.stat-link:hover { background: var(--surface-2, rgba(255,255,255,0.03)); }
.stat-link:hover .arrow, .stat-link:hover p { color: var(--accent); }
.stat dd { margin-top: 0; font-size: 32px; }
.stat p { margin-top: var(--s-1); font-size: 15px; color: var(--text-2); }
