/* =============================================================================
   Desky — page stylesheet (index.html)
   Built to design/direction.md: Archivo / IBM Plex Sans / JetBrains Mono, the
   cold cobalt instrument palette, the 2x2 canvas as the page's layout grammar.
   The simulator's own internals live in styles/demo.css and are left alone —
   this file only frames them and styles the page around them.
   ============================================================================= */

/* ---------------------------------------------------------------- 1. TOKENS */
:root {
  /* ground + surfaces */
  --bg:       #0B0E14;
  --bg-deep:  #05070B;   /* exactly two bands use this: the footage + the footer */
  --surface-1: #131823;
  --surface-2: #1A2130;
  --border:   #2A3342;
  --border-soft: #1C2331;
  --border-strong: #4C5A73;   /* control edges that need to read as controls */

  /* ink */
  --text:   #E8EEF7;
  --text-2: #A7B2C2;
  --text-3: #7D8794;

  /* the product's own HUD cobalt */
  --accent:       #58A6FF;
  --accent-hover: #7DB8FF;
  --accent-wash:  rgba(88, 166, 255, 0.10);
  --accent-edge:  rgba(88, 166, 255, 0.28);

  /* the solid CTA fill — white label, 4.63:1 resting, darker on hover so the
     label never drops under 4.5:1 */
  --cta:       #1F6FEB;
  --cta-hover: #1A5FD0;

  /* status — reserved, never used as a series colour */
  --ok:  #3FB950;
  --err: #F85149;

  /* type */
  --font-display: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* 7-step scale. --step--1 (13–14px) is the floor for mono meta; nothing a
     human reads as a sentence is set below --step-0. */
  --step--1: clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);
  --step-0:  clamp(1rem, 0.965rem + 0.18vw, 1.0625rem);
  --step-1:  clamp(1.0625rem, 1.02rem + 0.22vw, 1.1875rem);
  --step-2:  clamp(1.25rem, 1.17rem + 0.4vw, 1.5rem);
  --step-3:  clamp(1.5rem, 1.34rem + 0.8vw, 2rem);
  --step-4:  clamp(1.875rem, 1.6rem + 1.4vw, 2.75rem);
  --step-5:  clamp(2.875rem, 2.2rem + 3.9vw, 4.5rem);

  /* 8px spacing scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px; --s-11: 160px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --maxw: 1200px;
  --maxw-wide: 1360px;   /* the instrument: the only element wider than 1200px */

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------------ 2. BASE */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p  { margin: 0; }

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

img, svg, video { max-width: 100%; }
svg { flex: 0 0 auto; }

::selection { background: rgba(88, 166, 255, 0.28); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-5); }

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

.mono { font-family: var(--font-mono); }
.dim  { color: var(--text-3); }
.muted { color: var(--text-2); }

kbd {
  font-family: var(--font-mono); font-size: max(13px, 0.86em); line-height: 1.4;
  background: var(--surface-2); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--text);
  white-space: nowrap;
}
code { font-family: var(--font-mono); font-size: 0.92em; color: var(--text-2); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------ 3. BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid transparent; font-family: var(--font-body); font-size: var(--step-0);
  font-weight: 500; line-height: 1; text-align: center; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
              border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: var(--step-1); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: var(--step--1); }
.btn-block { width: 100%; margin-top: auto; }

.btn-primary { background: var(--cta); border-color: var(--cta); color: #FFFFFF; }
.btn-primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); color: #FFFFFF; transform: translateY(-2px); }

.btn-secondary { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-hover); transform: translateY(-2px); }

.btn:active { transform: translateY(0); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.btn-row .btn { text-decoration: none; }

[data-magnetic] { transition: transform 0.12s linear, background-color 0.2s var(--ease), border-color 0.2s var(--ease); will-change: transform; }

.link-btn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--accent);
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: var(--accent-hover); }

/* --------------------------------------------------------------- 4. STRIP */
.strip { border-bottom: 1px solid var(--border-soft); font-size: var(--step--1); color: var(--text-2); }
.strip-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 4px var(--s-5);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3);
  min-height: 30px;
}
.strip b { font-weight: 500; color: var(--text); }
.strip-sep { color: var(--border-strong); }

/* ----------------------------------------------------------------- 5. NAV */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(11, 14, 20, 0.88);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav.scrolled { border-bottom-color: var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-5); display: flex; align-items: center; gap: var(--s-5); min-height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand svg, .brand-mark { color: var(--accent); width: 22px; height: 22px; }
.brand-name { font-size: var(--step-1); }

.nav-links, #navLinks { display: flex; align-items: center; gap: var(--s-5); }
.nav-links a, #navLinks a {
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-2);
  letter-spacing: 0.01em; text-decoration: none; transition: color 0.2s var(--ease);
}
.nav-links a:hover, #navLinks a:hover { color: var(--text); }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
.nav-actions .btn { min-height: 40px; padding: 8px 16px; font-size: var(--step--1); }

.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border-strong); border-radius: var(--radius);
  color: var(--text); cursor: pointer;
}

/* ---------------------------------------------------------------- 6. HERO */
.hero { padding: var(--s-6) 0 var(--s-9); }
.hero > .wrap { max-width: var(--maxw-wide); }
.hero-copy { max-width: 1120px; }

.hero h1 {
  font-size: var(--step-5);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
}
/* the one kinetic moment on the page: the headline masks in, word by word, and
   then it stops. Without the animation the words are simply visible. */
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0 0 0.08em; margin-bottom: -0.08em; }
.hero h1 .w > span { display: inline-block; animation: heroRise 0.42s var(--ease) both; }
.hero h1 .w > span.accent { color: var(--accent); }
.hero h1 .w:nth-child(1) > span { animation-delay: 0s; }
.hero h1 .w:nth-child(2) > span { animation-delay: 0.05s; }
.hero h1 .w:nth-child(3) > span { animation-delay: 0.10s; }
.hero h1 .w:nth-child(4) > span { animation-delay: 0.14s; }
.hero h1 .w:nth-child(5) > span { animation-delay: 0.18s; }
.hero h1 .w:nth-child(6) > span { animation-delay: 0.22s; }
@keyframes heroRise { from { transform: translateY(112%); } to { transform: translateY(0); } }

.hero-mono {
  margin-top: var(--s-4);
  font-family: var(--font-mono); font-size: var(--step-0); line-height: 1.5;
  color: var(--text-2);
}
.hero-cta-row { margin-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero-cta-row .btn { text-decoration: none; }

/* ---------------------------------------------------- 7. THE INSTRUMENT */
.demo-stage { position: relative; margin-top: var(--s-6); max-width: var(--maxw-wide); }
.demo-top {
  border: 1px solid var(--border); border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface-1); overflow: hidden;
}

/* the rail: live dot, the pan gesture, the engine's own ctrl pill, one zoom control */
.demo-rail {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3);
  padding: 10px 14px; border-bottom: 1px solid var(--border-soft);
}
.live-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.16); }
.demo-hint { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); }
.demo-hint kbd { font-size: 11px; padding: 0 5px; text-transform: none; }
.demo-caption kbd, .demo-chin kbd { font-size: 11px; }
.rail-hint { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.rail-hint kbd { font-size: 11px; padding: 0 5px; }
.ctrl-status-pill {
  margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.ctrl-status-pill.active { color: var(--accent); border-color: var(--accent); }

/* #btnZoomToggle keeps its id and keeps the engine's own label text, but the page
   renders the wording itself so the engine's glyph never reaches the screen. */
.rail-btn {
  font-family: var(--font-mono); font-size: 0; line-height: 1.4;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-2); padding: 6px 10px; min-height: 32px; cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.rail-btn::after { content: "50% Overview"; font-size: 11px; }
.rail-btn.active::after { content: "100% Normal View"; }
.rail-btn:hover { color: var(--accent-hover); border-color: var(--accent); }

/* the 2x2 pad: the quadrant stated in shape, with the real coordinate offsets.
   Every cell carries .mm-desk-btn + data-goto, so the engine's own
   updateViewportUI() lights it as the camera moves — no new JS. */
.sector-legend { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; background: var(--border-soft); }
#sectorLegend .mm-desk-btn.legend-item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: auto; height: auto; padding: 12px 14px; text-align: left;
  background: var(--bg); border: 0; border-radius: 0; color: inherit;
  font: inherit; cursor: pointer; transition: background-color 0.2s var(--ease);
}
#sectorLegend .mm-desk-btn.legend-item:hover { background: var(--surface-2); color: inherit; }
#sectorLegend .mm-desk-btn.legend-item.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); color: inherit; }
.legend-k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--accent); }
.legend-name { font-family: var(--font-display); font-weight: 600; font-size: var(--step-0); color: var(--text); }
.legend-coord { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* the live simulator, framed. These three numbers are load-bearing: DESK_H is
   520 inside the engine, so a 560px monitor is exactly one sector plus a 40px
   margin. Do not retune them. */
.demo-scroll { margin: 0; background: var(--bg-deep); }
.demo-inner { display: block; }
.demo-frame {
  position: relative; margin: 0; padding: 10px;
  border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--bg-deep);
}
.demo-frame .simulated-monitor { height: 560px; }
.demo-frame .sim-minimap { width: 330px; }
.demo-frame .sim-mm-radar { height: 150px; }

/* item 6: the HUD and the page must not disagree about the product's colour.
   The engine hard-coded amber here; the ring is cobalt, like the page. */
.simulated-monitor.ctrl-held {
  cursor: grab;
  box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 24px rgba(0, 0, 0, 0.75);
}
/* the pin buttons now hold an icon rather than a glyph */
.simulated-monitor .pin-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 18px; padding: 0;
}
.simulated-monitor .pin-btn svg { display: block; }
.simulated-monitor .act-icon svg,
.simulated-monitor .app-badge svg,
.simulated-monitor .dc-srv svg,
.simulated-monitor .dc-ch svg,
.simulated-monitor .dc-reactions svg,
.simulated-monitor .obs-item svg,
.simulated-monitor .sp-q-row svg,
.simulated-monitor .mm-win svg,
.simulated-monitor .mm-icon-btn svg,
.simulated-monitor .tb-win-start svg { vertical-align: middle; }

.demo-chin {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3);
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.demo-chin .osd-btn {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-2); padding: 6px 10px; min-height: 32px; cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.demo-chin .osd-btn:hover { color: var(--text); border-color: var(--accent); }
.demo-chin .osd-btn.active { color: var(--accent); border-color: var(--accent); }
.demo-chin-spec { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.demo-chin > span:first-child { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--text-3); }
#osdZoomLevel, .demo-chin-zoom { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }

/* the six themes: name, the real hex the engine applies, one line, one selector */
.theme-rack {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px;
  margin: 0; background: var(--border); border: 1px solid var(--border); border-top: 0;
  border-radius: 0;
}
.theme-col {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  background: var(--surface-1); border: 0; padding: 14px;
  text-align: left; color: inherit; font: inherit; cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.theme-col:hover { background: var(--surface-2); }
.theme-col[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 0 2px 0 var(--accent); }
.tc-name { font-family: var(--font-display); font-weight: 600; font-size: var(--step--1); color: var(--text); }
.tc-chips { display: flex; flex-direction: column; gap: 5px; }
.hexchip { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.hexchip i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.16); }
.tc-copy { font-size: var(--step--1); color: var(--text-3); line-height: 1.45; }

.demo-caption {
  margin: var(--s-4) 0 0; font-size: var(--step--1); color: var(--text-2); line-height: 1.6; max-width: 96ch;
}
.demo-caption strong { color: var(--text); font-weight: 500; }
.caption-more { margin-top: var(--s-2); }
.caption-more summary {
  cursor: pointer; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
}
.caption-more p { margin-top: var(--s-2); color: var(--text-3); max-width: 96ch; }

/* ------------------------------------------------------- 8. THE BOTTLENECK */
.section { padding: var(--s-9) 0; }
/* the two act-breaks: a single 160px gap before the canvas and before the close */
.section--act { padding-top: var(--s-11); }

.section-head { max-width: 76ch; margin-bottom: var(--s-7); }
.section-head h2 { font-size: var(--step-4); }
.section-head--bare, .section-head--tight { margin-bottom: var(--s-6); }
.section-sub { margin-top: var(--s-3); font-size: var(--step--1); color: var(--text-3); }

.eyebrow {
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: var(--s-3);
}
.lede { margin-top: var(--s-4); font-size: var(--step-1); line-height: 1.6; color: var(--text-2); max-width: 68ch; }
.lede em { font-style: normal; color: var(--text); font-weight: 500; }

.table-scroll { overflow-x: auto; border-radius: var(--radius-lg); }
.compare-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.compare-table th, .compare-table td {
  padding: 14px 18px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border-soft);
}
.compare-table thead th {
  font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2);
  background: var(--surface-2);
}
.compare-table tbody th {
  font-family: var(--font-body); font-size: var(--step--1); font-weight: 500;
  color: var(--text-3); width: 22%;
}
.compare-table tbody td { font-size: var(--step-0); color: var(--text-2); }
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: 0; }

.compare-table .col-desky { color: var(--text); background: var(--accent-wash); border-left: 1px solid var(--accent-edge); border-right: 1px solid var(--accent-edge); }
.compare-table thead th.col-desky { color: var(--accent); border-top: 2px solid var(--accent); }
.compare-table tbody tr:last-child td.col-desky { border-bottom: 2px solid var(--accent); }

/* ---------------------------------------------------------------- 9. FOOTAGE */
.footage { background: var(--bg-deep); padding: var(--s-9) 0; border-top: 1px solid var(--border-soft); }
.video-frame { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); overflow: hidden; }
.video-el { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; cursor: pointer; object-fit: cover; }
.video-bar { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border); }
.video-ctl {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font: inherit; font-size: var(--step--1); cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.video-ctl:hover { border-color: var(--accent); color: var(--accent-hover); }
.video-ctl .ctl-pause { display: none; }
.video-ctl.playing .ctl-play { display: none; }
.video-ctl.playing .ctl-pause { display: block; }
.video-note { font-size: var(--step--1); color: var(--text-3); }
.video-frame figcaption { padding: 0 18px 18px; font-size: var(--step--1); color: var(--text-3); }

/* --------------------------------------------------- 10. THE CANVAS ITSELF */
.quad-map { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-1); overflow: hidden; }
.quad-top { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); border-bottom: 1px solid var(--border); }
.quad-corner { padding: var(--s-5) var(--s-5) var(--s-4); border-right: 1px solid var(--border); }
.quad-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s-2); }
.quad-corner h2 { font-size: var(--step-2); }
.quad-note { margin-top: var(--s-2); font-size: var(--step--1); color: var(--text-2); max-width: 42ch; }

.quad-gutter--x { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.quad-gutter--x span {
  padding: var(--s-4) var(--s-5); font-family: var(--font-mono); font-size: 11px;
  color: var(--text-3); border-left: 1px solid var(--border-soft);
}
.quad-body { display: grid; grid-template-columns: 72px minmax(0, 1fr); }
.quad-gutter--y { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); border-right: 1px solid var(--border); }
.quad-gutter--y span {
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: var(--s-5); font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  border-bottom: 1px solid var(--border-soft);
}
.quad-gutter--y span:last-child { border-bottom: 0; }

.quad-pad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; background: var(--border-soft); }
.quad-map .mm-desk-btn.quad-cell {
  display: flex; flex-direction: column; gap: var(--s-4);
  width: auto; height: auto; padding: var(--s-5);
  background: var(--bg); border: 0; border-radius: 0; color: inherit;
  font: inherit; cursor: pointer; transition: background-color 0.2s var(--ease);
}
.quad-map .mm-desk-btn.quad-cell:hover { background: var(--surface-2); color: inherit; }
.quad-map .mm-desk-btn.quad-cell.active { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--accent-edge); color: inherit; }
.quad-head { display: flex; align-items: baseline; gap: 10px; }
.quad-k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--accent); }
.quad-name { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); letter-spacing: -0.01em; }
.quad-coord { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.quad-what { font-size: var(--step-0); line-height: 1.55; color: var(--text-2); }
.quad-jump { margin-top: auto; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.quad-cell:hover .quad-jump { color: var(--accent-hover); }

.win-list { display: flex; flex-direction: column; gap: var(--s-2); margin-top: auto; }
.win-chip {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  background: var(--surface-1); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.win-chip > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.win-chip .t { font-size: var(--step-0); color: var(--text); line-height: 1.45; }
.win-chip .s { font-size: var(--step--1); color: var(--text-3); line-height: 1.45; }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex: 0 0 auto; border-radius: 5px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: #05070B;
}
.bg-vs   { background: #4E9BE8; }
.bg-term { background: #7DD3A0; }
.bg-tv   { background: #58A6FF; }
.bg-l2   { background: #E0B050; }
.bg-dc   { background: #8A94F0; }
.bg-sp   { background: #7DD3A0; }
.bg-obs  { background: #C9A0F0; }
.bg-tm   { background: #F0A0A0; }

/* ------------------------------------------------------- 11. CAPABILITIES */
.feature-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-4); align-items: start; }
.feature {
  display: flex; flex-direction: column; gap: var(--s-2);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--s-6);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.feature:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-2); }
.f-a { grid-column: span 7; } .f-b { grid-column: span 5; }
.f-c { grid-column: span 5; } .f-d { grid-column: span 7; }
.f-e { grid-column: span 7; } .f-f { grid-column: span 5; }
.feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-bottom: var(--s-3); border-radius: var(--radius);
  background: var(--accent-wash); border: 1px solid var(--accent-edge); color: var(--accent);
}
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: var(--step-2); }
.feature p { font-size: var(--step-0); color: var(--text-2); max-width: 62ch; }
.feature kbd { font-size: 11px; }

.radar-diagram { width: 100%; max-width: 320px; margin-top: var(--s-5); color: var(--text-3); }
.iso-diagram { width: 100%; max-width: 320px; margin-top: var(--s-5); color: var(--text-3); }
.iso-diagram .screen { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; }
.iso-diagram .screen.on { fill: var(--accent-wash); stroke: var(--accent); }
.iso-diagram .stand { stroke: var(--border-strong); stroke-width: 1; }
.iso-diagram text { fill: var(--text-3); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; }
.radar-diagram .quad { fill: rgba(88, 166, 255, 0.16); stroke: var(--accent-edge); stroke-width: 1; }
.radar-diagram .quad.on { fill: rgba(88, 166, 255, 0.34); stroke: var(--accent); }
.radar-diagram .swipe { stroke: var(--accent-edge); stroke-width: 1; }
.radar-diagram text { fill: var(--text-3); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; }

/* ------------------------------------------------------------ 12. PRICING */
.tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); align-items: stretch; }
.tier {
  display: flex; flex-direction: column; gap: var(--s-3);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--s-6);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.tier:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.tier.featured { border-color: var(--accent); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.tier-tag { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.tier h3 { font-size: var(--step-2); }
.tier-price { display: flex; align-items: baseline; gap: var(--s-3); font-family: var(--font-display); font-weight: 700; font-size: var(--step-4); line-height: 1; letter-spacing: -0.02em; }
.tier-price span { font-family: var(--font-body); font-size: var(--step--1); font-weight: 400; letter-spacing: 0; color: var(--text-3); }
.tier > p { font-size: var(--step-0); color: var(--text-2); }
.tier ul { list-style: none; margin: var(--s-2) 0 var(--s-5); padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tier li { position: relative; padding-left: 26px; font-size: var(--step-0); line-height: 1.5; color: var(--text-2); }
.tier li::before {
  content: ""; position: absolute; left: 6px; top: 0.44em; width: 9px; height: 5px;
  border-left: 1.75px solid var(--accent); border-bottom: 1.75px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------------------------------------------------------------- 13. CTA */
.cta-band { background: var(--bg); }
.cta-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s-8); align-items: start; }
.band-kicker { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s-3); }
.cta-copy h2 { font-size: var(--step-4); max-width: 24ch; }
.cta-copy .lede { max-width: 52ch; }
.cta-copy .btn-row { margin-top: var(--s-5); }
.cta-copy .btn { text-decoration: none; }

.hero-meta { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px var(--s-4); }
.hero-meta li { display: flex; align-items: center; gap: 8px; font-size: var(--step--1); color: var(--text-2); }
.hero-meta svg { color: var(--accent); }

.spec-table { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-1); overflow: hidden; }
.spec-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--s-3); padding: 9px 14px; border-bottom: 1px solid var(--border-soft); align-items: baseline; }
.spec-row:last-child { border-bottom: 0; }
.spec-k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.spec-v { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text); word-break: break-word; }
.spec-v.sha { font-size: 11px; color: var(--text-2); word-break: break-all; }
.feed-line { margin-top: var(--s-4); font-size: var(--step--1); line-height: 1.6; color: var(--text-2); max-width: 72ch; }
.feed-line a { text-decoration: underline; text-underline-offset: 2px; }

.changelog { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--border); }
.notes-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--s-4); }
.notes { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--s-8); }
.notes li { position: relative; padding-left: 16px; margin-bottom: 6px; font-size: var(--step--1); line-height: 1.55; color: var(--text-3); break-inside: avoid; }
.notes li::before { content: "\2014"; position: absolute; left: 0; color: var(--border-strong); }

/* ------------------------------------------------------------------ 14. FAQ */
.faq-list { border-top: 1px solid var(--border); }
.faq-list details { border-bottom: 1px solid var(--border); }
.faq-list summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
  padding: var(--s-5) 0; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-1);
  letter-spacing: -0.01em; color: var(--text); transition: color 0.2s var(--ease);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--accent-hover); }
.plus { font-family: var(--font-mono); font-size: var(--step-1); color: var(--accent); transition: transform 0.2s var(--ease); }
details[open] .plus { transform: rotate(45deg); }
.answer { padding-bottom: var(--s-5); max-width: 76ch; font-size: var(--step-0); line-height: 1.65; color: var(--text-2); }
.qa-turn { display: block; margin-top: 10px; }
.answer em { font-style: normal; color: var(--text); }

/* --------------------------------------------------------------- 15. FOOTER */
.footer { background: var(--bg-deep); border-top: 1px solid var(--border); padding: var(--s-9) 0 var(--s-6); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-7); }
.footer h4 { font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--s-3); }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { font-size: var(--step--1); color: var(--text-2); }
.footer a:hover { color: var(--accent-hover); }
.footer .muted, .footer .dim, .footer code { font-size: var(--step--1); color: var(--text-3); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3);
  margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--border-soft);
  font-size: var(--step--1); color: var(--text-3);
}

/* --------------------------------------------------------------- 16. MODALS */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; padding: var(--s-5);
  align-items: center; justify-content: center; overflow-y: auto;
  background: rgba(5, 7, 11, 0.8);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  width: min(560px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--s-6);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-3); }
.modal-head h3 { font-size: var(--step-2); }
.modal-close {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; background: transparent; border: 1px solid var(--border-strong);
  border-radius: var(--radius); color: var(--text-2); cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.modal-close:hover { color: var(--text); border-color: var(--accent); }
.modal-sub { font-size: var(--step-0); color: var(--text-2); }
.modal-note {
  margin-top: var(--s-3); padding: 12px 14px; border: 1px solid var(--border-soft);
  border-radius: var(--radius); background: var(--surface-2);
  font-size: var(--step--1); line-height: 1.6; color: var(--text-2);
}
.field { margin-top: var(--s-4); }
.field label { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-2); }
.field input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-body); font-size: var(--step-0);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input::placeholder { color: var(--text-3); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.18); }
.promo-row { display: flex; gap: var(--s-2); }
.promo-row input { flex: 1 1 auto; }
.summary {
  display: flex; flex-direction: column; gap: 8px; margin-top: var(--s-5); padding: var(--s-4);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  font-size: var(--step--1); color: var(--text-2);
}
.summary .line, .summary .total { display: flex; justify-content: space-between; gap: var(--s-4); }
.summary .total { padding-top: 8px; border-top: 1px solid var(--border); color: var(--text); font-weight: 500; }
.modal-error {
  margin-top: var(--s-4); padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid rgba(248, 81, 73, 0.45); background: rgba(248, 81, 73, 0.1);
  color: #FFC3BE; font-size: var(--step--1);
}
.modal-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }
.issued .badge-line { font-family: var(--font-mono); font-size: var(--step--1); color: var(--ok); margin-bottom: var(--s-3); }
.key-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.key-row code {
  padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--step-0); color: var(--text); word-break: break-all;
}
.result-box { margin-top: var(--s-4); font-size: var(--step--1); line-height: 1.6; color: var(--text-2); }

/* ------------------------------------------------------------ 17. RESPONSIVE */
@media (max-width: 1100px) {
  .feature-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .f-a, .f-d, .f-e { grid-column: span 6; }
  .f-b, .f-c, .f-f { grid-column: span 6; }
  .theme-rack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .theme-rack { border-top: 1px solid var(--border); }
  .quad-top { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .demo-rail { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
  .ctrl-status-pill { margin-left: 0; }
  :root { --s-9: 64px; --s-10: 80px; --s-11: 64px; }
  .nav-toggle { display: inline-flex; }
  .brand { order: 1; }
  .nav-actions { order: 2; margin-left: auto; gap: var(--s-2); }
  .nav-actions .btn-ghost { display: none; }
  .nav-actions .btn { min-height: 40px; padding: 8px 14px; font-size: var(--step--1); }
  .nav-links, #navLinks { display: none; order: 3; }
  .nav.open .nav-inner { flex-wrap: wrap; }
  .nav.open .nav-links, .nav.open #navLinks {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0;
    width: 100%; margin-top: var(--s-3); padding: var(--s-2) 0 var(--s-4);
    border-top: 1px solid var(--border);
  }
  .nav.open .nav-links a, .nav.open #navLinks a { width: 100%; padding: 12px 0; font-size: var(--step-0); }

  .hero h1 { letter-spacing: -0.025em; }
  .cta-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { gap: var(--s-6); }
  .tier-grid { grid-template-columns: minmax(0, 1fr); }
  .quad-top { grid-template-columns: minmax(0, 1fr); }
  .quad-corner { border-right: 0; border-bottom: 1px solid var(--border); }
  .quad-gutter--x span:first-child { border-left: 0; }
  .hero-meta { grid-template-columns: minmax(0, 1fr); }
  .notes { columns: 1; }
}

@media (max-width: 700px) {
  .strip-sep { display: none; }
  .strip-inner { gap: 2px var(--s-3); padding: 6px var(--s-5); }
  .sector-legend .legend-item { grid-template-columns: 30px minmax(0, 1fr); row-gap: 2px; padding: 10px 12px; }
  .sector-legend .legend-coord { grid-column: 2; }
  .quad-head { flex-wrap: wrap; }
  .quad-coord { margin-left: 0; }
  .win-chip .t, .win-chip .s { overflow-wrap: anywhere; }
  .demo-chin-spec { display: none; }
  .theme-rack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .demo-inner { min-width: 660px; }
  .demo-frame .simulated-monitor { height: 440px; }
  .demo-frame .sim-minimap { width: 258px; padding: 6px; }
  .demo-frame .sim-mm-radar { height: 124px; }
  .osd-btn, .rail-btn { min-height: 44px; }
  .compare-table { min-width: 620px; }
  .quad-body { grid-template-columns: 46px minmax(0, 1fr); }
  .quad-gutter--y span { writing-mode: vertical-rl; padding: 14px 0; justify-content: center; }
  .quad-cell { padding: var(--s-4); }
  .quad-gutter--x span { padding: 12px 0; }
  .spec-row { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 460px) {
  .quad-cell .win-list { display: none; }
  .hero h1 br { display: none; }
}

/* -------------------------------------------------------- 18. REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .hero h1 .w > span { animation: none !important; transform: none !important; }
}
