/* ═══════════════════════════════════════════════════════════════════
   Artha Elements — The Data Chemist's Lab
   Standalone stylesheet. No dependency on the main site's design system.
   App rules: 100dvh, no page scroll, scenes swap in place.
   ═══════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/spacegrotesk-var.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* ═══ Theme tokens ═══════════════════════════════════════════════
   :root holds the dark theme (the default look). [data-theme="light"]
   below overrides every colour-bearing token — including the pastel
   tile system. Structure, spacing and motion never vary by theme.
   ═══════════════════════════════════════════════════════════════ */
:root {
  color-scheme: dark;
  --bg: #0a0e1c;
  --bg-deep: #060912;
  --bg-1: #0b1020; --bg-2: #0a0e1c; --bg-3: #090d1a;
  --ink: #f4f7fb;
  --ink-mute: #9fb0c7;
  --ink-dim: #6b7c95;
  --accent: #38bdf8;
  --accent-bright: #67e8f9;
  --accent-soft: rgba(56, 189, 248, .16);
  --panel: rgba(13, 18, 32, .82);
  --panel-line: rgba(255, 255, 255, .09);

  /* category ramps — pastel in light (see [data-theme="light"]) */
  --move-a: #10b981;   --move-b: #047857;
  --transform-a: #f59e0b; --transform-b: #ea580c;
  --trust-a: #3b82f6;  --trust-b: #1d4ed8;
  --special-a: #a855f7; --special-b: #7c3aed;
  /* type on tiles: white on dark ramps, category ink on pastel */
  --tile-ink: #fff;
  --tile-ring: transparent;

  /* elevation-by-alpha surfaces (inverted, not merely lightened, in light) */
  --surface-1: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .07);
  --surface-3: rgba(255, 255, 255, .10);
  --ring-strong: rgba(255, 255, 255, .35);
  --scroll-thumb: rgba(255, 255, 255, .18);
  --slot-line: rgba(255, 255, 255, .1);

  /* ambience */
  --glow-a: rgba(34, 211, 238, .10);
  --glow-b: rgba(139, 92, 246, .13);
  --glow-1: rgba(16, 185, 129, .07);
  --glow-2: rgba(124, 58, 237, .12);
  --mote: rgba(148, 210, 255, .35);

  /* glass + overlays */
  --glass: rgba(10, 15, 28, .72);
  --glass-solid: rgba(10, 15, 28, .88);
  --scrim: rgba(6, 9, 18, .55);
  --drawer-bg: #0c1120;
  --drawer-scrim: rgba(4, 6, 12, .6);
  --tooltip-bg: #0d1424;
  --tooltip-ink: var(--ink-mute);

  /* chips, shadows, lines */
  --chip-bg: rgba(0, 0, 0, .3);
  --chip-ring: var(--ring-strong);
  --proof-chip-bg: rgba(0, 0, 0, .28);
  --shadow-stage: rgba(0, 0, 0, .55);
  --shadow-mini: rgba(0, 0, 0, .45);
  --shadow-tooltip: rgba(0, 0, 0, .5);
  --shadow-drawer: rgba(0, 0, 0, .6);
  --bond-line: rgba(103, 232, 249, .4);
  --photo-wash: rgba(13, 18, 32, .82);
  --photo-wash-edge: rgba(10, 14, 28, .08);
  --photo-wash-top: rgba(10, 14, 28, .25);
  --photo-wash-bot: rgba(10, 14, 28, .05);
  --photo-filter: saturate(.78) brightness(.82) contrast(1.03);

  /* semantic inks */
  --cv-move: #6ee7b7; --cv-transform: #fcd34d; --cv-trust: #93c5fd; --cv-special: #d8b4fe;
  --warn-ink: #fbbf24;
  --error-ink: #fca5a5;
  --req-ink: #f87171;
  --qlik-bullet: #34d399;

  /* industry lens accents — referenced by name, never inlined as hex */
  --lens-all: #38bdf8;
  --lens-manufacturing: #f59e0b;
  --lens-healthcare: #14b8a6;
  --lens-bfsi: #6366f1;
  --lens-retail: #ec4899;

  --r-tile: clamp(10px, 1.2vh, 16px);
  --r-panel: 20px;
  --gap: clamp(6px, 1vw, 12px);
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ═══ Light theme ════════════════════════════════════════════════
   Softer pastel tiles on paper. Every ink below measures ≥4.5:1
   against both the page (#eef1f7) and the panel (white).
   ═══════════════════════════════════════════════════════════════ */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f7;
  --bg-deep: #e4e9f2;
  --bg-1: #f3f6fb; --bg-2: #eef1f7; --bg-3: #e9edf5;
  --ink: #0f1729;
  --ink-mute: #475569;
  --ink-dim: #5b6b82;
  --accent: #0369a1;
  --accent-bright: #0e7490;
  --accent-soft: rgba(3, 105, 161, .10);
  --panel: rgba(255, 255, 255, .88);
  --panel-line: rgba(15, 23, 41, .12);

  /* pastel category ramps */
  --move-a: #d1fae5;   --move-b: #a7f3d0;
  --transform-a: #fef3c7; --transform-b: #fde68a;
  --trust-a: #dbeafe;  --trust-b: #bfdbfe;
  --special-a: #f3e8ff; --special-b: #e9d5ff;
  --tile-ink: #0f1729;

  --surface-1: rgba(15, 23, 41, .045);
  --surface-2: rgba(15, 23, 41, .065);
  --surface-3: rgba(15, 23, 41, .095);
  --ring-strong: rgba(15, 23, 41, .28);
  --scroll-thumb: rgba(15, 23, 41, .22);
  --slot-line: rgba(15, 23, 41, .14);

  --glow-a: rgba(34, 211, 238, .07);
  --glow-b: rgba(139, 92, 246, .07);
  --glow-1: rgba(16, 185, 129, .05);
  --glow-2: rgba(124, 58, 237, .05);
  --mote: rgba(71, 85, 105, .22);

  --glass: rgba(255, 255, 255, .82);
  --glass-solid: rgba(255, 255, 255, .92);
  /* a scrim over a light page must DARKEN, not lighten */
  --scrim: rgba(15, 23, 41, .18);
  --drawer-bg: #ffffff;
  --drawer-scrim: rgba(15, 23, 41, .35);
  --tooltip-bg: #ffffff;
  --tooltip-ink: #475569;

  --chip-bg: rgba(255, 255, 255, .72);
  --chip-ring: rgba(15, 23, 41, .3);
  --proof-chip-bg: rgba(255, 255, 255, .62);
  --shadow-stage: rgba(15, 23, 41, .16);
  --shadow-mini: rgba(15, 23, 41, .14);
  --shadow-tooltip: rgba(15, 23, 41, .14);
  --shadow-drawer: rgba(15, 23, 41, .18);
  --bond-line: rgba(3, 105, 161, .45);
  --photo-wash: rgba(255, 255, 255, .86);
  --photo-wash-edge: rgba(255, 255, 255, .06);
  --photo-wash-top: rgba(255, 255, 255, .18);
  --photo-wash-bot: rgba(255, 255, 255, .04);
  --photo-filter: saturate(.92) brightness(1.02) contrast(1);

  --cv-move: #047857; --cv-transform: #a8490a; --cv-trust: #1d4ed8; --cv-special: #7c3aed;
  --warn-ink: #a8490a;
  --error-ink: #b91c1c;
  --req-ink: #b91c1c;
  --qlik-bullet: #047857;

  --lens-all: #0369a1;
  --lens-manufacturing: #a8490a;
  --lens-healthcare: #0f766e;
  --lens-bfsi: #4f46e5;
  --lens-retail: #be185d;
}

/* Pastel tiles carry a category ink + a 1px inset edge — without it they
   sit at ~1.05:1 against the page. Inset ring = no layout shift vs dark. */
:root[data-theme="light"] :is(.cat-move, .pill-move, .flip-front.cat-move, .rx-move .rx-phase) {
  --tile-ink: #065f46; --tile-ring: #34d399;
}
:root[data-theme="light"] :is(.cat-transform, .pill-transform, .flip-front.cat-transform, .rx-transform .rx-phase) {
  --tile-ink: #92400e; --tile-ring: #f59e0b;
}
:root[data-theme="light"] :is(.cat-trust, .pill-trust, .flip-front.cat-trust, .rx-trust .rx-phase) {
  --tile-ink: #1e3a8a; --tile-ring: #60a5fa;
}
:root[data-theme="light"] :is(.cat-special, .pill-special, .flip-front.cat-special, .rx-special .rx-phase) {
  --tile-ink: #6b21a8; --tile-ring: #c084fc;
}
:root[data-theme="light"] :is(.shelf-artha .p-tile, .stage-tile.shelf-artha) {
  --tile-ink: #155e75; --tile-ring: #22d3ee;
  background: linear-gradient(140deg, #cffafe, #a5f3fc);
}
:root[data-theme="light"] :is(.shelf-qlik .p-tile, .stage-tile.shelf-qlik) {
  --tile-ink: #065f46; --tile-ring: #14b8a6;
  background: linear-gradient(140deg, #ccfbf1, #99f6e4);
}
:root[data-theme="light"] :is(.tile, .pill, .mini-tile, .p-tile, .flip-front, .rx-phase) {
  box-shadow: inset 0 0 0 1px var(--tile-ring);
}
:root[data-theme="light"] .t-num {
  box-shadow: inset 0 0 0 1.5px var(--tile-ring);
  color: var(--tile-ink);
}
/* coloured blooms read as smudges on paper — neutral elevation instead */
:root[data-theme="light"] .grid .tile:hover,
:root[data-theme="light"] .grid .tile:focus-visible {
  box-shadow: inset 0 0 0 1.5px var(--tile-ring), 0 10px 26px rgba(15, 23, 41, .16);
}
:root[data-theme="light"] .mini-tile:hover {
  box-shadow: inset 0 0 0 1px var(--tile-ring), 0 8px 20px var(--shadow-mini);
}
:root[data-theme="light"] .stage-tile {
  box-shadow: inset 0 0 0 1.5px var(--tile-ring), 0 18px 50px var(--shadow-stage);
}
:root[data-theme="light"] .btn-primary { box-shadow: 0 4px 14px rgba(3, 105, 161, .22); }
:root[data-theme="light"] .btn-primary:hover { box-shadow: 0 6px 18px rgba(3, 105, 161, .3); }
:root[data-theme="light"] .hero-card:hover { box-shadow: 0 10px 30px rgba(15, 23, 41, .12); }
:root[data-theme="light"] .product-card.shelf-artha:hover { box-shadow: 0 10px 26px rgba(15, 23, 41, .12); border-color: rgba(3, 105, 161, .4); }
:root[data-theme="light"] .product-card.shelf-qlik:hover { box-shadow: 0 10px 26px rgba(15, 23, 41, .12); border-color: rgba(4, 120, 87, .45); }
:root[data-theme="light"] .grid .tile::after { border-color: var(--panel-line); }
:root[data-theme="light"] :is(.ir-btn, .theme-btn)[aria-checked="true"] svg { filter: none; }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(13px, 1.5vh, 15px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── App frame ─────────────────────────────────────────────────── */
.app {
  position: fixed; inset: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(90rem 60rem at 8% -10%, var(--glow-1), transparent 55%),
    radial-gradient(80rem 55rem at 104% 112%, var(--glow-2), transparent 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
}

.glow { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.glow-a { width: 34vw; height: 34vw; left: -10vw; top: -12vw; background: var(--glow-a); }
.glow-b { width: 38vw; height: 38vw; right: -12vw; bottom: -14vw; background: var(--glow-b); }

#motes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mote {
  position: absolute; border-radius: 50%;
  background: var(--mote);
  animation: drift linear infinite;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  8%   { opacity: .55; }
  92%  { opacity: .55; }
  100% { transform: translate3d(var(--dx), -110vh, 0); opacity: 0; }
}

/* ── Header ────────────────────────────────────────────────────── */
.lab-header {
  display: flex; align-items: center; gap: 18px;
  padding: clamp(8px, 1.4vh, 14px) clamp(14px, 2.4vw, 30px);
  z-index: 5;
}
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand-logo { height: clamp(24px, 3.4vh, 34px); width: auto; display: block; }
.masthead { flex: 1 1 auto; min-width: 0; text-align: center; }
.masthead-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(19px, 3.2vh, 30px);
  letter-spacing: .06em;
  line-height: 1.15;
}
.masthead-title .accent { color: var(--accent); }
.masthead-tag {
  color: var(--ink-mute);
  font-size: clamp(10px, 1.5vh, 13px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.year-chip { color: var(--ink-dim); font-family: var(--font-display); letter-spacing: .12em; font-size: 12px; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary, .btn-ghost {
  font-family: var(--font-display);
  font-size: clamp(12px, 1.6vh, 14px);
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn-primary {
  color: #06121f;
  background: linear-gradient(120deg, var(--accent-bright), #38bdf8 55%, #60a5fa);
  padding: .55em 1.2em;
  box-shadow: 0 4px 18px rgba(56, 189, 248, .35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(56, 189, 248, .5); }
.btn-ghost {
  color: var(--ink-mute);
  background: var(--surface-1);
  border-color: var(--panel-line);
  padding: .5em 1.1em;
}
.btn-ghost:hover { color: var(--ink); background: var(--surface-3); }
:is(button, a, textarea, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Main / scenes ─────────────────────────────────────────────── */
.lab-main { position: relative; flex: 1 1 auto; min-height: 0; z-index: 4; }
.scene { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; }

/* Scene A — the table */
.scene-table { padding: 0 clamp(14px, 3vw, 40px) 4px; transition: filter .35s ease, opacity .35s ease; }
.scene-home { padding: 0 clamp(14px, 3vw, 40px) 4px; transition: filter .35s ease, opacity .35s ease; }
.scene-table.backdrop, .scene-home.backdrop { filter: blur(7px) brightness(.45) saturate(.7); pointer-events: none; }

/* theme-swapped logo: two <img>, one shown per theme (no JS, no flash) */
.logo-light { display: none; }
:root[data-theme="light"] .logo-dark { display: none; }
:root[data-theme="light"] .logo-light { display: block; }

/* colour transitions are enabled only after first paint (see .theme-ready)
   so switching themes glides but loading never sweeps */
.theme-ready :is(body, .app, .panel, .strip, .tile, .product-card, .flip-face,
  .btn-ghost, .vs-btn, .ir-btn, .bench-chip, .fb-sub, .reaction, .formula-row,
  .alchemist-card, .f-field input, .f-field textarea, .bench-input textarea) {
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}

/* ── QR mode ─────────────────────────────────────────────────────
   A badge on each card, and a zoom overlay that is actually scannable.
   The badge itself is ~46px: at that size a 41-module code is under
   1.2px per module, which reads only on a projector or large TV. The
   overlay is what a phone at arm's length can scan. Codes stay dark-on-
   light in both themes — inverted QRs fail on some Android cameras. */
.qr-btn[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.qr-btn[aria-pressed="true"] svg { filter: drop-shadow(0 0 5px currentColor); }

.card-qr {
  position: absolute;
  right: 6px; bottom: 6px;
  width: 46px; height: 46px;
  padding: 3px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
  display: grid; place-items: center;
  cursor: zoom-in;
  transition: transform .15s ease;
}
.card-qr img { width: 100%; height: 100%; display: block; }
.card-qr:hover { transform: scale(1.08); }
/* the number chip shares the bottom-left, so only the right corner is used */
.grid .tile.has-qr .t-name { padding-right: 50px; }

.qr-zoom {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: var(--drawer-scrim);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 24px;
}
.qr-zoom-card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-panel);
  padding: clamp(16px, 3vh, 26px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: 340px; text-align: center;
  animation: rise .25s ease;
}
.qr-zoom-card .qr-sheet {
  width: clamp(200px, 46vw, 260px);
  background: #fff; border-radius: 14px; padding: 12px;
}
.qr-zoom-card .qr-sheet img { width: 100%; display: block; }
.qr-zoom-card h3 { font-family: var(--font-display); font-size: 17px; }
.qr-zoom-card p { color: var(--ink-mute); font-size: 12.5px; line-height: 1.45; }
.qr-zoom-card .qr-close {
  background: var(--surface-1); border: 1px solid var(--panel-line);
  border-radius: 999px; color: var(--ink-mute);
  padding: .45em 1.2em; cursor: pointer;
  font-family: var(--font-display); font-size: 13px;
}
.qr-zoom-card .qr-close:hover { color: var(--ink); }

@media (max-width: 900px) {
  .card-qr { width: 34px; height: 34px; right: 4px; bottom: 4px; }
}

/* ── Lab rail — thin-line icons, grey → bright on select ─────────── */
.rail-group { display: flex; flex-direction: column; gap: 8px; }
.rail-divider {
  display: block;
  height: 1px;
  margin: 2px 4px;
  background: var(--panel-line);
}
/* each lens button lights in its own accent; theme buttons use --accent */
.ir-btn[data-lens=""] { --lens-accent: var(--lens-all); }
.ir-btn[data-lens="manufacturing"] { --lens-accent: var(--lens-manufacturing); }
.ir-btn[data-lens="healthcare"] { --lens-accent: var(--lens-healthcare); }
.ir-btn[data-lens="bfsi"] { --lens-accent: var(--lens-bfsi); }
.ir-btn[data-lens="retail"] { --lens-accent: var(--lens-retail); }
.theme-btn { --lens-accent: var(--accent); }

.industry-rail {
  position: fixed;
  left: 0; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  z-index: 40;
  background: var(--glass);
  border: 1px solid var(--panel-line);
  border-left: none;
  border-radius: 0 16px 16px 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ir-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: none; border: none;
  border-radius: 12px;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.ir-btn svg {
  width: 22px; height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ir-btn:hover { color: var(--ink-mute); background: var(--surface-1); }
.ir-btn[aria-checked="true"] {
  color: var(--lens-accent);
  background: var(--surface-2);
}
.ir-btn[aria-checked="true"] svg { filter: drop-shadow(0 0 5px currentColor); }

@media (min-width: 901px) {
  .app { padding-left: 56px; }
}

/* lens-tailored fragments inside stages */
.lens-note { color: var(--ink-dim); font-style: italic; font-size: .92em; }
.lens-take {
  border-left: 3px solid var(--lens-accent, var(--accent));
  padding-left: .8em;
  color: var(--ink);
}
/* `.panel-body b` is declared later at equal specificity, so the lens accent
   needs the extra class to win — otherwise these read as plain ink. */
.lens-take b, .panel-body .lens-take b { color: var(--lens-accent, var(--accent)); }
.uc-lens b, .panel-body .uc-lens b { color: var(--lens-accent, var(--accent)); }
.fb-sub.hot::after { content: " ●"; color: var(--lens-accent, var(--accent)); }

/* ── View switcher ─────────────────────────────────────────────── */
.view-switch {
  display: flex; justify-content: center; gap: 6px;
  padding: 0 14px clamp(4px, .8vh, 8px);
  z-index: 5;
}
.vs-btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-display);
  font-size: clamp(11px, 1.55vh, 13.5px);
  color: var(--ink-mute);
  background: var(--surface-1);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: .42em 1.3em;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}
.vs-btn:hover { color: var(--ink); background: var(--surface-3); }
/* thin-line marks, same weight as the rail icons — no emoji, which render
   in their own colours and break the line-art identity */
.vs-btn svg {
  width: 15px; height: 15px; flex: 0 0 auto;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.vs-btn[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(56, 189, 248, .45);
}

/* ── Home scenes (solutions / products) ────────────────────────── */
.home-head { text-align: center; padding: clamp(2px, .8vh, 8px) 0 clamp(8px, 1.4vh, 14px); }
.home-head h2 {
  font-family: var(--font-display);
  font-size: clamp(17px, 2.8vh, 24px);
  font-weight: 700;
}
.home-head p { color: var(--ink-mute); font-size: clamp(11px, 1.6vh, 13.5px); }
.home-foot {
  text-align: center;
  color: var(--ink-dim);
  font-size: clamp(10.5px, 1.5vh, 13px);
  padding: clamp(4px, 1vh, 10px) 0 2px;
}
.linklike {
  background: none; border: none; cursor: pointer;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: inherit;
  padding: 0 2px;
}
.linklike:hover { text-decoration: underline; }

/* ── Flip wall (solutions home) ────────────────────────────────── */
.flip-wall {
  flex: 1 1 auto; min-height: 0;
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
  perspective: 1400px;
}
.flip-card { position: relative; min-height: 0; }
.flip-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  display: flex; flex-direction: column;
}
.flip-front {
  border: none;
  cursor: pointer;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  padding: clamp(12px, 2vh, 22px) clamp(14px, 1.6vw, 22px);
  color: var(--tile-ink);
  transition: transform .18s ease, box-shadow .25s ease;
}
.flip-front:hover { transform: translateY(-3px); }
.flip-front.cat-move { background: linear-gradient(160deg, var(--move-a), var(--move-b)); }
.flip-front.cat-transform { background: linear-gradient(160deg, var(--transform-a), var(--transform-b)); }
.flip-front.cat-trust { background: linear-gradient(160deg, var(--trust-a), var(--trust-b)); }
.flip-front.cat-special { background: linear-gradient(160deg, var(--special-a), var(--special-b)); }
.ff-statement {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(15px, 2.5vh, 21px);
  line-height: 1.25;
}
.ff-statement::before { content: "“"; }
.ff-statement::after { content: "”"; }
.ff-meta { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.ff-tagline { font-family: var(--font-ui); font-size: clamp(9px, 1.3vh, 11px); opacity: .85; }
.ff-hint { font-family: var(--font-display); font-size: clamp(10px, 1.4vh, 12px); opacity: .9; }
.flip-back {
  transform: rotateY(180deg);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  padding: clamp(8px, 1.4vh, 14px) clamp(12px, 1.4vw, 18px);
  gap: 4px;
}
.fb-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-display);
  font-size: clamp(9px, 1.3vh, 11px);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-dim);
  flex: 0 0 auto;
}
.fb-close { background: none; border: none; color: var(--ink-mute); cursor: pointer; font-size: 15px; padding: 2px 6px; }
.fb-close:hover { color: var(--ink); }
.fb-subs { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-height: 0; justify-content: center; }
.fb-sub {
  text-align: left;
  background: var(--surface-1);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  color: var(--ink-mute);
  font-family: var(--font-ui);
  font-size: clamp(10.5px, 1.55vh, 13px);
  line-height: 1.3;
  padding: clamp(5px, .9vh, 9px) 10px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.fb-sub:hover { color: var(--ink); border-color: rgba(56, 189, 248, .45); background: var(--accent-soft); }
.fb-sub::before { content: "▸ "; color: var(--accent); }

/* ── Shelves (products home) ───────────────────────────────────── */
.shelves {
  flex: 1 1 auto; min-height: 0;
  width: min(1240px, 100%);
  margin: 0 auto;
  display: flex; flex-direction: column;
  gap: clamp(6px, 1.2vh, 14px);
}
.shelf { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1 1 auto; }
.shelf-label {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.3vh, 11px);
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-dim);
  flex: 0 0 auto;
}
.shelf-label b { color: var(--ink-mute); font-weight: 600; }
.shelf-row { display: grid; gap: clamp(8px, 1vw, 14px); flex: 1 1 auto; min-height: 0; }
.shelf-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.shelf-row.cols-6 { grid-template-columns: repeat(6, 1fr); }
.product-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  padding: clamp(8px, 1.4vh, 14px) clamp(10px, 1vw, 14px);
  text-align: left;
  cursor: pointer;
  min-height: 0;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .25s ease, border-color .2s ease;
}
.product-card:hover { transform: translateY(-3px); }
.product-card.shelf-artha:hover { box-shadow: 0 10px 30px rgba(56, 189, 248, .25); border-color: rgba(56, 189, 248, .4); }
.product-card.shelf-qlik:hover { box-shadow: 0 10px 30px rgba(0, 152, 69, .3); border-color: rgba(0, 178, 90, .45); }
.p-tile {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(13px, 2vh, 17px);
  color: var(--tile-ink);
  border-radius: 9px;
  padding: .25em .55em;
  line-height: 1.1;
}
.p-tile sup { font-size: .55em; }
.shelf-artha .p-tile { background: linear-gradient(140deg, #22d3ee, #2563eb); }
.shelf-qlik .p-tile { background: linear-gradient(140deg, #00b25a, #006e38); }
.p-name { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: clamp(11px, 1.65vh, 13.5px); line-height: 1.2; }
.p-line { color: var(--ink-mute); font-size: clamp(9.5px, 1.4vh, 11.5px); line-height: 1.3; }
.p-uc { list-style: none; margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.p-uc li { color: var(--ink-dim); font-size: clamp(9px, 1.3vh, 10.5px); line-height: 1.3; }
.p-uc li::before { content: "• "; color: var(--accent); }
.shelf-qlik .p-uc li::before { color: var(--qlik-bullet); }
.p-urgency {
  position: absolute; top: 0; right: 0;
  font-family: var(--font-display);
  font-size: 8.5px; letter-spacing: .06em;
  color: var(--warn-ink);
  background: rgba(245, 158, 11, .14);
  border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 0 14px 0 10px;
  padding: 3px 8px;
}

/* ── Stage tile variants (problem / product modes) ─────────────── */
.stage-tile.problem-tile { justify-content: center; gap: 8px; cursor: default; }
.problem-tile .t-kicker {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.3vh, 11px);
  letter-spacing: .22em; text-transform: uppercase;
  opacity: .85;
}
.problem-tile .pt-quote {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(15px, 2.5vh, 21px);
  line-height: 1.3;
}
.stage-tile.product-tile { gap: 6px; cursor: default; }
.product-tile .t-sym { font-size: clamp(24px, 4.4vh, 38px); }
.product-tile .pt-name { font-family: var(--font-display); font-weight: 600; font-size: clamp(12px, 1.9vh, 15px); }
.product-tile .pt-ucs { list-style: none; display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.product-tile .pt-ucs li { font-family: var(--font-ui); font-size: clamp(9.5px, 1.4vh, 11.5px); opacity: .95; line-height: 1.3; }
.product-tile .pt-ucs li::before { content: "• "; }
.stage-tile.shelf-artha { background: linear-gradient(160deg, #0ea5e9, #1d4ed8); }
.stage-tile.shelf-qlik { background: linear-gradient(160deg, #00b25a, #00552b); }
.stage-urgency {
  font-family: var(--font-display);
  font-size: clamp(9.5px, 1.35vh, 11.5px);
  color: var(--warn-ink);
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 8px;
  padding: .35em .7em;
  text-align: center;
}
.compound-label {
  font-size: clamp(9px, 1.3vh, 10.5px);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-dim);
}

.legend {
  display: flex; justify-content: center; gap: clamp(6px, 1vw, 12px);
  padding: clamp(2px, .8vh, 8px) 0 clamp(6px, 1.2vh, 12px);
  flex-wrap: wrap;
}
.pill {
  font-family: var(--font-display);
  font-size: clamp(11px, 1.5vh, 13px);
  color: var(--tile-ink);
  border: none; border-radius: 999px;
  padding: .42em 1.15em;
  cursor: pointer;
  opacity: .92;
  transition: opacity .2s, transform .15s, box-shadow .2s;
}
.pill:hover { opacity: 1; transform: translateY(-1px); }
.pill[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor; opacity: 1; }
.pill-move { background: linear-gradient(120deg, var(--move-a), var(--move-b)); }
.pill-transform { background: linear-gradient(120deg, var(--transform-a), var(--transform-b)); }
.pill-trust { background: linear-gradient(120deg, var(--trust-a), var(--trust-b)); }
.pill-special { background: linear-gradient(120deg, var(--special-a), var(--special-b)); }

.grid {
  flex: 1 1 auto; min-height: 0;
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

/* ── Tiles ─────────────────────────────────────────────────────── */
.tile {
  position: relative;
  display: flex; flex-direction: column;
  align-items: flex-start;
  border: none;
  border-radius: var(--r-tile);
  padding: clamp(7px, 1.4vh, 14px) clamp(8px, 1vw, 14px);
  color: var(--tile-ink);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-display);
  overflow: visible;
  transition: transform .18s ease, box-shadow .25s ease, opacity .3s ease, filter .3s ease;
}
.cat-move { background: linear-gradient(160deg, var(--move-a), var(--move-b)); }
.cat-transform { background: linear-gradient(160deg, var(--transform-a), var(--transform-b)); }
.cat-trust { background: linear-gradient(160deg, var(--trust-a), var(--trust-b)); }
.cat-special { background: linear-gradient(160deg, var(--special-a), var(--special-b)); }

.grid .tile:hover, .grid .tile:focus-visible {
  transform: translateY(-3px) scale(1.05);
  z-index: 3;
}
.grid .cat-move:hover, .grid .cat-move:focus-visible { box-shadow: 0 10px 32px rgba(16, 185, 129, .45); }
.grid .cat-transform:hover, .grid .cat-transform:focus-visible { box-shadow: 0 10px 32px rgba(245, 158, 11, .45); }
.grid .cat-trust:hover, .grid .cat-trust:focus-visible { box-shadow: 0 10px 32px rgba(59, 130, 246, .5); }
.grid .cat-special:hover, .grid .cat-special:focus-visible { box-shadow: 0 10px 32px rgba(168, 85, 247, .5); }

.grid.filtered .tile:not(.spot):not(.hero-card) { opacity: .22; filter: saturate(.25); }

.t-sym {
  font-size: clamp(16px, 3vh, 27px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .01em;
}
.t-sym sup { font-size: .52em; font-weight: 600; }
.t-name {
  margin-top: .35em;
  font-family: var(--font-ui);
  font-size: clamp(9px, 1.35vh, 12px);
  font-weight: 400;
  line-height: 1.28;
  opacity: .95;
}
.t-num {
  position: absolute;
  left: clamp(8px, 1vw, 13px);
  bottom: clamp(6px, 1.2vh, 11px);
  width: 1.75em; height: 1.75em;
  display: grid; place-items: center;
  font-size: clamp(9px, 1.3vh, 11px);
  font-weight: 500;
  border-radius: 50%;
  background: var(--chip-bg);
  box-shadow: inset 0 0 0 1px var(--chip-ring);
}

/* quote tooltip */
.grid .tile::after {
  content: attr(data-quote);
  position: absolute;
  left: 50%; top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
  width: max-content; max-width: 240px;
  background: var(--tooltip-bg);
  border: 1px solid var(--panel-line);
  color: var(--tooltip-ink);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-style: italic;
  line-height: 1.4;
  padding: 7px 11px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease .12s, transform .18s ease .12s;
  z-index: 20;
  box-shadow: 0 10px 30px var(--shadow-tooltip);
}
.grid .tile.tt-up::after { top: auto; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px); }
.grid .tile:hover::after, .grid .tile:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }

.slot-empty {
  border: 1.5px dashed var(--slot-line);
  border-radius: var(--r-tile);
}

/* hero card */
.hero-card {
  grid-row: 2; grid-column: 4 / span 2;
  border: 1px solid var(--panel-line);
  border-radius: var(--r-tile);
  background:
    linear-gradient(120deg, rgba(56, 189, 248, .07), rgba(139, 92, 246, .07)),
    var(--glass-solid);
  color: var(--ink);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .35em;
  text-align: center;
  padding: 10px 14px;
  cursor: pointer;
  font-family: var(--font-display);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .25s ease;
}
.hero-card::before {
  content: "";
  position: absolute; inset: -60% -120%;
  background: linear-gradient(100deg, transparent 42%, rgba(103, 232, 249, .12) 50%, transparent 58%);
  animation: shimmer 5.5s ease-in-out infinite;
}
@keyframes shimmer { 0%, 55% { transform: translateX(-38%); } 90%, 100% { transform: translateX(38%); } }
.hero-card:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(56, 189, 248, .22); }
.hero-num {
  font-size: clamp(22px, 4.4vh, 40px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.hero-text { font-size: clamp(9.5px, 1.45vh, 12.5px); color: var(--ink-mute); line-height: 1.35; max-width: 24ch; }
.hero-cta { font-size: clamp(9px, 1.3vh, 11px); color: var(--accent); letter-spacing: .06em; }

.table-footnote {
  text-align: center;
  color: var(--ink-dim);
  font-size: clamp(10px, 1.4vh, 12.5px);
  padding: clamp(4px, 1vh, 10px) 0 2px;
}
.footnote-hint { color: var(--ink-mute); }

/* ── Overlays (stage & bench share chrome) ─────────────────────── */
.overlay {
  z-index: 10;
  background: var(--scrim);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: 0 clamp(14px, 2.6vw, 36px) clamp(8px, 1.4vh, 14px);
}
.overlay-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: clamp(6px, 1.2vh, 12px) 0;
}
.overlay-context {
  font-family: var(--font-display);
  font-size: clamp(11px, 1.6vh, 14px);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: center;
  flex: 1;
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.overlay-context .cat-dot { display: inline-block; width: .65em; height: .65em; border-radius: 50%; margin-right: .5em; vertical-align: baseline; }
.cat-dot.move { background: var(--move-a); }
.cat-dot.transform { background: var(--transform-a); }
.cat-dot.trust { background: var(--trust-a); }
.cat-dot.special { background: var(--special-a); }
.cat-dot.dot-artha { background: #22d3ee; }
.cat-dot.dot-qlik { background: #00b25a; }
.overlay-top-spacer { width: 110px; }

/* ── Scene B — stage layout ────────────────────────────────────── */
.stage-grid {
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(230px, 24vw, 320px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "what center when"
    "why  center how";
  gap: clamp(8px, 1.2vw, 16px);
  width: min(1240px, 100%);
  margin: 0 auto;
}
.panel-what { grid-area: what; }
.panel-why { grid-area: why; }
.panel-when { grid-area: when; }
.panel-how { grid-area: how; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-panel);
  padding: clamp(10px, 1.6vh, 18px) clamp(12px, 1.4vw, 20px);
  display: flex; flex-direction: column;
  min-height: 0;
  opacity: 0;
  transform: translateY(10px);
}
.scene-stage.revealed .panel { opacity: 1; transform: none; transition: opacity .4s ease, transform .4s ease; }
.scene-stage.revealed .panel-why { transition-delay: .06s; }
.scene-stage.revealed .panel-when { transition-delay: .1s; }
.scene-stage.revealed .panel-how { transition-delay: .16s; }

.panel-h {
  font-family: var(--font-display);
  font-size: clamp(10px, 1.5vh, 12px);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6em;
  flex: 0 0 auto;
}
.panel-body {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
  font-size: clamp(11.5px, 1.65vh, 14px);
  color: var(--ink-mute);
  display: flex; flex-direction: column; gap: .55em;
  padding-right: 4px;
}
.panel-body .lead { color: var(--ink); }
.panel-body b, .panel-body strong { color: var(--ink); font-weight: 600; }
.panel-body blockquote {
  font-style: italic;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: .8em;
}
.panel-body .probe { color: var(--ink-mute); }
.panel-body .case { color: var(--ink-dim); }
.panel-body details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: .92em;
  list-style: none;
}
.panel-body details summary::-webkit-details-marker { display: none; }
.panel-body details[open] summary { margin-bottom: .4em; }
.panel-body details p { color: var(--ink-dim); font-size: .95em; }

.proof-badge {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: clamp(11px, 1.5vh, 12.5px);
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid rgba(56, 189, 248, .3);
  border-radius: 8px;
  padding: .3em .7em;
}
.fn-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fn-chip {
  font-size: clamp(9.5px, 1.35vh, 11px);
  color: var(--ink-mute);
  background: var(--surface-2);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: .18em .7em;
}

/* stage center */
.stage-center {
  grid-area: center;
  position: relative;
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 5vh, 48px);
  min-height: 0;
}
.stage-tile {
  width: clamp(190px, 21vw, 280px);
  aspect-ratio: 1 / .96;
  border-radius: 22px;
  padding: clamp(14px, 2vh, 22px);
  cursor: default;
  box-shadow: 0 18px 60px var(--shadow-stage);
  flex: 0 0 auto;
}
.stage-tile .t-sym { font-size: clamp(34px, 6.4vh, 56px); }
.stage-tile .t-name { font-size: clamp(12px, 1.9vh, 16px); margin-top: .5em; }
/* the tile's bottom row: proof chip + (when the card has one) a download
   affordance for its one-pager. Shared by all three stage modes. */
.stage-tile .t-footer {
  margin-top: auto;
  display: flex; align-items: center; gap: 8px;
  width: 100%;
}
.t-download {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--proof-chip-bg);
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease;
}
.t-download svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.t-download:hover { transform: translateY(-1px); background: rgba(0, 0, 0, .42); }
:root[data-theme="light"] .t-download:hover { background: rgba(255, 255, 255, .95); }

.stage-tile .t-proof {
  margin-top: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-size: clamp(10px, 1.5vh, 12.5px);
  background: var(--proof-chip-bg);
  border-radius: 8px;
  padding: .35em .6em;
  max-width: 100%;
}
.stage-tile .t-proof::before { content: "▶ "; font-size: .8em; }
.stage-tile .t-num { left: auto; right: clamp(10px, 1vw, 14px); top: clamp(10px, 1.4vh, 14px); bottom: auto; }

#bond-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bond-svg line {
  stroke: var(--bond-line);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  animation: bondpulse 2.2s linear infinite;
}
@keyframes bondpulse { to { stroke-dashoffset: -20; } }

.stage-bonds { display: flex; gap: clamp(8px, 1vw, 14px); justify-content: center; flex: 0 0 auto; }

/* mini tiles (bond chips, formula tiles) */
.mini-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: clamp(54px, 6.2vh, 68px);
  aspect-ratio: 1;
  border: none; border-radius: 12px;
  color: var(--tile-ink);
  font-family: var(--font-display);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .2s ease;
  position: relative;
}
.mini-tile .m-sym { font-size: clamp(14px, 2.2vh, 19px); font-weight: 700; line-height: 1; }
.mini-tile .m-sym sup { font-size: .5em; }
.mini-tile .m-num { font-size: 9px; opacity: .8; margin-top: 3px; }
.mini-tile:hover { transform: translateY(-3px) scale(1.07); box-shadow: 0 8px 24px var(--shadow-mini); z-index: 2; }
.mini-tile[disabled] { cursor: default; }

/* stage bottom strips */
.stage-bottom {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: clamp(8px, 1.2vw, 16px);
  width: min(1240px, 100%);
  margin: clamp(8px, 1.2vh, 14px) auto 0;
}
.strip {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-panel);
  padding: clamp(8px, 1.3vh, 14px) clamp(12px, 1.4vw, 20px);
  min-height: 0;
  overflow: hidden;
}
.strip h4 {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.35vh, 11px);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: .55em;
}
.chip-row { display: flex; align-items: center; gap: clamp(8px, 1vw, 12px); flex-wrap: wrap; }
.bond-name {
  display: flex; flex-direction: column;
  font-size: clamp(10px, 1.4vh, 12px);
  color: var(--ink-mute);
  max-width: 15ch;
  line-height: 1.25;
}
.bond-pair { display: flex; align-items: center; gap: 8px; }
.bonds-note { color: var(--ink-mute); font-size: clamp(11px, 1.5vh, 13px); font-style: italic; }
.uc-row { display: flex; flex-direction: column; gap: .4em; }
.uc { font-size: clamp(10.5px, 1.5vh, 13px); color: var(--ink-mute); }
.uc b { color: var(--ink); font-weight: 600; }

/* ── Case study card ───────────────────────────────────────────── */
.strip-case { display: flex; flex-direction: column; min-height: 0; }
#case-title .case-industry { color: var(--accent); }
.case-card {
  flex: 1 1 auto; min-height: 0;
  display: flex; gap: clamp(10px, 1.2vw, 16px);
  align-items: stretch;
}
.case-media {
  position: relative;
  flex: 0 0 clamp(118px, 13vw, 172px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--panel-line);
  min-height: 84px;
}
.case-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: var(--photo-filter);
}
/* blend the photo into the glass panel: dark wash + a fade toward the text */
.case-media::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(105deg, var(--photo-wash-edge) 45%, var(--photo-wash) 100%),
    linear-gradient(0deg, var(--photo-wash-top), var(--photo-wash-bot));
}
.case-body {
  display: flex; flex-direction: column;
  gap: clamp(2px, .5vh, 5px);
  min-width: 0;
  padding: 2px 0;
}
.case-client {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: clamp(12px, 1.7vh, 14.5px);
  line-height: 1.25;
}
.case-text {
  color: var(--ink-mute);
  font-size: clamp(10.5px, 1.5vh, 12.5px);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.case-values { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.case-value {
  font-family: var(--font-display);
  font-size: clamp(9.5px, 1.35vh, 11.5px);
  border-radius: 7px;
  padding: .28em .6em;
  border: 1px solid;
  white-space: nowrap;
}
.case-cat-move .case-value { color: var(--cv-move); border-color: rgba(16, 185, 129, .35); background: rgba(16, 185, 129, .1); }
.case-cat-transform .case-value { color: var(--cv-transform); border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .1); }
.case-cat-trust .case-value { color: var(--cv-trust); border-color: rgba(59, 130, 246, .38); background: rgba(59, 130, 246, .12); }
.case-cat-special .case-value { color: var(--cv-special); border-color: rgba(168, 85, 247, .38); background: rgba(168, 85, 247, .12); }

.uc-compounds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .55em; align-items: center; }
.uc-compounds .label { font-size: clamp(9px, 1.3vh, 10.5px); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
.compound-chip {
  font-family: var(--font-display);
  font-size: clamp(10px, 1.4vh, 12px);
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 999px;
  padding: .22em .8em;
  cursor: pointer;
  transition: background .2s;
}
.compound-chip:hover { background: rgba(56, 189, 248, .28); }

/* stage tabs — mobile only */
.stage-tabs { display: none; }

/* ── Scene C — the bench ───────────────────────────────────────── */
.bench-title {
  font-family: var(--font-display);
  font-size: clamp(15px, 2.4vh, 21px);
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
  flex: 1;
}
.bench-inner {
  flex: 1 1 auto; min-height: 0;
  width: min(880px, 100%);
  margin: 0 auto;
  display: flex; flex-direction: column;
  gap: clamp(8px, 1.4vh, 16px);
}
.bench-sub { color: var(--ink-mute); text-align: center; font-size: clamp(11.5px, 1.7vh, 14px); }

.bench-input { display: flex; gap: 10px; align-items: stretch; }
.bench-input textarea {
  flex: 1;
  resize: none;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(12.5px, 1.8vh, 15px);
  line-height: 1.5;
  padding: 12px 16px;
}
.bench-input textarea::placeholder { color: var(--ink-dim); font-style: italic; }
.bench-input textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.btn-distill { display: flex; align-items: center; gap: 8px; border-radius: 16px; padding: 0 1.4em; position: relative; }

.beaker { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.beaker i { width: 3px; background: #06121f; border-radius: 2px; height: 5px; }
.btn-distill.bubbling .beaker i { animation: bub .5s ease-in-out infinite alternate; }
.btn-distill.bubbling .beaker i:nth-child(2) { animation-delay: .12s; }
.btn-distill.bubbling .beaker i:nth-child(3) { animation-delay: .22s; }
@keyframes bub { from { height: 4px; } to { height: 12px; } }

.bench-chips-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chips-label { color: var(--ink-dim); font-size: clamp(10px, 1.4vh, 12px); white-space: nowrap; }
.bench-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bench-chip {
  font-family: var(--font-display);
  font-size: clamp(10px, 1.45vh, 12.5px);
  color: var(--ink-mute);
  background: var(--surface-1);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: .3em .95em;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.bench-chip:hover { color: var(--accent); border-color: rgba(56, 189, 248, .45); background: var(--accent-soft); }

.bench-result {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  gap: clamp(6px, 1.2vh, 12px);
  animation: rise .35s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.formula-row {
  display: flex; align-items: center; gap: clamp(10px, 1.6vw, 18px);
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-panel);
  padding: clamp(8px, 1.4vh, 14px) clamp(12px, 1.6vw, 20px);
}
.formula-label {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.35vh, 11px);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.formula-tiles { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.formula-plus { color: var(--ink-dim); font-family: var(--font-display); font-size: 15px; }
.formula-tiles .catalyst { position: relative; }
.formula-tiles .catalyst::before {
  content: "catalyst";
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim);
}
.formula-tiles .catalyst .mini-tile { outline: 1.5px dashed var(--ring-strong); outline-offset: 2px; }
.confidence { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: clamp(10px, 1.45vh, 12px); color: var(--ink-mute); }
.conf-bar { display: block; width: 90px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.conf-fill { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-bright), #38bdf8); }
.conf-high .conf-fill { background: linear-gradient(90deg, var(--qlik-bullet), #10b981); }
.conf-medium .conf-fill { background: linear-gradient(90deg, var(--warn-ink), #f59e0b); }

.reaction {
  flex: 1 1 auto; min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-panel);
  padding: clamp(10px, 1.6vh, 16px) clamp(12px, 1.6vw, 20px);
  display: flex; flex-direction: column; gap: .7em;
}
.reaction-h {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.35vh, 11px);
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-dim);
}
.rx { display: flex; gap: 12px; align-items: baseline; }
.rx-phase {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: clamp(9px, 1.3vh, 10.5px);
  font-weight: 700;
  letter-spacing: .16em;
  padding: .25em .7em;
  border-radius: 6px;
  color: var(--tile-ink);
  min-width: 86px;
  text-align: center;
}
.rx-move .rx-phase { background: linear-gradient(120deg, var(--move-a), var(--move-b)); }
.rx-transform .rx-phase { background: linear-gradient(120deg, var(--transform-a), var(--transform-b)); }
.rx-trust .rx-phase { background: linear-gradient(120deg, var(--trust-a), var(--trust-b)); }
.rx-special .rx-phase { background: linear-gradient(120deg, var(--special-a), var(--special-b)); }
.rx p { color: var(--ink-mute); font-size: clamp(11.5px, 1.6vh, 13.5px); }
.rx p b { color: var(--ink); }
.rx-outcome { color: var(--ink); font-size: clamp(11.5px, 1.65vh, 14px); border-top: 1px solid var(--panel-line); padding-top: .7em; }
.rx-outcome::before { content: "⚗ "; }
.rx-signals { color: var(--ink-dim); font-size: clamp(10px, 1.4vh, 11.5px); font-style: italic; }
.rx-unknown { color: var(--ink); font-size: clamp(12px, 1.8vh, 15px); }
.bench-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; flex: 0 0 auto; }
.bench-actions .attn { animation: attn 1.6s ease-in-out infinite; }
@keyframes attn { 0%, 100% { box-shadow: 0 4px 18px rgba(56, 189, 248, .35); } 50% { box-shadow: 0 4px 30px rgba(56, 189, 248, .75); } }

/* ── Footer ────────────────────────────────────────────────────── */
.lab-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: clamp(4px, .9vh, 9px) clamp(14px, 2.4vw, 30px);
  color: var(--ink-dim);
  font-size: clamp(9.5px, 1.35vh, 12px);
  z-index: 5;
}
.lab-footer a { color: var(--ink-mute); text-decoration: none; }
.lab-footer a:hover { color: var(--accent); }
.rainbow-rail {
  height: 4px; flex: 0 0 auto;
  background: linear-gradient(90deg, #14b8a6, #22d3ee, #3b82f6, #8b5cf6, #a855f7);
}

/* ── FLIP layer ────────────────────────────────────────────────── */
#flip-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
#flip-layer .tile { position: fixed; margin: 0; }

/* ── Alchemist overlay ─────────────────────────────────────────── */
.alchemist { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: flex-end; }
.alchemist-scrim { position: absolute; inset: 0; background: var(--drawer-scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.alchemist-card {
  position: relative;
  width: min(500px, 100%);
  height: 100%;
  background: var(--drawer-bg);
  border-left: 1px solid var(--panel-line);
  box-shadow: -30px 0 80px var(--shadow-drawer);
  padding: clamp(16px, 3vh, 28px) clamp(18px, 2.4vw, 30px);
  display: flex; flex-direction: column;
  gap: clamp(8px, 1.4vh, 14px);
  overflow-y: auto;
  animation: slidein .32s cubic-bezier(.2, .7, .2, 1);
}
@keyframes slidein { from { transform: translateX(60px); opacity: 0; } }
.alch-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  color: var(--ink-dim); font-size: 26px; line-height: 1;
  cursor: pointer;
}
.alch-close:hover { color: var(--ink); }
.alchemist-card h3 { font-family: var(--font-display); font-size: clamp(16px, 2.6vh, 21px); }
.alch-sub { color: var(--ink-mute); font-size: clamp(11px, 1.6vh, 13px); }
.alch-context {
  background: var(--surface-1);
  border: 1px dashed var(--panel-line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: clamp(10.5px, 1.5vh, 12.5px);
  color: var(--ink-mute);
  display: flex; flex-direction: column; gap: 6px;
}
.alch-context .ctx-formula { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.alch-context .ctx-formula .mini-tile { width: 34px; border-radius: 8px; cursor: default; }
.alch-context .ctx-formula .mini-tile .m-sym { font-size: 12px; }
.alch-context .ctx-formula .mini-tile .m-num { display: none; }
.alch-context .ctx-problem { font-style: italic; color: var(--ink-dim); }
.alch-context .ctx-problem b { color: var(--ink-mute); font-weight: 600; font-style: normal; }

#alch-form { display: flex; flex-direction: column; gap: clamp(8px, 1.3vh, 12px); }
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 1px; width: 1px; overflow: hidden; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1.2vh, 12px); }
.f-field { display: flex; flex-direction: column; gap: 4px; font-size: clamp(10.5px, 1.5vh, 12.5px); color: var(--ink-mute); }
.f-field input, .f-field textarea {
  background: var(--surface-1);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: clamp(12px, 1.7vh, 14px);
  padding: 9px 12px;
  width: 100%;
}
.f-field input:focus, .f-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.req { color: var(--req-ink); margin-left: 2px; }
.consent { display: flex; gap: 9px; align-items: flex-start; font-size: clamp(10.5px, 1.5vh, 12.5px); color: var(--ink-mute); cursor: pointer; }
.consent input { margin-top: 2px; accent-color: var(--accent); }
.alch-error {
  background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .4);
  color: var(--error-ink);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: clamp(10.5px, 1.5vh, 12.5px);
}
.alch-submit { align-self: flex-start; }
.alch-submit[disabled] { opacity: .55; cursor: wait; }
.alch-success { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 6vh; }
.flask-ok { font-size: 42px; }
.alch-success h4 { font-family: var(--font-display); font-size: clamp(16px, 2.6vh, 20px); }
.alch-success p { color: var(--ink-mute); font-size: clamp(11.5px, 1.7vh, 13.5px); }
.alch-success a { color: var(--accent); }

/* ═══ Responsive ═════════════════════════════════════════════════ */

/* medium desktop / small laptop */
@media (min-width: 901px) {
  .grid .tile[style] { grid-row: var(--r); grid-column: var(--c); }
}

/* tablet & phone */
@media (max-width: 900px) {
  .masthead-tag { display: none; }
  .masthead { text-align: left; }
  .masthead-title { font-size: clamp(15px, 4.2vw, 22px); white-space: nowrap; }
  .brand-logo { height: 22px; }
  .lab-header { gap: 10px; }
  .header-actions .year-chip { display: none; }
  #compose-cta { font-size: 11.5px; padding: .5em .9em; }

  .grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, minmax(0, 1fr));
    gap: 7px;
  }
  .slot-empty, .hero-card { display: none; }
  .grid .tile::after { display: none; }
  .t-name { display: none; }
  .t-sym { font-size: clamp(15px, 2.6vh, 22px); }
  .tile { align-items: center; justify-content: center; padding: 4px; }
  .t-num { position: absolute; left: 5px; top: 5px; bottom: auto; width: 1.6em; height: 1.6em; font-size: 8.5px; }
  .table-footnote .footnote-hint { display: block; }

  /* stage becomes a tabbed column: tile first, tabs, then the active panel.
     display:contents lifts the grid's children up to the scene flexbox so the
     tab bar (a sibling of the grid) can slot between tile and panel. */
  .scene-stage { gap: 8px; }
  .stage-grid { display: contents; }
  .stage-center { order: 1; flex-direction: row; justify-content: flex-start; gap: 12px; flex: 0 0 auto; }
  .scene-stage .stage-tabs { order: 2; }
  .scene-stage .panel { order: 3; }
  .scene-stage .stage-bottom { order: 4; }
  .stage-tile {
    width: clamp(120px, 34vw, 170px);
    aspect-ratio: auto;
    min-height: 100px;
    padding: 10px 12px;
  }
  .stage-tile .t-sym { font-size: clamp(22px, 3.6vh, 30px); }
  .stage-tile .t-name { font-size: 11px; }
  .stage-tile .t-proof { font-size: 9.5px; }
  .stage-tile .t-footer { margin-top: 8px; }
  .t-download { width: 32px; height: 32px; }
  #bond-svg { display: none; }
  .stage-bonds { flex-direction: column; justify-content: center; gap: 6px; }
  .stage-bonds .mini-tile { width: 44px; border-radius: 10px; }

  .panel { display: none; flex: 1 1 150px; min-height: 130px; opacity: 1; transform: none; }
  .panel.active { display: flex; }

  .stage-tabs {
    display: flex; gap: 6px;
    flex: 0 0 auto;
    padding: 2px 0;
  }
  .stage-tabs [role="tab"] {
    flex: 1;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: .55em 0;
    background: var(--surface-1);
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    color: var(--ink-mute);
    cursor: pointer;
  }
  .stage-tabs [role="tab"][aria-selected="true"] {
    background: var(--accent-soft);
    border-color: rgba(56, 189, 248, .45);
    color: var(--accent);
  }

  /* the bottom strips must never starve the tab panel: they shrink and
     scroll internally once space runs out */
  .stage-bottom { grid-template-columns: 1fr; gap: 8px; flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  .strip-bonds .chip-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .bond-pair { flex: 0 0 auto; }
  .uc-row { gap: .25em; }
  .case-media { flex-basis: 88px; min-height: 68px; }
  .case-text { -webkit-line-clamp: 2; }
  .case-values { flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding-bottom: 2px; scrollbar-width: none; }
  .case-value { flex: 0 0 auto; }

  .bench-title { font-size: 15px; white-space: nowrap; }
  .bench-sub { font-size: 11.5px; }
  .bench-input { flex-direction: column; }
  .bench-input textarea { min-height: 84px; }
  .btn-distill { justify-content: center; padding: .8em 1.4em; }
  /* chips collapse to one thumb-scrollable row so the formula stays on screen */
  .bench-chips-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .bench-chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: thin; }
  .bench-chip { flex: 0 0 auto; }
  .formula-row { gap: 8px; padding: 8px 12px; }
  .formula-row .mini-tile { width: 44px; }
  .confidence { margin-left: 0; width: 100%; }
  .reaction { min-height: 90px; }
  .overlay-top-spacer { width: 40px; }
  .rx { flex-direction: column; gap: 4px; }
  .rx-phase { min-width: 0; align-self: flex-start; }

  .alchemist { justify-content: center; }
  .alchemist-card { width: 100%; border-left: none; }
  .f-grid { grid-template-columns: 1fr; }

  /* V3 lens rail becomes a floating bottom dock */
  .industry-rail {
    top: auto; bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    gap: 4px;
    padding: 5px 8px;
    border-left: 1px solid var(--panel-line);
    border-radius: 16px;
  }
  .rail-group { flex-direction: row; gap: 4px; }
  .rail-divider { width: 1px; height: auto; margin: 4px 2px; align-self: stretch; }
  .ir-btn { width: 36px; height: 36px; }
  .ir-btn svg { width: 20px; height: 20px; }

  /* V2 on small screens */
  .view-switch { padding-bottom: 4px; }
  .vs-btn { font-size: 10.5px; padding: .4em .9em; gap: .4em; }
  .vs-btn svg { width: 13px; height: 13px; }
  .flip-wall { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ff-statement { font-size: clamp(12px, 1.9vh, 15px); }
  .ff-tagline { display: none; }
  .fb-sub { font-size: 10.5px; padding: 4px 8px; }
  .home-head h2 { font-size: 16px; }
  .home-head p { font-size: 10.5px; }
  .shelves { overflow-y: auto; scrollbar-width: thin; }
  .shelf { flex: 0 0 auto; }
  .shelf-row.cols-4, .shelf-row.cols-6 {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }
  .shelf-row .product-card { flex: 0 0 168px; min-height: 148px; }
  .product-tile .pt-ucs { display: none; }
}

/* very short screens */
@media (max-height: 620px) {
  .masthead-tag { display: none; }
  .table-footnote { display: none; }
  .stage-center { gap: 14px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .mote, .hero-card::before { display: none; }
  /* flip becomes an instant crossfade-style swap */
  .flip-inner { transition: none; }
}
