/* Duet public demo. Tokens and chrome from the handoff README. */
:root {
  --paper: #fafcfc; --ink: #1b1b1b; --accent: #7b8388; --accent-light: #a7adb1; --focus: #59666e;
  --light: #fbfbf8; --a: #b07a55; --b: #4f86a8;
  --w-va: #1b1b1b; --w-nva: #59666e; --w-wait: #7b8388; --w-motion: #a7adb1; --w-rework: #8f5a45; --w-unknown: #d3d8da;
  --hatch-unknown: repeating-linear-gradient(45deg, #d3d8da 0 3px, #fafcfc 3px 6px);
  --hatch-waiting: repeating-linear-gradient(45deg, #7b8388 0 2px, transparent 2px 4px);
  --hatch-video: repeating-linear-gradient(135deg, #1b1b1b 0 10px, #222 10px 20px);
  --mono: 'Spline Sans Mono', ui-monospace, Menlo, monospace;
  --serif: 'Times New Roman', Times, serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; color: var(--ink); font-family: var(--serif); line-height: 1.32; letter-spacing: -0.005em;
  min-height: 100vh;
  background:
    linear-gradient(rgba(250,252,252,.52), rgba(250,252,252,.52)),
    repeating-linear-gradient(0deg, rgba(27,27,27,.14) 0 1px, transparent 1px 128px),
    repeating-linear-gradient(90deg, rgba(27,27,27,.14) 0 1px, transparent 1px 128px),
    repeating-linear-gradient(0deg, rgba(27,27,27,.07) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(90deg, rgba(27,27,27,.07) 0 1px, transparent 1px 16px),
    #fafcfc;
}
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--focus); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, p, figure { margin: 0; }
.mono { font-family: var(--mono); }
.c-a { color: var(--a); } .c-b { color: var(--b); }

.page { max-width: 1280px; margin: 0 auto; padding: 28px 56px 56px; }

/* Header */
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hdr .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.hdr .brand svg { display: block; }
.hdr .brand span { font-size: 18px; font-weight: 700; }
.hdr nav { display: flex; gap: 24px; font-size: 15px; flex-wrap: wrap; }
.hdr nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.hdr .cta { border: 1px solid var(--ink); color: var(--ink); text-decoration: none; padding: 6px 14px; font-size: 15px; }
.hdr .cta:hover { background: var(--ink); color: var(--light); }

/* Title rows */
.title-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-top: 36px; }
.kicker { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.page-title { font-size: 34px; font-weight: 700; line-height: 1.05; margin-top: 4px; }
.stats { display: grid; grid-auto-flow: column; gap: 28px; }
.stat .l { font-size: 13px; color: var(--accent); font-style: italic; }
.stat .v { font-family: var(--mono); font-size: 26px; line-height: 1.1; }
.stat .v small { font-size: 14px; color: var(--accent); }

/* Figure pattern */
.fig-title { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--ink); padding-bottom: 6px; font-size: 14px; font-style: italic; }
.fig-n { font-family: var(--mono); font-style: normal; font-size: 12px; }
figcaption { font-size: 14px; font-style: italic; margin-top: 10px; line-height: 1.4; }
figcaption.small { font-size: 13px; color: var(--accent); }
.prov { font-family: var(--mono); font-size: 11px; color: var(--accent); margin-top: 6px; }
.sec-head { font-size: 14px; font-style: italic; color: var(--accent); }

/* Strip */
.strip { display: grid; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.strip > div { padding: 14px; border-left: 1px solid var(--accent-light); }
.strip > div:first-child { padding-left: 0; border-left: 0; }
.strip .k { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.strip .s { font-size: 14px; color: var(--focus); margin-top: 6px; }

/* Plate: the 3D viewport with its overlays */
.plate { position: relative; width: 100%; background: var(--ink); overflow: hidden; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.plate.dragging { cursor: grabbing; }
.plate canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
.plate .labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.plate .labels span { position: absolute; left: 0; top: 0; font-family: var(--mono); font-size: 11px; color: var(--light); white-space: nowrap; transform: translate(-50%, -50%); }
.readout { position: absolute; left: 20px; top: 16px; font-family: var(--mono); font-size: 12px; color: var(--light); line-height: 1.75; white-space: pre; pointer-events: none; }
.hint { position: absolute; right: 20px; font-family: var(--mono); font-size: 10.5px; color: var(--accent-light); pointer-events: none; }
.hint.top { top: 16px; } .hint.low { bottom: 70px; }
.chips { position: absolute; right: 20px; top: 16px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(251,251,248,.35); color: var(--light); font-family: var(--mono); font-size: 10.5px; padding: 4px 9px; }
.chip .sq { width: 7px; height: 7px; border: 1px solid var(--light); background: transparent; }
.chip[aria-pressed="true"] .sq { background: var(--light); }
.chip.muted { color: var(--accent-light); border-color: rgba(251,251,248,.2); }
.pips { position: absolute; right: 20px; bottom: 72px; display: flex; gap: 10px; pointer-events: none; }
.pip { position: relative; width: 19%; min-width: 160px; aspect-ratio: 16/9; border: 1px solid rgba(251,251,248,.4); background: var(--hatch-video); overflow: hidden; }
.pip .tag { position: absolute; left: 8px; top: 6px; font-family: var(--mono); font-size: 10.5px; }
.pip .file { position: absolute; right: 8px; bottom: 6px; font-family: var(--mono); font-size: 9.5px; color: var(--accent); }
.pips-wrap { position: absolute; left: 0; right: 0; bottom: 0; top: 0; pointer-events: none; }

/* Video frames */
.ego { position: relative; aspect-ratio: 16/9; background: var(--hatch-video); overflow: hidden; }
.ego video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ego video.missing { display: none; }
.ego .tag { position: absolute; left: 12px; top: 10px; font-family: var(--mono); font-size: 11px; }
.ego .time { position: absolute; right: 12px; top: 10px; font-family: var(--mono); font-size: 11px; color: var(--light); }
.ego .file { position: absolute; right: 12px; bottom: 10px; font-family: var(--mono); font-size: 10px; color: var(--accent); }
.label-chip { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; background: rgba(27,27,27,.88); border: 1px solid rgba(251,251,248,.35); color: var(--light); font-family: var(--mono); font-size: 11px; padding: 4px 9px; white-space: nowrap; }
.label-chip .sq { width: 7px; height: 7px; display: inline-block; }
.fade { opacity: 1; transition: opacity 120ms; }
.fade.off { opacity: 0; transition: opacity 80ms; }

/* Transport bar */
.transport { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; border-top: 1px solid rgba(251,251,248,.25); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: rgba(27,27,27,.9); cursor: default; }
.transport .play { color: var(--light); font-family: var(--mono); font-size: 12px; min-width: 48px; text-align: left; padding: 4px; }
.transport .now { font-family: var(--mono); font-size: 12px; color: var(--light); min-width: 62px; }
.transport .end { font-family: var(--mono); font-size: 12px; color: var(--accent-light); }
.transport .speed { font-family: var(--mono); font-size: 11px; color: var(--accent-light); border: 1px solid rgba(251,251,248,.35); padding: 3px 8px; }
.scrub { position: relative; flex: 1; height: 30px; cursor: ew-resize; touch-action: none; }
.scrub .base { position: absolute; left: 0; right: 0; top: 14px; height: 1px; background: rgba(251,251,248,.35); }
.scrub .ticks { position: absolute; left: 0; right: 0; top: 9px; height: 12px; background: repeating-linear-gradient(90deg, rgba(251,251,248,.35) 0 1px, transparent 1px 16.3043%); }
.scrub .seg { position: absolute; height: 3px; }
.scrub .seg.a { top: 18px; } .scrub .seg.b { top: 23px; }
.scrub .ho { position: absolute; top: 11px; width: 6px; height: 6px; background: var(--light); transform: rotate(45deg); margin-left: -3px; }
.scrub .head { position: absolute; top: 4px; width: 1px; height: 24px; background: var(--light); }

/* Quality strip */
.quality { position: relative; height: 40px; margin-top: 10px; border-bottom: 1px solid var(--ink); }
.quality .l { position: absolute; left: 0; top: 0; font-family: var(--mono); font-size: 10px; color: var(--accent); }
.quality .hi { position: absolute; right: 0; top: 0; font-family: var(--mono); font-size: 10px; color: var(--accent); }
.quality .lo { position: absolute; right: 0; bottom: 2px; font-family: var(--mono); font-size: 10px; color: var(--accent); }
.quality svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 26px; display: block; }
.quality polyline { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.quality .head { position: absolute; top: 12px; width: 1px; height: 28px; background: var(--ink); }

/* Footer */
.ftr { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: baseline; padding-top: 14px; border-top: 1px solid var(--ink); }
.ftr .note { font-size: 13px; font-style: italic; color: var(--accent); }

/* Phone note on view pages */
.phone-note { display: none; }

/* Breakpoints */
@media (max-width: 1023px) {
  .two-col { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
  .page { padding: 20px 20px 40px; }
  body {
    background:
      linear-gradient(rgba(250,252,252,.52), rgba(250,252,252,.52)),
      repeating-linear-gradient(0deg, rgba(27,27,27,.14) 0 1px, transparent 1px 96px),
      repeating-linear-gradient(90deg, rgba(27,27,27,.14) 0 1px, transparent 1px 96px),
      repeating-linear-gradient(0deg, rgba(27,27,27,.07) 0 1px, transparent 1px 12px),
      repeating-linear-gradient(90deg, rgba(27,27,27,.07) 0 1px, transparent 1px 12px),
      #fafcfc;
  }
  .phone-note { display: block; }
}
