/* Train Rivals site
   Layout: one centred 1120px column. Home = split hero (pitch | live squad card), then
   features grid, join steps, privacy strip. Policy pages = narrow reading column with a
   sticky contents list on wide screens.
   Dark first (the app is dark by default); light follows the visitor's system setting. */

:root {
  --bg: #0B0D10;
  --surface: #14171C;
  --surface-2: #1A1E24;
  --line: #262B33;
  --fg: #F3F5F8;
  --muted: #94A3B8;
  --blue: #4C94F2;
  --blue-text: #6AA8F7;
  --on-blue: #0B0D10;
  --green: #7FD6B0;
  --gold: #D4AF5A;
  --mark-r: url(#trWhite);
  --mark-train: url(#trWord);
  --mark-rivals: url(#trRivals);

  --font-display: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Manrope", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);
  --step-4: clamp(2.4rem, 1.4rem + 4.4vw, 4.25rem);

  --radius: 14px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F5F7FA; --surface: #FFFFFF; --surface-2: #EEF1F5; --line: #DCE1E8;
    --fg: #0F1318; --muted: #556070; --blue: #2F7DE1; --blue-text: #2166C2; --on-blue: #FFFFFF;
    --green: #17865A; --gold: #A97F1E;
    --mark-r: #15171B; --mark-train: #15171B; --mark-rivals: #2F7DE1;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F5F7FA; --surface: #FFFFFF; --surface-2: #EEF1F5; --line: #DCE1E8;
  --fg: #0F1318; --muted: #556070; --blue: #2F7DE1; --blue-text: #2166C2; --on-blue: #FFFFFF;
  --green: #17865A; --gold: #A97F1E;
  --mark-r: #15171B; --mark-train: #15171B; --mark-rivals: #2F7DE1;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--blue-text); text-underline-offset: 3px; }
a:hover { color: var(--fg); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

/* Logo */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mark-r { fill: var(--mark-r); }
.word-train { fill: var(--mark-train); }
.word-rivals { fill: var(--mark-rivals); }
.lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.lockup .mark { height: 26px; width: auto; }
.lockup .word { height: 13px; width: auto; }

/* Header */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--bg);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.site-nav { display: flex; align-items: center; gap: 20px; font-size: 0.9375rem; font-weight: 600; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); }
.site-nav .btn { padding: 8px 14px; font-size: 0.875rem; }
.site-nav a.btn-primary { color: var(--bg); }
.site-nav a.btn-primary:hover { color: var(--on-blue); }
@media (max-width: 560px) { .site-nav .hide-sm { display: none; } }
@media (max-width: 340px) { .lockup .word { display: none; } }

/* Buttons: chalk primary like the app, blue reserved for highlights */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: var(--blue); color: var(--on-blue); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); color: var(--fg); }

/* Type */
h1, h2, h3 { margin: 0; text-wrap: balance; }
.display {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.02;
  text-transform: uppercase;
}
.eyebrow {
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blue-text); margin: 0;
}
.lede { font-size: var(--step-1); color: var(--muted); max-width: 34em; margin: 0; }
p { margin: 0; }

/* Hero */
.hero { padding-block: clamp(48px, 8vw, 96px) clamp(48px, 7vw, 88px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hero h1 { font-size: var(--step-4); }
.hero h1 .hl { color: var(--blue); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; }
.fine { font-size: 0.875rem; color: var(--muted); }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }

/* Squad card (product illustration) */
.squad-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.55);
  max-width: 440px; width: 100%; justify-self: end; min-width: 0; margin: 0;
}
@media (max-width: 860px) { .squad-card { justify-self: start; } }
.sc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.sc-title { font-weight: 800; font-size: 1.0625rem; }
.sc-sub { font-size: var(--step--1); color: var(--muted); }
.sc-tabs { display: flex; gap: 6px; font-size: 0.75rem; font-weight: 700; }
.sc-tabs button { font: inherit; border: 0; cursor: pointer; white-space: nowrap; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.sc-tabs button:hover { color: var(--fg); }
.sc-tabs button.on { background: var(--fg); color: var(--bg); }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.board li {
  display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; font-variant-numeric: tabular-nums;
}
.board li.me { background: var(--surface-2); outline: 1px solid color-mix(in srgb, var(--blue) 55%, transparent); }
.board .pos { color: var(--muted); font-weight: 700; font-size: 0.875rem; text-align: center; }
.board .av {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 800; background: var(--surface-2); color: var(--muted);
}
.board li.me .av { background: var(--blue); color: var(--on-blue); }
.board .name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .name small { display: block; font-weight: 600; font-size: 0.75rem; color: var(--muted); }
.board .kg { font-weight: 800; }
.board .kg small { font-weight: 600; color: var(--muted); font-size: 0.75rem; }
.pr { color: var(--green); font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.06em; }
.sc-next {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px solid var(--line); padding-top: 14px;
}
.sc-next .lbl { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.sc-next .val { font-weight: 800; font-variant-numeric: tabular-nums; }
.sc-next .log-chip { padding: 9px 16px; font-size: 0.875rem; font-weight: 700; border-radius: 999px; background: var(--fg); color: var(--bg); white-space: nowrap; }
.season {
  display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.season .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.season .bar i { display: block; height: 100%; width: 62%; background: var(--blue); border-radius: inherit; }
.season b { color: var(--gold); font-weight: 800; }

/* Spec chips */
.specs { border-block: 1px solid var(--line); }
.specs ul {
  list-style: none; margin: 0; padding: 18px 0;
  display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between;
  font-weight: 700; font-size: 0.9375rem;
}
.specs li { display: flex; align-items: center; gap: 8px; }
.specs svg { width: 18px; height: 18px; color: var(--blue); flex: none; }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 40em; margin-bottom: 40px; }
.section-head h2 { font-size: var(--step-3); }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature { background: var(--bg); padding: clamp(22px, 3vw, 32px); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.feature h3 { font-size: var(--step-1); font-weight: 800; }
.feature p { color: var(--muted); }
.feature .tag { font-size: 0.75rem; font-weight: 700; color: var(--blue-text); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
@media (max-width: 680px) { .features { grid-template-columns: minmax(0, 1fr); } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 2px solid var(--line); min-width: 0; }
.steps li:first-child { border-top-color: var(--blue); }
.steps li::before { content: "Step " counter(step); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-text); }
.steps h3 { font-size: var(--step-1); font-weight: 800; }
.steps p { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; } }
@media (max-width: 480px) { .steps { grid-template-columns: minmax(0, 1fr); } }

.promise {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
}
.promise h2 { font-size: var(--step-2); font-weight: 800; }
.promise p { color: var(--muted); margin-top: 8px; max-width: 40em; }
@media (max-width: 680px) { .promise { grid-template-columns: minmax(0, 1fr); } }

/* Get the app */
.get {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
  padding-block: clamp(28px, 4vw, 44px); border-block: 1px solid var(--line);
}
.get h2 { font-size: var(--step-3); }
.get p { color: var(--muted); margin-top: 8px; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: flex; flex-direction: column; line-height: 1.15; padding: 10px 20px; min-width: 168px;
  border-radius: 12px; background: var(--fg); color: var(--bg); font-weight: 800; font-size: 1.125rem;
}
.store small { font-size: 0.6875rem; font-weight: 600; opacity: 0.75; }
@media (max-width: 680px) { .get { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px 48px; margin-top: 24px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 40px; justify-content: space-between; align-items: flex-start; }
.foot-brand { display: flex; flex-direction: column; gap: 10px; }
.foot-brand .tagline { font-size: 0.75rem; letter-spacing: 0.18em; font-weight: 700; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 28px; font-weight: 600; }
.foot-links a { color: var(--fg); text-decoration: none; }
.foot-links a:hover { color: var(--blue-text); }
.foot-meta { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 0.875rem; color: var(--muted); }

/* Placeholder text for the owner to replace before going live */
.ph { background: color-mix(in srgb, var(--gold) 18%, transparent); border-radius: 4px; padding: 0 3px; }

/* Document pages (support, privacy, terms) */
.doc-hero { padding-block: clamp(40px, 6vw, 72px) 28px; border-bottom: 1px solid var(--line); }
.doc-hero .wrap { display: flex; flex-direction: column; gap: 14px; }
.doc-hero h1 { font-size: var(--step-4); }
.doc-hero .meta { color: var(--muted); font-size: 0.9375rem; }
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-block: 40px 72px; align-items: start; }
.toc { position: sticky; top: calc(88px + env(safe-area-inset-top, 0px)); font-size: 0.875rem; display: flex; flex-direction: column; gap: 4px; }
.toc p { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.toc a { color: var(--muted); text-decoration: none; padding: 3px 0; }
.toc a:hover { color: var(--fg); }
@media (max-width: 860px) { .doc { grid-template-columns: minmax(0, 1fr); gap: 24px; } .toc { position: static; display: none; } }

.prose { max-width: 42rem; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.prose h2 { font-size: var(--step-2); font-weight: 800; margin-top: 28px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--step-1); font-weight: 800; margin-top: 8px; }
.prose ul, .prose ol { margin: 0; padding-left: 1.25em; display: flex; flex-direction: column; gap: 6px; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 800; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; white-space: nowrap; }

.callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.callout .label { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.email { font-size: var(--step-1); font-weight: 800; user-select: all; overflow-wrap: anywhere; }
.copy-btn { font: inherit; font-size: 0.8125rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: transparent; color: var(--fg); border: 1px solid var(--line); cursor: pointer; }
.copy-btn:hover { border-color: var(--muted); }

.install { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.install > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.install h3 { margin: 0; font-size: 1rem; }
.install ol { font-size: 0.9375rem; color: var(--muted); }
.install ol b { color: var(--fg); }
@media (max-width: 760px) { .install { grid-template-columns: minmax(0, 1fr); } }

details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary {
  cursor: pointer; list-style: none; padding: 16px 0; font-weight: 700; font-size: 1.0625rem;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.4rem; font-weight: 500; color: var(--muted); line-height: 1; flex: none; }
details[open] summary::after { content: "\2212"; }
details > div { padding-bottom: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; }
details > div strong { color: var(--fg); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .site-nav a, .foot-links a { transition: background-color .15s, color .15s, border-color .15s; }
}
