/* =============================================================
   Genomain Vault — Canonical Brand (aligned to api.genomainvault.com/docs)
   Dark canvas · System sans + Fira Code · Deep-teal brand · Bright-teal signal
   2026-05-09 corrective pass — see super_admin/dev_docs/styles.css for the
   byte-for-byte source of truth.
   ============================================================= */

/* Fira Code — vendored woff2 subset (Latin + Latin-Ext + symbols).
   See /public/fonts/firacode/LICENSE.md for SIL OFL 1.1 attribution
   and the byte-identical sha256 across all three repos that vendor
   this file. font-display: swap so the system mono renders first
   and Fira Code seamlessly replaces it on load. */
@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Fira Code"),
       url("/fonts/firacode/FiraCode-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local("Fira Code Medium"),
       url("/fonts/firacode/FiraCode-Medium.woff2") format("woff2");
}

:root {
  /* Type families — canonical /docs uses platform system sans (NO Geist as
     default; NO Fraunces as default). Geist + Fraunces remain available as
     opt-in display variants if a marketing surface wants the editorial
     voice — pages opt in via .display class on a hero element. */
  --ff-display: "Fraunces", "Iowan Old Style", "Apple Garamond", Georgia, "Times New Roman", serif;
  --ff-body: -apple-system, BlinkMacSystemFont, "SF Pro Text",
             "Segoe UI", Roboto, Inter, "Fira Sans", system-ui, sans-serif;
  --ff-mono: "Fira Code", ui-monospace, "SF Mono", Menlo, Monaco, "Consolas", monospace;

  /* Canvas + surface — canonical /docs slate ramp.
     bg-0 #020617 → surface #0f172a → surface-2 #161e2e → hover #1c2638. */
  --ink-0: #020617;      /* deep OLED canvas (canonical /docs c-bg-0) */
  --ink-1: #0b121f;      /* body bg (canonical /docs c-bg-1) */
  --ink-2: #0f172a;      /* alt section / canonical /docs c-surface */
  --ink-3: #161e2e;      /* card surface (canonical /docs c-surface-2) */
  --ink-4: #1c2638;      /* hover surface (canonical /docs c-surface-hover) */

  --line:    rgba(255, 255, 255, 0.07);
  --line-2:  rgba(255, 255, 255, 0.14);
  --line-3:  rgba(255, 255, 255, 0.22);

  /* Text — canonical /docs slate-100 / slate-400 / slate-500. */
  --fg:      #f1f5f9;
  --fg-dim:  #94a3b8;
  --fg-mute: #64748b;

  /* Primary accent (brand) — canonical DEEP TEAL #05867d.
     Replaces the prior #4b7bff "Nordic" electric blue. */
  --brand:       #05867d;
  --brand-hi:    #38e8c8;
  --brand-soft:  rgba(5, 134, 125, 0.12);

  /* Signal accent — canonical BRIGHT TEAL #38e8c8 (use sparingly!).
     Replaces the prior #c5f82a "electric lime". Bright teal is the
     interactive accent on the /docs page (links, focus, gradient hi). */
  --signal:       #38e8c8;
  --signal-hi:    #5fe6e6;
  --signal-soft:  rgba(56, 232, 200, 0.12);

  /* Radii + shadow */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;

  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 32px rgba(0,0,0,0.6);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.06) inset, 0 24px 60px rgba(0,0,0,0.8);

  /* Layout */
  --max-w: 1240px;
  --pad-x: clamp(20px, 5vw, 48px);
  --fold-py: clamp(96px, 12vw, 176px);

  /* Type scale — editorial */
  --t-display:  clamp(2.5rem, 9vw, 9.5rem);
  --t-h1:       clamp(2.1rem, 6vw, 5.25rem);
  --t-h2:       clamp(1.7rem, 4.2vw, 3.75rem);
  --t-h3:       1.5rem;
  --t-lead:     clamp(1.125rem, 0.5vw + 1rem, 1.4rem);
  --t-body:     1.0625rem;
  --t-small:    0.9375rem;
  --t-eyebrow:  0.75rem;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* =============================== Base =============================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}
body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--fg);
  background: var(--ink-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  max-width: 100vw;
  position: relative;
  min-height: 100vh;
}
img, svg, video { max-width: 100%; height: auto; }

/* Global grain overlay — subtle film texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* Global backdrop — ambient gradient that drifts */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(50% 40% at 18% 12%, rgba(5, 134, 125, 0.18), transparent 70%),
    radial-gradient(40% 34% at 92% 88%, rgba(56, 232, 200, 0.08), transparent 70%),
    radial-gradient(30% 28% at 70% 40%, rgba(5, 134, 125, 0.06), transparent 75%);
  filter: blur(8px);
  animation: gv-drift 24s ease-in-out infinite alternate;
}
@keyframes gv-drift {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

a { color: var(--fg); text-decoration: none; transition: color 180ms var(--ease); }
a:hover { color: var(--signal); }

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0;
}
h1 { font-size: var(--t-h1); line-height: 1.02; font-variation-settings: "SOFT" 100, "WONK" 0, "opsz" 144; }
h2 { font-size: var(--t-h2); line-height: 1.05; font-variation-settings: "SOFT" 60, "opsz" 80; }
h3 { font-size: var(--t-h3); line-height: 1.2; letter-spacing: -0.01em; font-weight: 500; font-family: var(--ff-body); }
h4 { font-size: 1.0625rem; letter-spacing: 0; font-weight: 600; font-family: var(--ff-body); }

p { margin: 0; color: var(--fg-dim); }
p.lead { font-size: var(--t-lead); color: var(--fg-dim); line-height: 1.5; letter-spacing: -0.005em; }

.eyebrow {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 18px;
}

.eyebrow::before { content: "— "; color: var(--signal); opacity: 0.6; }

/* Gradient text for special words */
.accent {
  background: linear-gradient(180deg, var(--fg) 0%, var(--fg) 55%, var(--signal) 55%, var(--signal) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.italic { font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }

/* =============================== Nav =============================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(10, 10, 13, 0.65);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px var(--pad-x);
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--ff-display);
  font-size: 1.3125rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
  font-variation-settings: "SOFT" 80, "opsz" 80;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand img {
  display: block;
  height: 42px;
  width: auto;
  object-fit: contain;
}
.brand span { display: inline-block; line-height: 1; }
.footer .brand { font-size: 1.125rem; gap: 10px; }
.footer .brand img { height: 32px; }
@media (max-width: 560px) {
  .brand { font-size: 1.0625rem; gap: 9px; }
  .brand img { height: 32px; }
  .footer .brand img { height: 28px; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
  .brand img { height: 30px; }
}
/* Hide the old gradient square when an img is present */
.brand:has(img) .brand-mark { display: none; }
.brand-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hi) 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset, 0 8px 24px rgba(5, 134, 125, 0.35);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: -2px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 55%);
  pointer-events: none;
}
.nav-links { list-style: none; display: flex; gap: 28px; margin: 0 auto; padding: 0; }
.nav-links a {
  color: var(--fg-dim);
  font-size: 0.9375rem;
  padding: 6px 0;
  position: relative;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--signal);
}
.nav-cta { display: inline-flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none;
  background: transparent; border: 1px solid var(--line-2);
  color: var(--fg); padding: 8px; border-radius: 10px; cursor: pointer;
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .nav-toggle { display: inline-flex; }
}

/* =============================== Buttons =============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--ff-body);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease), box-shadow 240ms var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: 15px 28px; font-size: 1rem; }

.btn-primary {
  background: var(--fg);
  color: var(--ink-0);
  border-color: var(--fg);
}
.btn-primary:hover { background: var(--signal); border-color: var(--signal); color: var(--ink-0); box-shadow: 0 10px 40px rgba(56, 232, 200, 0.25); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--line-3); background: rgba(255,255,255,0.03); }

.btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--fg);
  font-weight: 500;
  border-bottom: 1px solid var(--signal);
  padding-bottom: 2px;
  transition: color 180ms var(--ease), transform 180ms var(--ease);
}
.btn-link::after { content: "→"; transition: transform 180ms var(--ease); }
.btn-link:hover { color: var(--signal); }
.btn-link:hover::after { transform: translateX(4px); }

/* =============================== Layout =============================== */
section { position: relative; padding: var(--fold-py) 0; }
section.alt { background: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad-x); }
.center { text-align: center; }
.mt-m { margin-top: 1.25rem; }
.mt-l { margin-top: 2.5rem; }
.mt-xl { margin-top: 4rem; }

/* =============================== Hero =============================== */
.hero {
  padding-top: clamp(120px, 16vw, 200px);
  padding-bottom: clamp(80px, 10vw, 140px);
  position: relative;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  position: relative;
  z-index: 1;
  text-align: center;
}
.hero h1 {
  font-size: var(--t-display);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-variation-settings: "SOFT" 40, "WONK" 0, "opsz" 144;
  max-width: min(18ch, 100%);
  margin: 0 auto 28px;
  overflow-wrap: break-word;
}
.hero p.lead {
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(1.125rem, 0.5vw + 1rem, 1.5rem);
  color: var(--fg-dim);
  line-height: 1.45;
}
.hero .hero-ctas { margin-top: 40px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* Hero trust strip — monospace spec-sheet row */
.trust-strip {
  margin-top: 56px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  font-family: var(--ff-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  position: relative;
  line-height: 1.2;
}
.trust-item:first-child { padding-left: 0; }
.trust-item:last-child::after { display: none; }
.trust-item::after {
  content: "";
  position: absolute;
  right: -2px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 3px;
  background: var(--signal);
  border-radius: 50%;
  opacity: 0.8;
}
.trust-item svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  stroke-width: 1.6;
  opacity: 0.7;
}
.trust-note {
  margin-top: 26px;
  font-size: 1.0625rem;
  color: var(--fg-dim);
  max-width: 60ch;
  line-height: 1.55;
}
.trust-note a {
  color: var(--signal);
  border-bottom: 1px solid var(--signal);
  padding-bottom: 1px;
  font-weight: 500;
}
.trust-note a:hover { color: var(--signal-hi); }

@media (max-width: 680px) {
  .trust-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    font-size: 0.6875rem;
    row-gap: 10px;
    column-gap: 16px;
    margin-top: 40px;
    width: 100%;
  }
  .trust-item {
    padding: 0;
    letter-spacing: 0.12em;
    gap: 6px;
    line-height: 1;
  }
  .trust-item::after { display: none; }
  .trust-item svg { width: 12px; height: 12px; }
  .trust-note { font-size: 1rem; margin-top: 22px; }
}

@media (max-width: 560px) {
  .trust-strip {
    flex-direction: column;
    row-gap: 12px;
    margin-top: 36px;
  }
  .trust-item {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .nav-inner { gap: 8px; padding: 12px 16px; }
  .btn { padding: 9px 14px; font-size: 0.8125rem; }
  .btn-lg { padding: 13px 20px; font-size: 0.9375rem; }
  .brand { font-size: 0.9375rem; gap: 8px; }
  .brand-mark { width: 18px; height: 18px; }
}

/* Hero word-level reveal (no JS needed beyond already-present) */
.hero h1 .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px) rotate(1deg);
  animation: gv-word 900ms var(--ease) forwards;
}
@keyframes gv-word {
  from { opacity: 0; transform: translateY(28px) rotate(1deg); }
  to   { opacity: 1; transform: translateY(0) rotate(0); }
}

/* =============================== Cards grid =============================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 880px)  { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px)  { .grid-4 { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 320ms var(--ease), border-color 320ms var(--ease), background 320ms var(--ease);
}
.card::before {
  /* Gradient border glow on hover */
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, transparent 40%, var(--brand) 70%, var(--signal) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 320ms var(--ease);
  pointer-events: none;
}
.card:hover { transform: translateY(-4px); background: var(--ink-4); }
.card:hover::before { opacity: 1; }

.card h3 {
  font-size: 1.3125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--fg);
}
.card p { color: var(--fg-dim); font-size: 0.9375rem; line-height: 1.55; }

.card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-soft), transparent);
  border: 1px solid var(--line-2);
  color: var(--brand-hi);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
}
.card-icon svg { width: 20px; height: 20px; }

/* =============================== Steps (how it works) =============================== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
  counter-reset: step;
}
@media (max-width: 880px) { .steps { grid-template-columns: 1fr; } }
.step {
  position: relative;
  padding: 28px 24px 28px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.step::before {
  /* Top hairline accent */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal), transparent);
  opacity: 0.5;
}
.step-num {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--ff-display);
  font-size: 3.5rem;
  line-height: 0.9;
  color: var(--signal);
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  margin-bottom: 20px;
  letter-spacing: -0.04em;
}
.step h3 { margin-bottom: 6px; color: var(--fg); }
.step p { color: var(--fg-dim); font-size: 0.9375rem; }

/* =============================== Chat demo (cycling) =============================== */
.chat-demo {
  max-width: 760px;
  margin: 0 auto;
  perspective: 1400px;
}

.chat-window {
  position: relative;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 40px 80px -20px rgba(0,0,0,0.8), 0 0 0 1px rgba(5, 134, 125, 0.04);
  transform-style: preserve-3d;
}
.chat-window::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 30%;
  background: linear-gradient(180deg, rgba(5, 134, 125, 0.08), transparent);
  pointer-events: none;
}

.chat-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--ink-4);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1;
}
.chat-dots { display: inline-flex; gap: 7px; }
.chat-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.chat-dot:nth-child(1) { background: #ff5f57; }
.chat-dot:nth-child(2) { background: #febc2e; }
.chat-dot:nth-child(3) { background: var(--signal); box-shadow: 0 0 10px rgba(56, 232, 200, 0.35); }
.chat-title {
  text-align: center;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  color: var(--fg-mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.chat-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-mono);
  font-size: 0.625rem;
  color: var(--signal);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.chat-live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal);
  animation: chat-live-pulse 1.6s ease-in-out infinite;
}
@keyframes chat-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 var(--signal); }
  50% { opacity: 0.5; transform: scale(0.92); box-shadow: 0 0 0 6px rgba(56, 232, 200, 0); }
}

.chat-body {
  position: relative;
  padding: 32px 28px 40px;
  min-height: 320px;
}
@media (max-width: 560px) {
  .chat-body { padding: 24px 18px 32px; min-height: 380px; }
}

.chat-slide {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: chat-slide-fade 360ms var(--ease) both;
}
.chat-slide.is-active { display: flex; }
@keyframes chat-slide-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.chat-msg {
  padding: 13px 18px;
  border-radius: 18px;
  max-width: 88%;
  font-size: 0.9375rem;
  line-height: 1.5;
  opacity: 0;
  position: relative;
}
.chat-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(5, 134, 125, 0.22), rgba(5, 134, 125, 0.10));
  color: var(--fg);
  border: 1px solid rgba(5, 134, 125, 0.35);
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 24px -12px rgba(5, 134, 125, 0.5);
}
.chat-msg-ai {
  align-self: flex-start;
  background: var(--ink-0);
  border: 1px solid var(--line-2);
  color: var(--fg-dim);
  border-bottom-left-radius: 6px;
}
.chat-msg-ai strong { color: var(--fg); font-weight: 500; }

.chat-source {
  display: block;
  margin-top: 10px;
  font-family: var(--ff-mono);
  font-size: 0.6875rem;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.chat-source::before {
  content: "◆ ";
  color: var(--signal);
  margin-right: 2px;
}

.chat-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  background: var(--ink-0);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  opacity: 0;
}
.chat-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--fg-mute);
  animation: chat-dot-bounce 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes chat-dot-bounce {
  0%, 60%, 100% { transform: translateY(0) scale(0.85); opacity: 0.4; }
  30%           { transform: translateY(-3px) scale(1); opacity: 1; }
}

/* Sequence triggered when a slide becomes active */
.chat-slide.is-active .chat-msg-user {
  animation: chat-in-right 500ms var(--ease) forwards;
  animation-delay: 250ms;
}
.chat-slide.is-active .chat-typing {
  animation: chat-typing-life 2400ms var(--ease) forwards;
  animation-delay: 1200ms;
}
.chat-slide.is-active .chat-msg-ai {
  animation: chat-in-up 580ms var(--ease) forwards;
  animation-delay: 3400ms;
}

@keyframes chat-in-right {
  from { opacity: 0; transform: translate(30px, 8px); }
  to   { opacity: 1; transform: translate(0, 0); }
}
@keyframes chat-in-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes chat-typing-life {
  0%         { opacity: 0; transform: translateY(6px); }
  12%, 78%   { opacity: 1; transform: translateY(0); }
  100%       { opacity: 0; transform: translateY(-6px); }
}

/* Progress indicator */
.chat-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--line);
  overflow: hidden;
}
.chat-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--signal));
  transform-origin: left;
}
.chat-slide.is-active ~ .chat-progress .chat-progress-fill,
.chat-window.is-active .chat-progress-fill {
  animation: chat-progress 6500ms linear forwards;
}
@keyframes chat-progress {
  from { width: 0%; }
  to   { width: 100%; }
}

/* Pager dots */
.chat-pager {
  display: inline-flex;
  gap: 6px;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
}
.chat-pager span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line-2);
  transition: background 240ms var(--ease), transform 240ms var(--ease);
}
.chat-pager span.is-active {
  background: var(--signal);
  transform: scale(1.35);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .chat-slide .chat-msg,
  .chat-slide .chat-typing { opacity: 1; animation: none !important; }
  .chat-progress-fill { animation: none !important; width: 100%; }
  .chat-dot:nth-child(3) { box-shadow: none; }
  .chat-live::before { animation: none; }
}

/* =============================== Code blocks =============================== */
pre.code {
  background: var(--ink-0);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 22px;
  margin: 1rem 0;
  overflow-x: auto;
  text-align: left;
  font-family: var(--ff-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--fg);
  position: relative;
}
pre.code::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0.4;
}
pre.code code { color: var(--fg); font-family: inherit; }

/* =============================== Footer =============================== */
.footer {
  border-top: 1px solid var(--line);
  padding: 80px 0 40px;
  background: var(--ink-0);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 880px) { .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; } }
.footer h4 { color: var(--fg); margin-bottom: 14px; font-size: 0.875rem; letter-spacing: 0.01em; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer a { color: var(--fg-mute); font-size: 0.9375rem; }
.footer a:hover { color: var(--signal); }
.footer-bottom {
  max-width: var(--max-w);
  margin: 48px auto 0;
  padding: 24px var(--pad-x) 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: var(--t-small);
  color: var(--fg-mute);
  font-family: var(--ff-mono);
  letter-spacing: 0.02em;
}
@media (max-width: 560px) { .footer-bottom { flex-direction: column; gap: 8px; } }

/* =============================== Scroll reveal =============================== */
main > section { opacity: 0; transform: translateY(28px); transition: opacity 720ms var(--ease), transform 720ms var(--ease); }
main > section.hero, main > section.is-in { opacity: 1; transform: none; }
main > section.is-in .card,
main > section.is-in .step {
  animation: gv-rise 640ms var(--ease) both;
}
main > section.is-in .card:nth-child(2), main > section.is-in .step:nth-child(2) { animation-delay: 80ms; }
main > section.is-in .card:nth-child(3), main > section.is-in .step:nth-child(3) { animation-delay: 160ms; }
main > section.is-in .card:nth-child(4), main > section.is-in .step:nth-child(4) { animation-delay: 240ms; }
@keyframes gv-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================== Misc =============================== */
blockquote {
  font-family: var(--ff-display);
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
}

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

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-0); }
::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 10px; border: 2px solid var(--ink-0); }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

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

/* ======================= Mobile polish ======================= */
@media (max-width: 560px) {
  :root {
    --fold-py: clamp(56px, 12vw, 96px);
    --pad-x: clamp(16px, 4vw, 24px);
  }
  .hero {
    padding-top: clamp(72px, 14vw, 120px);
    padding-bottom: clamp(48px, 8vw, 80px);
  }
  .card { padding: 26px 22px; }
  .card h3 { font-size: 1.1875rem; }
  .step { padding: 24px 20px; }
  .step-num { font-size: 2.75rem; margin-bottom: 14px; }
  .chat-body { padding: 24px 18px 34px; min-height: 380px; }
  .chat-header { padding: 12px 14px; }
  .chat-title { font-size: 0.625rem; }
  .chat-msg {
    font-size: 0.875rem;
    padding: 11px 15px;
    max-width: 94%;
    line-height: 1.45;
  }
  .chat-source { font-size: 0.625rem; }
  .chat-typing { padding: 11px 15px; }
  .hero-ctas { width: 100%; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .wrap.center .hero-ctas .btn { width: auto; }
  .grid-3 { gap: 14px; }
  .grid-4 { gap: 12px; }
  pre.code { font-size: 0.75rem; padding: 16px 14px; }
  blockquote { font-size: 1.125rem !important; }
  .footer { padding: 56px 0 32px; }
  .footer-bottom { font-size: 0.75rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  main > section { opacity: 1; transform: none; }
  .hero h1 .word { opacity: 1; transform: none; }
  body::after, body::before { animation: none; }
}
