@font-face {
  font-family: 'Atkinson Next';
  src: url('/assets/fonts/atkinson-next-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg: #0F1B2D;
  --raised: #16253B;
  --line: #2C3E5A;
  --text: #F3F6FA;
  --muted: #A9B6C8;
  --gold: #E9B949;
  --control: #6A7FA0;
  --font: 'Atkinson Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.55 var(--font); }
a { color: var(--gold); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 16px; }
.col { max-width: 46rem; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .9375rem; }

/* Header and footer */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; padding-block: .85rem; }
.brand { font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand-note { color: var(--muted); font-size: .875rem; }
.site-foot { border-top: 1px solid var(--line); margin-top: 4rem; padding-block: 2rem 3rem; color: var(--muted); font-size: .875rem; }
.site-foot p { max-width: 70ch; }

/* Type */
h1 { font-size: clamp(2.1rem, 7vw, 3.1rem); line-height: 1.05; font-weight: 800; letter-spacing: -.025em; margin: 2.25rem 0 1.1rem; max-width: 16ch; }
h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; margin: 3.5rem 0 .75rem; }
h3 { font-size: 1.125rem; line-height: 1.3; margin: 2rem 0 .6rem; display: flex; align-items: center; gap: .6rem; }
p { margin: 0 0 1rem; max-width: 68ch; }
.lede { font-size: 1.1875rem; line-height: 1.5; }

/* Hero */
.hero { display: grid; gap: .5rem; }
@media (min-width: 880px) {
  .hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 3.5rem; align-items: start; }
  .hero .ruler-fig { margin-top: 2.6rem; }
}

/* Odds ruler: log scale from 1 in 100 (top) to 1 in 1,000,000 (bottom) */
.ruler-fig { margin: 1rem 0 0; }
.ruler-head { font-weight: 700; margin: 0 0 1rem; }
.ruler { display: grid; grid-template-columns: 5.5rem 1fr; height: 480px; margin-bottom: 2rem; }
.scale, .marks { position: relative; margin: 0; padding: 0; list-style: none; }
.scale { border-right: 2px solid var(--line); }
.scale span { position: absolute; right: .7rem; transform: translateY(-50%); font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.marks li { position: absolute; left: 0; transform: translateY(-50%); padding-left: 1.1rem; line-height: 1.15; }
.marks li::before { content: ''; position: absolute; left: -7px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold); background: var(--bg); }
.marks b { display: block; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.marks span { display: block; font-size: .8125rem; color: var(--muted); }
.marks li.g-none::before { border-style: dashed; border-color: var(--muted); }
.marks li.g-custom::before { border-color: var(--text); }
.marks li.is-selected::before { background: var(--gold); border-color: var(--gold); border-style: solid; }
.marks li.is-selected b { color: var(--gold); }
.ruler-fig figcaption { font-size: .9375rem; color: var(--muted); max-width: 34ch; }

/* Calculator */
.calc { background: var(--raised); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; margin-top: 1.25rem; }
.calc label, .calc legend { font-weight: 700; }
.field { margin-bottom: 1.4rem; }
.stepper { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .4rem; }
.stepper input { flex: 1 0 7ch; min-width: 7ch; max-width: 9ch; }
.stepper button { flex: none; }
input[type=number] { font: inherit; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; width: 6.5ch; min-height: 48px; padding: .3rem .6rem; background: var(--bg); color: var(--text); border: 1px solid var(--control); border-radius: 10px; }
input[type=number]:disabled { opacity: .45; }
input.inline { font-size: 1.0625rem; width: 10ch; min-height: 40px; }
button { font: inherit; font-weight: 700; min-height: 48px; padding: 0 .85rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
button:hover { border-color: var(--gold); }
button[aria-disabled=true] { opacity: .45; cursor: default; }
button[aria-disabled=true]:hover { border-color: var(--line); }
.hint { color: var(--muted); font-size: .875rem; margin: .4rem 0 0; }
.check { display: flex; gap: .6rem; align-items: center; min-height: 44px; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--gold); }
fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }
legend { padding: 0; margin-bottom: .5rem; }
.rates { display: grid; gap: .5rem; }
.rate { display: grid; grid-template-columns: auto 1fr; gap: .1rem .7rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; font-weight: 400 !important; cursor: pointer; }
.rate input[type=radio] { accent-color: var(--gold); width: 1.15rem; height: 1.15rem; grid-row: span 2; }
.rate b { font-variant-numeric: tabular-nums; }
.rate span { color: var(--muted); font-size: .875rem; grid-column: 2; }
.rate label { font-weight: inherit; cursor: pointer; }
.rate > label:first-of-type b { font-weight: 700; }
.rate:has(input:checked) { border-color: var(--gold); }
.result { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.big { font-size: clamp(2.6rem, 11vw, 3.6rem); font-weight: 800; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; margin: 0 0 .35rem; letter-spacing: -.02em; }
.targets { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 1rem 0; }
.targets dt { color: var(--muted); }
.targets dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.targets small { display: block; font-weight: 400; color: var(--muted); font-size: .875rem; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 1rem 0 1.25rem; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .9375rem; }
th, td { text-align: right; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { color: var(--muted); font-weight: 700; vertical-align: bottom; }
tbody th { white-space: nowrap; }
tbody th span { display: block; color: var(--muted); font-size: .8125rem; font-weight: 400; white-space: normal; }

/* Evidence grades: the same markers as the ruler */
.grade::before { content: ''; flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold); }
.grade-epic::before { background: var(--gold); }
.grade-game::before { background: linear-gradient(90deg, var(--gold) 50%, transparent 50%); }
.grade-none::before { border-style: dashed; border-color: var(--muted); }
.claims { list-style: none; padding: 0; margin: 0; }
.claims li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.claims li:first-child { border-top: 1px solid var(--line); }
.claims p { margin: 0; }
.src { color: var(--muted); font-size: .875rem; margin-top: .25rem !important; }

/* Deadline */
.deadline { font-size: 1.25rem; font-weight: 700; margin-bottom: .25rem; }

/* FAQ */
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; padding: .8rem 0; min-height: 44px; }
details p { margin: 0 0 1rem; }
