/* ================================================================
   HELIXID — main.css
   Cipher theme (deep ink + teal→cyan) on a light background.
   Follows AGENTS.md: transform/opacity-only motion, visible focus,
   44px touch targets, reduced-motion support, no horizontal scroll.
   ================================================================ */

/* ── TOKENS ─────────────────────────────────────────────────────── */
:root {
  /* Cipher palette (HelixID brand, design E) */
  --accent:        #0FB5AE;  /* a1 — fills, strokes, icons (not text: 2.5:1 on white) */
  --accent-2:      #22D3EE;  /* a2 — cyan end of gradients, accents on dark */
  --accent-dark:   #0A7C77;  /* teal for text and links (5:1 on white) */
  --accent-ink:    #075E5A;  /* hover/active teal text — higher contrast (7.6:1) */
  --accent-soft:   #E6FBF9;
  --accent-line:   #B4EAE5;
  --accent-grad:   linear-gradient(135deg, #0FB5AE 0%, #22D3EE 50%, #22D3EE 100%);
  --on-accent:     #0B1220;  /* ink on teal; white on teal fails contrast */

  /* Neutrals (tinted toward the ink hue) */
  --ink:    #0B1220;
  --muted:  #5B6B7A;
  --soft:   #F7FAFC;
  --hero-bg:#F7FBFC;
  --line:   #E3E8EE;
  --white:  #ffffff;

  /* Status */
  --green:    #15803d;
  --green-bg: #ecfdf3;
  --green-line:#c8f0d7;
  --red:      #b91c1c;
  --red-bg:   #fef2f2;
  --red-line: #fbd5d5;

  /* Layered shadows: ambient + direct, tinted toward ink */
  --shadow-sm: 0 1px 2px rgba(11,18,32,.06), 0 2px 8px rgba(11,18,32,.04);
  --shadow:    0 1px 2px rgba(11,18,32,.05), 0 12px 32px rgba(11,18,32,.07);
  --shadow-accent: 0 1px 2px rgba(11,18,32,.08), 0 6px 18px rgba(15,181,174,.28);

  /* Radius (children ≤ parents) */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  /* Layout */
  --nav-h:  68px;
  --rail-h: 56px;
  --gutter: min(8%, 123px);

  /* Motion */
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: .15s;
  --dur:      .25s;
}

/* ── RESET / BASE ───────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  color-scheme: light;
  scroll-behavior: smooth;
  /* Anchor jumps and focus scrolling land below the sticky nav + step rail */
  scroll-padding-top: calc(var(--nav-h) + var(--rail-h) + 16px);
  touch-action: manipulation;
  /* No scroll anchoring: the script sizes the fold holds after load, and anchoring nudged a
     reload at the top of the page ~24px down */
  overflow-anchor: none;
  -webkit-tap-highlight-color: rgba(15,181,174,.18);
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-dark); text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: 12px; z-index: 100;
  background: var(--ink); color: var(--white); font-weight: 600; font-size: 14px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  transform: translateY(-200%); transition: transform var(--dur-fast) var(--ease);
}
.skip-link:focus { transform: none; }

/* ── LAYOUT ──────────────────────────────────────────────────────── */
.wrap { max-width: 1536px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 96px 0; }
.band-soft {
  background: var(--soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ── TYPOGRAPHY ──────────────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: clamp(2.125rem, 3.4vw, 3.375rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(1.75rem, 2.6vw, 2.375rem); font-weight: 800; letter-spacing: -.03em; }
h3 { font-size: 20px; font-weight: 700; }

.eyebrow {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-dark); font-weight: 700;
}
.lede { font-size: 18px; color: var(--muted); }
.accent { color: var(--accent-dark); }

.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section-head .eyebrow { display: block; margin-bottom: 16px; }
.section-head h2 { margin-bottom: 14px; }

/* ── BUTTONS & LINKS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 11px 24px;
  font-size: 15px; font-weight: 700; line-height: 1.2;
  border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  position: relative; isolation: isolate;
  transition: transform var(--dur-fast) var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary {
  color: var(--on-accent);
  background-image: linear-gradient(135deg, #0FB5AE 0%, #22D3EE 100%);
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}
/* Hover fades in a brighter cyan layer: ink-on-cyan is higher contrast (10:1 vs 7:1) */
.btn-primary::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: linear-gradient(135deg, #22D3EE 0%, #5EE3F2 100%);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-ghost {
  color: var(--accent-dark);
  background-color: var(--white);
  border-color: var(--accent-line);
}
.btn-ghost:hover { color: var(--accent-ink); border-color: var(--accent-dark); background-color: var(--accent-soft); }
.btn-sm { min-height: 40px; padding: 8px 18px; font-size: 14px; border-radius: 9px; }
.btn .arrow { transition: transform var(--dur-fast) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-size: 15px; font-weight: 600; color: var(--accent-dark);
  text-decoration: underline; text-decoration-color: var(--accent-line);
  text-underline-offset: 4px; text-decoration-thickness: 2px;
}
.link:hover { color: var(--accent-ink); text-decoration-color: currentColor; }

/* ── NAV ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h); gap: 24px; position: relative;
}
.brand { display: flex; align-items: center; min-height: 44px; }
.logo { display: block; height: 36px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a,
.nav-cta .signin {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 14.5px; white-space: nowrap;
}
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-cta .signin { color: var(--ink); font-weight: 600; }
.nav-links a:hover, .nav-cta .signin:hover { color: var(--accent-ink); }
.nav-cta { display: flex; align-items: center; gap: 20px; }

@media (max-width: 1240px) {
  .nav-links { gap: 22px; }
  .nav-cta { gap: 16px; }
}

/* Mobile nav toggle (CSS-only). The checkbox stays focusable but visually hidden,
   so keyboard users can open the drawer with Space; main.js closes it on Escape. */
.nav-toggle-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nav-burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px; cursor: pointer;
  width: 44px; height: 44px; padding: 0 11px; margin-left: auto; margin-right: -11px;
  border-radius: var(--radius-sm);
}
.nav-burger span {
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur-fast) ease;
  transform-origin: center;
}
.nav-toggle-input:focus-visible ~ .wrap .nav-burger { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.nav-drawer {
  display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
  max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: 8px var(--gutter) calc(20px + env(safe-area-inset-bottom)); flex-direction: column;
  box-shadow: var(--shadow);
}
.nav-drawer nav { display: flex; flex-direction: column; }
.nav-drawer a { font-size: 16px; font-weight: 500; color: var(--ink); padding: 11px 0; min-height: 44px; }
.nav-drawer a + a:not(.btn) { border-top: 1px solid var(--line); }
.nav-drawer .btn { margin-top: 12px; }

@media (max-width: 1080px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .nav-toggle-input:checked ~ .nav-drawer { display: flex; }
  .nav-toggle-input:checked ~ .wrap .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle-input:checked ~ .wrap .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle-input:checked ~ .wrap .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ── HERO ────────────────────────────────────────────────────────── */
.hero { padding: 20px 0 40px; background: var(--hero-bg); }
.hero-full-container {
  /* clip, not hidden: hidden would make this a scroll container and freeze
     the hero's scroll-linked motion */
  position: relative; max-width: 1536px; margin: 0 auto; overflow: clip;
  display: flex; align-items: flex-start; min-height: 600px;
}
.hero-bg { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
/* The scene is anchored bottom-right (preserveAspectRatio="xMaxYMax meet") so the copy keeps the left side */
.hero-bg .hero-ill { width: 100%; height: 100%; padding: 56px 24px 28px 47%; }
.hero-full-copy { position: relative; z-index: 2; margin-left: 8%; width: 42%; padding: 20px 0 40px; }
.hero-full-copy .eyebrow { display: block; margin-bottom: 12px; font-size: .9rem; }
.hero-full-copy h1 { line-height: 1.05; margin-bottom: 16px; }
.hero-full-copy .lede { font-size: clamp(1rem, 1.2vw, 1.15rem); line-height: 1.5; margin-bottom: 24px; max-width: 480px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; margin-bottom: 32px; }
.hero-actions .btn { font-size: 1.0625rem; padding: 14px 28px; }
.hero .hero-actions .btn-ghost { padding-inline: 12px; border-color: transparent; background-color: transparent; color: var(--ink); }
.hero .hero-actions .btn-ghost:hover { background-color: var(--accent-soft); color: var(--accent-ink); }
.hero-pill {
  display: inline-flex; align-items: center; min-height: 28px; margin-bottom: 14px; padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); border: 1px solid var(--accent-line);
  text-decoration: none; transition: background-color .2s ease, border-color .2s ease;
}
.hero-pill:hover { border-color: var(--accent); }
@media (pointer: coarse) {
  /* keep the pill small but give it a 44px tap area */
  .hero-pill { position: relative; }
  .hero-pill::after { content: ""; position: absolute; inset: -8px -4px; }
  .hero-selfhost a { display: inline-block; padding: 10px 0; }
}
.hero-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-selfhost { margin: -16px 0 28px; font-size: 14.5px; }
.hero-selfhost a { color: var(--accent-dark); font-weight: 600; text-underline-offset: 3px; }
.hero-selfhost a:hover { color: var(--accent-ink); }
.trust-row { display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; }
.hero-badge { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .95rem; color: var(--muted); }
.hero-badge-icon {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-dark);
}

@media (max-width: 1200px) { .hero-full-copy { width: 45%; } }
@media (max-width: 900px) {
  .hero-full-container { display: block; min-height: 0; }
  .hero-full-copy { margin-left: 0; width: 100%; padding: 40px 20px 0; }
  .hero-bg {
    position: relative; inset: auto; width: 100%; max-width: 560px; margin: 20px auto 0;
    aspect-ratio: 600 / 430;
  }
  .hero-bg .hero-ill { padding: 0; }
}
@media (max-width: 560px) {
  .hero-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero .hero-actions .btn-ghost { border-color: var(--accent-line); background-color: var(--white); }
}

/* ── HOW IT WORKS ────────────────────────────────────────────────── */
.how { position: relative; }

/* Step rail — fixed under the nav; hidden over the overview, slides in once
   scrolling into the steps starts. Step numbers, plus the title of the step in view. */
.step-rail {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(11,18,32,.04);
  transform: translateY(-100%); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .35s var(--ease), opacity .25s ease, visibility 0s linear .35s;
}
.step-rail.is-shown {
  transform: none; opacity: 1; visibility: visible; pointer-events: auto;
  transition: transform .35s var(--ease), opacity .25s ease, visibility 0s;
}
.step-rail-list {
  display: flex; align-items: center; gap: 6px;
  height: var(--rail-h); padding: 0 var(--gutter);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.step-rail-list::-webkit-scrollbar { display: none; }
.step-rail-list li { flex: none; }
/* Centre the numbers but keep the first one reachable when the row overflows */
.step-rail-list li:first-child { margin-left: auto; }
.step-rail-list li:last-child { margin-right: auto; }
.step-rail-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; height: 44px; padding: 0 8px; border-radius: 100px;
  color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.step-rail-link[aria-current] { color: var(--ink); background: var(--accent-soft); padding-right: 16px; }
/* Only the step in view shows its title; the others keep it for screen readers only */
.step-rail-link:not([aria-current]) .step-rail-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.step-rail-link[aria-current] .step-rail-label { animation: nudge .35s var(--ease) backwards; }
.step-rail-num {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--white); color: var(--muted);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: transform .3s var(--ease);
}
.step-rail-link:hover .step-rail-num { border-color: var(--accent-dark); color: var(--ink); transform: scale(1.08); }
.step-rail-link[aria-current] .step-rail-num {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  transform: scale(1.18);
}

.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.num {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-accent);
}

/* Overview: steps 1–4 as side-by-side columns (the second fold) */
.overview { padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov-col {
  --ov-pad: clamp(16px, 2vw, 32px);
  position: relative; display: flex; flex-direction: column; min-width: 0;
  padding: 40px var(--ov-pad) 44px;
  border-left: 1px solid var(--line);
}
.ov-col:first-child { border-left: 0; }
.ov-col h3 { font-size: 21px; letter-spacing: -.025em; margin-bottom: 12px; }
.ov-col p { font-size: 15px; color: var(--muted); margin-bottom: 24px; }
/* On narrow columns the illustration bleeds into the column padding so it reads
   larger; on wide screens it stops at one shared size, centred, so the four
   scenes stay in proportion with each other and with the detail steps. */
.ill.ov-img {
  width: min(100% + 2 * var(--ov-pad) - 8px, 340px); max-width: none; height: auto;
  margin: auto 0 0; padding-top: 8px; align-self: center;
}
.flow-arrow {
  position: absolute; top: 46px; right: -13px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--white); border: 1px solid var(--accent-line); color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
}

/* Detail steps 4–11: copy + media, alternating sides */
.step-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 64px; align-items: center;
}
.step.flip .step-copy { order: 2; }
.step-copy { min-width: 0; max-width: 560px; }
.step.flip .step-copy { justify-self: end; }
.step-copy h3 { font-size: clamp(1.625rem, 2.2vw, 2.125rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 14px; }
.step-copy .lede { margin-bottom: 24px; }
.step-media { min-width: 0; display: grid; gap: 20px; }
.step-img { width: 100%; height: auto; max-height: 520px; object-fit: contain; }
/* The trust stack is a tall, busy scene beside five cards: keep it smaller */
#stack .step-img { max-width: 470px; justify-self: center; }
.step-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 24px; }

/* Lists */
.x-list, .check-list { display: grid; gap: 10px; }
.x-list li, .check-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; font-weight: 500; }
.ov-col .x-list, .ov-col .check-list { padding: 14px 16px; border-radius: var(--radius); }
.ov-col .x-list { background: var(--red-bg); border: 1px solid var(--red-line); }
.ov-col .x-list li { color: #7f1d1d; font-size: 14px; }
.ov-col .check-list { background: var(--green-bg); border: 1px solid var(--green-line); }
.ov-col .check-list li { color: #14532d; font-size: 14px; }
.mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-top: 2px; }
.mark.x { background: #fee2e2; color: var(--red); }
.mark.c { background: var(--accent-soft); color: var(--accent-dark); }

/* Result card (step 5) */
.result {
  display: flex; align-items: center; gap: 14px; margin-top: 24px; max-width: 460px;
  background: var(--green-bg); border: 1px solid var(--green-line);
  border-radius: var(--radius); padding: 14px 18px;
}
.result-icon {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--white); border: 1px solid var(--green-line); color: var(--green);
}
.result-title { font-weight: 600; font-size: 15px; }
.result-title strong { color: var(--green); letter-spacing: .02em; }
.result-sub { font-size: 13.5px; color: var(--muted); }

/* Trust stack Q&A (step 7) */
.qa-stack { display: grid; gap: 10px; margin-top: 8px; }
.qa-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; box-shadow: var(--shadow-sm);
}
.qa-num {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-dark);
  font-family: 'Source Code Pro', monospace; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.qa-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.qa-card p { font-size: 14px; color: var(--muted); line-height: 1.45; }
.qa-tag {
  display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 6px; vertical-align: 1px;
  font-family: 'Source Code Pro', monospace; font-size: 11px; font-weight: 600; line-height: 1.4; color: var(--accent-dark);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.step-note { margin-top: 16px; font-size: 15px; font-weight: 600; color: var(--ink); text-wrap: balance; }

/* Demo steps (step 10) */
.demo-steps { display: grid; gap: 12px; }
.demo-steps li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; }
.ds-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-dark);
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Console (step 10) */
.console { background: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.console-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px 0;
  background: var(--white); border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0; overflow-x: auto; scrollbar-width: none;
}
.console-bar .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.console-bar .dot.r { background: #ff5f56; }
.console-bar .dot.y { background: #ffbd2e; }
.console-bar .dot.g { background: #27c93f; }
.console-tabs { display: flex; gap: 8px; margin-left: 16px; min-width: 0; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.console-tabs::-webkit-scrollbar { display: none; }
.console-tab {
  min-height: 44px; padding: 0 8px; flex: none;
  font-size: 13px; font-weight: 600; color: var(--muted);
  background: none; border: none; border-bottom: 3px solid transparent; cursor: pointer;
}
.console-tab:hover { color: var(--ink); }
.console-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.console-panels { position: relative; padding: 20px 24px 24px; min-height: 168px; }
.console-panel { display: none; overflow-x: auto; }
.console-panel.active { display: block; }
.console-panel code {
  display: block; font-family: 'Source Code Pro', monospace;
  font-size: 12.5px; line-height: 1.9; color: #cfe0ee;
}
.console-panel .p { color: var(--accent-2); }
.console-panel .ok { color: #67d98a; }
.console-annotation {
  position: absolute; bottom: 20px; right: 24px; pointer-events: none;
  font-family: 'Caveat', 'Comic Sans MS', cursive; font-size: 20px; line-height: 1.3;
  color: var(--accent-2); transform: rotate(-4deg); text-align: right;
}

/* ── DEVELOPERS ──────────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.split .eyebrow { display: block; margin-bottom: 16px; }
.split h2 { margin-bottom: 16px; }
.split p { color: var(--muted); margin-bottom: 22px; }
.code-card { background: #0f1e2e; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid #1d3145; }
.code-bar .f { font-family: 'Source Code Pro', monospace; font-size: 12px; color: #8ba3b8; }
.code-bar .tab { font-size: 12px; color: #8396a8; margin-left: auto; }
pre { padding: 22px 20px; overflow-x: auto; }
code { font-family: 'Source Code Pro', monospace; font-size: 13px; line-height: 1.75; color: #cfe0ee; }
.tok-k { color: var(--accent-2); }
.tok-s { color: #a5e6a1; }
.tok-c { color: #7d93a6; }
/* Developer section: flow illustration on the left, tabbed code on the right */
.dev-split { align-items: start; }
.split p code {
  font-size: .9em; line-height: 1.4; color: var(--accent-ink, #075E5A); background: var(--accent-soft);
  border: 1px solid var(--accent-line); padding: 1px 6px; border-radius: 6px; white-space: nowrap;
}
.dev-flow { position: relative; margin-top: 8px; }
.dev-flow .ill { width: 100%; height: auto; }
.dev-flow:hover .ill-replay, .dev-flow .ill-replay:focus-visible { opacity: 1; }
.code-tablist { display: flex; gap: 4px; }
.code-tab {
  min-height: 32px; padding: 6px 12px; border: 0; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: #8ba3b8; background: transparent;
  transition: color .2s ease, background-color .2s ease; touch-action: manipulation;
}
.code-tab:hover { color: #cfe0ee; background: #17293b; }
.code-tab[aria-selected="true"] { color: #fff; background: #1d3145; }
.code-tab:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.code-tabs .code-bar .f { margin-left: auto; }
.code-panel:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.code-panel.active { animation: fadeUp .3s var(--ease) backwards; }
.code-note { margin: -8px 20px 18px; font-size: 12.5px; color: #8ba3b8; }
.dev-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
@media (pointer: coarse) { .code-tab { min-height: 44px; } }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips span {
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: var(--white); border: 1px solid var(--line); padding: 9px 15px; border-radius: 10px;
}

/* ── REGULATED INDUSTRIES ───────────────────────────────────────── */
.reg { border-top: 1px solid var(--line); }
.reg-head { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; margin-bottom: 48px; }
.reg-head .eyebrow { display: block; margin-bottom: 16px; }
.reg-head h2 { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.06; margin-bottom: 18px; text-wrap: balance; }
.reg-media { position: relative; }
.reg-img { width: 100%; height: auto; }
.reg-media:hover .ill-replay, .reg-media .ill-replay:focus-visible { opacity: 1; }
/* Both cards are the same size, and their parts line up row by row (title, scenario, story,
   panel, bullets) so the two panels match too; without subgrid they still stretch equal */
.reg-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; row-gap: 0; align-items: stretch; }
@supports (grid-template-rows: subgrid) {
  .reg-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; }
}
.reg-card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow-sm); min-width: 0; }
.reg-panel { display: flex; flex-direction: column; }
.reg-panel .reg-foot { margin-top: auto; padding-top: 10px; }
.reg-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.reg-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); }
.reg-card h3 { font-size: 24px; letter-spacing: -.02em; }
.reg-scenario { font-size: 17px; font-weight: 700; line-height: 1.45; color: var(--ink); margin-bottom: 12px; }
.reg-story { font-size: 15.5px; line-height: 1.6; color: var(--muted); margin-bottom: 22px; }
.reg-panel {
  background: #0f1e2e; color: #cfe0ee; border-radius: 14px; padding: 18px 22px; margin-bottom: 24px;
  font-family: 'Source Code Pro', monospace; font-size: 13.5px; line-height: 1.5;
}
.reg-panel-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: #8ba3b8; }
.reg-panel dl > div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 8px; padding: 3px 0; }
.reg-panel dt { color: #8ba3b8; }
.reg-panel dd { color: #e6eef5; overflow-wrap: anywhere; }
.reg-panel dd.hl { color: var(--accent-2); }
.reg-decisions { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #1d3145; }
.reg-decisions li { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #e6eef5; }
.verdict { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.verdict.ok { background: #4ade80; color: #052e16; }
.verdict.no { background: #fca5a5; color: #450a0a; }
.reg-foot { font-size: 11.5px; color: #8ba3b8; }
.reg-card .check-list li { color: var(--ink); }
.reg-strip { margin-top: 28px; padding: 30px 32px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; }
.reg-strip h3.eyebrow { display: block; margin-bottom: 18px; font-size: 13px; }
.reg-strip-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
.reg-strip-grid dt { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.reg-strip-grid dd { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.reg-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 40px; }
.reg-cta p { font-size: 15px; color: var(--muted); }
/* the decisions land one after the other as the section reveals */
.js [data-animate]:not(.in) .reg-decisions li { opacity: 0; }
[data-animate].in .reg-decisions li { animation: fadeUp .5s var(--ease) backwards; animation-delay: calc(600ms + var(--i, 0) * 260ms); }
[data-animate].in .reg-decisions .verdict { animation: popIn .45s var(--ease) backwards; animation-delay: calc(800ms + var(--i, 0) * 260ms); }
@media (max-width: 1100px) { .reg-strip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .reg-head, .reg-cards { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .reg-card { grid-row: auto; grid-template-rows: none; }
  .reg-media { max-width: 560px; }
  .reg-strip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .reg-card, .reg-strip { padding: 24px 20px; }
  .reg-panel { padding: 16px; font-size: 12.5px; }
  .reg-panel dl > div { grid-template-columns: 7.5em minmax(0, 1fr); }
  .reg-decisions li { flex-wrap: wrap; }
  .reg-strip-grid { grid-template-columns: minmax(0, 1fr); }
  .reg-cta .btn { width: 100%; justify-content: center; }
}

/* ── PRICING ─────────────────────────────────────────────────────── */
.price-note { margin: 28px auto 0; max-width: 720px; text-align: center; font-size: 15px; color: var(--muted); text-wrap: balance; }
.price-note a { color: var(--accent-dark); font-weight: 600; white-space: nowrap; }
.prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.price {
  position: relative; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 32px 28px; box-shadow: var(--shadow-sm);
}
.price.featured { border-color: var(--accent); box-shadow: 0 1px 2px rgba(11,18,32,.06), 0 18px 40px rgba(15,181,174,.16); }
.price .tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; padding: 5px 13px; border-radius: 100px; white-space: nowrap;
}
.price h3 { font-size: 19px; margin-bottom: 4px; }
.price .amt { font-size: 36px; font-weight: 800; letter-spacing: -.03em; margin: 12px 0 2px; font-variant-numeric: tabular-nums; }
.price .amt small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.price .sub { font-size: 13.5px; color: var(--muted); }
.price ul { margin: 22px 0 28px; display: grid; gap: 11px; }
.price li { position: relative; padding-left: 26px; font-size: 14.5px; color: var(--muted); }
.price li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-dark); font-weight: 700; }
.price .btn { width: 100%; }

/* ── FINAL CTA ───────────────────────────────────────────────────── */
.final {
  text-align: center; padding: 96px 0;
  background: linear-gradient(180deg, var(--accent-soft), var(--white));
  border-top: 1px solid var(--accent-line);
}
.final h2 { font-size: clamp(2rem, 3vw, 2.625rem); margin-bottom: 16px; }
.final p { color: var(--muted); font-size: 17px; max-width: 580px; margin: 0 auto 30px; }
.final .hero-actions { justify-content: center; margin-bottom: 0; }

/* ── FOOTER ──────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line); background: var(--white);
  padding: 52px 0 calc(44px + env(safe-area-inset-bottom));
}
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.foot-brand { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 10px; }
.foot-grid > div:first-child p { color: var(--muted); font-size: 14px; max-width: 280px; }
.foot-social { display: flex; gap: 14px; }
.foot-social a {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -13px;
  color: var(--muted);
}
.foot-social a:hover { color: var(--ink); }
.foot-col h2 {
  font-size: 12px; font-weight: 700; line-height: 1.4; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.foot-col a {
  display: flex; align-items: center; min-height: 36px;
  color: var(--muted); font-size: 14px;
}
.foot-col a:hover { color: var(--ink); }
.foot-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}

/* ── TEXT PAGES (About, Privacy, Terms) ──────────────────────────── */
.text-page { max-width: 800px; margin: 60px auto 100px; padding: 0 20px; font-size: 1.125rem; line-height: 1.7; }
.text-page h1 { font-size: clamp(2.25rem, 6vw, 3rem); margin-bottom: .5rem; letter-spacing: -.02em; }
.text-page .last-updated, .text-page .lead { font-size: 1.25rem; color: var(--muted); margin-bottom: 3rem; }
.text-page h2 {
  font-size: 1.75rem; margin: 2.5rem 0 1rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.text-page p { margin-bottom: 1.5rem; }
.text-page ul { margin-bottom: 1.5rem; padding-left: 1.5rem; list-style: disc; }
.text-page li { margin-bottom: .5rem; }
.text-page a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.text-page a:hover { color: var(--accent-ink); }

/* ── MOTION ───────────────────────────────────────────────────────
   Transform + opacity only. Sections get .in from main.js when they enter
   the viewport; children reveal in sequence via --col-delay / --i.
   Everything is disabled under prefers-reduced-motion.            */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideL   { from { opacity: 0; transform: translateX(-40px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes slideR   { from { opacity: 0; transform: translateX(40px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes popIn    { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
@keyframes nudge    { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes heroArt  { from { opacity: 0; transform: translateX(48px) scale(.98); } to { opacity: 1; transform: none; } }

/* Hidden start states — only before a section is revealed, and only when JS runs
   (no-JS visitors see everything). Animations fill backwards, so once they finish the
   element returns to its normal styles and hover transforms work. */
.js [data-animate]:not(.in) :is(.animate-child, .hero-full-copy > *, .hero-art, .num, .flow-arrow,
  .check-list li, .x-list li, .qa-card, .demo-steps li, .result) { opacity: 0; }

/* Hero: copy lines rise in sequence, illustration drifts in from the right */
[data-animate].in .hero-full-copy > * { animation: fadeUp .7s var(--ease) backwards; }
[data-animate].in .hero-full-copy > :nth-child(2) { animation-delay: 80ms; }
[data-animate].in .hero-full-copy > :nth-child(3) { animation-delay: 160ms; }
[data-animate].in .hero-full-copy > :nth-child(4) { animation-delay: 240ms; }
[data-animate].in .hero-full-copy > :nth-child(5) { animation-delay: 320ms; }
[data-animate].in .hero-art { animation: heroArt 1s var(--ease) 200ms backwards; }

/* Section blocks */
[data-animate].in .animate-child { animation: fadeUp .65s var(--ease) backwards; animation-delay: var(--col-delay, 0ms); }

/* Step sections: media slides in from its own side, copy rises */
.step[data-animate].in .step-media { animation: slideR .8s var(--ease) 120ms backwards; }
.step.flip[data-animate].in .step-media { animation-name: slideL; }

/* Step numbers pop after their block lands */
[data-animate].in .num { animation: popIn .5s var(--ease) backwards; animation-delay: calc(var(--col-delay, 0ms) + 200ms); }

/* Overview flow arrows nudge in after their column */
[data-animate].in .flow-arrow { animation: nudge .5s var(--ease) backwards; animation-delay: calc(var(--col-delay, 0ms) + 350ms); }

/* Lists and cards cascade item by item */
[data-animate].in .check-list li,
[data-animate].in .x-list li,
[data-animate].in .demo-steps li {
  animation: nudge .45s var(--ease) backwards;
  animation-delay: calc(var(--col-delay, 0ms) + 300ms + var(--i, 0) * 70ms);
}
[data-animate].in .qa-card { animation: fadeUp .5s var(--ease) backwards; animation-delay: calc(300ms + var(--i, 0) * 90ms); }
[data-animate].in .result { animation: fadeUp .5s var(--ease) 700ms backwards; }

/* Hover: gentle lift on cards and illustrations (transform only) */
.qa-card, .price, .ov-img, .step-img { transition: transform .3s var(--ease); }
.qa-card:hover { transform: translateX(4px); }
.price:hover { transform: translateY(-4px); }
.ov-col:hover .ov-img, .step-media:hover .step-img { transform: scale(1.02); }

/* Console: panels fade up when switching tabs */
.console-panel.active { animation: fadeUp .35s var(--ease) backwards; }

/* ── SCROLL-LINKED MOTION (Apple-style) ──────────────────────────
   Tied to scroll position rather than time: scenes settle into place as
   they arrive and ease back as they leave, and it all reverses on scroll
   up. Pure CSS scroll timelines — no JS, runs on the compositor. Uses the
   individual `translate` / `scale` properties so it never fights the
   time-based reveals and hover transforms above (which use `transform`).
   Browsers without scroll timelines keep the time-based reveals only.  */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes sc-hero-copy { to { translate: 0 -48px; opacity: .15; } }
    @keyframes sc-hero-art  { to { translate: 0 36px; scale: .94; opacity: .4; } }
    @keyframes sc-settle    { from { translate: 0 56px; scale: .9; } to { translate: 0 0; scale: 1; } }
    @keyframes sc-recede    { from { scale: 1; opacity: 1; } to { scale: .96; opacity: .55; } }
    @keyframes sc-title     { from { translate: 0 28px; opacity: .15; } to { translate: 0 0; opacity: 1; } }
    @keyframes sc-lift      { from { translate: 0 40px; scale: .96; } to { translate: 0 0; scale: 1; } }
    @keyframes sc-zoom      { from { scale: .88; opacity: .3; } to { scale: 1; opacity: 1; } }

    /* Hero: the copy drifts up and fades, the scene sinks back more slowly (depth) */
    /* (tied to page scroll, so it starts fully visible at the top) */
    .hero-full-copy      { animation: sc-hero-copy linear both; animation-timeline: scroll(root block); animation-range: 0 60vh; }
    .hero-bg > .hero-ill { animation: sc-hero-art  linear both; animation-timeline: scroll(root block); animation-range: 0 75vh; }

    /* Detail steps: each scene rises and grows into place, then recedes as you move on */
    .step-media .step-img {
      animation: sc-settle linear both, sc-recede linear forwards; /* recede must not fill backwards over settle */
      animation-timeline: view(), view();
      animation-range: entry 0% entry 100%, exit 10% exit 100%;   /* settled once fully in view, before its fold holds */
    }
    .step-copy h3 { animation: sc-title linear both; animation-timeline: view(); animation-range: entry 10% entry 100%; }

    /* Developer flow and code, the pricing row and the closing line lift in
       (on wrappers — the cards themselves already have a time-based reveal) */
    .dev-flow, .code-tabs { animation: sc-lift linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .prices              { animation: sc-lift linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .final h2            { animation: sc-zoom linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 860px) {
  /* three overview columns stack to one rather than leaving step 3 alone on a row */
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-col { border-left: 0; }
  .ov-col + .ov-col { border-top: 1px solid var(--line); }
  .ov-col .flow-arrow { display: none; }
}
@media (max-width: 960px) {
  .step-grid, .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .step.flip .step-copy { order: 0; justify-self: start; }
  .step-copy { max-width: 680px; }
  .step-img { max-height: 440px; }
}
@media (max-width: 900px), (pointer: coarse) {
  .btn { min-height: 44px; }
  .foot-col a { min-height: 44px; }
}
@media (max-width: 900px) {
  .prices { grid-template-columns: minmax(0, 1fr); max-width: 440px; margin: 0 auto; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; --rail-h: 52px; }
  section { padding: 64px 0; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-col { --ov-pad: 20px; border-left: 0; padding: 40px var(--ov-pad); }
  .ov-col + .ov-col { border-top: 1px solid var(--line); }
  .ov-col .flow-arrow { display: none; }
  .lede { font-size: 17px; }
  .console-annotation { display: none; }
}
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; }
}

/* Print */
@media print {
  .nav, .step-rail, .skip-link { display: none; }
  .js [data-animate] * { opacity: 1 !important; animation: none !important; }
}
