/* Shared stylesheet for the vertical-page templates: drive, flight,
   workout, science. Paired with the brief's alternating light/dark
   section design. */

:root {
  --bg:      #e6e0d2;
  --bg-2:    #dcd4c1;
  --bg-dark: #0f0f0e;
  --ink:     #1f1a12;
  --ink-soft:  rgba(26,23,20,.62);
  --ink-quiet: rgba(26,23,20,.38);
  --hair:      rgba(26,23,20,.22);
  --cream:     #ece4d6;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Newsreader", "EB Garamond", Garamond, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; color: var(--ink); }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif); font-weight: 400;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  min-height: 100vh;
}

.grain {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.1  0 0 0 0 0.1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Fixed chrome ---------- */
.chrome { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.chrome > * { pointer-events: auto; }
.wordmark {
  position: absolute; top: 28px; left: 32px;
  font-family: var(--mono); font-weight: 400; font-size: 11.5px;
  letter-spacing: .22em; color: var(--ink);
}
.wordmark a { color: inherit; text-decoration: none; }
.wordmark .p { color: var(--ink-quiet); }
.nav {
  position: absolute; top: 28px; right: 32px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; color: var(--ink);
}
.nav a {
  color: inherit; text-decoration: none;
  display: inline-flex; gap: 6px;
  opacity: 1; transition: opacity .2s;
}
.nav a[aria-current="page"] { opacity: 1; font-weight: 500; }
.nav a:hover { opacity: .65; }
.nav .arr { font-size: 9px; opacity: .8; transform: translateY(-1px); }

/* Chrome adapts to the section currently underneath it.
   vertical.js toggles `body.chrome-dark` based on which alternating
   section is at the top of the viewport — without this, the
   ink-coloured wordmark/nav disappear over the dark sections.
   Soft .35s colour transition so the swap is barely perceptible. */
.wordmark,
.wordmark a,
.wordmark .p,
.nav,
.nav a { transition: color .35s ease; }
body.chrome-dark .wordmark,
body.chrome-dark .wordmark a,
body.chrome-dark .nav,
body.chrome-dark .nav a { color: var(--cream); }
body.chrome-dark .wordmark .p { color: rgba(236, 228, 214, 0.38); }

/* ---------- Section theming (light / dark alternating) ---------- */
.vp-section, .vp-hero {
  padding: 16vh 6vw;
  position: relative;
}
.vp-hero {
  min-height: 100vh;
  display: flex; align-items: center;
}
.vp-section.dark, .vp-hero.dark {
  background: var(--bg-dark); color: var(--cream);
}
.vp-section.light {
  background:
    radial-gradient(ellipse 110% 90% at 50% 30%,
      color-mix(in srgb, var(--bg) 96%, white) 0%,
      var(--bg) 45%,
      color-mix(in srgb, var(--bg) 78%, black) 100%);
}
.vp-inner { max-width: 1200px; margin: 0 auto; width: 100%; }
.vp-2col {
  display: grid; grid-template-columns: 1fr 3fr; gap: 6vw;
  align-items: start;
}

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--mono); font-weight: 500;
  font-size: 10.5px; letter-spacing: .3em;
  text-transform: uppercase; opacity: .7;
  margin-bottom: 4vh;
}
.col-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em;
  text-transform: uppercase; opacity: .45;
  margin-bottom: 4vh;
}
.display-headline {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(48px, 6.4vw, 108px);
  line-height: 0.98; letter-spacing: -0.02em;
  margin: 0 0 4vh;
  max-width: 14ch;
  text-wrap: balance;
}
.display-headline em { font-style: italic; }
.display-line {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(32px, 3.8vw, 58px);
  line-height: 1.05; letter-spacing: -0.018em;
  margin: 0 0 6vh;
  max-width: 22ch;
  text-wrap: balance;
}
.display-line em { font-style: italic; }
.subheadline {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.5;
  max-width: 46ch;
  margin: 0;
  opacity: .75;
}
.lead {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(19px, 1.7vw, 24px);
  line-height: 1.55;
  max-width: 48ch;
  margin: 0 0 1.3em;
  text-wrap: pretty;
}
.lead.soft { opacity: .72; }
.lead em { font-style: italic; }
.vp-body {
  font-family: var(--serif); font-weight: 400;
  font-size: 18px; line-height: 1.65;
  max-width: 56ch;
  text-wrap: pretty;
}
.vp-body p { margin: 0 0 1.3em; }
.vp-body em { font-style: italic; }
.vp-section.dark .lead.soft { opacity: .55; }
.vp-section.dark .col-label { opacity: .55; }

/* ---------- Playground (three states) ---------- */
.playground .states {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 4vh;
}
.state {
  padding: 40px;
  border: 1px solid rgba(236,228,214,0.15);
  border-radius: 2px;
  background: rgba(236,228,214,0.03);
}
.state-meta {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em;
  text-transform: uppercase; margin-bottom: 1.6em;
  color: var(--cream); opacity: .85;
}
.state-meta .dot { opacity: .5; padding: 0 4px; }
.state p {
  font-family: var(--serif); font-weight: 400;
  font-size: 17px; line-height: 1.55;
  margin: 0;
  opacity: .78;
}

/* ---------- Metrics grid (for the science page) ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 4vh 0 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.metric {
  padding: 5vh 3vw;
  border-right: 1px solid var(--hair);
}
.metric:last-child { border-right: none; }
.metric-num {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(48px, 5.2vw, 80px);
  line-height: 1; letter-spacing: -0.02em;
  margin-bottom: 0.4em;
}
.metric-num em { font-style: italic; }
.metric-label {
  font-family: var(--serif); font-weight: 400;
  font-size: 16px; line-height: 1.45;
  opacity: .72;
  max-width: 28ch;
}
.vp-section.dark .metrics { border-color: rgba(236,228,214,0.15); }
.vp-section.dark .metric { border-color: rgba(236,228,214,0.15); }

/* ---------- CTA section ---------- */
.cta-section .cta-headline {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 1.1; letter-spacing: -0.015em;
  margin: 4vh 0;
  max-width: 28ch;
  text-wrap: balance;
}
.cta-section .cta-headline em { font-style: italic; }
.pill-cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono); font-weight: 500;
  font-size: 11.5px; letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  transition: background .22s ease, color .22s ease;
}
.pill-cta:hover { background: var(--ink); color: var(--bg); }
.vp-section.dark .pill-cta { color: var(--cream); }
.vp-section.dark .pill-cta:hover { background: var(--cream); color: var(--bg-dark); }
.pill-cta .arr { font-size: 12px; }

/* ---------- Footer (shared minimal) ---------- */
footer {
  background: var(--bg-dark);
  color: rgba(236,228,214,.62);
  padding: 40px 6vw;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .22em;
  text-transform: uppercase;
}
.footer-inner {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 40px; align-items: center;
}
.footer-inner > :first-child { text-align: left;   color: var(--cream); }
.footer-inner > :nth-child(2) {
  text-align: center; opacity: .55; letter-spacing: .14em;
  text-transform: none; font-family: var(--serif);
  font-size: 14px; font-style: italic;
}
.footer-inner > :last-child { text-align: right; }
.footer-inner a { color: inherit; text-decoration: none; }
.footer-inner a:hover { color: var(--cream); }

@media (max-width: 1023px) {
  .vp-2col { grid-template-columns: 1fr; }
  .playground .states { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .metric { border-right: none; border-bottom: 1px solid var(--hair); }
  .metric:last-child { border-bottom: none; }
}

@media (max-width: 767px) {
  /* Compact chrome on mobile — wordmark stays top-left, the
     top-right nav is HIDDEN since the footer carries the full
     nav inventory and the chrome nav would crowd the headline. */
  .wordmark { top: 24px; left: 24px; font-size: 11px; }
  .nav { display: none; }

  /* Tighter section padding so content claims more of the screen. */
  .vp-section, .vp-hero {
    padding: 64px 24px;
  }
  .vp-hero {
    padding-top: 88px;  /* leave room for wordmark */
  }

  /* Display headline scales down. */
  .display-headline {
    font-size: clamp(40px, 10vw, 64px);
    line-height: 1.04;
  }
  .display-line {
    font-size: clamp(28px, 7vw, 40px);
  }
  .cta-section .cta-headline {
    font-size: clamp(28px, 7vw, 40px);
  }

  /* Touch-friendly CTA button. */
  .pill-cta {
    padding: 18px 28px;
    font-size: 12px;
    letter-spacing: .18em;
  }

  /* Footer — single column, bigger touch targets. */
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 16px;
  }
  .footer-inner > :first-child,
  .footer-inner > :last-child { text-align: center; }
  .footer-inner a {
    display: inline-block;
    padding: 8px 4px;
  }
}

/* Reduced-motion: honor OS setting. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
