/* Layout concept: the page is a pillar — one strong vertical axis, heavy
   horizontal "plates" between sections, stats set like a training log. */
:root {
  --paper: #f5f6fb;
  --paper-2: #ffffff;
  --ink: #11142b;
  --muted: #5a5f78;
  --line: #dcdfeb;
  --pillar: #3d4fea;
  --pillar-ink: #ffffff;
  --pillar-soft: #e6e9ff;
  --flame: #e87a00;
  --flame-soft: #fff0dd;
  --logo-filter: none;

  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.75rem, 7vw, 5.25rem);

  --gutter: clamp(16px, 4vw, 40px);
  --measure: 66ch;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d0f1e;
    --paper-2: #151831;
    --ink: #eceefa;
    --muted: #9aa0bd;
    --line: #262a47;
    --pillar: #7482ff;
    --pillar-ink: #0d0f1e;
    --pillar-soft: #1d2250;
    --flame: #ffa040;
    --flame-soft: #2e2012;
    --logo-filter: invert(1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d0f1e;
  --paper-2: #151831;
  --ink: #eceefa;
  --muted: #9aa0bd;
  --line: #262a47;
  --pillar: #7482ff;
  --pillar-ink: #0d0f1e;
  --pillar-soft: #1d2250;
  --flame: #ffa040;
  --flame-soft: #2e2012;
  --logo-filter: invert(1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--pillar); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pillar); outline-offset: 3px; border-radius: 4px; }

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

/* ---------- header / footer ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; }
.brand img { height: 30px; width: auto; filter: var(--logo-filter); }
.nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  padding-block: 4px;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--pillar); }

.site-footer {
  margin-top: 96px;
  border-top: 6px solid var(--ink);
  background: var(--paper-2);
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  padding-block: 40px 48px;
}
.site-footer h4 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.site-footer .brand img { height: 26px; margin-bottom: 12px; }

/* ---------- type ---------- */
h1, h2, h3 { text-wrap: balance; margin: 0; }
.display {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 0.92;
}
.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pillar);
  margin: 0;
}
.lede { font-size: var(--step-1); color: var(--muted); max-width: 52ch; margin: 0; }

/* heavy "plate" dividers between sections */
.plate { border: 0; border-top: 6px solid var(--ink); margin: 0; }

/* ---------- buttons ---------- */
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-size: 0.9375rem;
  font-family: var(--body);
  cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--pillar); border-color: var(--pillar); color: var(--pillar-ink); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.store-badge {
  display: inline-flex;
  flex-direction: column;
  padding: 9px 20px 10px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  line-height: 1.15;
}
.store-badge small { font-size: 0.6875rem; letter-spacing: 0.04em; opacity: 0.8; }
.store-badge strong { font-size: 1.0625rem; }

/* ---------- long-form document pages ---------- */
.doc-head { padding-block: 64px 32px; display: grid; gap: 14px; }
.doc-head h1 { font-size: var(--step-4); }
.doc-meta { font-family: var(--mono); font-size: var(--step--1); color: var(--muted); margin: 0; }

.doc {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.toc {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 84px);
  border-left: 3px solid var(--ink);
  padding-left: 16px;
}
.toc p { margin: 0 0 8px; }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: toc; }
.toc li { counter-increment: toc; font-size: 0.875rem; }
.toc li::before {
  content: counter(toc, decimal-leading-zero) " ";
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.75rem;
}
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--pillar); }

.prose { max-width: var(--measure); min-width: 0; }
.prose h2 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: var(--step-3);
  line-height: 1;
  margin: 48px 0 14px;
  scroll-margin-top: 90px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--step-1); margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.25rem; display: grid; gap: 6px; }
.prose .note {
  background: var(--pillar-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 20px 0;
}
.prose .note p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; min-width: 520px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
}

/* ---------- misc ---------- */
.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;
}

@media (max-width: 760px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .toc { position: static; }
  .site-footer { margin-top: 64px; }
}

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