:root {
  --bg: #0f0e0d;
  --surface: #171615;
  --surface-2: #1f1d1b;
  --line: #2d2a27;
  --text: #ece7e0;
  --muted: #a49c92;
  --faint: #6f6861;
  --accent: #f0a43a;
  --accent-ink: #1b1206;
  --rec: #e5484d;
  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
code, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; padding: 0 0.35em; border-radius: 4px; background: var(--surface); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 0.95rem; color: var(--muted); font-weight: 600; margin-top: 0.2em; }
p { margin: 0 0 1em; }
small { color: var(--muted); font-weight: 400; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15, 14, 13, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: 0.02em; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { display: block; height: 22px; width: auto; }
.topbar nav { display: flex; gap: 20px; overflow-x: auto; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; white-space: nowrap; }
.topbar nav a:hover { color: var(--text); }

/* hero */
.hero { padding-top: 72px; padding-bottom: 48px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center; }
@media (max-width: 1000px) { .hero { grid-template-columns: 1fr; gap: 32px; } }
.hero-solo { grid-template-columns: 1fr; }
.eyebrow { color: var(--accent); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.8em; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); max-width: 16ch; letter-spacing: -0.02em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.lede b { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 0.92rem; }
.facts li::before { content: "·"; margin-right: 8px; color: var(--accent); }
.facts b { color: var(--text); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); text-decoration: none; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { border-color: #4a4540; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #f5b65c; border-color: #f5b65c; }
.btn-small { padding: 6px 12px; font-size: 0.88rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--text); }

.section { padding-top: 88px; }
.section-head { max-width: 72ch; margin-bottom: 28px; }
.section-head p { color: var(--muted); }
.section-head code { white-space: nowrap; }
.table-scroll + p { margin-top: 20px; }
.section-head .keys { font-size: 0.85rem; color: var(--faint); }

/* simulator */
.sim { overflow-x: clip; padding: 64px 0 64px; background: linear-gradient(#141312, var(--bg)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sim-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) {
  .sim-grid { grid-template-columns: 1fr; }
  /* phones/tablets: camera, then what you're recording, then the walkthrough */
  .stage-col { display: contents; }
  .stage-col > .stage { order: 1; } .stage-col > .clip { order: 2; margin-top: -14px; }
  .rec-col { order: 3; } .stage-col > .panel-block { order: 4; margin-top: 0; }
}
.stage-col .panel-block { margin-top: 18px; }
.sim-controls { margin-top: 20px; }
.direct { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2px 20px; align-items: start; }
.direct .field { margin-bottom: 12px; }


.direct .field, .direct .field:last-child { margin-bottom: 10px; }

/* what you're recording (next to the camera) */
.rec-col { display: flex; flex-direction: column; gap: 14px; }
.rec-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.rec-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 14px; }
.rec-tabs button {
  border: 0; background: none; color: var(--muted); font: 600 0.9rem var(--sans); padding: 8px 12px 10px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.rec-tabs button:hover { color: var(--text); }
.rec-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.rec-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
/* both panels share one grid cell so switching tabs never changes the card height */
.tab-panels { display: grid; }
.tab-panel { grid-area: 1 / 1; visibility: hidden; }
.tab-panel.active { visibility: visible; }
#panel-how h3 { font-size: 1.1rem; margin-bottom: 0.4em; }
#panel-how .eyebrow { margin-bottom: 0.4em; }
.cap-body { color: var(--muted); font-size: 0.92rem; }
.how-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 520px) { .how-grid { grid-template-columns: 1fr; } }
.how-pixels { margin: 0; }
.how-pixels .fig-note { font-size: 0.78rem; margin-top: 6px; }
.how-notes h4 { margin-bottom: 0.2em; }
.how-notes p { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.8em; }
.rec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rec-head h3 { margin: 0; font-size: 1rem; }
.seg-mini { margin: 0; }
.seg-mini button { padding: 4px 10px; font-size: 0.78rem; }
#cv-rec { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 6px; background: #080808; }
.rec-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rec-tags span { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.rec-tags b { color: var(--accent); font-weight: 600; }
.rec-note { font-size: 0.85rem; color: var(--muted); margin: 8px 0 0; }
.rec-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 520px) { .rec-split { grid-template-columns: 1fr; } }
.mini-map { margin: 0; }
.mini-map canvas { display: block; width: 100%; aspect-ratio: 3 / 2; height: auto; border-radius: 6px; background: #0a0a0a; }
.mini-map figcaption { font-size: 0.75rem; color: var(--faint); margin-top: 6px; }
.rec-split .stats { font-size: 0.84rem; gap: 4px 12px; }
.rec-split .stats dd { font-size: 0.8rem; }

.stage { position: relative; width: 100%; max-width: 700px; margin: 0 auto; aspect-ratio: 932 / 716; outline: none; border-radius: 18px; }
.stage::before { content: ""; position: absolute; inset: -6% -8%; background: radial-gradient(closest-side, rgba(255,240,220,0.10), transparent 75%); pointer-events: none; }
.stage:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.cam-photo { filter: drop-shadow(0 24px 40px rgba(0,0,0,0.6)); position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }

.hotspots { position: absolute; inset: 0; z-index: 3; }
.hs, .lamp {
  position: absolute;
  left: calc(var(--x) / 932 * 100%); top: calc(var(--y) / 716 * 100%);
  width: calc(var(--r) * 2 / 932 * 100%); aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%;
}
.hs { border: 0; padding: 0; background: transparent; cursor: pointer; transition: background 0.12s, box-shadow 0.12s; }
.hs:hover { background: rgba(255,255,255,0.12); box-shadow: 0 0 0 2px rgba(255,255,255,0.35); }
.hs:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent); }
.hs.press { background: rgba(255,255,255,0.28); }
.hs.hint { box-shadow: 0 0 0 3px var(--accent); animation: hint 1.3s ease-in-out infinite; }
@keyframes hint { 50% { box-shadow: 0 0 0 3px rgba(240,164,58,0.2), 0 0 18px 4px rgba(240,164,58,0.25); } }
@media (prefers-reduced-motion: reduce) { .hs.hint { animation: none; } }
.lamp { pointer-events: none; }
.lamp.on { background: radial-gradient(circle, #ff5a4a 0 35%, rgba(255,60,50,0.45) 55%, transparent 72%); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

/* the LCD is a fixed 720x480 box mapped onto the photo's screen quad with matrix3d (sim.js) */
.lcd-box { position: absolute; left: 0; top: 0; width: 720px; height: 480px; transform-origin: 0 0; overflow: hidden; background: #000; z-index: 2; border-radius: 6px; }
.lcd-box canvas { display: block; width: 100%; height: 100%; }
.lcd-glass { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0) 45%); }
.toast {
  position: absolute; left: 50%; bottom: 13%; transform: translate(-50%, 8px);
  max-width: 88%; padding: 10px 18px; border-radius: 8px;
  background: rgba(10,10,10,0.9); border: 1px solid #444; color: #f2f2f2;
  font: 600 22px/1.35 var(--sans); text-align: center;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.clip { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); text-align: center; margin: 14px 0 0; min-height: 1.6em; }
.clip.rec { color: var(--rec); }
.credit { font-size: 0.75rem; color: var(--faint); text-align: center; margin: 6px 0 0; }
.credit a { color: var(--muted); }

.panel { display: flex; flex-direction: column; gap: 16px; }
.panel-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel-block h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }
.steps { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding-left: 32px; font-size: 0.92rem; color: var(--muted); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 700; border: 1px solid var(--line); color: var(--muted);
}
.steps li.current { color: var(--text); }
.steps li.current::before { border-color: var(--accent); color: var(--accent); }
.steps li.done { color: var(--faint); }
.steps li.done::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps b { color: var(--text); }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.seg { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px; margin-bottom: 6px; }
.seg-wrap { display: grid; grid-template-columns: 1fr 1fr; }
.seg button {
  flex: 1 1 auto; border: 0; background: transparent; color: var(--muted);
  font: 600 0.82rem var(--sans); padding: 7px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px #48433d; }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.seg button .exp { color: var(--accent); font-weight: 500; font-size: 0.72rem; margin-left: 3px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 0.88rem; color: var(--muted); cursor: pointer; margin-top: 6px; }
.check input { accent-color: var(--accent); }
.photo-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.photo-note { margin-top: 8px !important; max-width: 60ch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card p { color: var(--muted); }
.pixels svg { display: block; width: 100%; height: auto; }
.fig-note { font-size: 0.86rem; color: var(--muted); margin: 10px 0 0; font-family: var(--mono); }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 0.9rem; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-family: var(--mono); font-size: 0.85rem; text-align: right; }
.stats dd small { display: block; font-family: var(--sans); }
.stats select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 0.82rem; }
.fine { font-size: 0.78rem; color: var(--faint) !important; margin: 0; }

/* tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.modes td:nth-child(3), .modes td:nth-child(4), .modes td:nth-child(5), .modes td:nth-child(6) { font-family: var(--mono); font-size: 0.85rem; white-space: nowrap; }
.modes tr.group td { border-top: 1px solid #3f3a35; }
.modes tr.exp td { color: var(--muted); }
.tag { display: inline-block; font-size: 0.7rem; color: var(--accent); border: 1px solid rgba(240,164,58,0.4); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.hash { font-size: 0.75rem; word-break: break-all; background: none; padding: 0; color: var(--muted); }
.files td:first-child a { white-space: nowrap; }

.note { margin-top: 20px; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; color: var(--muted); max-width: 90ch; }
.note b { color: var(--text); }

.mp-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .mp-groups { grid-template-columns: 1fr; } }
.mp-groups h3 { font-size: 1rem; margin-bottom: 0.6em; color: var(--accent); }
.mp-groups ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: 0.92rem; }
.mp-groups li { margin-bottom: 6px; }
.mp-groups b { color: var(--text); }
.mp-tables { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; margin-top: 48px; align-items: start; }
@media (max-width: 900px) { .mp-tables { grid-template-columns: 1fr; } }
.mp-tables h3 { font-size: 1rem; margin-bottom: 0.6em; }
.mp-tables .fine { margin-top: 10px; }
.keys-table td:first-child { font-weight: 600; white-space: nowrap; color: var(--text); }
.keys-table td, .vs-table td { color: var(--muted); }
.vs-table td:first-child { color: var(--text); font-weight: 600; }
.vs-table td:last-child { color: var(--text); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feature p { color: var(--muted); margin: 0; font-size: 0.94rem; }

.limits ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.limits li { margin-bottom: 8px; }
.limits b { color: var(--text); }
.limits h3 { font-size: 1rem; margin: 0 0 0.5em; }
.limits ul + h3 { margin-top: 1.2em; }
.install { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .install { grid-template-columns: 1fr; } }
.install ol { margin: 0; padding-left: 1.2em; color: var(--muted); }
.install li { margin-bottom: 8px; }
.install b { color: var(--text); }

.changelog { margin-top: 28px; }
.changelog ul { color: var(--muted); padding-left: 1.2em; }
.changelog li { margin-bottom: 6px; }

.footer { margin-top: 96px; padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.88rem; }
.footer p { max-width: 80ch; }
.footer a { color: var(--muted); }
