/* ============================================================
   Electromove — design system
   Tokens + reusable composition patterns (static HTML)
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #f7f8fa;
  --bg-band: #eef0f3;
  --surface: #ffffff;
  --ink: #101218;
  --ink-2: #3a4050;
  --ink-3: #6a7280;
  --line: #e1e4ea;
  --line-strong: #c5cad3;

  /* Brand */
  --accent: #1d4ed8;
  --accent-hover: #1e3a8a;
  --accent-soft: #eef3ff;
  --amber: #a16207;
  --amber-soft: #fffbeb;
  --green: #166534;
  --green-soft: #f0fdf4;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  --sidebar: #1a1f2b;
  --sidebar-muted: #9aa3b2;

  /* Type */
  --font-display: "Instrument Sans", "Source Sans 3", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Instrument Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Space / layout — fluid where it helps scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: clamp(1.15rem, 1.5vw, 1.5rem);
  --space-6: clamp(1.5rem, 2.2vw, 2rem);
  --space-7: clamp(2.25rem, 4vw, 3rem);
  --space-8: clamp(3rem, 6vw, 5rem);
  --shell: 1120px;
  --shell-narrow: 680px;
  --gutter: clamp(16px, 3.5vw, 32px);
  --radius: 4px;
  --radius-lg: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.4s;
  --touch: 44px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: clamp(15px, 0.35vw + 14.5px, 18px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink-2);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.mono { font-family: var(--font-mono); font-size: 0.9em; }
.warn { color: var(--amber); font-weight: 600; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--gutter);
  z-index: 300;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
  transform: translateY(-120%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* ---- Shell ---- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--narrow { max-width: var(--shell-narrow); }

/* ---- Stack (vertical rhythm) ---- */
.stack > * + * { margin-top: var(--space-4); }
.stack--sm > * + * { margin-top: var(--space-2); }
.stack--lg > * + * { margin-top: var(--space-6); }
.stack--xl > * + * { margin-top: var(--space-7); }

/* ---- Type triad ---- */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.display {
  font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.2rem);
  max-width: 24ch;
}
.display--hero {
  font-size: clamp(1.65rem, 1.15rem + 2.4vw, 2.85rem);
  max-width: min(26ch, 100%);
}
.lede {
  font-size: clamp(0.98rem, 0.92rem + 0.35vw, 1.1rem);
  color: var(--ink-2);
  max-width: 42ch;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch);
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  will-change: transform;
  transition: background 0.2s var(--ease), border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn--lg {
  min-height: calc(var(--touch) + 4px);
  padding: 0.85rem 1.45rem;
  font-size: 1rem;
}
.btn--full { width: 100%; }
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(29, 78, 216, 0.22);
}
.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 18px rgba(29, 78, 216, 0.35);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--ink-3);
  background: var(--surface);
}
.threeui-btn-beam {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 255, 0.3) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.45;
  transition: opacity 0.25s;
}
.btn:hover .threeui-btn-beam {
  opacity: 1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-8) var(--space-7);
}
.hero-telemetry-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.95;
}
.hero .split {
  position: relative;
  z-index: 1;
}

/* ---- Section ---- */
.section {
  padding-block: var(--space-8);
  position: relative;
}
.section--band {
  background: var(--bg-band);
  border-block: 1px solid var(--line);
}
.section--tight { padding-block: var(--space-7); }

.section-head { margin-bottom: var(--space-6); }
.section-head .display { margin-top: var(--space-3); }
.section-head .lede { margin-top: var(--space-3); }

/* ---- Split ---- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.split--canvision,
.split--spectraq {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 3vw, 3rem);
}
.split--reverse { direction: rtl; }
.split--reverse > * { direction: ltr; }

/* ---- SpectraQ POC Interactive Showcase (2-Tab Viewer) ---- */
.showcase-stage {
  margin-top: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(0.9rem, 2vw, 1.5rem);
  box-shadow: 0 14px 40px rgba(16, 18, 24, 0.05);
}

.showcase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.showcase-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.showcase-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.showcase-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  background: var(--bg-band);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.showcase-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.showcase-tab .tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  transition: background 0.2s;
}

.showcase-tab:hover {
  color: var(--ink);
}

.showcase-tab:hover .tab-dot {
  background: var(--ink);
}

.showcase-tab.active {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--line-strong);
  box-shadow: 0 2px 8px rgba(16, 18, 24, 0.08);
}

.showcase-tab.active .tab-dot {
  background: var(--accent);
}

.showcase-pane {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.showcase-pane.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.showcase-frame {
  margin: 0;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px rgba(16, 18, 24, 0.06);
}

.showcase-frame img {
  width: 100%;
  height: auto;
  max-height: min(72vh, 680px);
  object-fit: contain;
  display: block;
}

.showcase-caption {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-band);
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ---- ThreeUI Diagnostics & Telemetry System ---- */
.threeui-stage {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
}

.threeui-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(0.75rem, 1.6vw, 1.15rem);
  box-shadow: 0 12px 32px rgba(16, 18, 24, 0.05);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.threeui-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    480px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(29, 78, 216, 0.05),
    transparent 65%
  );
  z-index: 1;
}

/* Corner Register Marks */
.threeui-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--accent);
  z-index: 4;
  pointer-events: none;
}
.threeui-corner--tl { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.threeui-corner--tr { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; }
.threeui-corner--bl { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; }
.threeui-corner--br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

/* Scanline Sweep */
.threeui-scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(29, 78, 216, 0.5), transparent);
  pointer-events: none;
  z-index: 3;
  animation: threeui-scan 4.5s linear infinite;
}
@keyframes threeui-scan {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(320px); opacity: 0; }
}

.threeui-panel__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.threeui-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.threeui-status__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.threeui-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.threeui-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 500;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.threeui-tag--accent {
  background: var(--accent-soft);
  border-color: rgba(29, 78, 216, 0.25);
  color: var(--accent);
  font-weight: 600;
}

.threeui-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
  position: relative;
  z-index: 2;
}
.threeui-grid__cell {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
}
.threeui-cell__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}
.threeui-cell__title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-2);
}
.threeui-cell__badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.threeui-canvas-wrap {
  position: relative;
  width: 100%;
  height: 175px;
  min-height: 150px;
  border-radius: 3px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  cursor: grab;
}
.threeui-canvas-wrap:active {
  cursor: grabbing;
}
.threeui-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.threeui-caption {
  font-size: 0.7rem;
  color: var(--ink-3);
  margin-top: var(--space-2);
  line-height: 1.35;
}
.threeui-hint {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--ink-3);
}

/* Featured Hardware Controller Card */
.product-row--featured {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--space-6);
  align-items: center;
}
.controller-visual-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: 0 8px 24px rgba(16, 18, 24, 0.05);
}
.controller-visual-card .threeui-canvas--controller {
  height: 180px;
  width: 100%;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.controller-visual-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--ink-3);
  margin-top: var(--space-2);
  padding-inline: var(--space-1);
}

/* ---- Media frame ---- */
.media-frame {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(16, 18, 24, 0.07);
  position: relative;
}

/* Media Frame HUD Reticles */
.hud-reticle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent);
  z-index: 4;
  pointer-events: none;
}
.hud-reticle--tl { top: 8px; left: 8px; border-top: 2px solid; border-left: 2px solid; }
.hud-reticle--tr { top: 8px; right: 8px; border-top: 2px solid; border-right: 2px solid; }
.hud-reticle--bl { bottom: 8px; left: 8px; border-bottom: 2px solid; border-left: 2px solid; }
.hud-reticle--br { bottom: 8px; right: 8px; border-bottom: 2px solid; border-right: 2px solid; }

.hud-statusbar {
  position: absolute;
  top: 10px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 4;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.64rem;
}
.hud-badge {
  background: rgba(16, 18, 24, 0.8);
  color: #ffffff;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}
.hud-coord-readout {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-2);
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  border: 1px solid var(--line);
  backdrop-filter: blur(4px);
}
.media-frame img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
  background: var(--bg-band);
}
.media-frame--hero img {
  max-height: min(68vh, 640px);
  object-fit: contain;
}
.media-frame--product img {
  max-height: min(52vh, 480px);
  width: 100%;
  object-fit: contain;
}

.product-clip {
  margin-top: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.product-clip summary {
  cursor: pointer;
  min-height: var(--touch);
  display: flex;
  align-items: center;
  padding: 0.85rem 1.1rem;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
}
.product-clip summary::-webkit-details-marker { display: none; }
.product-clip summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--ink-3);
}
.product-clip[open] summary::after { content: "–"; }
.product-clip .media-frame {
  border: none;
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid var(--line);
}
.media-frame figcaption {
  padding: var(--space-3) var(--space-4);
  font-size: 0.85rem;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* ---- Rule list (about facts) ---- */
.rule-list { border-top: 1px solid var(--line); }
.rule-list li {
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: var(--space-2);
}
.rule-list strong {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.05rem;
}

/* ---- Wedge list ---- */
.wedge-list { display: grid; gap: var(--space-3); }
.wedge-list li {
  padding-left: var(--space-4);
  border-left: 2px solid var(--accent);
}

/* ---- Mode toggles ---- */
.mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.mode-btn {
  min-height: var(--touch);
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
}
.mode-btn:hover { border-color: var(--ink-3); }
.mode-btn.active,
.mode-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---- Sim chrome (product demo) ---- */
.sim-chrome {
  display: grid;
  grid-template-columns: 128px 1fr;
  min-height: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(16, 18, 24, 0.06);
}
.sim-sidebar {
  background: var(--sidebar);
  color: var(--sidebar-muted);
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 0.72rem;
}
.sim-sidebar__brand {
  font-family: var(--font-display);
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  margin-bottom: var(--space-3);
  padding-inline: var(--space-2);
}
.sim-nav {
  padding: 0.4rem 0.5rem;
  border-radius: 3px;
  opacity: 0.75;
}
.sim-nav.is-active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  opacity: 1;
}
.sim-main {
  background: #f3f5f8;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.sim-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
}
.sim-topbar__title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-3);
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--green);
  background: var(--green-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}
.live-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.gauge {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
}
.gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
}
.gauge-name {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.gbadge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.12rem 0.35rem;
  border-radius: 2px;
}
.gbadge.ok { background: var(--green-soft); color: var(--green); }
.gbadge.warn { background: var(--amber-soft); color: var(--amber); }
.gbadge.err { background: var(--red-soft); color: var(--red); }
.gauge-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-2);
}
.gauge-val small {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--ink-3);
}
.gauge-track {
  height: 4px;
  background: var(--bg-band);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}
.gauge-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.55s var(--ease);
}
.gauge-fill.gf-warn { background: var(--amber); }
.gauge-fill.gf-err { background: var(--red); }
.gauge-ref {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--ink-3);
  line-height: 1.35;
}
.gauge-ref.warn-ref { color: var(--amber); }

.sim-log {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  display: grid;
  gap: 0.3rem;
}
.log-entry { color: var(--ink-2); }
.log-entry em { font-style: normal; color: var(--accent); }
.log-entry.ok em { color: var(--green); }
.log-entry.warn,
.log-entry.warn em { color: var(--amber); }
.log-entry.err,
.log-entry.err em { color: var(--red); }

/* ---- Product rows ---- */
.product-rows { border-top: 1px solid var(--line); }
.product-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--space-6);
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--line);
}
.product-row__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--space-2);
}
.product-row h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-3);
}
.product-row__facts {
  display: grid;
  gap: var(--space-2);
  font-size: 0.95rem;
}
.product-row__facts li::before {
  content: "— ";
  color: var(--ink-3);
}

/* ---- Layer list ---- */
.layer-list { border-top: 1px solid var(--line); margin-bottom: var(--space-7); }
.layer {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background 0.3s var(--ease), border-color 0.3s;
  position: relative;
}
.layer.is-piping {
  background: rgba(29, 78, 216, 0.04);
  border-bottom-color: var(--accent);
}
.layer.is-piping .layer__num {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(29, 78, 216, 0.4);
}
.layer__num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  padding-top: 0.15rem;
}
.layer h3 { font-size: 1.08rem; margin-bottom: var(--space-2); }
.layer__pipe {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-3);
}

/* ---- Product role table ---- */
.compare {
  display: grid;
  gap: var(--space-5);
}
.compare__lead {
  font-size: clamp(0.98rem, 0.92rem + 0.35vw, 1.08rem);
  color: var(--ink-2);
  max-width: 52ch;
  line-height: 1.55;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 0.95rem;
}
.product-table th,
.product-table td {
  padding: 0.95rem 1.1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.product-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg);
}
.product-table tbody th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  width: min(34%, 16rem);
  line-height: 1.35;
}
.product-table tbody td {
  color: var(--ink-2);
  line-height: 1.5;
}
.product-table tbody tr:last-child th,
.product-table tbody tr:last-child td {
  border-bottom: none;
}
.product-table__ours th,
.product-table__ours td {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}
.product-table__ours td {
  font-weight: 500;
}

@media (max-width: 640px) {
  .product-table,
  .product-table tbody,
  .product-table tr,
  .product-table th,
  .product-table td {
    display: block;
    width: 100%;
  }
  .product-table thead { display: none; }
  .product-table tbody tr {
    padding: var(--space-4);
    border-bottom: 1px solid var(--line);
  }
  .product-table tbody tr:last-child { border-bottom: none; }
  .product-table tbody th,
  .product-table tbody td {
    border: none;
    padding: 0;
  }
  .product-table tbody th { margin-bottom: var(--space-2); }
  .product-table__ours {
    background: var(--accent-soft);
  }
  .product-table__ours th,
  .product-table__ours td {
    background: transparent;
  }
}

/* ---- Tiers ---- */
.tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.tier {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.tier--accent {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.tier h3 { font-size: 1.15rem; margin-bottom: var(--space-1); }
.tier__price {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-bottom: var(--space-3);
}

/* ---- Team ---- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}
.person {
  padding-top: var(--space-5);
  border-top: 2px solid var(--ink);
}
.person__avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--bg-band);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-4);
}
.person h3 { font-size: 1.05rem; margin-bottom: var(--space-1); }
.person__role {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

/* ---- Ecosystem strip ---- */
.eco-strip {
  border-block: 1px solid var(--line);
  background: var(--surface);
  padding-block: var(--space-5);
}
.eco-strip__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.eco-item strong {
  display: block;
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 0.95rem;
}
.eco-item span {
  font-size: 0.85rem;
  color: var(--ink-3);
}

/* ---- Nav ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 248, 250, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
  padding-top: env(safe-area-inset-top, 0px);
}
.navbar.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(16, 18, 24, 0.04);
}
.nav-bar {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding-block: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.brand__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius);
}
.brand__text { display: grid; line-height: 1.15; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.brand__sub {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.nav-links {
  display: flex;
  margin-left: auto;
  gap: 0.15rem;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0.4rem 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-3);
  border-radius: var(--radius);
}
.nav-link:hover,
.nav-link.active { color: var(--ink); }
.nav-cta { margin-left: var(--space-2); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s, opacity 0.25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line);
  z-index: 120;
  padding: 5rem 1.5rem 2rem;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
  display: grid;
  gap: var(--space-3);
  align-content: start;
  visibility: hidden;
  pointer-events: none;
}
.drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}
.drawer a {
  display: flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0.75rem 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 24, 0.35);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Hero ---- */
.hero {
  padding-block: var(--space-7) var(--space-8);
  border-bottom: 1px solid var(--line);
}
.hero .split {
  align-items: center;
  min-height: min(72vh, 720px);
}
.hero__product {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hero .lede { margin-block: var(--space-4) var(--space-5); }
.hero .actions { margin-top: 0; }

/* ---- Footer ---- */
.footer {
  background: var(--ink);
  color: #a7adb8;
  padding-top: var(--space-7);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
}
.footer .brand__name { color: #fff; }
.footer .brand__sub { color: #8b929e; }
.footer__blurb { margin-top: var(--space-4); font-size: 0.9rem; }
.heritage {
  margin-top: var(--space-3);
  font-size: 0.8rem;
  color: #8fa0c4;
}
.footer-nav,
.footer-contact {
  display: grid;
  gap: var(--space-2);
}
.footer-nav a:hover,
.footer-contact a:hover { color: #fff; }
.footer__bottom {
  border-top: 1px solid #2a303c;
  padding-block: var(--space-4);
  font-size: 0.8rem;
}
.footer__bottom .shell {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 24, 0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.98);
  width: min(440px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  z-index: 210;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
  max-height: 90vh;
  overflow-y: auto;
}
.modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.modal__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  color: var(--ink-3);
  min-width: var(--touch);
  min-height: var(--touch);
  display: grid;
  place-items: center;
  padding: var(--space-1);
}
.modal__close:hover { color: var(--ink); }
.modal__head { margin-bottom: var(--space-5); padding-right: var(--space-6); }
.modal__head h3 { font-size: 1.3rem; margin-block: var(--space-2); }
.modal__head p { color: var(--ink-3); font-size: 0.95rem; }
.modal-form { display: grid; gap: var(--space-4); }
.modal-form__hint {
  font-size: 0.82rem;
  color: var(--ink-3);
  line-height: 1.45;
}
.modal-form__hint a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.modal-success { display: none; text-align: center; padding: var(--space-5) 0; }
.modal-success.show { display: block; }
.modal-success h4 { margin-bottom: var(--space-2); color: var(--ink); }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-2);
}
.field input,
.field textarea {
  width: 100%;
  min-height: var(--touch);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  background: var(--bg);
}
.field textarea { min-height: 6rem; }
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* ---- Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .reveal-delay-1,
  .reveal-delay-2,
  .reveal-delay-3 { transition-delay: 0s; }
  .live-badge__dot { animation: none; }
  .gauge-fill { transition: none; }
}

/* ---- Large desktop ---- */
@media (min-width: 1280px) {
  :root { --shell: 1200px; }
  .hero .split {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    gap: 4rem;
  }
  .media-frame--hero img { max-height: 680px; }
}

/* ---- Tablet ---- */
@media (max-width: 960px) {
  .split,
  .split--canvision,
  .product-row,
  .product-row--featured,
  .team-grid,
  .tier-grid,
  .footer__grid,
  .eco-strip__inner,
  .hero .split {
    grid-template-columns: 1fr;
  }

  .hero .split {
    min-height: 0;
    gap: var(--space-6);
  }

  .display { max-width: 28ch; }
  .display--hero { max-width: min(28ch, 100%); }
  .lede { max-width: 46ch; }

  .threeui-grid {
    grid-template-columns: 1fr;
  }
  .threeui-canvas-wrap {
    height: 190px;
  }

  .sim-chrome { grid-template-columns: 1fr; }
  .sim-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
  }
  .sim-sidebar__brand {
    width: 100%;
    margin-bottom: 0;
  }

  .media-frame--hero img {
    max-height: min(48vh, 420px);
  }

  .product-row,
  .product-row--featured { gap: var(--space-4); }
  .eco-strip__inner { gap: var(--space-4); }
  .footer__grid { gap: var(--space-5); }
}

/* ---- Mobile nav + compact ---- */
@media (max-width: 760px) {
  .nav-links,
  .nav-cta { display: none; }
  .hamburger {
    display: flex;
    min-width: var(--touch);
    min-height: var(--touch);
    align-items: center;
    justify-content: center;
  }

  .nav-bar { padding-block: 0.55rem; }
  .brand__logo { width: 36px; height: 36px; }

  .gauges { grid-template-columns: 1fr; }

  .threeui-panel {
    padding: var(--space-3);
  }
  .threeui-panel__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .threeui-canvas-wrap {
    height: 175px;
  }

  .section { padding-block: var(--space-7); }
  .hero { padding-block: var(--space-5) var(--space-6); }

  .actions {
    width: 100%;
  }
  .actions .btn {
    flex: 1 1 auto;
    min-width: min(100%, 10rem);
  }

  .mode-bar { width: 100%; }
  .mode-btn {
    flex: 1 1 auto;
    min-height: var(--touch);
    text-align: center;
  }

  .team-grid { gap: var(--space-6); }
  .person { padding-top: var(--space-4); }

  .drawer {
    padding-top: calc(4.5rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .footer {
    padding-top: var(--space-6);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .footer__bottom .shell {
    flex-direction: column;
  }
}

/* ---- Narrow phones ---- */
@media (max-width: 420px) {
  .actions .btn {
    flex: 1 1 100%;
  }
  .sim-topbar {
    flex-wrap: wrap;
  }
  .threeui-panel {
    padding: 0.65rem;
  }
  .threeui-canvas-wrap {
    height: 160px;
  }
  .controller-visual-card .threeui-canvas--controller {
    height: 160px;
  }
  .tier-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Image Lightbox Modal ---- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 24, 0.88);
  backdrop-filter: blur(12px);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.lightbox-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(94vw, 1320px);
  max-height: 94vh;
  z-index: 310;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-content {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  width: 100%;
}
.lightbox-content img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}
.lightbox-caption {
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  margin: 0;
}
