/* DriverPeak marketing site — visual tokens deliberately reuse the real
   app's light-theme palette (frontend/src/index.css) so the marketing
   site and the product feel like the same thing, not a disconnected
   brand exercise. Only the F1 delta-strip colors below are new and
   specific to this page — see that block's own comment for why they're
   a separate color job from the rest of the palette. */

:root {
  --bg: #ffffff;
  --bg-panel: #f7f8fa;
  --bg-panel-raised: #eef0f3;
  --border: #e2e5e9;
  --border-strong: #d1d5db;

  --text: #14171c;
  --text-dim: #6b7280;

  --accent: #0e7490;
  --accent-dim: #38a3b8;
  --accent-bg: rgba(14, 116, 144, 0.08);

  /* Same values as frontend/src/index.css's confidence badges — shown
     here for the honesty/confidence section, which deliberately
     reuses the REAL app's badge colors (this is showing the actual
     product's actual signal, not a marketing-only recreation). */
  --confidence-high: #15803d;
  --confidence-medium: #b45309;
  --confidence-low: #c2410c;
  --confidence-single: #6b7280;
  --confidence-none: #dc2626;

  /* F1 sector-timing delta convention — purple/green/yellow — used
     ONLY for the hero's delta-strip visual below the track animation.
     This is a DIFFERENT semantic than the confidence badges above:
     confidence colors mean "how much to trust this lap's detection,"
     these mean "gained/lost time vs. a reference lap," the same
     distinction documented in frontend/src/components/DeltaStripChart.jsx.
     No official FOM/F1 hex values are published anywhere public — these
     are reasonable, WCAG-mindful approximations of the broadcast
     convention (purple = personal/session best, green = gaining,
     yellow = losing), not an official palette. Yellow needs a
     separate, darker value for text/badge use since the fill color
     itself fails contrast on a light background.
     TODO(#5, deferred per explicit scope gate): whether/how this same
     convention gets applied to the real app's DeltaStripChart.jsx is
     an open question reported separately, not implemented here. */
  --delta-purple: #9c00b0;
  --delta-green: #00913f;
  --delta-yellow-fill: #ffd60a;
  --delta-yellow-text: #b8860b;

  /* i18n font-stack notes (task #110/#111):
     No @font-face / webfont <link> exists anywhere in this site — 'Inter' and
     'JetBrains Mono' are unloaded and only render if present on the visitor's
     system; otherwise every visitor already falls through to system-ui/Segoe UI/
     Roboto (sans) or ui-monospace/SF Mono/Consolas (mono).
     Cyrillic (Russian): those fallback system fonts have full Cyrillic coverage
     on their respective platforms (Segoe UI/Windows, San Francisco via system-ui/
     macOS, Roboto/Android & ChromeOS) — no additional fallback needed.
     CJK (Japanese, Simplified Chinese): none of the above stacks include CJK
     glyphs, so Noto Sans JP / Noto Sans SC are added explicitly below.
     Deferred, not solved here: per-locale line-height/letter-spacing tuning for
     CJK and Arabic (needs real content review, not guessed now) and CJK
     line-breaking rules (word-break/line-break behave differently for ja/zh and
     aren't addressed by this font-stack change alone). */
  --sans: 'Inter', system-ui, 'Segoe UI', Roboto, 'Noto Sans JP', 'Noto Sans SC', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, 'Noto Sans JP', 'Noto Sans SC', monospace;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.6 var(--sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

img {
  max-width: 100%;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

.lang-suggest-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

.lang-suggest-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.lang-suggest-link:hover {
  text-decoration: underline;
}

.lang-suggest-dismiss {
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 4px;
  margin-inline-start: 4px;
}

.lang-suggest-dismiss:hover {
  color: var(--text);
}

.lang-switcher {
  position: relative;
}

.lang-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  cursor: pointer;
}

.lang-switcher-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.lang-switcher-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 30;
  /* Menu items are anchored to the switcher button's inline-end edge
     regardless of page direction, since the button itself sits at the
     end of a horizontal nav row in both LTR and RTL layouts. */
}

.lang-switcher-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  text-align: start;
}

.lang-switcher-menu a:hover {
  background: var(--bg-panel);
}

.lang-switcher-menu a[aria-current="true"] {
  font-weight: 700;
  color: var(--delta-purple);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: #0b5f75;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}

.btn-lg {
  padding: 13px 26px;
  font-size: 15px;
}

/* ── Hero ── */

.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(1200px 480px at 50% -120px, var(--accent-bg), transparent 70%),
    var(--bg);
}

.hero-inner {
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 32px;
}

.hero-ctas {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hero-ctas-note {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 48px;
}

/* ── Track animation panel ── */

.track-panel {
  max-width: 980px;
  margin: 0 auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 28px 20px;
}

.track-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.track-name {
  font-weight: 700;
  font-size: 15px;
  transition: opacity 0.25s ease;
}

.track-location {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
}

#hero-track-svg {
  width: 100%;
  height: auto;
  display: block;
}

#hero-track-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Delta strip ── */

.delta-strip-wrap {
  margin-top: 6px;
}

.delta-strip-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-family: var(--mono);
}

.delta-strip {
  display: flex;
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.delta-seg {
  height: 100%;
}

.delta-legend {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.delta-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.delta-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* ── Stat row ── */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  max-width: 980px;
  margin: 40px auto 0;
  text-align: start;
}

.stat {
  /* Logical properties (not left/right) — RTL-ready for Arabic:
     "inline-start" flips automatically with <html dir="rtl">, so the
     accent border sits on the correct reading-order side in every
     locale without a separate RTL stylesheet. */
  border-inline-start: 2px solid var(--border-strong);
  padding-inline-start: 14px;
}

.stat-value {
  font-size: 15px;
  font-weight: 700;
}

.stat-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ── Generic sections ── */

section.section {
  padding: 80px 0;
}

section.section.alt {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 48px;
}

.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(26px, 3.5vw, 34px);
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.section-head p {
  color: var(--text-dim);
  font-size: 16px;
  margin: 0;
}

/* ── How it works ── */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.step {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.step p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* ── Feature split ── */

.audience-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.audience-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}

.audience-card h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.audience-card .audience-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 24px;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-list li {
  display: flex;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.feature-list .check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-top: 1px;
}

.feature-list strong {
  display: block;
  color: var(--text);
}

.feature-list .feature-detail {
  color: var(--text-dim);
}

/* ── Honesty / confidence section ── */

.confidence-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.confidence-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.confidence-badge.high {
  color: var(--confidence-high);
  background: rgba(21, 128, 61, 0.1);
}

.confidence-badge.low {
  color: var(--confidence-low);
  background: rgba(194, 65, 12, 0.1);
}

.confidence-card .note {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin: 0;
}

.confidence-card .note-caption {
  font-size: 12px;
  color: var(--text-dim);
  margin: 10px 0 0;
}

/* ── Pricing ── */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.price-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.price-tier {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.founding-badge {
  position: absolute;
  top: -12px;
  inset-inline-end: 24px; /* logical — flips to the correct corner under RTL */
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 5px 10px;
  border-radius: 999px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.price-anchor {
  font-size: 18px;
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: var(--confidence-none);
}

.price-now {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.price-period {
  font-size: 14px;
  color: var(--text-dim);
}

.price-scarcity {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 20px;
}

.price-card .feature-list {
  margin-bottom: 28px;
  flex-grow: 1;
}

.price-card .feature-list li {
  font-size: 13.5px;
}

.price-cta {
  width: 100%;
}

.pricing-footnote {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 36px;
}

.pricing-footnote a {
  font-weight: 600;
}

/* ── Footer ── */

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  color: var(--text-dim);
  font-size: 13px;
}

/* ── Draft banner (legal pages) ── */

.draft-banner {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #991b1b;
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 14px;
  margin-bottom: 32px;
}

.draft-banner strong {
  display: block;
  margin-bottom: 4px;
}

.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.legal-content h1 {
  font-size: 30px;
  margin-bottom: 8px;
}

.legal-content .updated {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 32px;
}

.legal-content .draft-note {
  color: var(--text-dim);
  font-size: 13px;
  margin: -20px 0 32px;
}

.legal-content h2 {
  font-size: 19px;
  margin: 40px 0 12px;
  letter-spacing: -0.01em;
}

.legal-content p,
.legal-content li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

.legal-content ul,
.legal-content ol {
  padding-inline-start: 22px;
  margin: 12px 0;
}

.legal-content li {
  margin-bottom: 6px;
}

.legal-content strong {
  font-weight: 700;
}

.legal-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* Bracketed placeholder notes from the drafted content (sections not
   yet written — billing, disclaimers, liability, governing law) —
   kept visually distinct rather than styled like finished text, so
   they can't be mistaken for real, reviewed language at a glance. */
.legal-content .legal-todo {
  display: block;
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.25);
  color: #92400e;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-style: italic;
  margin: 8px 0;
}

.legal-content .final-reminder {
  margin-top: 40px;
  padding: 16px 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}

/* ── Responsive ── */

@media (max-width: 860px) {
  .steps,
  .audience-split,
  .confidence-examples,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .track-panel {
    padding: 20px 16px 16px;
  }
}
