/* ==========================================================================
   Chasing Tens — shared site stylesheet
   Loaded by every page in site/. Extracted from the per-page <style> blocks so
   that Content-Security-Policy can forbid inline styles entirely
   (style-src 'self', no 'unsafe-inline').
   ========================================================================== */

/* The @font-face lives in /assets/font.css — link it alongside this file. */

:root {
  --gold: #D4AF37;
  --gold-light: #F5D78A;
  --background: #111111;
  --surface: #1A1A1A;
  --card: #222222;
  --border: #333333;
  --text: #F7F7F7;
  --muted: #B5B5B5;
  --green: #34d399;
  --red: #f87171;
  /* One reading measure for body prose. Tables, figures and the phone rail stay
     full width; running text does not, because long lines are hard to track back. */
  --measure: 820px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--background);
  color: var(--text);
  font-family: 'Montserrat', system-ui, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 24px); }
a { color: var(--gold); }

/* ---------- top nav ---------- */
/* Sticky so the long scroll keeps its table of contents visible — the orientation benefit
   of tabs without splitting the document across pages. */
nav.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; gap: 20px; align-items: center; justify-content: center;
  padding: 16px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap;
  font-size: 14px;
  /* Opaque, NOT backdrop-filter. A blurred backdrop on a sticky element forces the browser to
     re-sample and re-blur the region behind it on every scroll frame — for the whole duration
     of a smooth-scroll animation. An opaque background occludes just as well and costs nothing. */
  background: var(--background);
}
nav.top a {
  color: var(--muted); text-decoration: none; font-weight: 500;
  padding: 4px 2px; border-bottom: 2px solid transparent; transition: color .15s ease;
}
nav.top a:hover { color: var(--gold); }
nav.top a.brand { color: var(--text); font-weight: 700; letter-spacing: 0.3px; }
nav.top a.active { color: var(--gold); border-bottom-color: var(--gold); }
/* Anchor jumps must clear the sticky bar. */
section { scroll-margin-top: 72px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- header ---------- */
header { padding: clamp(44px, 9vw, 76px) 0 clamp(28px, 5vw, 40px); text-align: center; }
h1 { font-size: clamp(30px, 5.2vw, 46px); font-weight: 700; letter-spacing: -0.5px; line-height: 1.2; }
h1 .gold { color: var(--gold); }
.lede {
  margin: 18px auto 0; max-width: 720px; font-size: clamp(15.5px, 2vw, 18px);
  color: var(--muted); font-weight: 500;
}
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.tag {
  padding: 7px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface);
}
.tag.gold { border-color: var(--gold); color: var(--gold); }

/* ---------- stat strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; padding: 20px 0 8px;
}
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 16px; text-align: center;
}
.stat b { display: block; font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; color: var(--gold); line-height: 1.15; }
.stat span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- sections ---------- */
section { padding: clamp(40px, 7vw, 68px) 0 0; }
h2 {
  font-size: clamp(22px, 3.2vw, 30px); font-weight: 700; letter-spacing: -0.3px;
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
h2 .num { color: var(--gold); font-size: 15px; font-weight: 600; letter-spacing: 1px; }
h3 { font-size: 17.5px; font-weight: 600; margin: 30px 0 10px; color: var(--gold-light); }
p { margin-top: 14px; color: var(--muted); font-size: 15.5px; }
p.tight { margin-top: 8px; }
strong { color: var(--text); font-weight: 600; }
.sub { margin-top: 10px; font-size: 15.5px; color: var(--muted); max-width: var(--measure); }
/* Body prose shares the same measure as .sub — a section whose intro is 760px wide and
   whose paragraphs run the full 1000px reads as a mistake, because the column edge moves. */
section > p, section > ul { max-width: var(--measure); }

ul { margin: 14px 0 0 0; padding-left: 20px; color: var(--muted); font-size: 15.5px; }
li { margin-bottom: 9px; }
li::marker { color: var(--gold); }

/* inline code (never inside figure.code, which styles its own block) */
p code, li code, td code, .lock code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em; background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; padding: 1.5px 6px; color: var(--gold-light);
}

/* ---------- callout ---------- */
.callout {
  margin-top: 20px; background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--gold); border-radius: 12px; padding: 18px 20px;
}
.callout p { margin-top: 0; }
.callout p + p { margin-top: 10px; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; margin-top: 18px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14.5px; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--gold-light); font-weight: 600; font-size: 13px; letter-spacing: 0.3px; text-transform: uppercase; }
td { color: var(--muted); }
td strong { color: var(--text); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- code ---------- */
figure.code {
  margin-top: 18px; background: #0d0d0d; border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
figure.code figcaption {
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
figure.code pre { margin: 0; padding: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
figure.code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.8px; line-height: 1.65; color: #d8d8d8; white-space: pre;
}
.c-com { color: #6f7c6f; }
.c-key { color: #c99bf0; }
.c-str { color: var(--gold-light); }
.c-fn  { color: #7fb8f5; }
figure.code figcaption b { color: var(--gold-light); font-weight: 600; }

/* ---------- phone showcase ---------- */
.phones {
  display: flex; gap: 24px; overflow-x: auto; padding: 26px 4px 16px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.phones::after { content: ""; flex: 0 0 1px; }
.phone { flex: 0 0 auto; scroll-snap-align: center; width: 244px; }
.bezel {
  border-radius: 34px; border: 1px solid #3d3d3d; background: #0a0a0a; padding: 9px;
  /* Large blur radii are expensive to rasterize and repaint as the scroll passes them.
     28px reads almost identically against this background at a fraction of the cost. */
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5);
}
/* height:auto is required — the intrinsic height attribute is a presentation hint that wins
   over width:100% alone, which stretches each screenshot to its full pixel height. The
   width/height pair stays for the aspect-ratio hint that prevents layout shift on load. */
.bezel img { display: block; width: 100%; height: auto; border-radius: 26px; }
.phone-caption { text-align: center; margin-top: 13px; }
.phone-caption b { display: block; font-size: 13.5px; font-weight: 600; }
.phone-caption span { font-size: 12.5px; color: var(--muted); }
.note {
  margin-top: 10px; font-size: 12.5px; color: var(--muted); text-align: center;
  font-style: italic;
}

/* ---------- incident cards ---------- */
.incidents { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 20px; }
.incident {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px;
}
.incident h4 { font-size: 15.5px; font-weight: 600; color: var(--text); }
.incident p { font-size: 14.5px; margin-top: 9px; }
.incident .lock {
  display: block; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 13.5px; color: var(--gold-light);
}

/* ---------- contacts ---------- */
.contacts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.contact {
  flex: 1 1 280px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 20px;
}
.contact .label {
  display: block; font-size: 11.5px; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 5px;
}
.contact a { font-size: 15px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.contact a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
footer {
  margin-top: clamp(56px, 9vw, 88px); padding: 34px 0 46px;
  border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: 13.5px;
}
footer .links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ==========================================================================
   Homepage components
   ========================================================================== */

/* hero */
h1 .tens { color: var(--gold); }
.tagline { margin-top: 12px; font-size: clamp(16px, 2.5vw, 20px); color: var(--muted); font-weight: 500; }
.coming {
  display: inline-block; margin-top: 28px; padding: 10px 22px;
  border: 1px solid var(--gold); border-radius: 999px;
  color: var(--gold); font-weight: 600; font-size: 14px; letter-spacing: 0.4px;
}
/* display:block is required. The base h2 rule makes headings flex containers (so the
   engineering page can sit a number beside the title), and text-align does not centre
   flex items — the marketing headings rendered left-aligned until this reset them. */
.section-title {
  display: block; text-align: center;
  font-size: clamp(22px, 3.5vw, 30px); font-weight: 700;
}
.section-sub { text-align: center; color: var(--muted); font-size: 15px; margin: 10px auto 0; max-width: 640px; }

/* Flex, not grid: with an auto-fit grid a row that cannot hold every card leaves the last one
   stranded at one-third width. Letting cards GROW means a leftover stretches to fill its row, so
   the section reads as deliberate at desktop, tablet and phone alike. */
.features { display: flex; flex-wrap: wrap; gap: 20px; padding-top: 26px; }
.feature {
  flex: 1 1 260px; background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 28px; text-align: center;
}
.feature .icon { font-size: 28px; text-align: center; }
.feature h3 { font-size: 18px; font-weight: 600; margin: 14px 0 8px; color: var(--text); }
.feature p { font-size: 14.5px; margin-top: 0; }
.feature strong { color: var(--gold-light); font-weight: 600; }

/* the loop, as numbered steps */
.steps { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.step {
  flex: 1 1 150px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px; text-align: center;
}
.step b { display: block; font-size: 11px; letter-spacing: 1px; color: var(--gold); font-weight: 700; }
.step span { display: block; font-size: 14.5px; font-weight: 600; margin-top: 6px; }
.step em { display: block; font-size: 13px; color: var(--muted); font-style: normal; margin-top: 4px; }

/* comparison grid */
.compare-grid { margin-top: 26px; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.compare-row { display: grid; grid-template-columns: 1fr 1fr; }
.compare-row + .compare-row { border-top: 1px solid var(--border); }
.compare-row.head { background: var(--surface); font-weight: 700; font-size: 14px; }
.compare-cell { padding: 16px 18px; font-size: 13.5px; color: var(--muted); text-align: center; }
.compare-cell.us { background: rgba(212, 175, 55, 0.05); }
.compare-cell .lbl {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; margin-bottom: 3px;
}
.compare-cell.us .lbl { color: var(--gold); }
.compare-cell.them .lbl { color: var(--muted); }
@media (max-width: 620px) {
  .compare-row { grid-template-columns: 1fr; }
  .compare-cell.them { border-top: 1px dashed var(--border); }
  .compare-row.head .compare-cell.them { display: none; }
}

/* honesty note under a claim */
.fineprint { margin-top: 14px; font-size: 12.5px; color: var(--muted); font-style: italic; text-align: center; }

/* small utilities that replaced inline style attributes (CSP forbids those now) */
.emblem { margin-bottom: 6px; }
.hi { color: var(--gold); }
b.hi, .section-sub b.hi { color: var(--text); font-weight: 700; }
.compare-cell.us.hi { color: var(--gold); }

/* ==========================================================================
   Legal pages (privacy, terms) — body class="legal"
   A narrower measure and plainer typography than the marketing pages. These
   override the shared defaults above, so they must stay specific.
   ========================================================================== */
body.legal { line-height: 1.7; }
body.legal .wrap { max-width: 820px; padding: clamp(28px, 6vw, 48px) clamp(16px, 4vw, 24px) 64px; }
a.home { color: var(--gold); text-decoration: none; font-size: 14px; font-weight: 600; }
body.legal h2 { display: block; font-size: clamp(22px, 5vw, 28px); margin: 24px 0 8px; letter-spacing: 0; }
body.legal h3 { font-size: clamp(17px, 4vw, 19px); margin: 28px 0 6px; color: var(--gold); }
body.legal h4 { font-size: 16px; margin: 20px 0 4px; color: var(--text); font-weight: 600; }
body.legal p { margin: 10px 0; font-size: 15px; color: var(--muted); }
body.legal strong { color: var(--text); }
body.legal ul { margin: 8px 0 8px 22px; padding-left: 0; font-size: 15px; }
body.legal li { font-size: 15px; color: var(--muted); margin: 4px 0; }
body.legal hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
body.legal blockquote {
  border-left: 3px solid var(--gold); background: var(--card);
  padding: 10px 16px; border-radius: 8px; margin: 14px 0;
}

/* ==========================================================================
   Small screens
   The layout is fluid by default (flex-wrap, clamp(), overflow-x on the wide
   things), so these are corrections rather than a separate mobile layout.
   ========================================================================== */

/* Nothing should ever push the page sideways. Wide content — tables, code blocks, the
   phone rail — scrolls inside its own container instead. */
html, body { max-width: 100%; overflow-x: hidden; }

@media (max-width: 720px) {
  /* The sticky bar wrapped to two or three lines on a phone, which ate the viewport AND
     broke scroll-margin-top (anchored headings landed underneath it). Scrolling it
     sideways keeps it exactly one line tall, so the offset below stays correct. */
  nav.top {
    justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto;
    gap: 18px; padding: 12px clamp(16px, 4vw, 24px);
    scrollbar-width: none;
  }
  nav.top::-webkit-scrollbar { display: none; }
  nav.top a { flex: 0 0 auto; white-space: nowrap; }

  section { scroll-margin-top: 52px; }

  /* Phones read better a touch narrower, so more of the next one peeks in and the rail
     is visibly scrollable rather than looking like a cropped single image. */
  .phone { width: 208px; }

  /* Tighter cards — 28px of padding on a 360px screen leaves very little line length. */
  .feature { padding: 22px 20px; }
  .callout, .incident { padding: 16px 18px; }
  figure.code pre { padding: 14px; }
  figure.code code { font-size: 12px; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { gap: 10px; }
  .step { flex: 1 1 100%; }
}
