/* =========================================================
   F1 StratLab — Landing page styles
   Consumes tokens from colors_and_type.css
   ========================================================= */

* { box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }

/* ---------- LAYOUT ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
}
.section {
  padding: 120px 0;
  position: relative;
}
.section-lg { padding: 160px 0; }
.section-sm { padding: 72px 0; }
.hairline-top { border-top: 1px solid var(--hairline); }
.hairline-bot { border-bottom: 1px solid var(--hairline); }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: 68px;
  z-index: 50;
  background: rgba(8,8,12,0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1360px; margin: 0 auto; padding: 0 32px;
  height: 100%;
  display: flex; align-items: center; gap: 32px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex; gap: 28px; margin-left: 16px;
  font-size: 14px; color: var(--fg-2);
  position: relative;
}
.nav-links a {
  padding: 4px 0;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--fg-1); }
.nav-links a.active { color: var(--purple-300); }
.nav-bar {
  position: absolute;
  bottom: -12px;
  height: 2px;
  background: linear-gradient(90deg, var(--purple-400), var(--purple-300));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(162, 155, 254, 0.45);
  pointer-events: none;
  transition: left 0.32s cubic-bezier(0.2, 0, 0, 1),
              width 0.32s cubic-bezier(0.2, 0, 0, 1),
              opacity 0.25s ease;
}
.nav-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }

/* ---------- MOBILE HAMBURGER NAV ---------- */
/* Hidden on desktop, shown below 900px via the media query further down. */
.nav-mobile { display: none; position: relative; margin-left: auto; }
.nav-mobile > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--fg-1);
  display: inline-flex;
  align-items: center;
  user-select: none;
}
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile > summary::marker { display: none; }
.nav-mobile[open] > summary { background: var(--bg-2); }
.nav-mobile-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--bg-2);
  border: 1px solid var(--divider);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 20;
  animation: navMobileIn 0.18s cubic-bezier(0.2,0,0,1);
}
.nav-mobile-panel a {
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--fg-2);
  font-size: 14px;
  display: block;
  transition: background 0.15s, color 0.15s;
}
.nav-mobile-panel a:hover { background: var(--bg-3); color: var(--fg-1); }
.nav-mobile-panel a.active { color: var(--purple-300); background: rgba(108,92,231,0.12); }
.nav-mobile-panel a.primary {
  background: var(--purple-600);
  color: #fff;
  margin-top: 4px;
  text-align: center;
  font-weight: 500;
}
.nav-mobile-panel a.primary:hover { background: var(--purple-500); color: #fff; }
.nav-mobile-panel hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 6px 4px;
}
@keyframes navMobileIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 10px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2,0,0,1);
  white-space: nowrap;
}
.btn-primary {
  background: var(--purple-600); color: #fff;
  box-shadow: 0 0 0 1px rgba(162,155,254,0.25), 0 8px 24px rgba(108,92,231,0.35);
}
.btn-primary:hover { background: var(--purple-500); box-shadow: 0 0 0 1px rgba(162,155,254,0.4), 0 12px 32px rgba(108,92,231,0.45); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent; color: var(--fg-1);
  border-color: var(--divider);
}
.btn-ghost:hover { background: var(--bg-3); border-color: var(--divider-strong); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

/* ---------- PILLS / BADGES ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: rgba(108,92,231,0.12);
  color: var(--purple-300);
  border: 1px solid rgba(108,92,231,0.28);
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--purple-300); box-shadow: 0 0 8px currentColor; }
.pill-mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0; }
.pill-neutral {
  background: rgba(255,255,255,0.04);
  color: var(--fg-2);
  border-color: var(--divider);
}
.pill-live { background: rgba(67,255,100,0.08); color: #43ff64; border-color: rgba(67,255,100,0.22); }
.pill-live .pill-dot { background: #43ff64; animation: pulse-dot 1.8s infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---------- EYEBROW ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--purple-300);
}
.eyebrow-bar {
  width: 24px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-400));
}

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-3);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-card), var(--shadow-inset);
  transition: all 0.18s cubic-bezier(0.2,0,0,1);
}
.card:hover {
  background: var(--bg-4);
  border-color: var(--divider-strong);
  box-shadow: var(--shadow-elev), var(--shadow-inset);
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 140px 0 120px;
  overflow: hidden;
}
.hero-halo {
  position: absolute; inset: 0;
  background: var(--grad-hero);
  pointer-events: none;
  z-index: 0;
}
.hero-grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, black 30%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 2; text-align: center; }
.hero-eyebrow { justify-content: center; margin-bottom: 28px; }
.hero h1 {
  font-size: clamp(44px, 7.6vw, 96px);
  letter-spacing: -0.035em;
  line-height: 1.02;
  font-weight: 600;
  margin-bottom: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #d6d0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero h1 .accent {
  background: linear-gradient(120deg, #a29bfe 0%, #6c5ce7 60%, #3385ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  max-width: 680px; margin: 0 auto;
  font-size: 19px; line-height: 1.55;
  color: var(--fg-2);
}
.hero-ctas {
  margin-top: 40px;
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.hero-meta {
  margin-top: 28px;
  display: flex; justify-content: center; gap: 28px;
  font-size: 13px; color: var(--fg-3);
  flex-wrap: wrap;
}
.hero-meta strong { color: var(--fg-1); font-weight: 500; }
.hero-meta code { color: var(--purple-300); font-size: 12px; }

/* ---------- HERO CENTERPIECE SLOT ---------- */
.hero-viz {
  margin: 72px auto 0;
  max-width: 1120px;
  position: relative; z-index: 1;
}

/* ---------- SECTION HEADERS ---------- */
.section-head {
  max-width: 760px;
  margin: 0 auto 64px;
  text-align: center;
}
.section-head.left { margin-left: 0; text-align: left; }
.section-head .eyebrow { margin-bottom: 20px; }
.section-head h2 {
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 18px;
}
.section-head p {
  font-size: 18px; line-height: 1.55;
  color: var(--fg-2);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- UTILITIES ---------- */
.mono { font-family: var(--font-mono); }
.muted { color: var(--fg-3); }
.dim   { color: var(--fg-2); }
.hairline { height: 1px; background: var(--hairline); }
.center { text-align: center; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .nav-links { display: none; }
  .nav-right { display: none; }
  .nav-mobile { display: block; }
  .hero { padding: 120px 0 80px; }
}

/* ---------- SCROLL REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s cubic-bezier(0.2,0,0,1), transform 0.9s cubic-bezier(0.2,0,0,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- CODE BLOCK ---------- */
.codeblock {
  background: var(--bg-1);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--fg-1);
  position: relative;
  overflow-x: auto;
  white-space: pre;
}
.codeblock .c-comment { color: var(--fg-3); }
.codeblock .c-cmd     { color: var(--purple-300); }
.codeblock .c-str     { color: #9ae6b4; }
.codeblock .c-flag    { color: #f6ad55; }
.code-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-2);
  border-radius: 12px 12px 0 0;
}
.code-chrome .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.12); }
.code-chrome .label { margin-left: 10px; font-size: 12px; color: var(--fg-3); font-family: var(--font-mono); }
.code-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--divider); }
.code-wrap .codeblock { border: 0; border-radius: 0; }

/* ---------- STAT ---------- */
.stat-tile {
  padding: 24px;
  border: 1px solid var(--divider);
  border-radius: 14px;
  background: var(--bg-3);
  display: flex; flex-direction: column; gap: 6px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 40px; font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-num.accent { color: var(--purple-300); }
.stat-label { font-size: 13px; color: var(--fg-3); }
.stat-sub { font-size: 12px; color: var(--fg-4); font-family: var(--font-mono); }

/* ---------- TIRE CHIP ---------- */
.tire {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tire-swatch {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor;
}
.tire.soft   { color: var(--tire-soft); }
.tire.medium { color: var(--tire-medium); }
.tire.hard   { color: var(--tire-hard); }
.tire.inter  { color: var(--tire-inter); }
.tire.wet    { color: var(--tire-wet); }

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 72px 0 40px;
  background: var(--bg-1);
}
.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
}
.footer-brand-copy {
  max-width: 320px;
  font-size: 14px;
  color: var(--fg-3);
  line-height: 1.6;
  margin-top: 16px;
}
.footer-col-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-3);
  margin-bottom: 16px;
  font-weight: 600;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--fg-2);
  padding: 6px 0;
}
.footer-col a:hover { color: var(--fg-1); }
.footer-legal {
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--fg-4);
  flex-wrap: wrap; gap: 16px;
}
@media (max-width: 900px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

/* ---------- TWEAKS PANEL ---------- */
.tweaks-panel {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 280px;
  background: var(--bg-2);
  border: 1px solid var(--divider-strong);
  border-radius: 14px;
  padding: 16px;
  z-index: 100;
  box-shadow: var(--shadow-elev);
  font-size: 13px;
}
.tweaks-panel h4 {
  font-family: var(--font-display);
  font-size: 13px;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  font-weight: 600;
}
.tweaks-panel .tweak-row { margin-bottom: 12px; }
.tweaks-panel .tweak-label { color: var(--fg-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.tweaks-panel .tweak-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.tweaks-panel .tweak-opt {
  padding: 6px 10px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--fg-2);
  font-size: 12px;
  cursor: pointer;
}
.tweaks-panel .tweak-opt.active {
  background: var(--purple-600);
  border-color: var(--purple-500);
  color: #fff;
}

@media (max-width: 640px) {
  .tweaks-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 12px;
    padding: 12px;
  }
  .codeblock {
    font-size: 12px;
    padding: 14px 16px;
  }
  .code-chrome .label { font-size: 11px; }
  .nav-inner { padding: 0 16px; gap: 16px; }
  .nav-right { gap: 8px; }
  .nav-right .btn-sm { padding: 0 10px; font-size: 12px; }
  .logo { font-size: 14px; }
  .hero { padding: 96px 0 60px; }
  .hero-eyebrow {
    flex-wrap: wrap;
    justify-content: center;
    font-size: 10px;
    letter-spacing: 0.14em;
    padding: 0 8px;
    line-height: 1.6;
  }
  /* Hide the 1px side bars on mobile — they can wrap alone onto their own
     line when the eyebrow text breaks, leaving ugly stray marks. */
  .hero-eyebrow .eyebrow-bar { display: none; }
  .hero-sub { font-size: 16px; }
  .hero-ctas { gap: 10px; }
  .hero-ctas .btn-lg { height: 44px; padding: 0 16px; font-size: 14px; }
  .hero-meta { font-size: 12px; gap: 14px; }
  .hero-viz { margin-top: 48px; }
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 40px; }
  .section-head h2 { font-size: clamp(26px, 6.5vw, 40px); }
  .section-head p { font-size: 15px; }
  .container, .container-wide { padding: 0 16px; }
  .btn-lg { height: 44px; padding: 0 16px; font-size: 14px; }
  /* Table-like grid readouts shouldn't squeeze to unreadable on phones */
  [class*="-readout"], [class*="readout-"] { font-size: 12px; }
}
@media (max-width: 400px) {
  .container, .container-wide { padding: 0 12px; }
  .nav-inner { padding: 0 12px; gap: 10px; }
  .logo { font-size: 13px; }
  .hero { padding: 88px 0 50px; }
  .hero-sub { font-size: 15px; line-height: 1.5; }
}
