/* =============================================================================
   BetSmart — betsmart.org.uk
   Design system + site styles.

   Direction: a quant research desk, not a tipster hype channel. Editorial serif
   display, technical mono for every number, deep tinted ink (never pure black).
   Numbers are the hero element; the design gets out of their way.
   ============================================================================= */

/* ----------------------------------------------------------------- tokens -- */
:root {
  /* Ink — tinted, never pure black/grey */
  --ink-900: #070b0a;
  --ink-850: #0a100e;
  --ink-800: #0e1513;
  --ink-750: #131b19;
  --ink-700: #1a2422;

  --text-hi:  #f2f7f5;
  --text-mid: #a8bab5;
  --text-lo:  #6f8580;

  /* Product accents */
  --football: #3ddc91;
  --racing:   #f0b429;

  /* Semantics */
  --pos: #3ddc91;
  --neg: #ff6b5e;
  --warn: #f0b429;

  --line: color-mix(in srgb, var(--text-mid) 14%, transparent);
  --line-strong: color-mix(in srgb, var(--text-mid) 26%, transparent);

  --bg: var(--ink-900);
  --surface: var(--ink-850);
  --surface-2: var(--ink-800);

  /* Type */
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Space — 4px base */
  --s1: 0.25rem; --s2: 0.5rem;  --s3: 0.75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem;     --s7: 3rem;    --s8: 4rem;
  --s9: 6rem;   --s10: 8rem;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px;

  /* Motion — ease-out on entry; nothing bouncy */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 140ms; --t-mid: 220ms; --t-slow: 380ms;

  --maxw: 1180px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9f8;
    --surface: #ffffff;
    --surface-2: #f1f5f3;
    --text-hi: #0b1412;
    --text-mid: #475854;
    /* 5.03:1 on the light background. --text-lo carries small text (captions,
       stat labels, the eyebrow), so it has to clear 4.5:1, not the 3:1 large-text
       bar. The previous #6d817c sat at 3.91 and failed WCAG AA. */
    --text-lo: #5d6f6a;
    --line: color-mix(in srgb, #0b1412 12%, transparent);
    --line-strong: color-mix(in srgb, #0b1412 22%, transparent);
    --football: #14966a;
    --racing: #a97706;
    --pos: #14966a;
    --neg: #c9372c;
  }
}

/* ------------------------------------------------------------------ reset -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-hi);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--football); outline-offset: 3px; border-radius: 3px; }

/* --------------------------------------------------------------- typography */
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.04; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2.75rem, 7.2vw, 5.25rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.35rem); }
h3 { font-size: clamp(1.3rem, 2.1vw, 1.7rem); }
p  { margin: 0; }

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

.eyebrow {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-lo);
}

.lede { font-size: clamp(1.05rem, 1.5vw, 1.24rem); color: var(--text-mid); line-height: 1.62; }

/* ------------------------------------------------------------------ layout */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s5); }
section { padding-block: clamp(var(--s8), 9vw, var(--s10)); }
.section-head { max-width: 62ch; margin-bottom: var(--s7); }
.section-head h2 { margin-block: var(--s3) var(--s4); }

/* --------------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-mid) var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in { display: flex; align-items: center; gap: var(--s5); height: 64px; }
.nav-logo { display: flex; align-items: center; gap: var(--s2); font-family: var(--display); font-size: 1.32rem; letter-spacing: -0.02em; }
.nav-logo .mark { width: 22px; height: 22px; border-radius: 5px; flex: none; background: linear-gradient(150deg, var(--football), var(--racing)); }
.nav-links { display: flex; gap: var(--s5); margin-left: auto; font-size: 0.9rem; color: var(--text-mid); }
.nav-links a { transition: color var(--t-fast) var(--ease); }
.nav-links a:hover { color: var(--text-hi); }
.nav-cta { display: flex; align-items: center; gap: var(--s3); }
.menu-btn { display: none; padding: var(--s2); font-size: 1.25rem; }

@media (max-width: 900px) {
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: var(--s3) var(--s5) var(--s5);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding-block: var(--s3); border-bottom: 1px solid var(--line); }
  .menu-btn { display: block; margin-left: auto; }
  .nav-cta .btn { display: none; }
}

/* ------------------------------------------------------------------ button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 0.78rem 1.35rem; border-radius: var(--r-md);
  font-size: 0.94rem; font-weight: 600; border: 1px solid transparent;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--football); color: #04120c; }
.btn.primary:hover { background: color-mix(in srgb, var(--football) 88%, #fff); }
.btn.racing { background: var(--racing); color: #17110a; }
.btn.racing:hover { background: color-mix(in srgb, var(--racing) 88%, #fff); }
.btn.ghost { border-color: var(--line-strong); color: var(--text-hi); }
.btn.ghost:hover { border-color: var(--text-mid); background: color-mix(in srgb, var(--text-mid) 8%, transparent); }
.btn.sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; }
.btn.lg { padding: 0.95rem 1.7rem; font-size: 1rem; }
.btn.block { width: 100%; }

/* ------------------------------------------------------------------- badge */
.badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 0.34rem 0.72rem; border: 1px solid var(--line-strong); border-radius: 100px;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em;
  color: var(--text-mid); text-transform: uppercase;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); flex: none; }
.dot.live { animation: pulse 2.4s var(--ease-io) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* -------------------------------------------------------------------- hero */
.hero { position: relative; padding-block: clamp(var(--s8), 11vw, 8.5rem) var(--s8); }
/* Insets stay at 0 horizontally: negative side insets pushed the element past the
   viewport and grew scrollWidth, which `overflow-x: hidden` on body hides but does
   not prevent. The gradients below are wide enough to read as full-bleed anyway. */
.hero::before {
  content: ""; position: absolute; inset: -30% 0 auto; height: 70vh; z-index: -1;
  background:
    radial-gradient(ellipse 75% 55% at 18% 0%, color-mix(in srgb, var(--football) 13%, transparent), transparent 70%),
    radial-gradient(ellipse 65% 50% at 88% 12%, color-mix(in srgb, var(--racing) 10%, transparent), transparent 70%);
  pointer-events: none;
}
.hero h1 { margin-block: var(--s5) var(--s5); max-width: 16ch; }
.hero h1 em { font-style: italic; color: var(--football); }
.hero .lede { max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
.hero-note { margin-top: var(--s4); font-size: 0.84rem; color: var(--text-lo); }

.proof-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden; margin-top: var(--s7);
}
.proof-cell { padding: var(--s5); border-right: 1px solid var(--line); }
.proof-cell:last-child { border-right: 0; }
.proof-cell .v { font-family: var(--mono); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; letter-spacing: -0.03em; display: block; }
.proof-cell .k { font-size: 0.78rem; color: var(--text-lo); margin-top: var(--s1); display: block; }
.proof-cell .v.pos { color: var(--pos); }
@media (max-width: 760px) {
  .proof-strip { grid-template-columns: repeat(2, 1fr); }
  .proof-cell:nth-child(2) { border-right: 0; }
  .proof-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ------------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 940px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* --------------------------------------------------------- product columns */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
@media (max-width: 880px) { .products { grid-template-columns: 1fr; } }

.product {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: var(--s6);
  transition: border-color var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.product:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.product::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent, var(--football)); }
.product.football { --accent: var(--football); }
.product.racing   { --accent: var(--racing); }
.product-icon { font-size: 1.6rem; line-height: 1; }
.product h3 { margin-block: var(--s4) var(--s2); }
.product .tag { color: var(--accent); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.product .desc { color: var(--text-mid); font-size: 0.96rem; margin-top: var(--s3); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-block: var(--s5); padding-block: var(--s5); border-block: 1px solid var(--line); }
.stat-row .s .v { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; letter-spacing: -0.03em; display: block; }
.stat-row .s .k { font-size: 0.72rem; color: var(--text-lo); }

.feat-list { list-style: none; margin: 0 0 var(--s5); padding: 0; display: grid; gap: var(--s2); font-size: 0.92rem; color: var(--text-mid); }
.feat-list li { display: flex; gap: var(--s3); align-items: flex-start; }
.feat-list li::before { content: "→"; color: var(--accent, var(--football)); flex: none; font-family: var(--mono); }

/* ---------------------------------------------------------------- evidence */
.evidence { background: var(--surface-2); border-block: 1px solid var(--line); }

.record-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.record-table th, .record-table td { padding: var(--s3) var(--s4); text-align: right; border-bottom: 1px solid var(--line); }
.record-table th:first-child, .record-table td:first-child { text-align: left; }
.record-table th { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-lo); font-weight: 500; }
.record-table td { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.record-table td:first-child { font-family: var(--sans); }
.record-table tbody tr:last-child td { border-bottom: 0; }
.record-table .pos { color: var(--pos); }
.record-table .neg { color: var(--neg); }
.record-table tr.muted td { color: var(--text-lo); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.table-wrap table { min-width: 520px; }

.callout {
  border-left: 3px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 7%, transparent);
  padding: var(--s4) var(--s5); border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 0.9rem; color: var(--text-mid);
}
.callout strong { color: var(--text-hi); }

/* ------------------------------------------------------------------ method */
.steps { counter-reset: step; display: grid; gap: var(--s4); }
.step { display: grid; grid-template-columns: auto 1fr; gap: var(--s5); align-items: start; padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-size: 0.82rem; color: var(--football); padding-top: 0.2rem;
}
.step h3 { font-size: 1.15rem; margin-bottom: var(--s2); }
.step p { font-size: 0.92rem; color: var(--text-mid); }

/* ---------------------------------------------------------------- features */
.feature { padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: border-color var(--t-mid) var(--ease); }
.feature:hover { border-color: var(--line-strong); }
.feature .ico { font-size: 1.35rem; }
.feature h3 { font-size: 1.08rem; margin-block: var(--s3) var(--s2); }
.feature p { font-size: 0.89rem; color: var(--text-mid); }
.feature code { font-family: var(--mono); font-size: 0.82em; color: var(--football); background: color-mix(in srgb, var(--football) 10%, transparent); padding: 0.1em 0.4em; border-radius: 4px; }

/* ----------------------------------------------------------------- pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); align-items: start; }
@media (max-width: 940px) { .plans { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; } }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--s6); }
.plan.featured { border-color: var(--football); }
.plan.featured::after {
  content: "Best value"; position: absolute; top: -10px; left: var(--s6);
  background: var(--football); color: #04120c;
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: 100px;
}
.plan h3 { font-size: 1.25rem; }
.price { display: flex; align-items: baseline; gap: 0.2rem; margin-block: var(--s4) var(--s1); }
.price .amt { font-family: var(--mono); font-size: 3rem; font-weight: 700; letter-spacing: -0.04em; }
.price .per { color: var(--text-lo); font-size: 0.9rem; }
.plan .annual { font-size: 0.82rem; color: var(--text-lo); margin-bottom: var(--s5); }
.plan .feat-list { margin-top: var(--s5); }

.toggle { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 100px; background: var(--surface); margin-bottom: var(--s6); }
.toggle button { padding: 0.4rem 1rem; border-radius: 100px; font-size: 0.85rem; color: var(--text-mid); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.toggle button[aria-pressed="true"] { background: var(--football); color: #04120c; font-weight: 600; }

/* --------------------------------------------------------------------- faq */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { display: flex; width: 100%; gap: var(--s4); align-items: center; padding: var(--s5) 0; text-align: left; font-size: 1.02rem; font-weight: 500; }
.faq-q .chev { margin-left: auto; color: var(--text-lo); transition: transform var(--t-mid) var(--ease); flex: none; }
.faq-item.open .chev { transform: rotate(180deg); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-mid) var(--ease-io); }
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; }
.faq-a p { padding-bottom: var(--s5); color: var(--text-mid); font-size: 0.94rem; max-width: 72ch; }

/* ------------------------------------------------------------------- final */
.final { text-align: center; }
.final h2 { max-width: 20ch; margin-inline: auto; }
.final .lede { max-width: 52ch; margin: var(--s4) auto 0; }
.final .hero-cta { justify-content: center; }

/* ------------------------------------------------------------------ footer */
.footer { border-top: 1px solid var(--line); background: var(--surface-2); padding-block: var(--s7) var(--s6); font-size: 0.88rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: var(--s6); margin-bottom: var(--s7); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: var(--s5); } }
.footer h4 { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-lo); margin: 0 0 var(--s3); font-weight: 500; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.footer a { color: var(--text-mid); transition: color var(--t-fast) var(--ease); }
.footer a:hover { color: var(--text-hi); }

.rg { border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: var(--s5); margin-bottom: var(--s6); display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; }
.rg .age { font-family: var(--mono); font-weight: 700; font-size: 0.9rem; border: 2px solid var(--text-hi); border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
.rg p { font-size: 0.85rem; color: var(--text-mid); flex: 1 1 320px; }
.rg a { color: var(--text-hi); text-decoration: underline; text-underline-offset: 2px; }

.legal { color: var(--text-lo); font-size: 0.78rem; line-height: 1.7; max-width: 90ch; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between; padding-top: var(--s5); border-top: 1px solid var(--line); margin-top: var(--s5); color: var(--text-lo); font-size: 0.8rem; }

/* --------------------------------------------------------------- utilities */
.mt3 { margin-top: var(--s3); } .mt4 { margin-top: var(--s4); }
.mt5 { margin-top: var(--s5); } .mt6 { margin-top: var(--s6); } .mt7 { margin-top: var(--s7); }
.center { text-align: center; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.muted { color: var(--text-lo); }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.76rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Reveal on scroll — opacity+transform only, no layout thrash.
   Content is visible by default and only hidden once JS has confirmed it can
   observe and un-hide it (`.has-reveal` on <html>). Without that guard, a missed
   IntersectionObserver callback, a failed script or a prerenderer leaves real
   content permanently invisible — a far worse outcome than no animation. */
.has-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.has-reveal .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .has-reveal .reveal { opacity: 1; transform: none; } }

/* ------------------------------------------------------- results page bits */
.equity-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: var(--s5); }
.equity-svg { width: 100%; height: auto; display: block; }
.feed-item { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s4); align-items: start; padding: var(--s4) 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.feed-item:last-child { border-bottom: 0; }
.pill { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.2rem 0.5rem; border-radius: 4px; white-space: nowrap; }
.pill.won { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.pill.lost { background: color-mix(in srgb, var(--neg) 16%, transparent); color: var(--neg); }
.pill.void { background: color-mix(in srgb, var(--text-lo) 16%, transparent); color: var(--text-lo); }
.feed-note { color: var(--text-lo); font-size: 0.82rem; margin-top: var(--s1); }
.tabs { display: inline-flex; gap: var(--s1); padding: 3px; border: 1px solid var(--line); border-radius: 100px; background: var(--surface); }
.tabs button { padding: 0.42rem 1.05rem; border-radius: 100px; font-size: 0.86rem; color: var(--text-mid); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.tabs button[aria-selected="true"] { background: var(--text-hi); color: var(--bg); font-weight: 600; }
