/*
  Rivian Tires — design system
  Direction: clean & technical. The aesthetic reference is an instrument panel /
  spec sheet, not an adventure brand. Trust comes from precision: a real
  monospace for data, tight tabular alignment, restrained color, hairline rules.

  Deliberately NOT the AI-design default (cream + serif + terracotta). The one
  risk taken here: a near-black "instrument" surface for data tables, with a
  single signal-green accent used only for live/active data — borrowed from the
  vocabulary of a vehicle dash, which is the subject's actual world.
*/

:root {
  /* Surfaces */
  --bg: #ffffff;
  --bg-panel: #0e1113;      /* instrument-panel dark, used for data surfaces */
  --bg-subtle: #f4f5f6;
  --border: #e2e5e8;
  --border-strong: #c8cdd2;

  /* Ink */
  --ink: #14181b;
  --ink-soft: #5a636b;
  --ink-invert: #e8ebed;
  --ink-invert-soft: #9aa3aa;

  /* Signal — used sparingly, only for active/live data */
  --signal: #3ddc84;        /* dash-green */
  --signal-ink: #0a3d22;
  --warn: #e8643c;          /* for the R2 21" "trap" flag */

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* Scale */
  --container: 1080px;
  --radius: 6px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-panel);
  color: var(--signal);
  padding: 4px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.site-nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--ink); }

/* ---- Hero ---- */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  max-width: 16ch;
}
.hero p {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 28px;
}
.hero-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-meta::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.2);
}

/* ---- Model selector cards ---- */
.section { padding: 56px 0; }
.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin: 0 0 6px;
}
.section h2 {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 760px) {
  .model-grid { grid-template-columns: 1fr; }
}
.model-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.model-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.model-card .mc-name {
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.model-card .mc-body {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.model-card .mc-count {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}
.model-card .mc-arrow { color: var(--signal-ink); font-weight: 600; }

/* ---- Fitment table (the instrument panel) ---- */
.fitment {
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 4px;
  overflow: hidden;
}
.fitment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--ink-invert);
}
.fitment-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-invert-soft);
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
}
.fitment-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}
.fitment-table tr:last-child td { border-bottom: none; }
.fitment-table .wheel-size {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
}
.fitment-table .wheel-name {
  font-size: 12px;
  color: var(--ink-invert-soft);
}
.fitment-table .tire-name { font-weight: 600; }
.fitment-table .tire-size {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal);
  margin-top: 2px;
}
.fitment-table .rating {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-invert-soft);
  white-space: nowrap;
}
.fitment-table .notes {
  font-size: 13px;
  color: var(--ink-invert-soft);
  line-height: 1.5;
  max-width: 38ch;
}
.flag-warn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--warn);
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

/* Placeholder strip for the future sentiment engine */
.sentiment-slot {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-invert-soft);
  opacity: 0.6;
  font-style: italic;
}

/* ---- Future-section teaser ---- */
.teaser {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--bg-subtle);
}
.teaser .badge {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--signal-ink);
  background: rgba(61, 220, 132, 0.16);
  padding: 3px 8px;
  border-radius: 3px;
}
.teaser h3 { margin: 14px 0 8px; font-size: 1.2rem; letter-spacing: -0.01em; }
.teaser p { margin: 0; color: var(--ink-soft); max-width: 60ch; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 40px;
}
.footer-note, .footer-affiliate {
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 70ch;
  margin: 0 0 8px;
}

/* ---- Generic page prose (model pages) ---- */
.page-head { padding: 56px 0 24px; }
.page-head h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.page-head .gen {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.page-head p { font-size: 1.1rem; color: var(--ink-soft); max-width: 62ch; }

/* Focus visibility for keyboard users */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--signal-ink);
  outline-offset: 2px;
}
