/* ═══════════════════════════════════════════════════════════════════════
   XODIAK — xodiak.net
   Design system. Structure modelled on stripe.com (sticky nav with product
   mega-menu, gradient hero, three-up feature grids, code panel, CTA band,
   large footer link map). Palette and material are ours: near-black
   institutional ground, chrome for structure, cold cyan/indigo for signal.

   Why dark and not Stripe's white: docs/WEB_LAUNCH_STANDARDS.md §15.4 —
   near-black is the standard for M&A / fintech / security / infrastructure
   audiences, which is exactly who reads a settlement-layer site.

   Tokens only in :root. Never hardcode a hex below this block.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* ground */
  --ink:        #05070b;
  --ink-1:      #080b12;
  --ink-2:      #0c1119;
  --ink-3:      #121924;
  --line:       rgba(226, 234, 245, 0.09);
  --line-2:     rgba(226, 234, 245, 0.16);

  /* chrome — the mark's material, used for structure and rules */
  --chrome-hi:  #f4f7fb;
  --chrome:     #c6cfdb;
  --chrome-lo:  #8792a3;

  /* signal */
  --cyan:       #22c7e6;
  --cyan-deep:  #0e93b3;
  --indigo:     #5b77ff;
  --violet:     #9a6cff;
  --mint:       #2fe0b8;
  --amber:      #f2b544;

  /* type */
  --fg:         #eef3fa;
  --fg-2:       #a6b2c4;
  --fg-3:       #76839a;

  /* geometry */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --maxw: 1180px;
  --nav-h: 72px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t: 200ms var(--ease);

  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-2: 0 2px 4px rgba(0,0,0,.45), 0 24px 60px rgba(0,0,0,.5);

  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--cyan); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--chrome-hi); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.022em;
  margin: 0 0 .6em;
  color: var(--chrome-hi);
}
h1 { font-size: clamp(2.6rem, 6.2vw, 4.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); letter-spacing: -0.03em; }
h3 { font-size: clamp(1.15rem, 1.7vw, 1.35rem); }
h4 { font-size: 1.02rem; }
p  { margin: 0 0 1.1em; color: var(--fg-2); }

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

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }
.section { padding: clamp(64px, 9vw, 116px) 0; position: relative; }
.section--tight { padding: clamp(44px, 6vw, 72px) 0; }
.section--alt { background: var(--ink-1); border-block: 1px solid var(--line); }

.eyebrow {
  font-size: .78rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--cyan);
  margin: 0 0 18px; display: block;
}
.lede { font-size: clamp(1.06rem, 1.6vw, 1.24rem); color: var(--fg-2); max-width: 62ch; }
.measure { max-width: 68ch; }
.center { text-align: center; }
.center .lede { margin-inline: auto; }

/* ── skip link ───────────────────────────────────────────────────────── */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--cyan); color: var(--ink); padding: 12px 20px;
  font-weight: 700; border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { left: 0; }

/* ── nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: rgba(5, 7, 11, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  height: 100%;
  display: flex; align-items: center; gap: 28px;
}
/* The lockup is sized by the visual gate's mark-and-type rule, not by taste:
   it must be at least 44px tall and fill at least half the 72px header band,
   with the mark at least 35% of the lockup. 46px tall with a 40px mark clears
   all three. Shrink either number and scripts/qa/website-visual-gate.mjs fails
   the site. */
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; min-height: 46px; }
.brand img { width: 40px; height: 40px; }
.brand__type {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700; letter-spacing: .17em;
  color: var(--chrome-hi); text-transform: uppercase; line-height: 1.1;
}
.nav__links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav__link {
  color: var(--fg-2); font-size: .95rem; font-weight: 500;
  padding: 9px 13px; border-radius: var(--r-sm);
  transition: color var(--t), background var(--t);
  background: none; border: 0; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav__link:hover, .nav__link[aria-expanded="true"] { color: var(--chrome-hi); background: rgba(226,234,245,.06); }
.nav__link svg { width: 11px; height: 11px; opacity: .6; transition: transform var(--t); }
.nav__link[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav__spacer { flex: 1; }
.nav__cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* mega menu */
.mega {
  position: absolute; left: 0; right: 0; top: var(--nav-h);
  background: var(--ink-1);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  display: none;
}
.mega[data-open="true"] { display: block; }
.mega__grid {
  display: grid; gap: 6px 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 26px 0 32px;
}
.mega__item {
  display: block; padding: 11px 13px; border-radius: var(--r-sm);
  transition: background var(--t);
}
.mega__item:hover { background: rgba(226,234,245,.05); }
.mega__item strong { display: block; color: var(--chrome-hi); font-size: .95rem; font-weight: 600; }
.mega__item span { display: block; color: var(--fg-3); font-size: .84rem; line-height: 1.45; }
.mega__head {
  grid-column: 1 / -1; font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--fg-3); font-weight: 700;
  padding: 6px 13px 2px;
}

/* mobile nav */
.nav__toggle { display: none; }
@media (max-width: 940px) {
  .nav__links { display: none; }
  .nav__toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: var(--r-sm);
    background: rgba(226,234,245,.06); border: 1px solid var(--line);
    color: var(--chrome-hi); cursor: pointer;
  }
  .nav__cta .btn--ghost { display: none; }
  .mobile {
    position: fixed; inset: var(--nav-h) 0 0; z-index: 55;
    background: var(--ink); overflow-y: auto;
    padding: 20px 0 60px; display: none;
  }
  .mobile[data-open="true"] { display: block; }
  .mobile a {
    display: block; padding: 13px 0; color: var(--fg);
    border-bottom: 1px solid var(--line); font-size: 1.02rem;
  }
  .mobile h4 {
    color: var(--fg-3); font-size: .72rem; letter-spacing: .18em;
    text-transform: uppercase; margin: 26px 0 4px;
  }
}
@media (min-width: 941px) { .mobile { display: none !important; } }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-family: var(--font-body); font-size: .96rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: transform var(--t), background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, var(--cyan) 0%, var(--cyan-deep) 100%);
  color: #04191f; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 10px 26px rgba(34,199,230,.24);
}
.btn--primary:hover { color: #04191f; filter: brightness(1.08); }
.btn--ghost {
  background: rgba(226,234,245,.05); color: var(--chrome-hi); border-color: var(--line-2);
}
.btn--ghost:hover { background: rgba(226,234,245,.11); color: var(--chrome-hi); }
.btn--lg { padding: 15px 30px; font-size: 1.02rem; }
.btn svg { width: 15px; height: 15px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.center .btn-row { justify-content: center; }
@media (max-width: 480px) {
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn { width: 100%; }
}

.arrowlink { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: .95rem; }
.arrowlink svg { width: 13px; height: 13px; transition: transform var(--t); }
.arrowlink:hover svg { transform: translateX(3px); }

/* ── hero ────────────────────────────────────────────────────────────── */
.hero {
  position: relative; isolation: isolate;
  padding: clamp(72px, 11vw, 138px) 0 clamp(60px, 8vw, 100px);
  /* Poster frame: painted immediately so first paint is branded, never black,
     while the Three.js module streams in. threeui-3d-web hard rule 4. */
  background:
    radial-gradient(120% 90% at 78% 8%,  rgba(34,199,230,.18) 0%, transparent 58%),
    radial-gradient(90% 80% at 12% 22%, rgba(91,119,255,.16) 0%, transparent 60%),
    radial-gradient(140% 120% at 50% 120%, rgba(154,108,255,.12) 0%, transparent 60%),
    var(--ink);
  overflow: hidden;
}
.hero__canvas {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  opacity: 0; transition: opacity 900ms var(--ease);
}
.hero__canvas[data-ready="true"] { opacity: 1; }
.hero::after {
  /* keeps type legible over whatever the scene is doing behind it */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(5,7,11,.90) 0%, rgba(5,7,11,.74) 42%, rgba(5,7,11,.16) 72%, rgba(5,7,11,0) 100%);
}
/* On a phone there is no left column to hide behind: the copy runs the full
   width and the scene sits under it. Scrim vertically instead, heavy through
   the text block and clearing at the bottom where the object actually is. */
@media (max-width: 768px) {
  .hero::after {
    background: linear-gradient(180deg, rgba(5,7,11,.86) 0%, rgba(5,7,11,.84) 52%, rgba(5,7,11,.62) 78%, rgba(5,7,11,.24) 100%);
  }
}
.hero__inner { max-width: 760px; }
.hero h1 { margin-bottom: 22px; }
.hero .lede { font-size: clamp(1.1rem, 1.9vw, 1.32rem); margin-bottom: 32px; }
.hero .btn-row { margin-bottom: 30px; }
.hero__note { font-size: .87rem; color: var(--fg-3); margin: 0; }

.gradtext {
  background: linear-gradient(96deg, var(--chrome-hi) 8%, var(--cyan) 44%, var(--indigo) 74%, var(--violet) 96%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ── stat strip ──────────────────────────────────────────────────────── */
.stats {
  display: grid; gap: 1px; background: var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.stat { background: var(--ink-1); padding: 26px 22px; }
.stat b {
  display: block; font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700; color: var(--chrome-hi); letter-spacing: -.03em; line-height: 1.1;
}
.stat span { display: block; font-size: .84rem; color: var(--fg-3); margin-top: 6px; }
@media (max-width: 780px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── cards / grids ───────────────────────────────────────────────────── */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: linear-gradient(180deg, var(--ink-2) 0%, var(--ink-1) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 24px;
  display: flex; flex-direction: column;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
a.card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-1); color: inherit; }
.card h3 { margin-bottom: 8px; }
.card p { font-size: .95rem; margin-bottom: 0; }
.card p + .arrowlink { margin-top: 16px; }
.card__icon {
  width: 42px; height: 42px; border-radius: 11px; margin-bottom: 18px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(34,199,230,.20), rgba(91,119,255,.14));
  border: 1px solid var(--line-2);
  color: var(--cyan);
}
.card__icon svg { width: 20px; height: 20px; }

/* ── feature rows (alternating text/media) ───────────────────────────── */
.split {
  display: grid; gap: clamp(28px, 5vw, 64px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}
.split--flip .split__media { order: -1; }
@media (max-width: 880px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split--flip .split__media { order: 0; }
}
.split__media img {
  width: 100%; border-radius: var(--r); border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
}

/* ── checklist ───────────────────────────────────────────────────────── */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; color: var(--fg-2); font-size: .98rem; }
.checks svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; color: var(--cyan); }

/* ── code panel ──────────────────────────────────────────────────────── */
.code {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.code__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  background: var(--ink-3);
}
.code__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.code__name { margin-left: 8px; font-family: var(--font-mono); font-size: .78rem; color: var(--fg-3); }
.code pre {
  margin: 0; padding: 20px 18px; overflow-x: auto;
  font-family: var(--font-mono); font-size: .82rem; line-height: 1.75; color: var(--fg-2);
  tab-size: 2;
}
.code .k { color: var(--violet); }
.code .s { color: var(--mint); }
.code .c { color: var(--fg-3); font-style: italic; }
.code .n { color: var(--amber); }
.code .f { color: var(--cyan); }

/* ── tables ──────────────────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
thead th {
  text-align: left; padding: 14px 18px; background: var(--ink-2);
  color: var(--fg-3); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 700; border-bottom: 1px solid var(--line);
}
tbody td { padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--fg-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { color: var(--chrome-hi); font-weight: 600; }
td code, p code, li code {
  font-family: var(--font-mono); font-size: .86em;
  background: rgba(226,234,245,.07); padding: 2px 6px; border-radius: 5px; color: var(--cyan);
}

/* ── pricing ─────────────────────────────────────────────────────────── */
.price {
  background: linear-gradient(180deg, var(--ink-2) 0%, var(--ink-1) 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 30px 26px; display: flex; flex-direction: column;
}
.price--feature { border-color: rgba(34,199,230,.4); box-shadow: 0 0 0 1px rgba(34,199,230,.14), var(--shadow-2); }
.price__tag {
  font-family: var(--font-display); font-size: 2.1rem; font-weight: 700;
  color: var(--chrome-hi); letter-spacing: -.03em; line-height: 1.1; margin: 6px 0 4px;
}
.price__unit { font-size: .86rem; color: var(--fg-3); margin-bottom: 20px; }
.price .checks { margin-bottom: 26px; }
.price .btn { margin-top: auto; }
.badge {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  background: rgba(34,199,230,.14); color: var(--cyan); border: 1px solid rgba(34,199,230,.3);
}
.badge--muted { background: rgba(226,234,245,.07); color: var(--fg-3); border-color: var(--line-2); }

/* ── callout ─────────────────────────────────────────────────────────── */
.callout {
  border: 1px solid var(--line-2); border-left: 3px solid var(--cyan);
  background: var(--ink-1); border-radius: var(--r);
  padding: 20px 22px;
}
.callout p:last-child { margin-bottom: 0; }
.callout h4 { color: var(--chrome-hi); margin-bottom: 6px; }

/* ── logo strip ──────────────────────────────────────────────────────── */
.strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 34px 54px; }
.strip img { height: 40px; width: auto; opacity: .78; filter: grayscale(1) brightness(1.7); transition: opacity var(--t), filter var(--t); }
.strip a:hover img { opacity: 1; filter: grayscale(0) brightness(1); }

/* ── CTA band (the stripe.com "Ready to get started?" block) ─────────── */
.cta {
  border-top: 1px solid var(--line);
  background:
    radial-gradient(80% 120% at 15% 0%, rgba(34,199,230,.13) 0%, transparent 62%),
    radial-gradient(70% 110% at 88% 100%, rgba(91,119,255,.13) 0%, transparent 62%),
    var(--ink-1);
}
.cta__grid { display: grid; gap: 44px; grid-template-columns: 1.15fr 1fr 1fr; align-items: start; }
@media (max-width: 880px) { .cta__grid { grid-template-columns: minmax(0, 1fr); gap: 34px; } }
.cta h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.cta h3 { color: var(--chrome-hi); margin-bottom: 6px; }
.cta p { font-size: .95rem; }

/* ── footer ──────────────────────────────────────────────────────────── */
.foot { background: var(--ink); border-top: 1px solid var(--line); padding: 64px 0 40px; }
.foot__cols {
  display: grid; gap: 34px 26px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 980px) { .foot__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .foot__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.foot h4 {
  font-family: var(--font-body); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--fg-3); font-weight: 700; margin: 0 0 14px;
}
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot li a { color: var(--fg-2); font-size: .9rem; }
.foot li a:hover { color: var(--chrome-hi); }
.foot__bottom {
  margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center;
  font-size: .86rem; color: var(--fg-3);
}
.foot__brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.foot__brand img { width: 26px; height: 26px; }
.foot__brand span { font-family: var(--font-display); font-weight: 700; letter-spacing: .16em; color: var(--chrome); font-size: .95rem; }

/* ── page header (interior pages) ────────────────────────────────────── */
.pagehead {
  padding: clamp(52px, 7vw, 88px) 0 clamp(36px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(90% 120% at 8% 0%, rgba(34,199,230,.12) 0%, transparent 60%),
    radial-gradient(80% 100% at 92% 10%, rgba(91,119,255,.10) 0%, transparent 60%),
    var(--ink);
}
.pagehead h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
.crumb { font-size: .82rem; color: var(--fg-3); margin-bottom: 18px; }
.crumb a { color: var(--fg-3); }
.crumb a:hover { color: var(--cyan); }

/* ── prose (legal pages) ─────────────────────────────────────────────── */
.prose { max-width: 74ch; }
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { color: var(--fg-2); padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }

/* ── reveal on scroll ────────────────────────────────────────────────── */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 620ms var(--ease), transform 620ms var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__canvas { transition: none; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
