/* KeepPace — see DESIGN.md for the token rationale. Mobile-first. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #0e1626;
  --deep: #152038;
  --dusk: #1e2b45;
  --day: #f4f7fa;
  --paper: #ffffff;
  --ink: #14213a;
  --ink-soft: #4a5874;
  --moon: #e8eef7;
  --mist: #a3b1c9;
  --sun: #f5a524;
  --sun-deep: #9a5b00;
  --line-dark: rgba(232, 238, 247, 0.14);
  --line-light: #d9e0ea;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 16px;
  --max: 1200px;
  --section-pad: clamp(64px, 10vw, 128px);
  --radius-control: 6px;
  --radius-panel: 14px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 160ms;
  --header-h: 64px;
}

@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 1200px) { :root { --gutter: 32px; } }

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

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

body {
  margin: 0;
  background: var(--night);
  color: var(--moon);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--sun);
  accent-color: var(--sun);
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(245, 165, 36, 0.18);
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

ul, ol { margin: 0; padding: 0; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

::selection { background: var(--sun); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--focus, var(--moon));
  outline-offset: 3px;
  border-radius: 2px;
}

.surface-dark { color-scheme: dark; --focus: var(--moon); }
.surface-light { color-scheme: light; --focus: var(--ink); background: var(--day); color: var(--ink); }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 600;
  border-radius: var(--radius-control);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type ---------- */

.display {
  font-size: clamp(2.5rem, 1.6rem + 4.2vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.h2 {
  font-size: clamp(1.875rem, 1.45rem + 1.9vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 22ch;
}

.h3 {
  font-size: clamp(1.1875rem, 1.12rem + 0.3vw, 1.375rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.lead {
  font-size: clamp(1.125rem, 1.06rem + 0.35vw, 1.3125rem);
  line-height: 1.5;
  max-width: 54ch;
}

.prose { max-width: 66ch; }
.prose > * + * { margin-top: 1em; }

.muted { color: var(--mist); }
.surface-light .muted { color: var(--ink-soft); }

.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--fast) ease, border-color var(--fast) ease, color var(--fast) ease, transform var(--fast) var(--ease-out);
}

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

.btn-primary { background: var(--sun); color: var(--ink); }
.btn-primary:hover { background: #ffb53f; }

.btn-secondary { border-color: currentColor; color: inherit; background: transparent; }
.surface-dark .btn-secondary { border-color: rgba(232, 238, 247, 0.4); }
.surface-dark .btn-secondary:hover { border-color: var(--moon); background: rgba(232, 238, 247, 0.06); }
.surface-light .btn-secondary { border-color: #9aa7bd; }
.surface-light .btn-secondary:hover { border-color: var(--ink); background: rgba(20, 33, 58, 0.04); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 22, 38, 0.92);
  border-bottom: 1px solid var(--line-dark);
}

@supports (backdrop-filter: blur(1px)) {
  .site-header {
    background: rgba(14, 22, 38, 0.9);
    backdrop-filter: saturate(140%) blur(12px);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  color: var(--moon);
}

.brand svg { width: 28px; height: 28px; flex: none; }

.nav-desktop { display: none; }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(232, 238, 247, 0.3);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--moon);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.menu-toggle svg { width: 18px; height: 18px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

.mobile-panel {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 49;
  overflow-y: auto;
  padding: 24px var(--gutter) calc(48px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
  background: var(--night);
  border-top: 1px solid var(--line-dark);
}

.mobile-panel[hidden] { display: none; }

.mobile-panel h2 {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--mist);
  margin: 8px 0 4px;
}

.mobile-panel ul { list-style: none; }

.mobile-panel a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line-dark);
  font-size: 1.125rem;
  text-decoration: none;
}

.mobile-panel .group + .group { margin-top: 24px; }
.mobile-panel .btn { width: 100%; margin-top: 28px; }

body.menu-open { overflow: hidden; }

@media (min-width: 900px) {
  .menu-toggle, .mobile-panel { display: none !important; }

  .nav-desktop {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .nav-desktop > a:not(.btn),
  .nav-desktop .dropdown > button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--mist);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--fast) ease, background-color var(--fast) ease;
  }

  .nav-desktop > a:not(.btn):hover,
  .nav-desktop .dropdown > button:hover,
  .nav-desktop .dropdown > button[aria-expanded="true"],
  .nav-desktop a[aria-current="page"] { color: var(--moon); }

  .nav-desktop .dropdown > button svg {
    width: 14px; height: 14px;
    transition: transform var(--fast) var(--ease-out);
  }
  .nav-desktop .dropdown > button[aria-expanded="true"] svg { transform: rotate(180deg); }

  .nav-desktop .btn { margin-left: 12px; min-height: 40px; padding: 8px 16px; font-size: 0.9375rem; }

  .dropdown { position: relative; }

  .dropdown-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: -12px;
    width: 340px;
    padding: 8px;
    background: var(--deep);
    border: 1px solid var(--line-dark);
    border-radius: var(--radius-panel);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.55);
  }

  .dropdown-panel[hidden] { display: none; }
  .dropdown-panel ul { list-style: none; }

  .dropdown-panel a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--moon);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.3;
  }

  .dropdown-panel a span {
    display: block;
    margin-top: 2px;
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--mist);
  }

  .dropdown-panel a:hover,
  .dropdown-panel a[aria-current="page"] { background: rgba(232, 238, 247, 0.07); }
}

/* ---------- Sections ---------- */

.section { padding-block: var(--section-pad); }
.section-night { background: var(--night); }
.section-deep { background: var(--deep); }
.section-dusk { background: var(--dusk); }

.section-head { display: grid; gap: 20px; }
.section-head + * { margin-top: clamp(40px, 6vw, 64px); }

/* The horizon: the one place the page turns from night to day. */
.horizon {
  height: clamp(96px, 14vw, 180px);
  background:
    radial-gradient(ellipse 55% 120% at 50% 100%, rgba(245, 165, 36, 0.38), rgba(245, 165, 36, 0) 70%),
    linear-gradient(180deg, var(--dusk) 0%, #34425f 38%, #8e9bb2 72%, #dfe6ef 92%, var(--day) 100%);
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(40px, 6vw, 72px) clamp(56px, 8vw, 104px); }

.hero-copy { display: grid; gap: 20px; }
.hero-copy .actions { margin-top: 8px; }

.thread-wrap { margin: clamp(40px, 5vw, 56px) 0 0; }

.thread-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 20px;
  font-size: 0.9375rem;
  color: var(--mist);
}

.thread-caption strong { color: var(--moon); font-weight: 500; }

/* Mobile: vertical timeline */
.thread {
  list-style: none;
  position: relative;
  display: grid;
  gap: 22px;
  padding-left: 22px;
}

.thread::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, rgba(163, 177, 201, 0.35), rgba(245, 165, 36, 0.8));
}

.thread-item { position: relative; display: grid; gap: 6px; }

.thread-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--night);
  border: 1px solid var(--mist);
}

.thread-item.is-booked::before { background: var(--sun); border-color: var(--sun); box-shadow: 0 0 0 4px rgba(245, 165, 36, 0.18); }

.thread-time {
  font-size: 0.875rem;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}

.thread-event { font-weight: 500; line-height: 1.4; }

.bubble {
  max-width: 34ch;
  padding: 12px 14px;
  border-radius: 4px 14px 14px 14px;
  background: var(--dusk);
  border: 1px solid var(--line-dark);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.bubble.from-lead {
  background: transparent;
  border-color: rgba(163, 177, 201, 0.35);
  color: var(--moon);
}

.booked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.booked svg { width: 16px; height: 16px; }

/* Desktop: the thread runs along a horizontal time axis */
@media (min-width: 900px) {
  .thread {
    grid-template-columns: repeat(5, minmax(0, 1fr)); /* threads always have 5 entries */
    gap: 24px;
    padding-left: 0;
    padding-top: 30px;
  }

  .thread::before {
    left: 4px;
    right: 0;
    top: 4px;
    bottom: auto;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, rgba(163, 177, 201, 0.35), rgba(245, 165, 36, 0.85));
  }

  .thread-item { align-content: start; }
  .thread-item::before { left: 0; top: -30px; }
  .bubble { max-width: none; }
}

/* The one authored moment: entries arrive in order, once. */
@media (prefers-reduced-motion: no-preference) {
  /* Starts faint, not invisible: an early screenshot or a slow tab never shows an empty axis. */
  .js .thread.is-pending .thread-item {
    opacity: 0.12;
    transform: translateY(8px);
    filter: blur(4px);
  }

  .js .thread .thread-item {
    transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out), filter 700ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 420ms + 250ms);
  }
}

/* ---------- Problem ---------- */

.split {
  display: grid;
  gap: 28px;
}

@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: start; }
}

.split .h2 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem); max-width: 20ch; }
.split .prose { color: var(--mist); }
.split .prose strong { color: var(--moon); font-weight: 500; }

/* ---------- Evidence (sourced research) ---------- */

.evidence-list { list-style: none; border-top: 1px solid var(--line-dark); }

.evidence-list li {
  display: grid;
  gap: 8px 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line-dark);
}

.evidence-figure {
  font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--moon);
}

.evidence-body { display: grid; gap: 8px; max-width: 62ch; }
.evidence-body p { color: var(--mist); }

cite {
  font-style: normal;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--mist);
}

.evidence-list cite::before { content: "Source: "; }

.evidence-note {
  margin-top: 24px;
  max-width: 66ch;
  font-size: 0.9375rem;
  color: var(--mist);
}

@media (min-width: 900px) {
  .evidence-list li { grid-template-columns: 220px minmax(0, 1fr); align-items: baseline; }
}

/* ---------- Workflows ---------- */

.workflows { list-style: none; border-top: 1px solid var(--line-dark); }

.workflows li {
  display: grid;
  gap: 8px 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-dark);
}

.workflows p { color: var(--mist); max-width: 62ch; }

@media (min-width: 900px) {
  .workflows li { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: baseline; }
}

/* ---------- Industry list ---------- */

.industry-list { list-style: none; border-top: 1px solid var(--line-light); }

.industry-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 16px;
  padding: 20px 4px;
  border-bottom: 1px solid var(--line-light);
  text-decoration: none;
  color: var(--ink);
  transition: background-color var(--fast) ease;
}

.industry-list a:hover { background: rgba(20, 33, 58, 0.035); }

.industry-name { font-weight: 600; font-size: 1.1875rem; letter-spacing: -0.01em; }
.industry-line { grid-column: 1; color: var(--ink-soft); font-size: 1rem; }

.industry-list svg {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 20px; height: 20px;
  color: var(--ink-soft);
  transition: transform var(--fast) var(--ease-out), color var(--fast) ease;
}

.industry-list a:hover svg { transform: translateX(3px); color: var(--ink); }

@media (min-width: 900px) {
  .industry-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; border-top: 0; }
  .industry-list li:nth-child(-n + 2) a { border-top: 1px solid var(--line-light); }
}

/* ---------- Pricing ---------- */

.price {
  display: grid;
  gap: 32px;
  padding: clamp(28px, 5vw, 56px);
  background: var(--paper);
  border-radius: var(--radius-panel);
  box-shadow: 0 1px 2px rgba(20, 33, 58, 0.06), 0 24px 48px -24px rgba(20, 33, 58, 0.22);
}

.price-figures {
  display: grid;
  gap: 24px;
}

.figure-amount {
  display: block;
  font-size: clamp(2.75rem, 2rem + 3vw, 4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.figure-label { display: block; margin-top: 8px; color: var(--ink-soft); }

.price-facts { list-style: none; display: grid; gap: 14px; }

.price-facts li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.price-facts svg { width: 20px; height: 20px; margin-top: 3px; color: var(--sun-deep); }

@media (min-width: 900px) {
  .price { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: 56px; }
  .price-figures { grid-template-columns: auto auto; justify-content: start; column-gap: 56px; }
  .price-figures > div + div { padding-left: 56px; border-left: 1px solid var(--line-light); }
}

.roi {
  display: grid;
  gap: 16px;
  margin: 24px 0 0;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-panel);
}

.roi > p { color: var(--ink-soft); max-width: 66ch; }

.roi-compare { display: grid; gap: 16px; margin: 0; }
.roi-compare div { display: grid; gap: 4px; }
.roi-compare dt { color: var(--ink-soft); font-size: 0.9375rem; }
.roi-compare dd {
  margin: 0;
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.roi-compare dd .verify { font-size: 0.5em; vertical-align: middle; }

.roi .source { font-size: 0.875rem; color: var(--ink-soft); max-width: 70ch; }

@media (min-width: 600px) {
  .roi-compare { grid-template-columns: auto auto; justify-content: start; column-gap: 56px; }
  .roi-compare div + div { padding-left: 56px; border-left: 1px solid var(--line-light); }
}

/* ---------- FAQ ---------- */

.faq { border-top: 1px solid var(--line-light); max-width: 820px; }

.faq details { border-bottom: 1px solid var(--line-light); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 16px 4px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1.0625rem;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary svg {
  flex: none;
  width: 18px; height: 18px;
  color: var(--ink-soft);
  transition: transform var(--fast) var(--ease-out);
}

.faq details[open] summary svg { transform: rotate(45deg); }

.faq .answer { padding: 0 4px 24px; color: var(--ink-soft); max-width: 62ch; }

/* ---------- Final CTA ---------- */

.final {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 20px;
}

.final .h2 { max-width: 18ch; }
.final .lead { color: var(--ink-soft); }
.final .actions { justify-content: center; margin-top: 8px; }
.final .note { font-size: 0.9375rem; color: var(--ink-soft); }

/* ---------- Sector pages ---------- */

.prose .prose-subhead { margin-top: 2em; color: var(--moon); }

/* Unsourced figure. Deliberately loud: it must be resolved before launch. */
.verify {
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: rgba(154, 91, 0, 0.12);
  outline: 1.5px dashed var(--sun-deep);
  color: var(--sun-deep);
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0;
}

.prelaunch {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1.5px dashed var(--sun);
  border-radius: var(--radius-panel);
  background: rgba(245, 165, 36, 0.06);
  color: var(--moon);
  font-size: 0.9375rem;
}

.prelaunch p { max-width: 70ch; }

.placeholder-tag {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.breadcrumb { font-size: 0.9375rem; color: var(--mist); }
.breadcrumb a { color: var(--mist); }
.breadcrumb a:hover { color: var(--moon); }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 48px 40px;
  background: var(--paper);
  color: var(--ink-soft);
  border-top: 1px solid var(--line-light);
  font-size: 0.9375rem;
}

.footer-grid { display: grid; gap: 32px; }

.site-footer .brand { color: var(--ink); }
.site-footer h2 { font-size: 0.9375rem; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.site-footer ul { list-style: none; }
.site-footer li a { display: inline-flex; min-height: 36px; align-items: center; color: var(--ink-soft); text-decoration: none; }
.site-footer li a:hover { color: var(--ink); text-decoration: underline; }
.footer-legal { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line-light); }

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

/* ---------- 404 ---------- */

.not-found { min-height: 70vh; display: grid; align-content: center; gap: 24px; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Section that continues the previous one's surface without double padding. */
.section[data-flush] { padding-top: 0; }
.footer-tagline { margin-top: 12px; max-width: 38ch; }

.price-facts strong { color: var(--ink); font-weight: 600; }
