/* ==========================================================================
   Capstan - landing page
   Shape lock: buttons + badges = pill, cards/panels/media = 16px,
   inline controls = 10px. Nothing else.
   Colour lock: emerald is the only accent on the page.
   ========================================================================== */

/* ---------- Fonts (self-hosted, no external font CDN) ---------- */
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #fafafa;
  --bg-sunk: #f4f4f5;
  --surface: #ffffff;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #8b8b93;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;

  --accent-ink: #04614a;      /* text-safe emerald on light */
  --accent-solid: #047857;    /* button fill, 4.8:1 against white text */
  --accent-bright: #059669;   /* decorative */
  --accent-soft: #edfaf4;
  --accent-band: #eef7f3;
  --accent-on-solid: #ffffff;

  --dark: #0b0b0d;
  --on-dark: #fafafa;
  --on-dark-2: #a1a1aa;

  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.05);
  --shadow-md: 0 18px 40px -24px rgba(9, 40, 30, 0.28), 0 2px 6px rgba(24, 24, 27, 0.04);
  --shadow-lg: 0 40px 90px -50px rgba(9, 40, 30, 0.45);

  --r-pill: 999px;
  --r-card: 16px;
  --r-control: 10px;

  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(72px, 9vw, 128px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --bg-sunk: #0d0d10;
    --surface: #131316;
    --ink: #fafafa;
    --ink-2: #a1a1aa;
    --ink-3: #71717a;
    --line: #26262b;
    --line-strong: #33333a;

    --accent-ink: #6ee7b7;
    --accent-solid: #34d399;
    --accent-bright: #10b981;
    --accent-soft: #06281f;
    --accent-band: #0b1512;
    --accent-on-solid: #052e22;

    --shadow-md: 0 18px 40px -24px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 40px 90px -50px rgba(0, 0, 0, 0.9);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Film grain: fixed, non-interactive, never on a scrolling container. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
}
.skip:focus { left: 16px; top: 16px; }

/* ---------- Shared type ---------- */
.section-h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  letter-spacing: -0.035em;
  max-width: 22ch;
}
.section-lede {
  margin-top: 18px;
  max-width: 58ch;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.3vw, 1.0625rem);
}
.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.22s var(--ease), background-color 0.22s var(--ease),
              border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.985); }

.btn--sm { padding: 9px 18px; font-size: 0.875rem; }
.btn--block { width: 100%; }

.btn--primary {
  background: var(--accent-solid);
  color: var(--accent-on-solid);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--accent-bright); box-shadow: var(--shadow-md); }

.btn--outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--outline:hover { border-color: var(--accent-solid); color: var(--accent-ink); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--ink); }

.btn--dark {
  background: var(--on-dark);
  color: var(--dark);
}
.btn--dark:hover { background: #ffffff; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .nav { background: var(--bg); }
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.logo__mark { width: 24px; height: 24px; color: var(--accent-solid); }
.logo__word { font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.03em; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: 12px;
}
.nav__links a {
  font-size: 0.9375rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__cta { margin-left: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(56px, 7vw, 96px) clamp(64px, 8vw, 112px);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(32px, 4vw, 56px);
  align-items: center;
}
.hero__h1 {
  margin-top: 20px;
  font-size: clamp(2.1rem, 4.3vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.06;
  text-wrap: balance;
}
.hero__sub {
  margin-top: 22px;
  max-width: 46ch;
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  line-height: 1.55;
  color: var(--ink-2);
}
.hero__actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero__media {
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--dark);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.hero__media img {
  width: 100%;
  aspect-ratio: 1100 / 803;
  object-fit: cover;
}

/* ---------- Logo wall ---------- */
.logos {
  padding-block: clamp(36px, 4vw, 56px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.logos__title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
}
.logos__row {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px 18px;
  align-items: center;
}
.logos__row li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--ink-3);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.logos__row li:hover { color: var(--ink); }
.mono-mark { width: 22px; height: 22px; flex: none; }

/* ---------- Metrics ---------- */
.metrics {
  position: relative;
  isolation: isolate;
  padding-block: var(--section-y);
  overflow: hidden;
}
.metrics::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent-band);
}
.metrics::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/topo-light.jpg") center / cover no-repeat;
  mix-blend-mode: multiply;
  opacity: 0.4;
}
@media (prefers-color-scheme: dark) {
  .metrics::after { filter: invert(1) hue-rotate(150deg); mix-blend-mode: screen; opacity: 0.11; }
}
.metrics__title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.03em;
  max-width: 26ch;
}
.metrics__row {
  margin-top: clamp(36px, 5vw, 60px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 3vw, 48px);
}
.metric { border-left: 1px solid var(--line-strong); padding-left: clamp(16px, 2vw, 26px); }
.metric dt {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.metric dd {
  margin-top: 12px;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.metric p {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 30ch;
}

/* ---------- How it works ---------- */
.how { padding-block: var(--section-y); }
.how__head { max-width: 100%; }
.steps {
  margin-top: clamp(44px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3.5vw, 52px);
}
.step { position: relative; padding-top: 30px; border-top: 1px solid var(--line); }
.step__mark {
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--accent-solid);
}
.step h3 { font-size: 1.25rem; letter-spacing: -0.025em; }
.step p { margin-top: 12px; color: var(--ink-2); max-width: 38ch; }

/* ---------- Bento ---------- */
.platform { padding-block: var(--section-y); }
.bento {
  margin-top: clamp(40px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(196px, auto);
  gap: 16px;
}
.cell {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: clamp(24px, 2.6vw, 34px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
}
.cell h3 { font-size: 1.1875rem; letter-spacing: -0.025em; }
.cell p { margin-top: 10px; color: var(--ink-2); font-size: 0.9375rem; max-width: 42ch; }

.cell--wide { grid-column: span 2; }
.cell--tall { grid-column: 3; grid-row: 1 / span 2; }
.cell--full { grid-column: 1 / -1; }

.cell--topo { justify-content: flex-end; }
.cell--topo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/topo-light.jpg") center / cover no-repeat;
  opacity: 0.75;
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  .cell--topo::before { filter: invert(1) hue-rotate(150deg); opacity: 0.18; }
}
.cell--topo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    var(--surface) 16%,
    color-mix(in srgb, var(--surface) 76%, transparent) 46%,
    transparent 76%
  );
}
.cell--topo h3, .cell--topo p { position: relative; z-index: 1; }

.cell--photo { padding: 0; justify-content: flex-end; }
.cell--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cell--photo figcaption {
  position: relative;
  padding: clamp(22px, 2.4vw, 30px);
  color: var(--on-dark);
  background: linear-gradient(to top, rgba(6, 20, 16, 0.92), rgba(6, 20, 16, 0.35) 55%, transparent);
}
.cell--photo p { color: rgba(250, 250, 250, 0.82); }

.cell--accent {
  background: var(--accent-solid);
  border-color: transparent;
  color: var(--accent-on-solid);
}
.cell--accent h3 { color: var(--accent-on-solid); }
.cell--accent p { color: var(--accent-on-solid); opacity: 0.86; max-width: 62ch; }

/* ---------- Quote ---------- */
.quote {
  padding-block: var(--section-y);
  background: var(--bg-sunk);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.quote blockquote { max-width: none; }
.quote blockquote p {
  font-size: clamp(1.5rem, 3.2vw, 2.35rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.04em;
  max-width: 34ch;
}
.quote blockquote footer {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9375rem;
}
.quote__name { font-weight: 600; }
.quote__role { color: var(--ink-2); }

/* ---------- Pricing ---------- */
.pricing { padding-block: var(--section-y); }
.pricing__head { max-width: 100%; }
.tiers {
  margin-top: clamp(40px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}
.tier {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: clamp(26px, 2.8vw, 34px);
  display: flex;
  flex-direction: column;
}
.tier h3 { font-size: 1.0625rem; letter-spacing: -0.02em; }
.tier__price { margin-top: 14px; display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.tier__num {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 2.1rem;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}
.tier__per { font-size: 0.875rem; color: var(--ink-2); }
.tier__desc { margin-top: 14px; font-size: 0.9375rem; color: var(--ink-2); }
.tier__list {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 11px;
  font-size: 0.9375rem;
  color: var(--ink-2);
  flex: 1 1 auto;
  align-content: start;
}
.tier__list li { position: relative; padding-left: 20px; }
.tier__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent-bright);
}
.tier .btn { margin-top: 28px; }

.tier--featured {
  border-color: var(--accent-solid);
  box-shadow: var(--shadow-md);
}
.tier__flag {
  position: absolute;
  top: 22px;
  right: 22px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pricing__note {
  margin-top: 28px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* ---------- FAQ ---------- */
.faq { padding-block: 0 var(--section-y); }
.faq__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.faq__list { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s var(--ease);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--accent-ink); }
.faq__item summary::after {
  content: "+";
  flex: none;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink-3);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}
.faq__item[open] summary::after { content: "+"; transform: rotate(45deg); color: var(--accent-solid); }
.faq__item p {
  padding: 0 0 26px;
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* ---------- Final CTA ---------- */
.cta { padding-block: 0 var(--section-y); }
.cta__panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-card);
  padding: clamp(44px, 6vw, 80px) clamp(26px, 5vw, 72px);
  background: var(--dark);
  color: var(--on-dark);
  text-align: center;
}
.cta__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/topo-light.jpg") center / cover no-repeat;
  filter: invert(1) hue-rotate(150deg);
  opacity: 0.13;
}
.cta__h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -0.045em; }
.cta__sub {
  margin: 16px auto 0;
  max-width: 56ch;
  color: var(--on-dark-2);
  font-size: 1.0625rem;
}
.cta__panel .btn { margin-top: 30px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(48px, 5vw, 72px) 36px;
  background: var(--bg);
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 3.5vw, 48px);
}
.footer__brand p {
  margin-top: 16px;
  max-width: 30ch;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.footer__col h2 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.footer__col ul { margin-top: 16px; display: grid; gap: 10px; }
.footer__col a {
  font-size: 0.9375rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer__col a:hover { color: var(--accent-ink); }

.footer__base {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.footer__note { max-width: 60ch; }

/* ---------- Reveal motion ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: var(--d, 0ms);
}
html.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal,
  html.js .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn, .faq__item summary::after, .nav { transition: none; }
  .btn:active { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav__links { gap: 22px; }
  .logos__row { grid-template-columns: repeat(3, 1fr); }
  .metrics__row { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__copy { order: 1; }
  .hero__media { order: 2; }
  .hero__sub { max-width: 60ch; }

  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { padding: 24px 0 24px 24px; border-top: none; border-left: 1px solid var(--line); }
  .step:last-child { border-left-color: transparent; }
  .step__mark { top: 30px; left: -5px; }

  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .cell--wide, .cell--tall, .cell--full { grid-column: auto; grid-row: auto; }
  .cell--tall { min-height: 380px; }

  .tiers { grid-template-columns: 1fr; gap: 16px; }
  .faq__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .nav__inner { height: 62px; gap: 16px; }
  .nav__links { display: none; }
  .logos__row { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
  .logos__row li { font-size: 0.875rem; }
  .metrics__row { grid-template-columns: 1fr; }
  .metric { padding-left: 18px; }
  .hero__actions .btn { flex: 1 1 auto; }
  .footer__grid { grid-template-columns: 1fr; }
  .quote blockquote p { font-size: 1.25rem; }
}
