:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-elev-2: #1c2128;
  --bg-line: #010409;
  --border: #30363d;
  --border-soft: #21262d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --text-faint: #6e7681;

  /* Editor accents */
  --red: #f85149;        /* error squiggle */
  --yellow: #d29922;     /* warning squiggle */
  --blue: #58a6ff;       /* hint / link */
  --green: #3fb950;      /* success */
  --purple: #bc8cff;
  --orange: #ff9e64;
  --cyan: #79c0ff;

  /* syntax */
  --kw: #ff7b72;        /* keyword */
  --fn: #d2a8ff;        /* function */
  --str: #a5d6ff;       /* string */
  --num: #79c0ff;       /* number */
  --com: #8b949e;       /* comment */
  --type: #ffa657;      /* type/class */
  --var: #e6edf3;       /* identifier */

  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); }

/* ── Editor chrome ──────────────────────────────────── */
.editor {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.6);
}
.editor-tabs {
  display: flex;
  background: var(--bg-line);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}
.editor-tabs .tab {
  padding: 8px 16px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.editor-tabs .tab.active {
  background: var(--bg-elev);
  color: var(--text);
  border-top: 2px solid var(--blue);
  margin-top: -1px;
  padding-top: 7px;
}
.editor-tabs .tab .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--yellow);
}
.editor-body {
  display: flex;
  background: var(--bg-elev);
}
.editor-body[hidden] { display: none; }
.gutter {
  padding: 14px 12px 14px 16px;
  color: var(--text-faint);
  text-align: right;
  user-select: none;
  border-right: 1px solid var(--border-soft);
  background: var(--bg-elev);
  font-variant-numeric: tabular-nums;
}
.gutter span { display: block; }
.code {
  padding: 14px 18px;
  flex: 1;
  white-space: normal;
  overflow-x: auto;
  min-width: 0;
}
.code .ln {
  display: block;
  min-height: 1.65em;
  white-space: pre;
  overflow-wrap: normal;
}
/* Thin VS Code-style scrollbars on editor mockups */
.code::-webkit-scrollbar { height: 10px; width: 10px; }
.code::-webkit-scrollbar-track { background: transparent; }
.code::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 5px;
}
.code:hover::-webkit-scrollbar-thumb {
  background: rgba(139,148,158,.25);
}
.code:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(139,148,158,.4);
}
.code { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.code:hover { scrollbar-color: rgba(139,148,158,.25) transparent; }

/* Squiggly underlines */
.sq-error, .sq-warn, .sq-hint, .sq-info {
  text-decoration: none;
  background-repeat: repeat-x;
  background-position: 0 100%;
  padding-bottom: 2px;
  position: relative;
  cursor: help;
}
.sq-error {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='3' viewBox='0 0 6 3'><path d='M0 2 L1.5 0.5 L3 2 L4.5 0.5 L6 2' stroke='%23f85149' stroke-width='0.8' fill='none'/></svg>");
}
.sq-warn {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='3' viewBox='0 0 6 3'><path d='M0 2 L1.5 0.5 L3 2 L4.5 0.5 L6 2' stroke='%23d29922' stroke-width='0.8' fill='none'/></svg>");
}
.sq-hint, .sq-info {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='3' viewBox='0 0 6 3'><path d='M0 2 L1.5 0.5 L3 2 L4.5 0.5 L6 2' stroke='%2358a6ff' stroke-width='0.8' fill='none'/></svg>");
}

/* Syntax */
.kw { color: var(--kw); }
.fn { color: var(--fn); }
.str { color: var(--str); }
.num { color: var(--num); }
.com { color: var(--com); font-style: italic; }
.type { color: var(--type); }
.var { color: var(--var); }
.op { color: var(--text-dim); }

.diag-popover.diag-floating {
  position: absolute;
  z-index: 100;
  max-width: 460px;
  pointer-events: none;
  transition: opacity 0.12s;
}
.diag-target {
  cursor: pointer;
  text-decoration: none;
  background-repeat: repeat-x;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: filter .15s;
}
.diag-target:hover { filter: brightness(1.3); }
.diag-target[data-sev="err"] {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='3' viewBox='0 0 6 3'><path d='M0 2 L1.5 0.5 L3 2 L4.5 0.5 L6 2' stroke='%23f85149' stroke-width='0.8' fill='none'/></svg>");
}
.diag-target[data-sev="warn"] {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='3' viewBox='0 0 6 3'><path d='M0 2 L1.5 0.5 L3 2 L4.5 0.5 L6 2' stroke='%23d29922' stroke-width='0.8' fill='none'/></svg>");
}
.diag-target[data-sev="hint"] {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='3' viewBox='0 0 6 3'><path d='M0 2 L1.5 0.5 L3 2 L4.5 0.5 L6 2' stroke='%2358a6ff' stroke-width='0.8' fill='none'/></svg>");
}
.diag-target.is-active {
  outline: 1px solid rgba(88,166,255,.5);
  border-radius: 2px;
}

/* Editor tabs as buttons (when clickable) */
.editor-tabs button.tab {
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--text-faint);
  cursor: pointer;
}
.editor-tabs button.tab.active {
  color: var(--text);
}
.editor-tabs button.tab:not(.active):hover {
  background: rgba(255,255,255,.03);
  color: var(--text-dim);
}

/* Compare-table — prevent feature labels from wrapping mid-word weirdly,
   but let them wrap softly on narrow viewports */
.compare-table td:first-child { white-space: normal; }


.diag-popover {
  background: #252526;
  border: 1px solid #454545;
  border-radius: 3px;
  padding: 0;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgba(0,0,0,.55);
  max-width: 560px;
  color: #cccccc;
  overflow: hidden;
}
.diag-popover .diag-msg {
  padding: 8px 12px 6px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.diag-popover .diag-msg + .diag-msg {
  border-top: 1px solid #3a3a3a;
  padding-top: 10px;
}
.diag-popover .diag-icon {
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1.5;
  width: 14px;
  text-align: center;
  margin-top: 4px;
}
.diag-popover .diag-icon.err { color: var(--red); }
.diag-popover .diag-icon.warn { color: var(--yellow); }
.diag-popover .diag-icon.hint { color: var(--blue); }
.diag-popover .diag-text {
  flex: 1;
  min-width: 0;
}
.diag-popover .diag-source {
  color: #9cdcfe;
  font-weight: 500;
}
.diag-popover .diag-ruleid {
  color: #569cd6;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: var(--mono);
  font-size: 12px;
  margin-left: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--blue);
  color: #0a0e14;
}
.btn-primary:hover {
  background: #79b8ff;
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-elev);
  border-color: var(--text-dim);
  text-decoration: none;
}

/* Section primitives */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue);
  margin-bottom: 16px;
}
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(40px, 6vw, 72px); margin: 0; }
h2 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 16px 0; }
h3 { font-size: 20px; margin: 0 0 8px 0; }
p { color: var(--text-dim); }

.sec {
  padding: 96px 0;
  border-top: 1px solid var(--border-soft);
}

/* Feature cards */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 24px;
}
.card .icon-box {
  width: 100px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--blue);
}

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
}
.pill.live .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }

.kbd {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
}

/* Subtle striped placeholder for screenshots */
.shot-placeholder {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(139,148,158,.06) 0 12px,
      rgba(139,148,158,.10) 12px 24px
    ),
    var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
/* ── Thumbnail figure (the "click to expand" card) ─────────────── */
.popup-figure {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
[data-popup-file] {
  cursor: zoom-in;
}
.popup-figure img.popup-trigger {
  max-width: 88%;
  max-height: 78%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.28);
  transition: transform .2s ease, box-shadow .2s ease;
}
.popup-figure img.popup-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,.36);
}
.popup-caption {
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--mono);
}

/* ── Popup overlay ──────────────────────────────────────────────── */
.base-popup {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1200;
}
.base-popup.is-open {
  display: flex;
  animation: popup-fade-in .18s ease;
}
@keyframes popup-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.base-popup__backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

/* ── Modal box ──────────────────────────────────────────────────────
   IMAGE mode  — box scrolls vertically; header is sticky at top.
     Why: flex:1 on a child only gets space when the parent has a
     *definite* height (explicit height=, not just max-height). With
     no definite height the body collapses to 0px and the image is
     clipped. Scrolling the box itself (with sticky header) sidesteps
     the flex height problem entirely.
   EMBED mode  — box has an explicit height so flex:1 on the body
     works and the iframe fills the space.                          */
.base-popup__box {
  position: relative;
  z-index: 1;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 40px 80px -10px rgba(0,0,0,.7);
  animation: popup-box-in .2s cubic-bezier(.2,.8,.2,1);
  /* shared constraint */
  width: min(1100px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
}
@keyframes popup-box-in {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

/* IMAGE — flex column like embed, body is the scroll container */
.base-popup__box[data-mode="image"] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 40px);
}

/* EMBED — explicit height so iframe can flex-fill */
.base-popup__box[data-mode="embed"] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width:  calc(100vw - 40px);
  max-width: 1400px;
  height: calc(100vh - 40px);
}

/* ── Header ─────────────────────────────────────────────────────── */
.base-popup__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-elev);
  min-height: 46px;
  flex-shrink: 0;
}
/* In image mode the header is a flex item — it stays at top naturally */
.base-popup__box[data-mode="image"] .base-popup__header {
  flex-shrink: 0;
}

.base-popup__caption {
  flex: 1;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.base-popup__close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.base-popup__close:hover {
  background: var(--border);
  color: var(--text);
  border-color: var(--text-dim);
}

/* ── Body ────────────────────────────────────────────────────────── */
/* Image mode: body scrolls — flex:1 + min-height:0 lets it shrink and overflow-y works */
.base-popup__box[data-mode="image"] .base-popup__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,148,158,.25) transparent;
}
.base-popup__box[data-mode="image"] .base-popup__body::-webkit-scrollbar       { width: 8px; }
.base-popup__box[data-mode="image"] .base-popup__body::-webkit-scrollbar-track { background: transparent; }
.base-popup__box[data-mode="image"] .base-popup__body::-webkit-scrollbar-thumb {
  background: rgba(139,148,158,.25); border-radius: 4px;
}
.base-popup__box[data-mode="image"] .base-popup__body::-webkit-scrollbar-thumb:hover {
  background: rgba(139,148,158,.4);
}

/* Embed mode: column flex so iframe fills the remaining height */
.base-popup__box[data-mode="embed"] .base-popup__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Image ───────────────────────────────────────────────────────── */
.base-popup__image {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Embed iframe ────────────────────────────────────────────────── */
.base-popup__embed {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  display: block;
  background: #fff;
}

/* ── Hide inactive content ───────────────────────────────────────── */
.base-popup__box[data-mode="image"] .base-popup__embed { display: none; }
.base-popup__box[data-mode="embed"] .base-popup__image { display: none; }


  /* Page-specific layout */
  .nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(13,17,23,.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
  }
  .nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 32px;
    max-width: 1200px;
    margin: 0 auto;
  }
  .logo {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--mono); font-weight: 600; font-size: 15px;
    color: var(--text);
    text-decoration: none;
  }
  .logo-mark {
    width: 26px; height: 26px;
    border-radius: 6px;
    background: linear-gradient(135deg, #58a6ff 0%, #bc8cff 100%);
    display: inline-flex; align-items: center; justify-content: center;
    color: #0a0e14; font-weight: 700; font-size: 14px;
  }
  .nav-links { display: flex; gap: 28px; align-items: center; }
  .nav-links a { color: var(--text-dim); font-size: 14px; }
  .nav-links a:hover { color: var(--text); text-decoration: none; }

  /* HERO */
  .hero {
    padding: 88px 0 80px;
    border-top: none;
    background:
      radial-gradient(ellipse 800px 400px at 80% 0%, rgba(88,166,255,.08), transparent 60%),
      radial-gradient(ellipse 600px 300px at 0% 20%, rgba(188,140,255,.06), transparent 60%);
  }
  .hero-grid {
    display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px;
    align-items: center;
  }
  .hero h1 .grad {
    background: linear-gradient(90deg, #58a6ff 0%, #bc8cff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .hero p.lead {
    font-size: 19px; color: var(--text-dim);
    margin: 24px 0 32px; max-width: 540px;
    line-height: 1.55;
  }
  .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
  .hero-meta {
    display: flex; gap: 18px; margin-top: 28px;
    color: var(--text-faint); font-size: 13px;
    font-family: var(--mono);
    flex-wrap: wrap;
  }
  .hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
  .hero-meta .ok { color: var(--green); }

  /* Numbers strip */
  .numbers {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--bg-elev);
    overflow: hidden;
  }
  .num-cell {
    padding: 22px 24px;
    border-right: 1px solid var(--border-soft);
  }
  .num-cell:last-child { border-right: none; }
  .num-cell .n {
    font-family: var(--mono);
    font-size: 32px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
  }
  .num-cell .n .unit { color: var(--blue); }
  .num-cell .l {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  /* Three product columns */
  .products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .product-card {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 28px;
    display: flex; flex-direction: column;
    position: relative;
    overflow: hidden;
  }
  .product-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 2px;
  }
  .product-card.p1::before { background: linear-gradient(90deg, var(--blue), transparent); }
  .product-card.p2::before { background: linear-gradient(90deg, var(--purple), transparent); }
  .product-card.p3::before { background: linear-gradient(90deg, var(--green), transparent); }
  .product-card .pnum {
    font-family: var(--mono);
    color: var(--text-faint);
    font-size: 13px;
    margin-bottom: 12px;
  }
  .product-card h3 { font-size: 22px; margin-bottom: 6px; }
  .product-card .ptag {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 16px;
  }
  .product-card p { font-size: 14px; line-height: 1.55; flex-grow: 1; }
  .product-card .pmeta {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--mono); font-size: 12px;
    color: var(--text-dim);
  }
  .product-card .pmeta .stack { color: var(--text-faint); }

  /* Two-up split */
  .split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
  .split.reverse > :first-child { order: 2; }

  /* Diagnostic stack */
  .diag-list { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
  .diag-row {
    display: grid; grid-template-columns: 24px 80px 1fr;
    gap: 14px; align-items: start;
    padding: 12px 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 12.5px;
  }
  .diag-row .icon {
    width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
  }
  .diag-row.err .icon { background: rgba(248,81,73,.15); color: var(--red); }
  .diag-row.warn .icon { background: rgba(210,153,34,.15); color: var(--yellow); }
  .diag-row.hint .icon { background: rgba(88,166,255,.15); color: var(--blue); }
  .diag-row .ruleid { color: var(--text-dim); }
  .diag-row .msg { color: var(--text); }

  /* Architecture diagram */
  .arch {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .arch-row {
    display: flex; align-items: center; gap: 16px;
    flex-wrap: wrap;
  }
  .arch-node {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    font-family: var(--mono);
    font-size: 13px;
    min-width: 180px;
  }
  .arch-node .role {
    color: var(--text-faint);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
  }
  .arch-node .name { color: var(--text); font-weight: 500; }
  .arch-node.ext { border-color: var(--blue); }
  .arch-node.builder { border-color: var(--purple); }
  .arch-node.api { border-color: var(--green); }
  .arrow {
    color: var(--text-faint); font-family: var(--mono);
  }

  /* Comparison */
  .compare-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    overflow: hidden;
    font-size: 14px;
  }
  .compare-table th, .compare-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
  }
  .compare-table th {
    background: var(--bg-elev-2);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
  }
  .compare-table td:first-child {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
  }
  .compare-table .yes { color: var(--green); font-family: var(--mono); }
  .compare-table .no { color: var(--text-faint); font-family: var(--mono); }
  .compare-table .partial { color: var(--yellow); font-family: var(--mono); }
  .compare-table .scalearch-col {
    background: rgba(88,166,255,.05);
  }

  /* Rule chip list (in category cards) */
  .rule-chip-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .rule-chip-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
  }
  .rule-chip-list .r-id {
    color: var(--text);
    background: var(--bg-elev-2);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    line-height: 1.4;
  }
  .rule-chip-list .r-desc {
    color: var(--text-faint);
    font-size: 11px;
  }

  /* Architecture diagram (rebuilt) */
  .arch-v2 {
    background: var(--bg-elev);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 40px;
    display: grid;
    gap: 32px;
  }
  .arch-track {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: center;
  }
  .arch-track-label {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-faint);
    border-left: 2px solid var(--border);
    padding-left: 14px;
    line-height: 1.6;
  }
  .arch-track-label.t-ide { border-left-color: var(--blue); }
  .arch-track-label.t-runtime { border-left-color: var(--green); }
  .arch-track-label .t-title { color: var(--text); display:block; font-weight:500; margin-bottom:4px; font-size:13px; text-transform:none; letter-spacing:0; }
  .arch-track-flow {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  .arch-box {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: var(--mono);
    font-size: 12.5px;
    min-width: 170px;
  }
  .arch-box .role {
    color: var(--text-faint);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 4px;
  }
  .arch-box .name { color: var(--text); font-weight: 500; }
  .arch-box.builder { border-color: var(--purple); }
  .arch-box.ext { border-color: var(--blue); }
  .arch-box.api { border-color: var(--green); }
  .arch-box.dash { border-color: var(--yellow); }
  .arch-arrow {
    color: var(--text-faint);
    font-family: var(--mono);
    font-size: 11px;
    white-space: nowrap;
  }
  .arch-divider {
    height: 1px;
    background: var(--border-soft);
    grid-column: 1 / -1;
  }
  .arch-note {
    grid-column: 1 / -1;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-dim);
    background: var(--bg-elev-2);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--yellow);
    border-radius: 6px;
    padding: 12px 16px;
    line-height: 1.6;
  }
  .arch-note strong { color: var(--text); font-weight: 600; }

  /* Code samples grid */
  .code-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

  /* Footer */
  footer {
    padding: 56px 0 40px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-faint);
    font-size: 13px;
  }
  .foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
  .foot-grid h4 {
    font-family: var(--mono); font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-dim); margin-bottom: 14px;
  }
  .foot-grid ul { list-style: none; padding: 0; margin: 0; }
  .foot-grid li { margin-bottom: 8px; }
  .foot-grid a { color: var(--text-faint); }
  .foot-grid a:hover { color: var(--text); }

  /* Responsive */
  @media (max-width: 900px) {
    .hero-grid, .split, .products, .code-grid, .foot-grid { grid-template-columns: 1fr; gap: 32px; }
    .split.reverse > :first-child { order: 0; }
    .numbers { grid-template-columns: repeat(2, 1fr); }
    .num-cell:nth-child(2) { border-right: none; }
    .num-cell:nth-child(1), .num-cell:nth-child(2) { border-bottom: 1px solid var(--border-soft); }
    .nav-inner { flex-wrap: wrap; gap: 16px; }
    .nav-links { flex-wrap: wrap; justify-content: flex-end; }
    .nav-links a, .nav-links .btn { white-space: nowrap; }
  }
  deck-stage > section {
    width: 1920px; height: 1080px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    padding: 80px 96px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
  }
  .view-deck .slide-eyebrow {
    font-family: var(--mono); font-size: 16px;
    text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--blue); margin-bottom: 24px;}
  .view-deck .s-title { font-size: 88px; line-height: 1.05; letter-spacing: -0.025em; font-weight: 600; margin: 0;}
  .view-deck .s-sub { font-size: 28px; color: var(--text-dim); line-height: 1.45; margin-top: 24px; max-width: 1400px;}
  .view-deck .footer-bar {
    position: absolute; bottom: 36px; left: 96px; right: 96px;
    display: flex; justify-content: space-between;
    font-family: var(--mono); font-size: 14px; color: var(--text-faint);
    border-top: 1px solid var(--border-soft); padding-top: 20px;}
  .view-deck .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 48px;}
  .view-deck .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; margin-top: 48px;}
  .view-deck .big-num { font-family: var(--mono); font-size: 96px; color: var(--blue); line-height: 1; letter-spacing: -0.03em; font-weight: 600;}
  .view-deck .big-num-label { font-family: var(--mono); font-size: 18px; color: var(--text-dim); margin-top: 12px; text-transform: uppercase; letter-spacing: 0.06em;}
  .view-deck .editor { font-size: 22px; line-height: 1.7;}
  .view-deck .editor-tabs { font-size: 18px;}
  .view-deck .editor-tabs .tab { padding: 14px 24px;}
  .view-deck .gutter { padding: 24px 18px 24px 24px;}
  .view-deck .code { padding: 24px 28px;}
  .view-deck .diag-row { font-size: 20px; padding: 18px 22px; grid-template-columns: 32px 220px 1fr;}
  .view-deck .diag-row .icon { width: 26px; height: 26px; font-size: 16px;}
  .view-deck .pill { font-size: 16px; padding: 6px 14px;}
  .view-deck .card h3 { font-size: 28px;}
  .view-deck .card p { font-size: 19px; line-height: 1.55;}
  .view-deck .card .icon-box { width: 100px; height: 48px; font-size: 18px;}
  .view-deck .compare-table { font-size: 19px;}
  .view-deck .compare-table th, .view-deck .compare-table td { padding: 18px 22px;}


.view-toggle {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  display: flex; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 100px; padding: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  font-family: var(--mono); font-size: 13px;
}
.view-toggle button {
  background: transparent; border: 0; padding: 8px 18px;
  border-radius: 100px; cursor: pointer; color: var(--text-dim);
  font-family: inherit; font-size: inherit;
}
.view-toggle button.active { background: var(--blue); color: #0a0e14; font-weight: 500; }
.view-landing, .view-deck { display: none; }
.view-landing.is-active { display: block; }
.view-deck.is-active { display: block; background: #000; min-height: 100vh; }

/* ══════════════════════════════════════════════════════
   BASE POPUP — image / pdf / html overlay
══════════════════════════════════════════════════════ */

#base-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow-y: auto;           /* scroll lives HERE on the overlay */
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  padding: 40px 24px;
  box-sizing: border-box;
}

#base-popup.is-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* NOT center — lets tall content push down */
}

.base-popup__box {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: auto;               /* centers horizontally + vertically for short images */
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  animation: popupFadeIn 0.18s ease;
}

@keyframes popupFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}


