/* ==========================================================================
   Hyperdrive Bio — site stylesheet
   All page styling lives here. Pages contain no inline styles.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
  --bg:            #07091D;
  --surface:       #0F1330;
  --surface-quiet: #0B0E24;
  --text:          #FBFFFF;
  --text-body:     #E5E6E8;
  --muted:         #ABB9CE;
  --faint:         #7F8191;
  --accent:        #3771FF;
  --accent-200:    #D9E7FF;
  --accent-300:    #8EBBFF;
  --accent-700:    #1438E1;
  --accent-800:    #172EB6;
  --accent-900:    #141D57;
  --section:       #06205B;
  --section-ink:   #C0E1FD;
  --signal:        #F75A3C;
  --ink-dark:      #090F31;
  --ink-dark-soft: #4A4B55;
  --hairline:      #414149;
  --divider:       rgba(251, 255, 255, 0.14);   /* fallback: Safari < 16.2, older Edge */
  --grad:          linear-gradient(100deg, #8ECCFB, #3771FF);

  --font-heading: "Manrope", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;

  --leading: 28px;            /* baseline unit; all vertical rhythm derives from it */
  --half:    14px;
  --edge:    clamp(20px, 5vw, 72px);
  --measure: 1240px;          /* content column max width */
  --radius:  14px;
}

@supports (color: color-mix(in srgb, white 14%, transparent)) {
  :root { --divider: color-mix(in srgb, #FBFFFF 14%, transparent); }
}

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

html {
  -webkit-text-size-adjust: 100%; /* stop iOS Safari inflating type in landscape */
  scroll-behavior: smooth;
}

/* Anchor targets get breathing room above them when jumped to */
[id] { scroll-margin-top: calc(var(--leading) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 500; margin: 0; }
p { margin: 0; }
img { display: block; max-width: 100%; }

a { color: var(--accent-300); text-underline-offset: 3px; }
a:hover { color: var(--accent-200); }

hr.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(to right, transparent, var(--divider) 48px calc(100% - 48px), transparent);
}

/* --- Page shell ----------------------------------------------------------- */
.page {
  position: relative;
  overflow-x: hidden;   /* fallback */
  overflow-x: clip;     /* clip does not create a scroll container, so #anchors still work */
  background:
    radial-gradient(1200px 760px at 84% -200px, var(--accent-900), transparent 62%),
    radial-gradient(1000px 800px at -8% 104%, #070708, transparent 58%),
    var(--bg);
}
.page--tall {
  min-height: 100vh;
  min-height: 100dvh;             /* mobile browsers: excludes the retracting URL bar */
  display: flex;
  flex-direction: column;
}

.wrap {
  position: relative;
  max-width: var(--measure);
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--edge);
}

/* --- Decorative orbitals -------------------------------------------------- */
.orbitals {
  position: absolute;
  top: -360px;
  right: -320px;
  width: 1100px;
  height: 1100px;
  pointer-events: none;
  opacity: 0.5;
}
.orbitals svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbitals .spin     { animation: orbit 120s linear infinite; }
.orbitals .spin-rev { animation: orbit-rev 200s linear infinite; }

@keyframes orbit     { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes orbit-rev { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }

/* --- Navigation ----------------------------------------------------------- */
.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: 14px max(var(--edge), calc((100% - var(--measure)) / 2 + var(--edge)));
  border-bottom: 1px solid var(--divider);
}
.nav__brand { display: block; flex: 0 0 auto; padding: 4px 50px 4px 0; }
.nav__brand img { width: 183px; height: 32px; }
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
  margin-left: auto;
  font-size: 14px;
}
.nav__links a { color: var(--text); text-decoration: none; white-space: nowrap; }
.nav__links a:hover { color: var(--accent-200); }
.nav__links .btn { color: var(--text); }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn--primary { background: var(--accent); color: var(--text); }
.btn--primary:hover { background: var(--accent-700); color: var(--text); }
.btn--ghost { background: transparent; border-color: var(--divider); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent-300); color: var(--accent-200); }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--leading); }

/* --- Tags ----------------------------------------------------------------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--leading); }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  font-size: 13.5px;
  line-height: 1.2;
  color: var(--muted);
}

/* --- Type ----------------------------------------------------------------- */
.eyebrow {
  display: block;
  font-size: 13px;
  line-height: var(--half);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-300);
  margin-bottom: var(--half);
}
.eyebrow--code {
  font-family: var(--font-heading);
  letter-spacing: 0.14em;
  margin-bottom: var(--leading);
  font-variant-numeric: tabular-nums;
}

.display {
  font-size: clamp(42px, 6.2vw, 84px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-left: -0.04em;
  max-width: 20ch;
}
.display--md { font-size: clamp(38px, 5.4vw, 72px); max-width: 22ch; }
.display--sm { font-size: clamp(34px, 4.4vw, 58px); line-height: 1.1; letter-spacing: -0.022em; max-width: 18ch; }
.display span { display: block; }
.display .grad { color: var(--accent-300); }  /* fallback if background-clip:text is unsupported */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .display .grad {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.h2 { font-size: clamp(26px, 2.8vw, 34px); line-height: 1.2; letter-spacing: -0.015em; }
.h2--lg { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.14; letter-spacing: -0.018em; }

.lede {
  font-size: 18px;
  line-height: var(--leading);
  color: var(--text-body);
  max-width: 56ch;
  margin-top: calc(1.5 * var(--leading));
}
.lede--sm { font-size: 17px; max-width: 52ch; }

.body {
  font-size: 15.5px;
  line-height: var(--leading);
  color: var(--muted);
  max-width: 56ch;
}
.body + .body { margin-top: var(--half); }
.measure-50 { max-width: 50ch; }
.measure-52 { max-width: 52ch; }
.measure-58 { max-width: 58ch; }
.tight-24 { max-width: 24ch; }
.tight-26 { max-width: 26ch; }
.tight-22 { max-width: 22ch; }
.gap-half { margin-top: var(--half); }
.gap-line { margin-top: var(--leading); }

/* --- Sections ------------------------------------------------------------- */
.section        { padding-block: calc(2.5 * var(--leading)); }
.section--hero  { padding: calc(3.5 * var(--leading)) 0 calc(3 * var(--leading)); }
.section--head  { padding: calc(3.5 * var(--leading)) 0 calc(2 * var(--leading)); }
.section--flush { padding: 0 0 calc(2.5 * var(--leading)); }
.section--last  { padding: 0 0 calc(2 * var(--leading)); }

.section--center {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  padding-block: calc(3 * var(--leading));
}

/* --- Stat band ------------------------------------------------------------ */
.stats {
  position: relative;
  background:
    radial-gradient(900px 420px at 86% -40%, var(--accent-800), transparent 64%),
    var(--section);
  padding-block: calc(2.5 * var(--leading));
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: calc(1.5 * var(--leading)) var(--leading);
}
.stats__grid > *, .split > *, .split--top > * { min-width: 0; }
.stat__num {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(34px, 3.4vw, 50px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-size: 13px;
  line-height: var(--half);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--section-ink);
  margin-top: var(--half);
}

/* --- Numbered feature rows ------------------------------------------------ */
.rows { margin-top: calc(1.5 * var(--leading)); }
.row {
  display: grid;
  grid-template-columns: minmax(56px, 120px) minmax(0, 360px) minmax(0, 1fr);
  gap: var(--leading) clamp(24px, 4vw, 72px);
  align-items: baseline;
  padding-block: calc(1.25 * var(--leading));
}
.row + .row { border-top: 1px solid var(--divider); }
.row__num {
  font-family: var(--font-heading);
  font-size: 15px;
  line-height: var(--leading);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.row__title { font-size: 24px; line-height: var(--leading); letter-spacing: -0.01em; }
.row__body { font-size: 15.5px; line-height: var(--leading); color: var(--muted); max-width: 52ch; }

@media (max-width: 720px) {
  .row { grid-template-columns: 34px minmax(0, 1fr); }
  .row__num { grid-row: span 2; }
}

/* --- Compact numbered steps (demo page) ---------------------------------- */
.steps {
  display: flex;
  flex-direction: column;
  gap: var(--leading);
  margin-top: calc(1.75 * var(--leading));
}
.step { display: grid; grid-template-columns: 34px 1fr; gap: 16px; align-items: baseline; }
.step__num {
  font-family: var(--font-heading);
  font-size: 15px;
  line-height: 1.6;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.step__title { font-size: 18px; line-height: 1.4; letter-spacing: -0.008em; }
.step__body { font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 44ch; margin-top: 6px; }

/* --- Split (text + figure) ----------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--leading) clamp(24px, 5vw, 88px);
  align-items: center;
  padding: calc(2 * var(--leading)) 0 calc(3 * var(--leading));
}
.split--top {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(1.5 * var(--leading)) clamp(28px, 5vw, 88px);
  padding: calc(2.5 * var(--leading)) 0 calc(3 * var(--leading));
}
@media (min-width: 1080px) {
  .split--top { grid-template-columns: minmax(340px, 1fr) minmax(0, clamp(360px, 40vw, 520px)); }
  .split--top > :first-child { grid-column: 1; grid-row: 1; }
  .split--top > .stack      { grid-column: 2; grid-row: 1; }
}
.figure { margin: 0; }
.figure img { width: 100%; height: auto; }
.figure img.provider { aspect-ratio: 2560 / 2087; }
@supports not (aspect-ratio: 1 / 1) {
  .figure img.provider { height: auto; }
}

/* --- Cards ---------------------------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: var(--leading); }

.card--light {
  padding: clamp(22px, 2.4vw, 34px);
  border-radius: var(--radius);
  background: var(--text);
  box-shadow: 0 0 0 1px var(--accent-800), 0 18px 44px rgba(7, 7, 8, 0.55);
  color: var(--ink-dark);
}
.card--light h2 { font-size: 22px; line-height: 1.24; letter-spacing: -0.012em; margin-bottom: 6px; }
.card--light p { font-size: 14.5px; line-height: 1.55; color: var(--ink-dark-soft); margin-bottom: 20px; }

.card--quiet {
  padding: clamp(20px, 2.2vw, 28px);
  border-radius: var(--radius);
  background: var(--surface-quiet);
  box-shadow: 0 0 0 1px var(--hairline);
}
.card--quiet h2 { font-size: 17px; line-height: 1.35; letter-spacing: -0.008em; }
.card--quiet p { font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 40ch; margin-top: 8px; }
.card--quiet .btn-row { margin-top: 18px; }

.stack { position: relative; min-width: 0; }

/* The HubSpot embed loads its own stylesheet after ours; these keep it boxed. */
.hs-form-frame {
  min-height: 640px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.hs-form-frame form,
.hs-form-frame iframe { max-width: 100% !important; }

/* --- Footer --------------------------------------------------------------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--half) clamp(16px, 3vw, 32px);
  align-items: center;
  padding-block: calc(2 * var(--leading));
  border-top: 1px solid var(--divider);
  font-size: 13px;
  color: var(--faint);
}
.footer img { width: 126px; height: 22px; margin-right: 34px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent-200); }
.footer__copy { margin-left: auto; }

/* --- Scroll reveal (progressive enhancement; see site.js) ---------------- */
[data-reveal].is-hidden {
  opacity: 0;
  transform: translateY(14px);
}
[data-reveal] {
  transition: opacity 620ms cubic-bezier(.22,.61,.36,1), transform 620ms cubic-bezier(.22,.61,.36,1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal].is-hidden { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   The layout is fluid by default: clamp() type, auto-fit grids, ch-based
   measures. These breakpoints handle the things fluidity cannot — the nav,
   the decorative orbitals, and vertical rhythm on small screens.
   ========================================================================== */

/* Tablet and below */
@media (max-width: 900px) {
  .orbitals { width: 760px; height: 760px; top: -280px; right: -260px; opacity: 0.36; }
  .split, .split--top { align-items: start; }
  .figure { order: 2; }
}

/* Phone */
@media (max-width: 640px) {
  :root { --leading: 22px; --half: 11px; }

  .nav {
    flex-wrap: wrap;
    row-gap: 12px;
    padding-block: 12px;
  }
  .nav__brand { padding-right: 0; }
  .nav__brand img { width: 148px; height: 26px; }
  .nav__links { width: 100%; margin-left: 0; justify-content: flex-start; gap: 16px; }
  .nav__links .btn { margin-left: auto; }

  .display    { font-size: clamp(30px, 8.4vw, 44px); max-width: none; }
  .display--md,
  .display--sm { font-size: clamp(28px, 7.6vw, 40px); max-width: none; }
  .lede, .lede--sm { font-size: 16.5px; }
  .h2, .h2--lg { max-width: none; }
  .tight-22, .tight-24, .tight-26 { max-width: none; }

  .btn { width: 100%; }             /* full-bleed, comfortable tap targets */
  .btn-row { gap: 8px; }
  .nav__links .btn { width: auto; }

  .stats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat__num { font-size: 30px; }

  .footer { row-gap: 10px; }
  .footer img { margin-right: 0; flex: 0 0 100%; }
  .footer__copy { margin-left: 0; flex: 0 0 100%; }

  .card--light, .card--quiet { border-radius: 12px; }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .stats__grid { grid-template-columns: minmax(0, 1fr); }
}

/* Short landscape phones: stop utility pages forcing a tall empty column */
@media (max-height: 520px) and (orientation: landscape) {
  .section--center { padding-block: calc(1.5 * var(--leading)); }
  .orbitals { display: none; }
}

/* Wide displays: the column stops growing, so only the gutter opens up */
@media (min-width: 1600px) {
  :root { --edge: 96px; }
}

/* Print */
@media print {
  .orbitals, .nav__links .btn, .hs-form-frame { display: none; }
  .page, .stats { background: #fff !important; }
  body { background: #fff; color: #111; }
  .body, .lede, .row__body, .step__body, .stat__label { color: #333; }
  .display .grad { color: #1438E1; -webkit-text-fill-color: #1438E1; }
  a { color: #1438E1; }
}
