/* ==========================================================================
   Extractron — company site
   Cinematic dark-first layout: animated wireframe mesh backdrop, HUD framing,
   statement typography, dense panels for substance.
   Brand from materials/logo_final[_dark].svg — navy hexagonal bracket,
   blue→cyan data flow, lowercase wordmark with gradient "x",
   EXTRACT · STRUCTURE · EMPOWER lockup.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
  --navy: #0b1729;
  --cyan: #22d3ee;
  --mint: #2dd4bf;
  --teal: #0d9488;

  --bg: #f2f6fb;
  --bg-soft: #e9eff8;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --panel-border: rgba(226, 232, 240, 0.9);
  --panel-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --hairline: #e2e8f0;

  --text: #334155;
  --text-strong: #0f172a;
  --text-muted: #64748b;
  --label: #64748b;

  --accent: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --accent-line: rgba(47, 126, 247, 0.4);

  --hud: rgba(47, 126, 247, 0.35);

  --radius: 12px;
  --radius-lg: 18px;
  --stream: linear-gradient(90deg, #1d4ed8 0%, #2f7ef7 45%, #22d3ee 100%);
}

html.dark {
  --bg: #04060a;
  --bg-soft: #080b11;
  --panel: rgba(8, 11, 17, 0.72);
  --panel-solid: rgba(10, 14, 21, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-shadow: none;
  --hairline: rgba(255, 255, 255, 0.08);

  --text: #cbd5e1;
  --text-strong: #ffffff;
  --text-muted: #94a3b8;
  --label: #94a3b8;

  --accent: #22d3ee;
  --accent-soft: rgba(34, 211, 238, 0.1);
  --accent-line: rgba(34, 211, 238, 0.3);
  --teal: #2dd4bf;

  --hud: rgba(34, 211, 238, 0.28);
}

html { color-scheme: light; scroll-behavior: smooth; scroll-padding-top: 5rem; }
html.dark { color-scheme: dark; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Depth wash behind the mesh — keeps the true-black floor but not flat. */
html.dark body {
  background-image:
    radial-gradient(ellipse 70% 50% at 50% -5%, rgba(29, 78, 216, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 45% at 50% 105%, rgba(34, 211, 238, 0.1), transparent 70%);
  background-attachment: fixed;
}
html:not(.dark) body {
  background-image: radial-gradient(ellipse 70% 50% at 50% -5%, rgba(47, 126, 247, 0.09), transparent 70%);
  background-attachment: fixed;
}

::selection { background: rgba(34, 211, 238, 0.25); color: var(--text-strong); }

* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
html.dark * { scrollbar-color: #1b222e transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border-radius: 999px; background: #cbd5e1; }
html.dark *::-webkit-scrollbar-thumb { background: #1b222e; }

a { color: inherit; text-decoration: none; }

/* --- Backdrop layers ------------------------------------------------------ */

/* Animated wireframe surface, drawn in assets/js/site.js. */
#mesh {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
}
html:not(.dark) #mesh { opacity: 0.6; }

/* Thin HUD frame + dashed centre guides, as a fixed overlay. */
.hud { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.hud span {
  position: absolute;
  width: 84px;
  height: 84px;
  border: 1px solid var(--hud);
}
/* Top pair clears the 64px header so the frame never crosses the nav. */
.hud span:nth-child(1) { top: 84px; left: 22px; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.hud span:nth-child(2) { top: 84px; right: 22px; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.hud span:nth-child(3) { bottom: 22px; left: 22px; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.hud span:nth-child(4) { bottom: 22px; right: 22px; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.hud i {
  position: absolute;
  left: 50%;
  width: 0;
  height: 54px;
  border-left: 1px dashed var(--hud);
}
.hud i:nth-child(5) { top: 84px; }
.hud i:nth-child(6) { bottom: 0; }

/* Corner brackets breathe, and a tracer drops down the top centre guide. */
.hud span { animation: hud-breathe 6s ease-in-out infinite; }
.hud span:nth-child(2) { animation-delay: 1.5s; }
.hud span:nth-child(3) { animation-delay: 3s; }
.hud span:nth-child(4) { animation-delay: 4.5s; }
@keyframes hud-breathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.hud b {
  position: absolute;
  top: 84px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 10px 1px var(--cyan);
  animation: hud-tracer 5s ease-in-out infinite;
}
@keyframes hud-tracer {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(52px); opacity: 0; }
}

/* Everything above the backdrop. */
.site-header, main, .site-footer, .to-top { position: relative; z-index: 2; }

@media (max-width: 780px) {
  .hud span { width: 46px; height: 46px; top: 12px; left: 12px; }
  .hud span:nth-child(2) { right: 12px; left: auto; }
  .hud span:nth-child(3) { bottom: 12px; top: auto; }
  .hud span:nth-child(4) { bottom: 12px; right: 12px; top: auto; left: auto; }
  .hud i { display: none; }
}

/* --- Typography ----------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', ui-sans-serif, sans-serif;
  color: var(--text-strong);
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6.2vw, 4.8rem); font-weight: 600; line-height: 1.02; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 600; line-height: 1.1; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.015em; }
h4 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0; }
.lede { font-size: clamp(1.15rem, 1.9vw, 1.5rem); line-height: 1.45; color: var(--text-muted); max-width: 30ch; }
.sub { color: var(--text-muted); max-width: 42ch; font-size: 1.0625rem; line-height: 1.55; }
strong { color: var(--text-strong); font-weight: 600; }

/* Big centred statement — the site's punctuation between dense sections. */
.statement {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.85rem, 4.6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--text-strong);
  text-align: center;
  text-wrap: balance;
  max-width: 22ch;
  margin: 0 auto;
}
.statement-wide { max-width: 30ch; }
/* Statement voice at panel scale — the vision/mission cards on about.html. */
.statement-sm {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  text-align: left;
  max-width: 26ch;
  margin: 0.8rem 0 0;
}

.micro {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--label);
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.grad-text {
  background: var(--stream);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Layout --------------------------------------------------------------- */

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4.25rem 0; position: relative; }
/* A section that butts straight onto the one above it (the illustration and
   card blocks that belong to the same argument) drops its top padding. */
.section-flush { padding-top: 0; }
.section-snug { padding-top: 1rem; }
.section-head { max-width: 46ch; margin-bottom: 1.9rem; }
.section-head .micro { display: block; margin-bottom: 0.5rem; }
.section-head h2 + .sub { margin-top: 0.6rem; }
.section-head .chip { margin-bottom: 0.8rem; }
.center { text-align: center; }
/* `.center` sits either on an ancestor or on the .section-head itself. */
.center .section-head, .section-head.center,
.center .sub, .center .lede { margin-left: auto; margin-right: auto; }
.center .cta-row { justify-content: center; }
.cta-end { justify-content: flex-end; }

/* Cinematic full-height stage for statements. */
.stage {
  min-height: min(58vh, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 3rem 0;
  text-align: center;
}
.stage-tight { min-height: 0; padding: 2.75rem 0; }
.stage .cta-row { justify-content: center; margin-top: 1.8rem; }

.head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.head-row .section-head { margin-bottom: 0; }

/* --- Panels --------------------------------------------------------------- */

.panel {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(10px);
}
.panel-pad { padding: 1.35rem; }
.panel-pad > .chip:first-child { margin-bottom: 0.9rem; }
.panel-interactive { transition: border-color 0.18s ease; }
.panel-interactive:hover { border-color: var(--accent-line); }

.panel-top::before {
  content: '';
  position: absolute;
  inset: -1px auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-line), transparent);
}

.reticle::before,
.reticle::after {
  content: '';
  position: absolute;
  width: 0.9rem;
  height: 0.9rem;
  border-color: var(--accent-line);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.reticle::before { top: 0.55rem; left: 0.55rem; border-left: 2px solid; border-top: 2px solid; border-top-left-radius: 6px; }
.reticle::after { bottom: 0.55rem; right: 0.55rem; border-right: 2px solid; border-bottom: 2px solid; border-bottom-right-radius: 6px; }
.reticle:hover::before,
.reticle:hover::after { opacity: 1; }

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.72rem 1.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--stream);
  color: #fff;
  box-shadow: 0 6px 26px -8px rgba(47, 126, 247, 0.8);
  /* `.btn` reserves a 1px transparent border. A background image is sized to
     the padding box by default but painted across the border box, and it
     repeats — so the gradient tiles, and the 1px strip down each edge shows the
     wrong end of it: cyan on the left, dark blue on the right. Sizing the
     gradient to the border box instead makes one tile cover the whole button.
     Any gradient sitting under a transparent border needs this. */
  background-origin: border-box;
}
.btn-primary:hover { box-shadow: 0 8px 32px -8px rgba(34, 211, 238, 0.85); }
.btn-ghost {
  border-color: var(--panel-border);
  background: var(--panel);
  color: var(--text-muted);
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--accent-line); color: var(--text-strong); }
.btn-lg { padding: 0.9rem 1.9rem; font-size: 1.0625rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; }

/* Floating scroll-to-top pill. */
.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--stream);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  /* visibility, not just opacity — otherwise the button stays in the tab order
     while invisible and keyboard users land on a control they can't see. */
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  box-shadow: 0 8px 28px -10px rgba(34, 211, 238, 0.9);
}
.to-top.is-in {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}
.to-top svg { width: 18px; height: 18px; }

/* --- Chips / status ------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.chip-mint { border-color: rgba(45, 212, 191, 0.45); background: rgba(45, 212, 191, 0.1); color: var(--teal); }
.chip-rose { border-color: rgba(244, 63, 94, 0.4); background: rgba(244, 63, 94, 0.08); color: #e11d48; }
html.dark .chip-rose { color: #fb7185; }

.dot { width: 6px; height: 6px; border-radius: 999px; background: var(--mint); box-shadow: 0 0 8px rgba(45, 212, 191, 0.8); flex: none; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 0.48rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
}
.eyebrow b { color: var(--accent); font-weight: 600; }

/* --- Brand lockup ---------------------------------------------------------
   The lockup is the master artwork itself — assets/img/logo*.svg, exported
   from materials/logo_final[_dark].svg with the background plate dropped and
   the Sora/Space Grotesk type outlined, so no font ships with it. Two files
   rather than one recoloured file: the wordmark ink and the gradient on the
   "x" both flip between themes, which currentColor can't express. The header
   takes the mark+wordmark crop, since the tagline stops being legible much
   below 40px; the footer has the room for the full lockup. */

.brand { display: inline-flex; align-items: center; }
.nav .brand { margin-right: auto; }
.logo { display: block; height: 40px; width: auto; flex: none; }
.brand-lg .logo { height: 58px; }
.logo-dark { display: none; }
html.dark .logo-light { display: none; }
html.dark .logo-dark { display: block; }

/* --- Header / nav --------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--hairline);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(14px);
}
.nav { display: flex; align-items: center; gap: 1.25rem; height: 64px; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
/* Products is a <button>, not an <a> — it opens the dropdown and goes nowhere
   on its own (there's no single "all products" page to send a click to). The
   background/border/font/cursor resets below exist only so it reads
   identically to the <a> siblings either side of it; nothing here is
   link-specific. */
.nav-link {
  position: relative;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.nav-link:hover { color: var(--text-strong); background: var(--accent-soft); }
.nav-link[aria-current='page'] { color: var(--text-strong); }
.nav-link[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.05rem;
  height: 2px;
  border-radius: 2px;
  background: var(--stream);
}
/* --- Products menu ---------------------------------------------------------
   Opens on hover and on keyboard focus. Deliberately CSS-only: `:focus-within`
   does the keyboard case, so there is no state to keep in sync and nothing to
   break with JS disabled.

   The closed state uses opacity + pointer-events, NOT `visibility: hidden` or
   `display: none` — either of those drops the links out of the tab order, so a
   keyboard user could never reach the menu that `:focus-within` is supposed to
   open. Invisible-but-focusable is safe here precisely because focus landing
   anywhere inside reveals it.
   -------------------------------------------------------------------------- */

.nav-item { position: relative; display: flex; align-items: center; }
.nav-caret {
  width: 13px;
  height: 13px;
  margin-left: 0.28rem;
  vertical-align: -1px;
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.has-menu:hover .nav-caret,
.has-menu:focus-within .nav-caret { transform: rotate(180deg); opacity: 1; }
.has-menu > .nav-link { display: inline-flex; align-items: center; }

.nav-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 40;
  width: 310px;
  padding: 0.4rem;
  /* The gap between link and panel is margin *inside* the box, so the pointer
     never crosses dead space on the way down and the menu can't flicker shut. */
  margin-top: 0.55rem;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: 0 18px 40px rgba(4, 6, 10, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.nav-menu::before {
  /* Invisible bridge over the gap, for the same reason. */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -0.6rem;
  height: 0.6rem;
}
.has-menu:hover .nav-menu,
.has-menu:focus-within .nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-menu-row {
  display: grid;
  gap: 0.15rem;
  padding: 0.6rem 0.7rem;
  border-radius: 9px;
  transition: background 0.15s ease;
}
.nav-menu-row:hover,
.nav-menu-row:focus-visible { background: var(--accent-soft); }
.nav-menu-top { display: flex; align-items: center; gap: 0.5rem; }
.nav-menu-name { font-size: 0.9375rem; font-weight: 600; color: var(--text-strong); }
.nav-menu-top .chip { margin-left: auto; }
.nav-menu-note { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.35; }

.nav-menu-all {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  padding: 0.6rem 0.7rem;
  border-top: 1px solid var(--hairline);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.nav-menu-all svg { width: 13px; height: 13px; }
.nav-menu-all:hover { color: var(--text-strong); }

/* The three planned products share a grid row, so every menu link scrolls to
   the same place. Mark the one that was actually asked for. */
.card:target {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.nav-actions { display: flex; align-items: center; gap: 0.45rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--text-strong); border-color: var(--accent-line); }
.icon-btn svg { width: 16px; height: 16px; }
#theme-toggle .icon-moon { display: none; }
html.dark #theme-toggle .icon-moon { display: block; }
html.dark #theme-toggle .icon-sun { display: none; }
.nav-toggle { display: none; }

/* --- Hero ----------------------------------------------------------------- */

.hero { position: relative; padding: 2.5rem 0 1.5rem; }
/* Home only (no other page uses .hero-stage). Deliberately shorter than a
   classic full-viewport cinematic hero: the home page's brief is "one look,
   everything" — the hero has to leave room in the first screen for the stat
   strip below it, not fill the screen by itself. */
.hero-stage {
  min-height: min(40vh, 380px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.15rem;
}
.hero-stage .lede { max-width: 30ch; }
.hero-slim { padding: 2.5rem 0 1.25rem; }
.hero-slim .eyebrow { margin-bottom: 1rem; }
.hero-slim h1 { font-size: clamp(2.3rem, 5.4vw, 4.1rem); }
.hero-slim .lede { margin-top: 1rem; }

.spec-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--hairline);
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.spec { background: var(--panel); padding: 1.4rem 1.35rem; text-align: left; }
.spec-num {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.spec .micro { display: block; margin-top: 0.2rem; }

/* --- The simulator ---------------------------------------------------------
   The home page's one demonstration: a messy document in, the asked-for
   details lit up on the page, a row in the sheet. Every state is driven by a
   class on #sim (.sim-1 / .sim-2 / .sim-3) rather than inline style, so the
   JS only ever swaps one attribute and the whole panel follows.
   -------------------------------------------------------------------------- */

.sim { overflow: hidden; }
/* The JS shows and hides parts of the panel with the `hidden` property, and
   several of them carry a class that sets `display` (.sim-drop is a grid, .btn
   an inline-flex). A class beats the UA's `[hidden] { display: none }` on
   specificity, so without this the attribute is set and nothing happens. */
.sim [hidden] { display: none; }

.sim-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}
.sim-rail-step {
  background: var(--panel);
  padding: 0.7rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.35s ease, color 0.35s ease;
}
.sim-rail-step b { color: var(--accent); margin-right: 0.45rem; font-weight: 600; }
.sim-1 .sim-rail-step[data-step='1'],
.sim-2 .sim-rail-step[data-step='2'],
.sim-3 .sim-rail-step[data-step='3'] { opacity: 1; color: var(--text-strong); }
/* Steps already walked stay legible — the rail is a trail, not a spotlight. */
.sim-2 .sim-rail-step[data-step='1'],
.sim-3 .sim-rail-step[data-step='1'],
.sim-3 .sim-rail-step[data-step='2'] { opacity: 0.8; }

.sim-body {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 1px;
  background: var(--panel-border);
}
.sim-stage,
.sim-out { background: var(--panel); padding: 1.5rem; }
.sim-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 310px;
}

/* Empty state */
.sim-drop {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 2rem 1rem;
  width: 100%;
  border: 1.5px dashed var(--accent-line);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
}
.sim-drop svg { width: 30px; height: 30px; color: var(--accent); opacity: 0.75; margin-bottom: 0.35rem; }
.sim-drop p { margin: 0; color: var(--text-strong); font-weight: 500; }

/* The document. Tilted and creased so it reads as something off a scanner
   rather than a tidy mock — the copy promises "creased and photographed",
   and the demo should look like the thing it promises. */
.sim-paper {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0;
  transform: rotate(-1.5deg);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.sim-0 .sim-paper { opacity: 0; transform: rotate(-1.5deg) translateY(14px) scale(0.97); }
.sim-paper-tag {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sim-paper-file { color: var(--accent); }
.sim-sheetpaper {
  position: relative;
  padding: 1rem 1.05rem 1.15rem;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--panel-solid);
  box-shadow: 0 12px 30px rgba(4, 6, 10, 0.28);
  font-size: 0.8125rem;
  overflow: hidden;
}
/* The crease: a soft diagonal sheen, not a drawn line. */
.sim-sheetpaper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(103deg, transparent 41%, rgba(120, 140, 170, 0.16) 47%, transparent 53%);
  pointer-events: none;
}
.sim-p-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.55rem; }
.sim-p-title { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; letter-spacing: 0.1em; color: var(--accent); }
.sim-p-no { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-muted); }
.sim-p-line { margin: 0 0 0.1rem; font-weight: 600; color: var(--text-strong); }
.sim-p-sub { margin: 0 0 0.7rem; font-size: 0.75rem; color: var(--text-muted); }
/* Two lines sit very slightly off-square — a page that was photographed, not typeset. */
.sim-p-lean { transform: rotate(-0.5deg); }
.sim-p-lean-b { transform: rotate(0.4deg); }
.sim-p-rule { height: 1px; background: var(--hairline); margin: 0.55rem 0; }
.sim-p-row { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 0.3rem; color: var(--text); }
.sim-p-row span:last-child { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.sim-p-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 0.55rem 0 0;
  font-weight: 600;
  color: var(--text-strong);
}
.sim-p-total > span:first-child { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; letter-spacing: 0.08em; }

/* The highlight that fires when a detail is found on the page. */
.sim-hl {
  background: transparent;
  color: inherit;
  border-radius: 3px;
  padding: 0.05em 0.25em;
  margin: 0 -0.25em;
  box-shadow: 0 0 0 1px transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}
.sim-hl.is-found {
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-line);
  color: var(--text-strong);
}

/* Right-hand column */
.sim-out { display: flex; flex-direction: column; gap: 1.1rem; }
.sim-block { display: flex; flex-direction: column; gap: 0.55rem; }
.sim-block-grow { flex: 1; }

.sim-fields { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.sim-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: var(--panel-solid);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.sim-field-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.sim-field-val {
  font-weight: 600;
  color: var(--text-strong);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.sim-field-val.mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.sim-field.is-found { border-color: var(--accent-line); }
.sim-field.is-found .sim-field-val { opacity: 1; transform: none; }
/* Before a value arrives, the row shows a placeholder rule where it will land. */
.sim-field::after {
  content: '';
  width: 46px;
  height: 7px;
  border-radius: 4px;
  background: var(--text-muted);
  opacity: 0.18;
  transition: opacity 0.25s ease;
}
.sim-field.is-found::after { opacity: 0; width: 0; }

.sim-sheet {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-solid);
}
.sim-tr {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr) minmax(0, 0.7fr);
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--hairline);
}
.sim-tr:last-child { border-bottom: 0; }
.sim-tr .num { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; text-align: right; }
.sim-th {
  background: var(--accent-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}
.sim-rows .sim-tr {
  color: var(--text);
  opacity: 0;
  transform: translateY(-6px);
}
.sim-rows .sim-tr.is-in { opacity: 1; transform: none; transition: opacity 0.4s ease, transform 0.4s ease; }
.sim-empty { margin: 0; padding: 1.15rem 0.85rem; color: var(--text-muted); font-size: 0.875rem; }

.sim-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem 1.15rem;
  border-top: 1px solid var(--panel-border);
}
.sim-say { margin: 0 0 0 auto; color: var(--text-muted); font-size: 0.9375rem; text-align: right; }

@media (max-width: 780px) {
  .sim-body { grid-template-columns: minmax(0, 1fr); }
  .sim-stage { min-height: 0; padding: 1.25rem; }
  .sim-out { padding: 1.25rem; }
  .sim-bar { padding: 1rem 1.25rem; }
  .sim-say { margin: 0; text-align: left; flex-basis: 100%; }
  .sim-rail-step { padding: 0.6rem; font-size: 0.65rem; text-align: center; }
  .sim-rail-step b { display: block; margin: 0 0 0.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sim-paper,
  .sim-hl,
  .sim-field,
  .sim-field-val,
  .sim-field::after,
  .sim-rail-step,
  .sim-rows .sim-tr.is-in { transition: none; }
  .sim-0 .sim-paper { transform: rotate(-1.5deg); }
}

/* --- Illustrations -------------------------------------------------------- */

.illus { display: block; width: 100%; height: auto; color: var(--navy); }
/* Narrow-viewBox illustrations scale their labels up when stretched — cap the
   width so label sizing stays consistent with the wide diagrams. */
.illus-narrow { max-width: 620px; margin-inline: auto; }
html.dark .illus { color: #fff; }
.illus-frame { padding: 2rem 1.75rem 1.5rem; overflow: hidden; }
/* The cards or callout that continue an illustration's argument sit tight
   under its frame rather than a full section gap away. */
.illus-frame + .cards,
.illus-frame + .callout { margin-top: 0.85rem; }

.il-card { fill: var(--panel-solid); stroke: var(--hairline); stroke-width: 1.5; }
.il-line { stroke: var(--text-muted); stroke-width: 3; stroke-linecap: round; opacity: 0.3; }
.il-arrow { stroke: var(--text-muted); stroke-width: 1.6; fill: none; opacity: 0.55; stroke-linecap: round; stroke-linejoin: round; }
.il-field { fill: var(--accent-soft); stroke: var(--accent-line); stroke-width: 1.4; stroke-dasharray: 4 3; }
.il-accent { fill: var(--accent); }
.il-mint { fill: var(--mint); }
.il-hair { stroke: var(--hairline); stroke-width: 1.2; }
.il-dash { stroke: var(--accent-line); stroke-width: 1.4; stroke-dasharray: 5 4; fill: none; }
.il-rose { stroke: #f43f5e; stroke-width: 1.8; fill: none; opacity: 0.8; }
.il-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.07em;
  fill: var(--label);
}
.il-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  fill: var(--text-strong);
}
.il-label-accent { fill: var(--accent); }
.il-label-mint { fill: var(--teal); }
.il-label-rose { fill: #e11d48; }
html.dark .il-label-rose { fill: #fb7185; }

/* Real document text inside the diagrams. The illustrations show an actual
   invoice and an actual sheet rather than grey placeholder bars, so they need
   body-sized type: .il-body for words, .il-num for figures (tabular, so the
   columns line up the way a real sheet does), .il-strong for the one value the
   eye should land on. */
.il-body { font-family: 'Inter', sans-serif; font-size: 12px; fill: var(--text); }
.il-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  fill: var(--text);
}
.il-strong { font-weight: 600; fill: var(--text-strong); }
.il-faint { fill: var(--text-muted); opacity: 0.75; }

/* --- Cards / grids -------------------------------------------------------- */

.cards { display: grid; gap: 0.85rem; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { padding: 1.55rem; text-align: left; }
.card-index {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.card h3 { margin: 0.6rem 0 0.4rem; }
/* A status chip or eyebrow label above the heading needs a little more air. */
.card .chip + h3, .card .micro + h3 { margin-top: 0.75rem; }
.card p { color: var(--text-muted); font-size: 1rem; line-height: 1.5; }

.edge-list { display: grid; gap: 0.85rem; }

/* --- Tables --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--panel-border); border-radius: var(--radius); background: var(--panel); backdrop-filter: blur(10px); text-align: left; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 26rem; }
table.data th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--label);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
table.data td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--hairline); color: var(--text-muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data td:first-child { color: var(--text-strong); }
table.data td.num { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.th-drift { color: #e11d48 !important; }
html.dark .th-drift { color: #fb7185 !important; }
.th-locked { color: var(--teal) !important; }

.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; align-items: start; text-align: left; }
.compare-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.55rem; }

/* Before/after demonstration row: explanation, the old way, the new way. */
.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) 1.75rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  text-align: left;
}
.demo-grid h3 { margin: 0.55rem 0 0.45rem; font-size: 1.35rem; }
.demo-box {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.8rem 0.85rem;
  background: var(--bg-soft);
  font-size: 0.95rem;
  color: var(--text-muted);
  min-height: 5.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}
.demo-box.is-good { border-color: rgba(45, 212, 191, 0.4); background: rgba(45, 212, 191, 0.06); }
.demo-box .mono { color: var(--text-strong); font-size: 0.875rem; line-height: 1.6; }
.demo-box table.data { min-width: 0; font-size: 0.875rem; }
.demo-box table.data th, .demo-box table.data td { padding: 0.34rem 0.5rem; }
.demo-cap { display: block; text-align: center; margin-top: 0.5rem; }
.demo-arrow { color: var(--accent); opacity: 0.6; text-align: center; font-size: 1.5rem; }
.demo-pair { display: flex; justify-content: space-between; gap: 1rem; font-family: 'JetBrains Mono', monospace; font-size: 0.875rem; }
.demo-pair span:last-child { color: var(--text-strong); }
.demo-bad span:last-child { color: #e11d48; }
html.dark .demo-bad span:last-child { color: #fb7185; }
.demo-ok span:last-child { color: var(--teal); }

@media (max-width: 900px) {
  .demo-grid { grid-template-columns: minmax(0, 1fr); }
  .demo-arrow { transform: rotate(90deg); }
}

/* --- Splits / callouts ---------------------------------------------------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.25rem; align-items: center; text-align: left; }
.split-wide { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }

.callout {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background:
    radial-gradient(ellipse 70% 120% at 100% 0%, var(--accent-soft), transparent 70%),
    var(--panel);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.callout::before {
  content: '';
  position: absolute;
  inset: -1px auto auto 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(to right, transparent, var(--accent-line), transparent);
}

.kv { display: grid; gap: 0; }
.kv-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.85rem; padding: 0.7rem 0; border-bottom: 1px solid var(--hairline); }
.kv-row:last-child { border-bottom: 0; }
.kv-row dd { margin: 0; color: var(--text-strong); font-size: 1.0625rem; font-weight: 500; }

.tick-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; text-align: left; }
.tick-list li { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 1.125rem; line-height: 1.45; color: var(--text); }
.tick-list svg { width: 20px; height: 20px; flex: none; margin-top: 0.3rem; color: var(--mint); }

/* --- Footer -------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--hairline); margin-top: 2rem; padding: 2.25rem 0 2rem; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.35rem; }
.footer-links a { font-size: 0.9375rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--text-strong); }
.footer-meta { font-size: 0.875rem; color: var(--text-muted); }

/* --- Reveal on scroll ---------------------------------------------------- */

[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hud span, .hud b { animation: none; }
  .hud b { display: none; }
  html { scroll-behavior: auto; }
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1040px) {
  .split, .split-wide { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
}

@media (max-width: 780px) {
  .section { padding: 2.5rem 0; }
  .stage { min-height: 0; padding: 3rem 0; }
  .hero-stage { min-height: 0; padding: 1.5rem 0; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
    padding: 0.6rem 1.5rem 1rem;
    background: var(--panel-solid);
    border-bottom: 1px solid var(--hairline);
    backdrop-filter: blur(14px);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-link { padding: 0.55rem 0.5rem; }
  .nav-link[aria-current='page']::after { left: 0.5rem; right: auto; width: 1.25rem; }

  /* In the burger panel there is nothing to hover, so the product list is
     simply part of the menu: static, always open, indented under Products.
     Every popup property has to be unwound, not just `position`. */
  .nav-item { display: block; }
  .nav-caret { display: none; }
  .nav-menu {
    position: static;
    width: auto;
    margin: 0.1rem 0 0.35rem 0.5rem;
    padding: 0.15rem 0 0.15rem 0.75rem;
    border: 0;
    border-left: 1px solid var(--hairline);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .nav-menu::before { content: none; }
  .nav-menu-row { padding: 0.45rem 0.5rem; }
  .nav-menu-note { display: none; }
  .nav-menu-all { margin-top: 0.15rem; padding: 0.5rem; }
  .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare, .cards-2, .cards-3 { grid-template-columns: minmax(0, 1fr); }
  .kv-row { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .brand-lg .logo { height: 46px; }
  .to-top { right: 1rem; bottom: 1rem; }
}

/* Narrow phones: the nav can't carry the lockup and a pill CTA at once, so
   the header logo shrinks (the footer keeps the full-size lockup). */
@media (max-width: 640px) {
  .nav { gap: 0.6rem; }
  .nav .logo { height: 27px; }
  .nav-actions .btn { padding: 0.52rem 0.9rem; font-size: 0.8125rem; }
}

/* Below this width a 900-unit diagram scales to about a third, which turns the
   real invoice text inside it into 4px. Let the wide illustrations keep a
   legible minimum and swipe sideways instead of shrinking to nothing. */
@media (max-width: 780px) {
  .illus-frame { overflow-x: auto; overscroll-behavior-x: contain; }
  .illus { min-width: 720px; }
  .illus-narrow { min-width: 0; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 1.1rem; }
  .callout, .illus-frame { padding: 1.25rem; }
  .panel-pad, .card { padding: 1.1rem; }
  .statement { max-width: 18ch; }
}
