/* =============================================
   MinDet Emago - "How it works" scroll story
   Loaded after styles.css and modern-enhancements.css
   ============================================= */

:root {
  --st-bg: #07090c;
  --st-bg-2: #0c121a;
  --st-surface: #111821;          /* chart cards - the surface the palette was validated on */
  --st-surface-2: #17202b;
  --st-line: rgba(255, 255, 255, 0.08);
  --st-line-2: rgba(255, 255, 255, 0.14);
  --st-text: #eaf0f6;
  --st-text-2: #b6c2ce;
  --st-muted: #7f8c99;
  --st-grid: #222b36;
  --st-axis: #384453;
  --st-accent: #57a8ff;
  --st-cyan: #7fd3ea;             /* MinDet logo blue */
  --st-det: #8fd0ff;              /* detection outlines */
  --st-nav: 64px;

}

body.story-page {
  background: var(--st-bg);
  color: var(--st-text);
  font-family: 'DM Sans', sans-serif;
}

/* The site nav, pinned in its compact state over the dark stage */
.story-page #mainNav,
.story-page #mainNav.navbar-shrink {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  background: rgba(7, 9, 12, 0.72);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--st-line);
}
.story-page #mainNav .navbar-brand img,
.story-page #mainNav.navbar-shrink .navbar-brand img {
  height: 2.5rem;
}
@media (max-width: 991.98px) {
  .story-page #mainNav .navbar-collapse { padding-bottom: 0.5rem; }
}

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

/* ── Story scaffold ─────────────────────────── */
.story {
  position: relative;
  padding: 0;                     /* the theme pads every section */
  overflow-anchor: none;          /* no browser scroll adjustments inside the story */
  height: 1460vh;                 /* replaced from JS with the timeline length */
}
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;                 /* the small viewport: steady while a phone's address bar moves */
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 58%, rgba(57, 135, 229, 0.16), transparent 70%),
    radial-gradient(ellipse at 50% 120%, #0f1a26 0%, var(--st-bg) 60%);
  isolation: isolate;
}
.stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(87, 168, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 168, 255, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 60% 50%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at 60% 50%, #000 30%, transparent 75%);
}
.layer {
  position: absolute;
  inset: 0;
}
.layer-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

/* ── Product (3D) ───────────────────────────── */
.layer-product { perspective: 2600px; }
.p3d {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.p3d > .layer-svg { overflow: visible; }
.world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  transform-origin: 0 0;
  transform-style: preserve-3d;
}
.face {
  position: absolute;
  backface-visibility: visible;
}
.face.top { transform-origin: 50% 100%; }
.face.right { transform-origin: 0 50%; }
.face.edge { transform-origin: 0 0; }
.face.front { transform-origin: 0 0; }
#prodSvg.turned .flat-only { visibility: hidden; }
.f-top-main {
  background: linear-gradient(to top, #f7f9fb, #e6ebf0);
}
.f-top-main .vents {
  position: absolute;
  background: radial-gradient(circle, rgba(70, 82, 96, 0.42) 0 2.4px, transparent 2.9px) 0 0 / 15px 15px;
  border-radius: 4px;
}
.f-top-main .seam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #d3dae1;
}
.f-top-main .fins,
.f-hood-top .fins {
  position: absolute;
  background: repeating-linear-gradient(90deg, #14171b 0 5px, #2b3037 5px 9px);
  border-radius: 3px;
  box-shadow: 0 0 0 1px #0b0d0f;
}
.f-top-shelf { background: linear-gradient(to top, #f3f6f9, #e3e8ed); }
.f-top-shelf .slot {
  position: absolute;
  border-radius: 14px;
  background: linear-gradient(to top, #8fdcef, #6ccbe2);
}
.f-right-tower { background: linear-gradient(90deg, #dfe5eb, #c3ccd5); }
.f-right-shelf { background: #cdd5dd; }
.f-chamfer { background: linear-gradient(90deg, #cfd6de, #b2bcc6); }
.f-hood-top { background: #1d2126; }
.f-hood-right { background: linear-gradient(90deg, #15181b, #0a0b0d); }
.f-bump-top { background: #24282e; }
.f-bump-right { background: #0d0f11; }
.f-cap { background: linear-gradient(#f4f6f8, #d7dee5); }
.f-cap-top { background: #ffffff center / 82% no-repeat; }
.f-cap-side { background: linear-gradient(90deg, #c9d1d9, #aab4be); }
.f-tray-top { background: linear-gradient(to top, #9fe2f2, #78d0e6); border-radius: 6px; }
.f-tray-right { background: #4fb1ca; }
.f-tray-front { background: linear-gradient(#a6e7f5, #5bc1da); border-radius: 5px; }
.f-bump-front { background: #121417; border-radius: 2px; }
.f-rack-top { background: #24282e; }
.f-rack-right { background: linear-gradient(90deg, #0f1113, #060708); }
.f-rack-front {
  background: repeating-linear-gradient(90deg, transparent 0 32px, #262b31 32px 34px) 0 8px / 100% calc(100% - 16px) no-repeat, #131619;
  border-radius: 1.5px;
}
.f-tower-front { background: linear-gradient(90deg, #dbe2e8, #eef2f5); }

/* blueprint strokes stay ~1.3px on screen at any zoom (--u = drawing units per pixel) */
#prodSvg .xr { stroke-width: calc(var(--u, 1) * 1.3px); }
.f-shadow {
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.35) 45%, transparent 72%);
}

/* x-ray callouts */
.callout {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.callout .dot {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--st-det);
  box-shadow: 0 0 0 4px rgba(143, 208, 255, 0.2), 0 0 16px rgba(143, 208, 255, 0.8);
}
.callout .stem {
  position: absolute;
  left: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(143, 208, 255, 0.9), rgba(143, 208, 255, 0.4));
  transform-origin: 0 0;
}
.callout .lbl {
  position: absolute;
  white-space: nowrap;
  font: 600 13px/1.2 'DM Sans', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--st-text);
  padding: 7px 11px;
  border: 1px solid rgba(143, 208, 255, 0.35);
  border-radius: 8px;
  background: rgba(7, 12, 18, 0.78);
}
.callout .lbl small {
  display: block;
  margin-top: 3px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--st-text-2);
  font-size: 12.5px;
}

/* ── Micrograph ─────────────────────────────── */
.layer-micro {
  opacity: 0;
  visibility: hidden;
}
.layer-micro .p-outline {
  fill: var(--st-det);
  fill-opacity: 0;
  stroke: var(--st-det);
  stroke-width: calc(var(--u, 1) * 1.6px);
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.layer-micro .p-outline.ided { stroke: var(--c); }
.layer-micro .p-outline.hero { stroke: #fff; stroke-width: calc(var(--u, 1) * 2.6px); }
.layer-micro .g-fill { fill-opacity: 0.5; }
.layer-micro .g-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: calc(var(--u, 1) * 1.3px);
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.micro-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}
.fov-ring {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(143, 208, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(143, 208, 255, 0.15), 0 0 42px rgba(87, 168, 255, 0.4), inset 0 0 70px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
}

/* grain chips on the micrograph */
.chips { position: absolute; inset: 0; pointer-events: none; }
.gchip {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(7, 9, 12, 0.82);
  border: 1px solid var(--st-line-2);
  font: 600 13px/1 'DM Sans', sans-serif;
  color: var(--st-text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.gchip i, .legend i, .dotkey {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.gchip b { font-weight: 500; color: var(--st-text-2); }

/* ── Glass panels ───────────────────────────── */
.glass {
  background: rgba(14, 20, 28, 0.84);
  border: 1px solid var(--st-line-2);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.ai-panel, .p-card {
  position: absolute;
  right: max(150px, 9vw);
  top: 50%;
  width: min(440px, 34vw);
  transform: translateY(-50%);
  padding: 18px 20px 20px;
  opacity: 0;
  pointer-events: none;
}
.ai-head, .p-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  color: var(--st-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ai-head strong, .p-card-head strong {
  color: var(--st-text);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.ai-top {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: center;
  margin: 14px 0 16px;
}
.ai-input {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 10px;
  background: #000;
  border: 1px solid var(--st-line-2);
  overflow: hidden;
}
.ai-input svg { width: 100%; height: 100%; display: block; }
.ai-input span, .ai-net-wrap span {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 11px;
  color: var(--st-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ai-net-wrap { position: relative; height: 112px; }
.ai-net-wrap span { left: auto; right: 0; bottom: -2px; }
.ai-net { width: 100%; height: 100%; display: block; overflow: visible; }
.ai-net line { stroke: var(--st-det); stroke-width: 0.8; }
.ai-net circle { fill: #1b2633; stroke: rgba(143, 208, 255, 0.5); stroke-width: 1; }
.ai-rows { display: grid; gap: 9px; }
.ai-row {
  display: grid;
  grid-template-columns: 10px 104px 1fr 44px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--st-text-2);
}
.ai-row .bar {
  position: relative;
  height: 10px;
  border-radius: 0 4px 4px 0;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.ai-row .bar b {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 0 4px 4px 0;
}
.ai-row .val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--st-text-2);
}
.ai-row.win { color: var(--st-text); }
.ai-row.win .val { color: var(--st-text); font-weight: 600; }
.ai-row.win .name::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 10px;
  margin-left: 8px;
  border: solid var(--st-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
}

.p-card .p-size {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 0 4px;
}
.p-card .p-size strong {
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  color: var(--st-text);
}
.p-card .p-size span { color: var(--st-text-2); font-size: 15px; }
.p-card .comp {
  display: flex;
  gap: 2px;
  height: 14px;
  margin: 14px 0 12px;
}
.p-card .comp b { display: block; height: 100%; }
.p-card .comp b:first-child { border-radius: 4px 0 0 4px; }
.p-card .comp b:last-child { border-radius: 0 4px 4px 0; }
.p-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
  font-size: 14.5px;
  color: var(--st-text-2);
}
.p-card li { display: flex; align-items: center; gap: 10px; }
.p-card li span:last-child { margin-left: auto; color: var(--st-text); font-variant-numeric: tabular-nums; }
.p-card .lib {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--st-line);
  font-size: 14px;
  color: var(--st-text-2);
}
.p-card .lib strong { color: var(--st-text); font-weight: 600; }

/* mineral legend */
.legend {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  padding: 10px 18px;
  max-width: min(1000px, 92vw);
  border-radius: 999px;
  background: rgba(7, 9, 12, 0.8);
  border: 1px solid var(--st-line);
  font-size: 13.5px;
  color: var(--st-text-2);
  opacity: 0;
  pointer-events: none;
}
.legend span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }

/* ── Captions ───────────────────────────────── */
.scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, rgba(7, 9, 12, 0.88) 0%, rgba(7, 9, 12, 0.6) 30%, rgba(7, 9, 12, 0) 56%);
}
.caps { position: absolute; inset: 0; pointer-events: none; }
.cap {
  position: absolute;
  left: clamp(20px, 6vw, 104px);
  top: 50%;
  width: min(440px, 36vw);
  opacity: 0;
  will-change: transform, opacity;
}
.cap .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 13px/1 'DM Sans', sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--st-cyan);
}
.cap .eyebrow::before {
  content: '';
  width: 26px;
  height: 1px;
  background: currentColor;
}
.cap h1, .cap h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.04;
  color: var(--st-text);
  text-transform: none;
  margin: 14px 0 14px;
}
.cap h2 { font-size: clamp(32px, 3.7vw, 56px); }
.cap p {
  font-size: clamp(16px, 1.15vw, 19px);
  line-height: 1.55;
  color: var(--st-text-2);
  margin: 0;
  max-width: 34ch;
}
.cap .stat {
  display: flex;
  gap: 28px;
  margin-top: 22px;
}
.cap .stat div { display: flex; flex-direction: column; gap: 4px; }
.cap .stat strong {
  font-size: clamp(34px, 3.4vw, 52px);
  font-weight: 600;
  line-height: 1;
  color: var(--st-text);
}
.cap .stat span { font-size: 13.5px; color: var(--st-muted); }

.cap.cap--top { top: calc(var(--st-nav) + 4vh); bottom: auto; }

.cap--hero {
  left: 50%;
  top: calc(var(--st-nav) + 6vh);
  width: min(960px, 92vw);
  text-align: center;
}
.cap--hero .eyebrow::after {
  content: '';
  width: 26px;
  height: 1px;
  background: currentColor;
}
.cap--hero h1 { font-size: clamp(40px, 4.7vw, 76px); margin: 14px 0 14px; }
.cap--hero p { margin: 0 auto; max-width: 46ch; font-size: clamp(16px, 1.35vw, 21px); }

/* Desktop: headline and subtitle on one line each, leaving the machine more room */
@media (min-width: 992px) {
  .cap--hero { top: calc(var(--st-nav) + 4vh); width: min(1320px, 94vw); }
  .cap--hero h1 { white-space: nowrap; font-size: min(4.4vw, 68px); margin-bottom: 10px; }
  .cap--hero p { max-width: none; }
}

/* Opening: scroll, or let the story play. Beside the machine on desktop, under it on smaller screens. */
.start-actions {
  position: absolute;
  z-index: 7;
  right: max(140px, 8vw);
  top: 60%;
  width: max-content;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.hint-big {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 600 19px/1.3 'DM Sans', sans-serif;
  color: var(--st-text);
}
.hint-big i {
  position: relative;
  flex: none;
  width: 24px;
  height: 38px;
  border: 2px solid var(--st-cyan);
  border-radius: 12px;
}
.hint-big i::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 7px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--st-cyan);
  animation: wheelDrop 1.6s ease-in-out infinite;
}
@keyframes wheelDrop { 60% { transform: translateY(10px); opacity: 0; } 61% { transform: none; opacity: 0; } }
/* Touch screens get a swiping finger instead of the mouse */
.hint-swipe { flex: none; width: 28px; height: 38px; overflow: visible; fill: none; stroke: var(--st-cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hint-swipe .sw-arrow { opacity: 0.7; }
.hint-swipe .sw-hand { animation: swipeUp 1.8s ease-in-out infinite; }
@keyframes swipeUp {
  0% { transform: translateY(6px); opacity: 0; }
  20% { opacity: 1; }
  65% { transform: translateY(-5px); opacity: 1; }
  85%, 100% { transform: translateY(-7px); opacity: 0; }
}
.hint-swipe, .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hint-mouse, .hint-desk { display: none; }
  .hint-swipe { display: block; }
  .hint-touch { display: inline; }
}
.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px 11px 13px;
  border-radius: 999px;
  border: 1px solid rgba(127, 211, 234, 0.45);
  background: rgba(127, 211, 234, 0.1);
  color: var(--st-cyan);
  font: 600 15.5px/1 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.play-btn:hover, .play-fab:hover { background: rgba(127, 211, 234, 0.2); border-color: var(--st-cyan); }
.play-btn:focus-visible, .play-fab:focus-visible { outline: 2px solid var(--st-cyan); outline-offset: 3px; }
.play-btn svg { width: 24px; height: 24px; }
.play-fab {
  position: absolute;
  z-index: 8;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(127, 211, 234, 0.45);
  background: rgba(7, 9, 12, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--st-cyan);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.2s, border-color 0.2s;
}
.play-fab.on { opacity: 1; pointer-events: auto; }
.play-fab svg { width: 20px; height: 20px; }
.i-pause, .playing .i-play { display: none; }
.playing .i-pause { display: inline; }

@media (max-width: 991.98px) {
  .start-actions {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 26px;
    width: max-content;
    max-width: 92vw;
    transform: translateX(-50%);
    align-items: center;
    gap: 12px;
  }
  .hint-big { font-size: 16px; gap: 10px; }
  .hint-big i { width: 20px; height: 32px; }
  .hint-swipe { width: 24px; height: 33px; }
}
.p-card .p-note { margin-top: 10px; font-size: 12.5px; color: var(--st-muted); }

/* ── Progress rail ──────────────────────────── */
.rail {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 6;
}
.rail button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 0 5px 10px;
  border: 0;
  background: none;
  color: var(--st-muted);
  font: 500 12px/1 'DM Sans', sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.rail .lbl {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.3s, transform 0.3s, color 0.3s;
}
.rail .dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
  transition: height 0.35s, background 0.35s, box-shadow 0.35s;
}
.rail button.on .dot {
  height: 22px;
  background: var(--st-cyan);
  box-shadow: 0 0 14px rgba(127, 211, 234, 0.45);
}
.rail button.on .lbl,
.rail:hover .lbl,
.rail button:focus-visible .lbl {
  opacity: 1;
  transform: none;
}
.rail button.on .lbl { color: var(--st-text); }
.rail button:hover .lbl { color: var(--st-text); }
.rail button:focus-visible { outline: 2px solid var(--st-cyan); outline-offset: 2px; border-radius: 4px; }

/* ── Dashboard ──────────────────────────────── */
.dash {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 2.2vh;
  padding: calc(var(--st-nav) + 3vh) max(160px, 10vw) 4vh clamp(20px, 5vw, 96px);
  opacity: 0;
  visibility: hidden;
}
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.dash-head .cap {
  position: static;
  width: auto;
  opacity: 1;
}
.dash-head .cap h2 { font-size: clamp(28px, 3vw, 46px); margin: 10px 0 8px; }
.dash-head .cap p { max-width: 70ch; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--st-line-2);
  font-size: 12.5px;
  color: var(--st-text-2);
  white-space: nowrap;
}
.dash-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
}
.dash-grid {
  height: 100%;
  display: grid;
  gap: 14px;
  grid-template-columns: 0.95fr 1.3fr 1fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "hero psd modal"
    "lib deport modal";
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 16px 18px 14px;
  border-radius: 14px;
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  will-change: transform, opacity;
}
.card h3 {
  margin: 0;
  font: 600 15px/1.3 'DM Sans', sans-serif;
  color: var(--st-text);
  letter-spacing: 0;
  text-transform: none;
}
.card .sub { margin-top: 2px; font-size: 12.5px; color: var(--st-muted); }
.card .plot { position: relative; flex: 1; min-height: 0; margin-top: 10px; }
.card .plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.card .keys {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--st-text-2);
}
.card .keys span { display: inline-flex; align-items: center; gap: 6px; }
.card .keys i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
#cardHero { grid-area: hero; }
#cardPsd { grid-area: psd; }
#cardModal { grid-area: modal; }
#cardLib { grid-area: lib; }
#cardDeport { grid-area: deport; }

.hero-fig { margin-top: 8px; }
.hero-fig strong {
  display: block;
  font-size: clamp(44px, 4.6vw, 72px);
  font-weight: 600;
  line-height: 1;
  color: var(--st-text);
  letter-spacing: -0.02em;
}
.hero-fig span { font-size: 13.5px; color: var(--st-text-2); }
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
}
.tile {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--st-surface-2);
  border: 1px solid var(--st-line);
}
.tile span { display: block; font-size: 12px; color: var(--st-muted); }
.tile strong { font-size: 22px; font-weight: 600; color: var(--st-text); }
.tile strong small { font-size: 13px; font-weight: 500; color: var(--st-text-2); margin-left: 2px; }
.tiles-note { margin-top: 8px; font-size: 12px; color: var(--st-muted); }
.also { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.also span {
  font-size: 12px;
  color: var(--st-text-2);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--st-line-2);
}

/* chart text */
.chart text { font-family: 'DM Sans', sans-serif; }
.chart .tick { fill: var(--st-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .lab { fill: var(--st-text-2); font-size: 12.5px; }
.chart .val { fill: var(--st-text); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--st-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis { stroke: var(--st-axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .hit { fill: transparent; cursor: default; }

.tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 20;
  padding: 8px 11px;
  border-radius: 8px;
  background: #0b1016;
  border: 1px solid var(--st-line-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  color: var(--st-text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  white-space: nowrap;
}
.tip.on { opacity: 1; }
.tip .k { display: flex; align-items: center; gap: 7px; color: var(--st-text-2); }
.tip .k b { color: var(--st-text); font-weight: 600; margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }

/* ── Deliver: every sample reported ─────────── */
.flow {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.flow-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.flow-links .fl-base { fill: none; stroke: rgba(127, 211, 234, 0.22); stroke-width: 1.5; }
.flow-links .fl-dash {
  fill: none;
  stroke: var(--st-cyan);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 2 13;
  animation: flowDash 0.9s linear infinite;
}
@keyframes flowDash { to { stroke-dashoffset: -15; } }
.flow:not(.live) .fl-dash { animation-play-state: paused; }
.flow-grid {
  position: absolute;
  left: clamp(20px, 6vw, 104px);
  right: max(150px, 10vw);
  top: calc(var(--st-nav) + 4vh + 230px);
  bottom: 6vh;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.75fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}
.fpanel {
  position: relative;
  z-index: 1;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--st-surface);
  border: 1px solid var(--st-line-2);
}
.fp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--st-text-2);
}
.fp-head b { color: var(--st-text); font-weight: 600; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.fp-foot { margin-top: 10px; font-size: 12.5px; color: var(--st-muted); }
.fsamples { width: 100%; max-width: 560px; justify-self: center; }
.sgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.stile {
  padding: 5px 6px 4px;
  border-radius: 7px;
  background: var(--st-surface-2);
  border: 1px solid var(--st-line);
  opacity: 0;
}
.stile span { display: block; font-size: 10.5px; line-height: 1; color: var(--st-muted); font-variant-numeric: tabular-nums; }
.stile svg { display: block; width: 100%; height: auto; margin-top: 4px; }
@media (min-width: 768px) and (max-height: 820px) { .fsamples { max-width: 460px; } }
.fouts { position: relative; z-index: 1; display: grid; gap: 12px; }
.out {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--st-surface);
  border: 1px solid var(--st-line-2);
}
.out svg { width: 34px; height: 34px; flex: none; }
.out b { display: block; font-size: 14.5px; font-weight: 600; color: var(--st-text); }
.out span { font-size: 12.5px; color: var(--st-muted); font-variant-numeric: tabular-nums; }

@media (max-width: 767.98px) {
  .flow-grid {
    left: 14px;
    right: 14px;
    top: calc(var(--st-nav) + 196px);
    bottom: 14px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 34px;
    align-content: center;
  }
  .fpanel { padding: 10px 11px; }
  .fp-head { font-size: 11px; letter-spacing: 0.04em; }
  .fp-foot { display: none; }
  .sgrid { gap: 4px; margin-top: 8px; }
  .stile { padding: 3px 3px 2px; border-radius: 4px; }
  .stile span { font-size: 8.5px; }
  .stile svg { margin-top: 2px; }
  .fouts { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .out { flex-direction: column; align-items: flex-start; gap: 6px; padding: 9px 10px; }
  .out svg { width: 24px; height: 24px; }
  .out b { font-size: 13px; }
  .out span { font-size: 11.5px; }
}

/* reduced-motion cuts */
.rm-dip {
  position: absolute;
  inset: 0;
  background: var(--st-bg);
  opacity: 0;
  pointer-events: none;
}

/* ── What's next: Elchemia ──────────────────── */
.next-section {
  position: relative;
  padding: 14vh clamp(20px, 6vw, 96px) 6vh;
  background: var(--st-bg);
}
.next-wrap {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.next-copy .pill {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(127, 211, 234, 0.4);
  color: var(--st-cyan);
  font: 600 11.5px/1 'DM Sans', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.next-copy .eyebrow {
  display: block;
  margin-top: 18px;
  font: 600 13px/1 'DM Sans', sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--st-text-2);
}
.next-copy h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 3.8vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--st-text);
  margin: 12px 0 16px;
}
.next-copy p {
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.6;
  color: var(--st-text-2);
  margin: 0;
}
.next-copy ul {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 8px;
  color: var(--st-text-2);
  font-size: 15.5px;
}
.next-copy li { display: flex; gap: 12px; align-items: baseline; }
.next-copy li::before {
  content: '';
  flex: none;
  width: 14px;
  height: 1px;
  background: var(--st-cyan);
  transform: translateY(-4px);
}
.next-copy .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.next-figure { margin: 0; }
.blueprint {
  border-radius: 14px;
  border: 1px solid rgba(127, 211, 234, 0.22);
  overflow: hidden;
  background:
    linear-gradient(rgba(127, 211, 234, 0.06) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(127, 211, 234, 0.06) 1px, transparent 1px) 0 0 / 24px 24px,
    #0a1624;
}
.bp { display: block; width: 100%; height: auto; }
.bp text { font-family: 'DM Sans', sans-serif; font-size: 13px; fill: var(--st-text-2); }
.bp .bp-name { font-size: 15px; font-weight: 700; letter-spacing: 0.12em; fill: var(--st-cyan); }
.bp-tb text { font-size: 10.5px; letter-spacing: 0.12em; fill: var(--st-muted); }
.bp-tb .bp-tb-title { fill: var(--st-text); font-weight: 700; }
.bp-line { fill: none; stroke: #7fd3ea; stroke-width: 1.5; }
.bp-thin { fill: none; stroke: #7fd3ea; stroke-opacity: 0.55; stroke-width: 1; }
.bp-hidden { fill: none; stroke: #7fd3ea; stroke-opacity: 0.55; stroke-width: 1; stroke-dasharray: 5 4; }
.bp-face { fill: rgba(127, 211, 234, 0.06); stroke: #7fd3ea; stroke-width: 1.5; }
.bp-front { fill: #0b1b2c; }
.bp-fillish { fill: #7fd3ea; fill-opacity: 0.7; }
.bp-pipe-o { fill: none; stroke: #7fd3ea; stroke-width: 11; }
.bp-pipe-i { fill: none; stroke: #0a1624; stroke-width: 8; }
.bp-flow { fill: none; stroke: #c8eef8; stroke-width: 2; stroke-dasharray: 3 9; animation: bpFlow 1.1s linear infinite; }
.bp-data { stroke: #7fd3ea; stroke-dasharray: 2 6; animation-duration: 0.6s; }
.bp-trend { fill: none; stroke: #7fd3ea; stroke-width: 1.5; stroke-linejoin: round; }
.bp-led { fill: #3ddc84; animation: bpBlink 1.8s ease-in-out infinite; }
.bp-led2 { animation-delay: 0.6s; }
@keyframes bpFlow { to { stroke-dashoffset: -12; } }
@keyframes bpBlink { 50% { opacity: 0.25; } }
.next-section.paused .bp * { animation-play-state: paused; }

.live { margin-top: 12px; }
.live-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--st-text-2);
}
.live-note { margin-left: auto; color: var(--st-muted); letter-spacing: 0.04em; text-transform: none; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5);
  animation: livePulse 1.8s ease-out infinite;
}
@keyframes livePulse { to { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); } }
.live-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.ltile {
  padding: 10px 12px 8px;
  border-radius: 10px;
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  min-width: 0;
}
.ltile span { display: block; font-size: 12px; color: var(--st-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltile strong { display: block; font-size: 22px; font-weight: 600; color: var(--st-text); line-height: 1.3; }
.ltile strong small { font-size: 12.5px; font-weight: 500; color: var(--st-text-2); margin-left: 3px; }
.spark { display: block; width: 100%; height: 30px; margin-top: 4px; overflow: visible; }
.next-figure figcaption { margin-top: 10px; font-size: 12.5px; color: var(--st-muted); }

@media (max-width: 991.98px) {
  .next-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
  .bp text { font-size: 22px; }
  .bp .bp-name { font-size: 18px; }
  .bp-tb text { font-size: 13px; letter-spacing: 0.06em; }
  .ltile { padding: 8px 9px 6px; }
  .ltile span { white-space: normal; min-height: 2.5em; line-height: 1.25; }
  .ltile strong { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .bp-flow, .bp-led, .live-dot { animation: none; }
}

/* ── After the story ────────────────────────── */
.story-end {
  position: relative;
  padding: 16vh 20px 14vh;
  text-align: center;
  background: radial-gradient(ellipse 60% 70% at 50% 0%, rgba(57, 135, 229, 0.14), transparent 70%), var(--st-bg);
}
.story-end h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 64px);
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--st-text);
  margin: 0 0 16px;
}
.story-end p {
  max-width: 54ch;
  margin: 0 auto;
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.6;
  color: var(--st-text-2);
}
.story-end .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}
.btn-story {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid var(--st-line-2);
  color: var(--st-text);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.btn-story:hover { color: var(--st-text); border-color: rgba(255, 255, 255, 0.35); transform: translateY(-1px); }
.btn-story.primary { background: var(--st-cyan); border-color: var(--st-cyan); color: #06222b; }
.btn-story.primary:hover { background: #9ce0f1; color: #06222b; }
.story-end .fine {
  margin-top: 46px;
  font-size: 13px;
  color: var(--st-muted);
  max-width: 70ch;
}
.story-end .fine a { color: var(--st-text-2); }

/* The home page's Story, Team and Contact sections, restyled for this page's dark theme.
   Scoped here so index.html keeps its light look. */
.site-sections {
  background: var(--st-bg);
  color: var(--st-text);
}
.site-sections #story { background: var(--st-bg); }
.site-sections #team.bg-light {
  background: linear-gradient(180deg, var(--st-bg) 0%, var(--st-bg-2) 50%, var(--st-bg) 100%) !important;
}
.site-sections h2, .site-sections h3, .site-sections h4 { color: var(--st-text); }
.site-sections .text-muted { color: var(--st-text-2) !important; }
.site-sections .section-subheading { color: var(--st-muted) !important; }

.site-sections .timeline:before { background-color: rgba(127, 211, 234, 0.22); }
.site-sections .timeline > li .timeline-panel {
  background: var(--st-surface);
  border: 1px solid var(--st-line-2);
  box-shadow: none;
}
.site-sections .timeline > li:hover .timeline-panel {
  border-color: rgba(127, 211, 234, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.site-sections .timeline > li .timeline-panel .subheading { color: var(--st-cyan); }
.site-sections .timeline > li .timeline-image { border-color: rgba(127, 211, 234, 0.3) !important; }

.site-sections .page-section.bg-light .team-member {
  background: var(--st-surface);
  border: 1px solid var(--st-line-2);
  box-shadow: none;
}
.site-sections .page-section.bg-light .team-member:hover {
  border-color: rgba(127, 211, 234, 0.4);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.site-sections .team-member a:not(.btn) { color: var(--st-cyan); }

.noscript-story { padding: 120px 20px 60px; text-align: center; color: var(--st-text-2); }
.noscript-story img { max-width: min(960px, 100%); border-radius: 12px; margin-top: 24px; }

/* ── Small screens ──────────────────────────── */
@media (max-width: 767.98px) {
  :root { --st-nav: 58px; }
  .rail { display: none; }
  .scrim {
    background: linear-gradient(0deg, rgba(7, 9, 12, 0.92) 0%, rgba(7, 9, 12, 0.7) 34%, rgba(7, 9, 12, 0) 60%);
  }
  .scrim.top {
    background: linear-gradient(180deg, rgba(7, 9, 12, 0.9) 0%, rgba(7, 9, 12, 0.6) 30%, rgba(7, 9, 12, 0) 52%);
  }
  .cap {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 22px;
    width: auto;
  }
  /* the play/pause button sits top-right on phones, so top captions and the legend leave room for it */
  .cap.cap--top-sm { top: calc(var(--st-nav) + 14px); bottom: auto; right: 62px; }
  .play-fab { top: calc(var(--st-nav) + 10px); bottom: auto; right: 12px; width: 40px; height: 40px; }
  .cap h2 { font-size: clamp(28px, 8vw, 38px); margin: 10px 0 10px; }
  .cap p { font-size: 15.5px; }
  .cap .stat { margin-top: 14px; }
  .cap--hero { top: calc(var(--st-nav) + 4vh); bottom: auto; left: 50%; right: auto; width: 92vw; }
  .cap--hero h1 { font-size: clamp(38px, 11vw, 52px); }
  .ai-panel, .p-card {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 14px;
    width: auto;
    transform: none;
    padding: 14px 14px 16px;
  }
  .ai-top { grid-template-columns: 84px 1fr; margin: 10px 0 12px; }
  .ai-input { width: 84px; height: 84px; }
  .ai-net-wrap { height: 84px; }
  .ai-row { grid-template-columns: 10px 96px 1fr 40px; font-size: 13px; gap: 8px; }
  .ai-rows { gap: 7px; }
  .p-card .p-size strong { font-size: 36px; }
  .legend {
    top: calc(var(--st-nav) + 12px);
    bottom: auto;
    left: 12px;
    right: 62px;
    transform: none;
    max-width: none;
    justify-content: flex-start;
    border-radius: 14px;
    font-size: 12.5px;
    gap: 4px 12px;
    padding: 8px 12px;
  }
  .gchip { font-size: 12px; padding: 4px 8px 4px 7px; }
  .callout .lbl { font-size: 11.5px; padding: 6px 9px; }
  .callout .lbl small { font-size: 11.5px; }
  .dash-head .badge { display: none; }
}

/* Compact results: phones and small or short desktops get the cards as a carousel that
   the scroll walks through (JS sets .compact on the stage). */
.stage.compact .dash { padding: calc(var(--st-nav) + 12px) 0 16px; gap: 12px; }
.stage.compact .dash-head { padding: 0 clamp(16px, 5vw, 64px); }
.stage.compact .dash-head .cap h2 { font-size: clamp(26px, 3.4vw, 36px); margin: 8px 0 6px; }
.stage.compact .dash-head .cap p { font-size: 14.5px; }
.stage.compact .dash-grid {
  display: flex;
  gap: 12px;
  padding: 0 calc(50vw - min(42vw, 230px));
  grid-template-areas: none;
  will-change: transform;
}
.stage.compact .dash-grid { align-items: center; }
.stage.compact .card { flex: 0 0 min(84vw, 460px); height: 100%; max-height: 440px; }

@media (prefers-reduced-motion: reduce) {
  .hint-big i::after, .hint-swipe .sw-hand { animation: none; }
  .flow-links .fl-dash { animation: none; }
  .rail .lbl, .rail .dot { transition: none; }
}
