/* Actual Odds — design system */

:root {
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font-ui);
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --border: #e2e6ee;
  --border-strong: #cdd4e1;
  --text: #0e1525;
  --muted: #5b6577;
  --accent: #009d5b;
  --accent-soft: rgba(0, 157, 91, 0.12);
  --neg: #d93444;
  --neg-soft: rgba(217, 52, 68, 0.1);
  --blue: #3565d8;
  --shadow: 0 1px 2px rgba(14, 21, 37, 0.05), 0 8px 24px rgba(14, 21, 37, 0.07);
  --glow: none;
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #0a0d14;
  --surface: #10141f;
  --surface-2: #171d2c;
  --border: #222a3c;
  --border-strong: #323d56;
  --text: #e9edf5;
  --muted: #93a0b8;
  --accent: #00e07f;
  --accent-soft: rgba(0, 224, 127, 0.12);
  --neg: #ff5a66;
  --neg-soft: rgba(255, 90, 102, 0.12);
  --blue: #6f9cff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  --glow: 0 0 24px rgba(0, 224, 127, 0.18);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* anchor jumps land flush below the sticky header: padded .sections tuck their
   own 56px top padding under it; the calculator (no padding) gets the full offset */
section[id] { scroll-margin-top: 66px; }
.section[id] { scroll-margin-top: 12px; }
@media (max-width: 720px) {
  section[id] { scroll-margin-top: 100px; }
  .section[id] { scroll-margin-top: 48px; }
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
  overflow-x: clip; /* nothing gets to widen the page on phones */
}

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

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; gap: 20px; height: 60px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  color: var(--text); letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand .logo { width: 26px; height: 26px; }
.brand em { font-style: normal; color: var(--accent); }
.site-nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer; font-size: 16px;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
@media (max-width: 720px) {
  .site-header .container {
    height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 8px 14px;
  }
  .site-nav { margin-left: 0; width: 100%; justify-content: space-between; gap: 10px; }
  .site-nav a { font-size: 13px; }
}

/* ---------- hero ---------- */
.hero { padding: 56px 0 8px; text-align: center; }
.hero h1 {
  font-family: var(--font-display); font-size: clamp(30px, 5vw, 46px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 12px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); font-size: 17px; max-width: 620px; margin: 0 auto; }
.hero .hero-free {
  margin-top: 14px; font-size: 14px; font-weight: 600;
  color: var(--accent); letter-spacing: 0.04em;
}

/* ---------- calculator ---------- */
.calc-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px; margin: 36px 0 0; align-items: start;
}
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); padding: 22px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; letter-spacing: 0.01em; white-space: nowrap;
}
.field .hint {
  font-weight: 400; color: var(--muted); font-size: 12px;
  font-family: var(--font-ui); margin-top: 6px; line-height: 1.4;
}
textarea, input[type='text'], input[type='number'], select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); font-family: var(--font-mono); font-size: 14px;
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select { font-family: var(--font-ui); }
textarea { resize: vertical; min-height: 64px; }
textarea:focus, input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row, .row-3 { grid-template-columns: 1fr; } }

details.advanced {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 0 14px; margin-top: 4px; background: var(--surface-2);
}
details.advanced summary {
  cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 600;
  color: var(--muted); user-select: none; list-style: none;
}
details.advanced summary::before { content: '▸ '; }
details.advanced[open] summary::before { content: '▾ '; }
details.advanced .inner { padding: 4px 0 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 13px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.weights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 560px) { .weights { grid-template-columns: 1fr 1fr; } }
.weights input { padding: 7px 9px; font-size: 13px; }
.weights .wlabel { font-size: 11px; color: var(--muted); margin-bottom: 3px; display: block; }

.error-box {
  border: 1px solid var(--neg); background: var(--neg-soft); color: var(--neg);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-top: 8px;
  font-family: var(--font-mono); display: none;
}

/* ---------- results ---------- */
.results { position: sticky; top: 80px; }
@media (max-width: 900px) { .results { position: static; } }
.ev-banner {
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 12px; padding: 16px 18px; margin-bottom: 16px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: background 0.2s ease;
}
.ev-banner.pos { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: var(--glow); }
.ev-banner.neg { background: var(--neg-soft); border-color: color-mix(in srgb, var(--neg) 40%, transparent); }
.ev-banner .label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.ev-banner .value { font-family: var(--font-mono); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.ev-banner.pos .value { color: var(--accent); }
.ev-banner.neg .value { color: var(--neg); }
.ev-banner .banner-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ev-banner .banner-sub > div { margin-top: 3px; white-space: nowrap; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.stat .k { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.stat .v { font-family: var(--font-mono); font-size: 17px; font-weight: 600; margin-top: 2px; }
.stat .sub { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }

table.legs-table, table.all-table {
  width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px;
}
.legs-table th, .legs-table td, .all-table th, .all-table td {
  text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border);
}
.legs-table th, .all-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.legs-table td.num, .all-table td.num { font-family: var(--font-mono); }
.all-table tr.worst td {
  background: var(--accent-soft);
  font-weight: 700;
}
.all-table tr.worst td:first-child {
  border-left: 3px solid var(--accent);
  border-radius: 6px 0 0 6px;
}
.all-table tr.worst td:last-child { border-radius: 0 6px 6px 0; }
.pos-text { color: var(--accent); font-weight: 600; }
.neg-text { color: var(--neg); font-weight: 600; }

.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); cursor: pointer; transition: all 0.15s ease;
  font-family: var(--font-ui);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06281a; }
.btn.primary:hover { filter: brightness(1.08); color: #06281a; }
.placeholder { color: var(--muted); font-size: 14px; text-align: center; padding: 48px 12px; }

/* ---------- content sections ---------- */
.section { padding: 56px 0 0; }
.section h2 {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  letter-spacing: -0.02em; margin: 0 0 6px;
}
.section .lede { color: var(--muted); max-width: 720px; margin: 0 0 24px; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.method-grid.four { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .method-grid, .method-grid.four { grid-template-columns: 1fr; } }
.method-card { padding: 18px; }
.method-card h3 { margin: 0 0 6px; font-size: 16px; font-family: var(--font-display); }
.method-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.method-card code { font-size: 12px; }
.method-card .best-for {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 13px;
}
.method-card .best-for strong { color: var(--accent); font-weight: 600; }

.callout {
  margin-top: 18px; padding: 14px 18px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft); font-size: 14.5px; max-width: 760px;
}
.callout strong { color: var(--accent); }

/* ---------- simulator ---------- */
.sim-card { margin-top: 4px; }
.sim-controls {
  display: grid; grid-template-columns: repeat(6, 1fr) auto;
  gap: 12px; align-items: end; margin-bottom: 16px;
}
@media (max-width: 980px) { .sim-controls { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .sim-controls { grid-template-columns: 1fr 1fr; } }
.sim-controls .field { margin-bottom: 0; }
.sim-controls label { font-size: 11.5px; white-space: normal; }
.sim-controls input, .sim-controls select { padding: 8px 10px; font-size: 13px; }
#sim-roll { height: 38px; }
#sim-canvas { width: 100%; height: 380px; display: block; border-radius: 10px; }
.sim-stats {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  margin-top: 12px; font-size: 13px;
}
.sim-stats em {
  font-style: normal; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em; margin-right: 4px;
}

/* ---------- blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .blog-grid { grid-template-columns: 1fr; } }
.blog-card { display: block; color: var(--text); padding: 20px; transition: border-color 0.15s ease, transform 0.15s ease; }
.blog-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.blog-card .blog-date { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.blog-card h3 { font-family: var(--font-display); font-size: 18px; margin: 8px 0 8px; letter-spacing: -0.01em; }
.blog-card p { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.blog-card .more { color: var(--accent); font-size: 13px; font-weight: 600; }

code, .code {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px;
}

details.fmt-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 0 20px; margin-bottom: 12px;
}
details.fmt-group summary {
  cursor: pointer; padding: 16px 0; list-style: none; user-select: none;
  font-family: var(--font-display); font-weight: 700; font-size: 16.5px;
  letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px;
}
details.fmt-group summary::before {
  content: '+'; color: var(--accent); font-family: var(--font-mono);
  font-size: 18px; width: 18px; flex: none;
}
details.fmt-group[open] summary::before { content: '−'; }
details.fmt-group summary::-webkit-details-marker { display: none; }
.fmt-tag {
  font-family: var(--font-ui); font-size: 11px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: 2px 9px; border-radius: 99px; letter-spacing: 0.04em;
}
.fmt-intro { color: var(--muted); font-size: 14px; margin: 0 0 8px 28px; max-width: 700px; }
table.fmt-table { width: calc(100% - 28px); margin: 0 0 16px 28px; border-collapse: collapse; font-size: 13.5px; }
.fmt-table td { text-align: left; padding: 9px 10px 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.fmt-table tr:last-child td { border-bottom: none; }
.fmt-table td:first-child { color: var(--muted); width: 42%; }
.fmt-table a.try { font-size: 12px; white-space: nowrap; }
@media (max-width: 640px) {
  .fmt-intro, table.fmt-table { margin-left: 0; width: 100%; }
  /* stack each row: label on top, example + try below — long code can't widen the page */
  .fmt-table, .fmt-table tbody { display: block; }
  .fmt-table tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
  }
  .fmt-table tr:last-child { border-bottom: none; }
  .fmt-table td { display: block; padding: 0; border: none; }
  .fmt-table td:first-child { width: 100%; font-size: 12.5px; }
  .fmt-table code { word-break: break-all; white-space: normal; }
  .legs-table td, .all-table td { word-break: break-all; }
}

details.faq {
  border-bottom: 1px solid var(--border); padding: 4px 0;
}
details.faq summary {
  cursor: pointer; font-weight: 600; font-size: 15px; padding: 12px 0;
  list-style: none; user-select: none;
}
details.faq summary::after { content: '+'; float: right; color: var(--muted); }
details.faq[open] summary::after { content: '–'; }
details.faq p { color: var(--muted); margin: 0 0 14px; font-size: 14px; max-width: 760px; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 72px; border-top: 1px solid var(--border);
  padding: 28px 0 40px; color: var(--muted); font-size: 13px;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.site-footer .disclaimer { max-width: 560px; }
.foot-brand .brand { font-size: 17px; }
.foot-brand .logo { width: 22px; height: 22px; }
.foot-tag { margin-top: 6px; }

.stake-chip {
  display: inline-block; padding: 1px 8px; border-radius: 99px;
  background: var(--accent); color: #06281a; font-weight: 700; font-size: 11px;
}
.ev-banner.neg .stake-chip { background: var(--neg); color: #fff; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
