/* MagMapper Interactive Tutorial — styles */

:root {
  /* Greens — MagMapper signal */
  --mm-green-50:  oklch(0.96 0.03 150);
  --mm-green-100: oklch(0.90 0.08 150);
  --mm-green-300: oklch(0.80 0.16 150);
  --mm-green-500: oklch(0.70 0.19 150);
  --mm-green-600: oklch(0.62 0.19 150);
  --mm-green-700: oklch(0.50 0.16 150);
  --mm-green-900: oklch(0.28 0.08 150);
  --mm-green-950: oklch(0.18 0.05 150);

  /* Warm amber for safety */
  --mm-amber-300: oklch(0.82 0.15 75);
  --mm-amber-500: oklch(0.72 0.17 70);
  --mm-amber-950: oklch(0.24 0.05 70);

  /* Cool blue accent for CIRES */
  --mm-blue-400: oklch(0.72 0.13 240);

  /* Heatmap swatches */
  --heat-0: oklch(0.45 0.18 260);   /* cool blue */
  --heat-1: oklch(0.65 0.17 230);
  --heat-2: oklch(0.75 0.15 190);
  --heat-3: oklch(0.80 0.17 140);
  --heat-4: oklch(0.82 0.17 95);
  --heat-5: oklch(0.75 0.20 50);
  --heat-6: oklch(0.65 0.22 25);    /* hot red */

  /* Neutrals (cool-tinted) */
  --ink-0:   oklch(0.98 0.005 180);
  --ink-50:  oklch(0.92 0.008 180);
  --ink-200: oklch(0.78 0.012 180);
  --ink-400: oklch(0.58 0.015 180);
  --ink-500: oklch(0.48 0.015 180);
  --ink-600: oklch(0.38 0.015 180);
  --ink-700: oklch(0.28 0.012 180);
  --ink-800: oklch(0.20 0.010 180);
  --ink-900: oklch(0.14 0.008 180);
  --ink-950: oklch(0.09 0.006 180);

  /* Theme tokens (dark default) */
  --bg:        var(--ink-950);
  --bg-raised: var(--ink-900);
  --bg-card:   var(--ink-800);
  --bg-inset:  var(--ink-900);
  --border:    oklch(0.24 0.01 180);
  --border-strong: oklch(0.32 0.012 180);
  --fg:        var(--ink-0);
  --fg-muted:  var(--ink-200);
  --fg-dim:    var(--ink-400);
  --accent:    var(--mm-green-500);
  --accent-soft: color-mix(in oklch, var(--mm-green-500) 18%, transparent);
  --accent-ink: oklch(0.12 0.04 150);

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

  --shadow-card: 0 1px 0 oklch(1 0 0 / 0.04) inset, 0 10px 30px oklch(0 0 0 / 0.3);

  /* Fonts */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display: 'Inter', var(--font-sans);
}

[data-theme="light"] {
  --bg:        oklch(0.99 0.005 150);
  --bg-raised: oklch(0.97 0.008 150);
  --bg-card:   #fff;
  --bg-inset:  oklch(0.96 0.008 150);
  --border:    oklch(0.90 0.012 150);
  --border-strong: oklch(0.82 0.015 150);
  --fg:        var(--ink-950);
  --fg-muted:  var(--ink-600);
  --fg-dim:    var(--ink-500);
  --accent:    var(--mm-green-700);
  --accent-soft: color-mix(in oklch, var(--mm-green-500) 14%, transparent);
  --accent-ink: oklch(0.98 0.02 150);
}

/* Base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: 0;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

h1 { font-size: 56px; letter-spacing: 0; }
h2 { font-size: 38px; letter-spacing: 0; }
h3 { font-size: 20px; letter-spacing: 0; }
h4 { font-size: 15px; font-weight: 600; letter-spacing: 0; }

p { margin: 0; color: var(--fg-muted); }
.mono { font-family: var(--font-mono); font-feature-settings: "zero", "ss01"; }

/* App Layout */
.app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: var(--bg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0;
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.06) inset, 0 4px 14px color-mix(in oklch, var(--accent) 40%, transparent);
}
.brand-logo img { width: 28px; height: 28px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0; }
.brand-sub { font-size: 12px; color: var(--fg-dim); margin-top: 2px; }

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s ease;
  box-shadow: 0 0 8px var(--accent);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-dim);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border: 1px solid transparent;
  user-select: none;
}
.nav-item:hover { background: var(--bg-raised); color: var(--fg); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--fg);
  border-color: color-mix(in oklch, var(--accent) 30%, transparent);
}
.nav-num {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}
.nav-item.active .nav-num {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.nav-item.done .nav-num {
  background: color-mix(in oklch, var(--accent) 25%, var(--bg-card));
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 30%, transparent);
}

.side-foot {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--fg-dim);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side-foot a { color: var(--fg-muted); text-decoration: underline; text-decoration-color: var(--border-strong); }

/* Main content */
main { min-width: 0; }
.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 56px 140px;
}

section { scroll-margin-top: 24px; padding-top: 72px; }
section:first-child { padding-top: 0; }
.sec-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  margin-bottom: 16px;
}
.sec-kicker::before {
  content: "";
  width: 5px; height: 5px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.sec-title { margin-bottom: 12px; }
.sec-lede { font-size: 17px; color: var(--fg-muted); max-width: 72ch; margin-bottom: 36px; }

/* Hero */
.hero {
  position: relative;
  padding: 48px 0 8px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: 560px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: 22px;
}
.hero-kicker .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--accent);
  animation: pulse 2s infinite ease-out;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 60%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
.hero h1 {
  font-size: 72px;
  font-weight: 800;
  line-height: 0.96;
  margin-bottom: 22px;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}
.hero-sub {
  font-size: 18px;
  max-width: 52ch;
  margin-bottom: 36px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 36px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-val {
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0;
  font-family: var(--font-display);
}
.stat-lbl { font-size: 12px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.1em; }

.hero-visual {
  position: relative;
  justify-self: center;
}

/* Safety callout */
.safety {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  padding: 22px 26px;
  margin-top: 48px;
  border: 1px solid color-mix(in oklch, var(--mm-amber-500) 40%, transparent);
  background: color-mix(in oklch, var(--mm-amber-950) 50%, var(--bg));
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
[data-theme="light"] .safety {
  background: oklch(0.97 0.04 80);
  border-color: color-mix(in oklch, var(--mm-amber-500) 40%, transparent);
}
.safety::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--mm-amber-500);
}
.safety-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: color-mix(in oklch, var(--mm-amber-500) 20%, transparent);
  color: var(--mm-amber-300);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 700;
}
.safety h3 { color: var(--mm-amber-300); margin-bottom: 6px; }
[data-theme="light"] .safety h3 { color: oklch(0.48 0.15 60); }
.safety p { color: var(--fg-muted); font-size: 14.5px; }
.safety ul { margin: 10px 0 0; padding-left: 18px; color: var(--fg-muted); font-size: 14.5px; }
.safety li { margin-bottom: 4px; }

/* Step cards grid */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}
.step:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklch, var(--accent) 40%, var(--border));
}
.step-num {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.step-num b {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0;
}
.step-title { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.step-body { font-size: 13.5px; color: var(--fg-muted); line-height: 1.5; }
.step-visual {
  aspect-ratio: 9 / 16;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 4px;
  overflow: hidden;
  position: relative;
}

/* Real screenshot phone displays */
.screenshot-phone {
  --shot-height: 420px;
  margin: 0 auto;
  width: min(100%, calc(var(--shot-height) * 0.49));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.screenshot-button {
  width: 100%;
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  font: inherit;
}
.screenshot-phone img {
  display: block;
  width: 100%;
  height: var(--shot-height);
  object-fit: contain;
  object-position: center;
  background: #000;
  border: 8px solid #050606;
  border-radius: 28px;
  box-shadow: 0 20px 44px oklch(0 0 0 / 0.35);
}
.screenshot-phone figcaption {
  color: var(--fg-dim);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}
.step-visual .screenshot-phone {
  width: 100%;
  height: 100%;
}
.step-visual .screenshot-phone img {
  height: 100%;
  border-width: 0;
  border-radius: var(--radius);
  box-shadow: none;
}

.screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: oklch(0 0 0 / 0.88);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}
.screenshot-lightbox.active { display: flex; }
.screenshot-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 18px;
  background: #000;
  box-shadow: 0 24px 80px oklch(0 0 0 / 0.7);
}
.screenshot-lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 42px;
  height: 42px;
  border: 1px solid oklch(1 0 0 / 0.25);
  border-radius: 999px;
  background: oklch(0 0 0 / 0.4);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.screen-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.screen-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.screen-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.screen-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}
.feature-card,
.mini-panel,
.detail-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.feature-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.feature-card p,
.mini-panel p,
.detail-box p {
  font-size: 13.5px;
  line-height: 1.55;
}
.mini-panel {
  padding: 18px 20px;
}
.mini-panel h4 {
  margin-bottom: 8px;
  color: var(--accent);
}
.detail-box {
  padding: 0;
  overflow: hidden;
}
.detail-box summary {
  cursor: pointer;
  padding: 14px 18px;
  color: var(--fg);
  font-weight: 600;
}
.detail-box > div {
  padding: 0 18px 18px;
}
.check-list {
  margin: 0;
  padding-left: 18px;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.65;
}
.check-list li { margin-bottom: 5px; }
.compact-info {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
}

.strategy-card {
  margin-top: 42px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.35fr);
  gap: 28px;
  align-items: start;
}
.strategy-copy h3 { margin-bottom: 10px; }
.strategy-copy h4 { margin: 18px 0 8px; color: var(--fg); }
.strategy-copy p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}
.strategy-list {
  margin: 12px 0 18px;
  padding-left: 18px;
  color: var(--fg-muted);
  font-size: 13.5px;
  line-height: 1.65;
}
.strategy-list li { margin-bottom: 5px; }
.strategy-visuals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.strategy-panel-title {
  margin-bottom: 8px;
  color: var(--fg-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.strategy-svg {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.strategy-cell {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: strategyCellIn 0.45s ease-out forwards;
}
.strategy-cell-empty {
  opacity: 0.18;
  stroke: var(--border);
  stroke-width: 0.35;
}
.strategy-grid-line {
  stroke: var(--border-strong);
  stroke-width: 0.45;
}
.strategy-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  animation: strategyPathDraw 3.4s ease-out forwards;
}
.strategy-surveyor {
  fill: var(--accent);
  stroke: var(--bg-card);
  stroke-width: 2;
}
.strategy-marker circle:first-child {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.4;
  opacity: 0.85;
}
.strategy-marker-dot,
.legend-dot.peak {
  fill: var(--fg);
  background: var(--fg);
}
.strategy-marker.delayed,
.strategy-refined {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: strategyFadeIn 0.55s 3.15s ease-out forwards;
}
.strategy-refined {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
}
.strategy-gps path {
  fill: none;
  stroke: var(--mm-blue-400);
  stroke-width: 1.5;
}
.strategy-scale,
.strategy-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--fg-dim);
  font-size: 12px;
}
.strategy-scale span:nth-child(2) {
  width: 80px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--heat-0), var(--heat-2), var(--heat-4), var(--heat-6));
}
.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 999px;
  vertical-align: -1px;
}
.legend-dot.path { background: var(--accent); }
.legend-diamond {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border: 1.5px solid var(--mm-blue-400);
  transform: rotate(45deg);
  vertical-align: -1px;
}
.replay-button {
  margin-top: 2px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.replay-button:hover {
  background: color-mix(in oklch, var(--accent) 85%, var(--fg));
}
@keyframes strategyCellIn {
  from { opacity: 0; transform: scale(0.45); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes strategyPathDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes strategyFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.callout-row {
  margin-top: 32px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

/* Feature split */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-top: 32px;
}
.split.reverse { grid-template-columns: 1fr 1fr; }
.split-copy h3 { margin-bottom: 14px; }
.split-copy p { font-size: 15px; margin-bottom: 14px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 36px;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.info-card h4 { margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.info-card h4::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
}
.info-card p { font-size: 13.5px; line-height: 1.55; }

/* Pill tabs */
.tabs {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  margin-bottom: 24px;
}
.tab {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--fg-muted);
  transition: all 0.15s;
  border: none;
  background: transparent;
  font-family: inherit;
}
.tab:hover { color: var(--fg); }
.tab.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* Pipeline (upload flow) */
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 24px;
}
.pipe-node {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
  position: relative;
  transition: all 0.3s;
}
.pipe-node.active {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 6%, var(--bg-card));
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 12%, transparent);
}
.pipe-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-dim);
  margin-bottom: 10px;
  letter-spacing: 0.1em;
}
.pipe-node.active .pipe-num { color: var(--accent); }
.pipe-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.pipe-body { font-size: 12.5px; color: var(--fg-dim); line-height: 1.5; }
.pipe-arrow {
  display: none;
}

/* Data table (inversion example) */
.data-table {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}
.data-table h4 {
  padding: 14px 18px;
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}
.data-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.data-row:last-child { border-bottom: none; }
.data-row .k { color: var(--fg-muted); }
.data-row .v { font-family: var(--font-mono); color: var(--fg); font-weight: 500; }
.data-row.highlight .v { color: var(--accent); }

/* Achievements list */
.achieve-list { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.achieve {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.medals { display: flex; gap: 6px; }
.medal {
  width: 22px; height: 22px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: oklch(0.1 0 0);
}
.medal.b { background: oklch(0.62 0.12 55); }
.medal.s { background: oklch(0.82 0.02 180); }
.medal.g { background: oklch(0.82 0.15 90); }
.medal.p { background: oklch(0.74 0.13 290); }
.medal.locked { background: var(--bg-inset); color: var(--fg-dim); border: 1px dashed var(--border-strong); }
.achieve-label .k { font-weight: 600; font-size: 15px; }
.achieve-label .v { font-size: 13px; color: var(--fg-dim); }
.achieve-pts {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  background: var(--bg-inset);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Pro tips */
.tips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.tip {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.tip h4 {
  color: var(--accent);
  margin-bottom: 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tip p { font-size: 13.5px; color: var(--fg-muted); }

/* FAQ */
.faq {
  margin-top: 24px;
  border-top: 1px solid var(--border);
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%;
  padding: 18px 4px;
  background: none;
  border: none;
  text-align: left;
  color: var(--fg);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.faq-q:hover { color: var(--accent); }
.faq-q span.ic {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: transform 0.2s;
  color: var(--fg-muted);
}
.faq-item.open .faq-q span.ic { transform: rotate(45deg); background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  color: var(--fg-muted);
  font-size: 14px;
}
.faq-a-inner { padding: 0 4px 18px; max-width: 70ch; }
.faq-a-inner a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklch, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
}

/* Footer */
.footer {
  margin-top: 120px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-left { font-size: 13px; color: var(--fg-dim); }
.footer-left strong { color: var(--fg-muted); font-weight: 600; }
.footer-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--fg-muted); }
.footer-right a { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.footer-right img { height: 28px; opacity: 0.9; }

/* Placeholder (for screens we don't have exports for) */
.ph {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  width: 100%;
  background:
    repeating-linear-gradient(
      135deg,
      oklch(0.25 0.01 180) 0 2px,
      transparent 2px 10px
    ),
    var(--bg-inset);
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px;
}
[data-theme="light"] .ph {
  background:
    repeating-linear-gradient(
      135deg,
      oklch(0.88 0.012 180) 0 2px,
      transparent 2px 10px
    ),
    var(--bg-inset);
}

/* Tweaks panel */
.tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  z-index: 100;
  display: none;
  font-size: 13px;
}
.tweaks.visible { display: block; }
.tweaks h4 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
}
.tweak-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.tweak-row:last-child { border-bottom: none; }
.tweak-row label { font-size: 13px; color: var(--fg-muted); }
.tweak-seg {
  display: inline-flex;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.tweak-seg button {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-family: inherit;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
}
.tweak-seg button.active { background: var(--accent); color: var(--accent-ink); }
.tweak-row input[type="range"] { width: 110px; accent-color: var(--accent); }

/* Dense layout tweak */
[data-density="compact"] .content { padding: 40px 40px 100px; }
[data-density="compact"] section { padding-top: 56px; }
[data-density="compact"] .sec-lede { margin-bottom: 24px; font-size: 15px; }
[data-density="compact"] .hero { min-height: 480px; padding: 24px 0; }
[data-density="compact"] .step { padding: 16px; gap: 12px; }

/* GPS Demo */
.gps-section {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.gps-section h3 { margin-bottom: 12px; }
.gps-section h4 { margin-top: 28px; margin-bottom: 8px; font-size: 16px; }
.gps-section > p { color: var(--fg-muted); font-size: 14px; margin-bottom: 12px; line-height: 1.65; }

.gps-demo {
  margin: 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}
.gps-demo-canvas {
  width: 320px;
  height: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-inset);
  flex-shrink: 0;
}
.gps-demo-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 200px;
}
.gps-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gps-control-row label {
  font-size: 12px;
  color: var(--fg-dim);
  min-width: 70px;
  flex-shrink: 0;
}
.tabs.mini { gap: 2px; }
.tabs.mini .tab {
  font-size: 11px;
  padding: 4px 10px;
  min-height: 0;
}
.gps-demo-run {
  margin-top: 8px;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.gps-demo-run:hover { background: color-mix(in oklch, var(--accent) 25%, transparent); }
.gps-demo-note {
  width: 100%;
  font-size: 11px;
  color: var(--fg-dim);
  font-style: italic;
  margin-top: -8px;
}

/* Responsive */
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .content { padding: 32px 24px 80px; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero h1 { font-size: 56px; }
  .steps, .info-grid, .tips, .pipeline, .screen-grid, .strategy-card, .callout-row { grid-template-columns: 1fr 1fr; }
  .screen-grid.cols-2, .screen-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .strategy-visuals { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  h1 { font-size: 40px; }
  h2 { font-size: 30px; }
  .hero h1 { font-size: 44px; }
  .steps, .info-grid, .tips, .pipeline, .screen-grid, .strategy-card, .callout-row, .compact-info { grid-template-columns: 1fr; }
  .screen-grid.cols-2, .screen-grid.cols-3 { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; gap: 16px; }
  .screenshot-phone { width: min(100%, calc(var(--shot-height) * 0.43)); }
  .gps-demo { flex-direction: column; align-items: center; }
  .gps-demo-canvas { width: min(100%, 320px); }
  .gps-demo-controls { flex-direction: row; flex-wrap: wrap; gap: 8px; justify-content: center; }
  .gps-control-row { flex: 1 1 45%; min-width: 160px; }
}
