/* tremorlab · style.css
   global stylesheet — colors, typography, nav, layout, chrome, telemetry */


/* ============================================================
   color tokens
   ============================================================ */

:root {
  --bg: #FAFAF7;
  --bg-elevated: #F1EFE8;
  --bg-canvas: #FFFFFF;
  --fg: #2C2C2A;
  --fg-muted: #5F5E5A;
  --fg-faint: #888780;
  --border: #D3D1C7;
  --accent: #2C2C2A;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #1A1A18;
  --bg-elevated: #242422;
  --bg-canvas: #0E0E0D;
  --fg: #E8E6DE;
  --fg-muted: #B4B2A9;
  --fg-faint: #888780;
  --border: #3A3A36;
  --accent: #E8E6DE;
}


/* ============================================================
   base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 200ms ease, color 200ms ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover { color: var(--fg); }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}


/* ============================================================
   document chrome (top line on every page)
   ============================================================ */

.doc-chrome {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-faint);
  padding: 8px 16px;
  letter-spacing: 0.02em;
}

.doc-chrome a { color: var(--fg-faint); }
.doc-chrome a:hover { color: var(--fg-muted); }


/* ============================================================
   top nav
   ============================================================ */

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px 16px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: 0.01em;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
}

.navlinks a {
  color: var(--fg-muted);
  transition: color 150ms ease;
}

.navlinks a:hover { color: var(--fg); }

.navlinks a.active { color: var(--fg); }

.theme-toggle {
  font-size: 14px;
  color: var(--fg-muted);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms ease, transform 300ms ease;
  margin-left: 8px;
}

.theme-toggle:hover { color: var(--fg); }

[data-theme="dark"] .theme-toggle { transform: rotate(180deg); }


/* ============================================================
   page layout
   ============================================================ */

.page {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1 0 auto;
}

.page-placeholder {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
  margin: 24px 0;
}


/* ============================================================
   experiment grid (canvas + results panel)
   ============================================================ */

.experiment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .experiment {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Keep title + one-liner + begin button above the fold on phones. Size the
     canvas to the VISIBLE viewport (svh accounts for the browser chrome that
     vh ignores) and tighten the above-canvas spacing. The ball is magnified
     (DISPLAY_ZOOM), so a smaller canvas stays perfectly usable. */
  .canvas-frame {
    max-width: min(100%, 38vh);   /* fallback for browsers without svh */
    max-width: min(100%, 38svh);  /* trimmed to fit the posture illustration + four numbered steps */
    margin-left: auto;
    margin-right: auto;
  }
  .page { padding-top: 12px; }
  .test-header { margin-bottom: 10px; }
  .canvas-stage { gap: 6px; }
  .canvas-actions { padding-top: 8px; }
}


/* ============================================================
   canvas stage
   ============================================================ */

.canvas-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* page header — the only bold heading; sans, confident, no gradient/glow */
.test-header {
  max-width: 600px;
  margin: 0 auto 16px;
  text-align: center;
}

.test-title {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.test-subhead {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .test-title { font-size: 22px; }
}

/* Pre-test hold cue: numbered steps do the work, a small posture illustration
   supports. Laid out as a row so the illustration adds no height beyond the
   steps, keeping the begin button above the fold. Hidden while testing. */
.posture-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 460px;
  margin: 0 auto;
  text-align: left;
}
.hold-img {
  flex: 0 0 auto;
  height: 96px;
  width: auto;
  /* soften the solid silhouette so it reads as part of the muted UI */
  opacity: 0.85;
}
/* the PNG is a dark silhouette on transparent — invert it so it stays
   visible against the dark canvas background */
[data-theme="dark"] .hold-img {
  filter: invert(1);
  opacity: 0.8;
}
.hold-steps {
  margin: 0;
  padding-left: 1.5em;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  color: var(--fg);
}
.hold-steps li { margin: 0 0 3px; }
.hold-steps li:last-child { margin-bottom: 0; }
.hold-steps strong { font-weight: 600; color: var(--fg); }
body.test-active .posture-cue { display: none; }

@media (max-width: 768px) {
  .hold-img { height: 84px; }
}

/* During an active test, suppress selection across the whole page so a
   stray drag off the canvas can't start an iOS text selection. */
body.test-active {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.canvas-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  /* Subtle radial depth: a touch lighter at center, fading to the edge. */
  background: radial-gradient(circle at 50% 50%, #FFFFFF 0%, #F6F3EC 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  /* iOS Safari: a press-and-hold must not select text or raise the
     "Copy / Search" callout menu, and must not scroll the page. */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

[data-theme="dark"] .canvas-frame {
  background: radial-gradient(circle at 50% 50%, #161513 0%, #0E0E0D 100%);
}

#hold-canvas,
#fx-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#hold-canvas {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* The fx layer is purely visual; let pointer events fall through to the base. */
#fx-canvas { pointer-events: none; }

.canvas-status {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-muted);
  padding-left: 4px;
  min-height: 1.5em;
}


/* ============================================================
   countdown overlay (3-2-1 over the canvas)
   ============================================================ */

.countdown-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: clamp(80px, 24vw, 200px);
  font-weight: 500;
  color: var(--fg);
  opacity: 0.22;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.02em;
}

.countdown-overlay.active { display: flex; }


/* "hold steadier" hint — appears when the ball passes the outer ring */
.hold-hint {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  padding: 3px 10px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.hold-hint.show { opacity: 1; }


/* ============================================================
   canvas action button(s) — leading-glyph microcopy
   ============================================================ */

.canvas-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
}

.action-btn {
  font-family: var(--mono);
  font-size: 17px;
  color: var(--fg);
  background: var(--bg-elevated);
  border: 1.5px solid var(--fg);
  padding: 16px 28px;
  border-radius: 4px;
  cursor: pointer;
  min-width: 220px;
  min-height: 44px;
  letter-spacing: 0.01em;
  transition: background-color 150ms ease, color 150ms ease;

  /* iOS Safari: kill the tap-zoom gesture (which can swallow button taps
     even when the viewport meta disables zoom delays) and normalize the
     UA's native button styling that can mess with hit-testing. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

/* Hover inverts: filled background, background-colored text. */
.action-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.action-btn:disabled {
  color: var(--fg-faint);
  border-color: var(--border);
  background: var(--bg-elevated);
  cursor: default;
}

.tap-hint {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-faint);
  text-align: center;
}


/* ============================================================
   results panel (empty in phase 1)
   ============================================================ */

.results-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  padding: 16px;
  min-height: 120px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-faint);
}

.results-panel:empty::before {
  content: "· results render here after a test";
}

/* [hidden] must win over .experiment's display:grid and section defaults */
[hidden] { display: none !important; }


/* ============================================================
   results panel — score as instrument readout, metrics, actions
   ============================================================ */

.score-readout { margin-bottom: 18px; }

.score-eyebrow {
  font-size: 9px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.score-rule { height: 1px; background: var(--fg-faint); opacity: 0.7; }

/* The payoff: big, bold, confident — the largest thing on screen at result. */
.score-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
}

.score-number {
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.score-suffix { font-size: 20px; font-weight: 500; color: var(--fg-muted); }

/* The verdict: prominent, colored by the result, fades in after the count-up. */
.score-bracket {
  font-size: 20px;
  font-weight: 600;
  margin-top: 10px;
  transition: opacity 350ms ease;
}

/* interpretation layer — compare-to-other-testers, fades in with the verdict */
.interp { margin: 14px 0; transition: opacity 350ms ease; }

.dist-band { position: relative; padding-top: 26px; margin-bottom: 10px; }

.dist-track {
  display: flex;
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.dist-zone { height: 100%; }

.dist-labels { display: flex; margin-top: 5px; }

.dist-label {
  font-size: 12px;
  color: var(--fg-muted);
  text-align: center;
  line-height: 1.2;
  padding: 0 2px;
}

.dist-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.dist-marker-chip {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--fg);
  border-radius: 4px;
  padding: 1px 6px;
}

.dist-marker::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--fg);
  margin-top: 2px;
}

.interp-sentence {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--fg);
  line-height: 1.5;
  margin: 10px 0 6px;
}

.interp-caveat {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.4;
  margin: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 16px 0;
}

.metric-cell { display: flex; flex-direction: column; gap: 2px; }
.metric-label { font-size: 14px; color: var(--fg-muted); }
.metric-value { font-size: 16px; color: var(--fg); }

/* ---- personal history (local-only) ---- */
.history-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.history-head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 6px;
}
.history-frame {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-muted);
  margin: 0 0 12px;
}
.history-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin: 0 0 12px;
}
.history-stat { display: flex; flex-direction: column; gap: 2px; }
.history-stat-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
}
.history-stat-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
}
.history-compare {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-muted);
  margin: 0 0 8px;
}
.history-compare-glyph { font-weight: 600; }
.history-trend {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-muted);
  margin: 0 0 12px;
}
.history-note {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-faint);
  margin: 0 0 10px;
}
.history-clear {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}
.history-clear:hover { color: var(--fg); border-color: var(--fg-faint); }

.result-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }

.result-btn {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  min-height: 38px;
  transition: background-color 150ms ease, color 150ms ease;
}

.result-btn:hover { background: var(--fg); color: var(--bg); }

/* primary retry — same bold treatment as the begin button, sits under the score */
.retry-primary {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--fg);
  background: var(--bg-elevated);
  border: 1.5px solid var(--fg);
  border-radius: 4px;
  padding: 14px 20px;
  width: 100%;
  min-height: 48px;
  text-align: center;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin: 8px 0 16px;
  transition: background-color 150ms ease, color 150ms ease;
}

.retry-primary:hover { background: var(--fg); color: var(--bg); }

/* invalid-test message (gross movement dominated the run) */
.invalid-msg {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--fg);
  line-height: 1.5;
  margin: 8px 0 16px;
}

@media (max-width: 768px) {
  .score-number { font-size: 56px; }
}


/* ============================================================
   QR overlay — revealed in place over the (reserved) canvas frame when
   "begin" is pressed on a device with no motion sensor. It sits inside the
   canvas-frame, so revealing it shifts no surrounding content (zero CLS).
   ============================================================ */

.qr-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-canvas);
  border-radius: 8px;
}

.qr-lead {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  margin: 0;
  line-height: 1.45;
  max-width: 280px;
}

.qr-hint {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-muted);
  margin: 0;
}

.qr-canvas {
  image-rendering: pixelated;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.qr-url {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-faint);
  margin: 0;
  word-break: break-all;
  max-width: 280px;
}


/* ============================================================
   "what this measures" body copy (SEO / steady-hand framing)
   ============================================================ */

.about-test {
  max-width: 640px;
  margin: 32px auto 0;
  padding: 0 4px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-muted);
}

.about-test h2 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 8px;
}

.about-test p { margin: 0 0 12px; }

.about-test a {
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}

.about-test a:hover { color: var(--fg-muted); }


/* ============================================================
   simple prose pages (about, notes)
   ============================================================ */

.prose { max-width: 640px; margin: 8px auto 0; }
.prose .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  margin: 0 0 8px;
}
.prose h1 {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 16px;
}
.prose p {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  margin: 0 0 14px;
}
.prose ul {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  margin: 0 0 14px;
  padding-left: 18px;
}
.prose li { margin: 0 0 6px; }
.prose a { color: var(--fg); border-bottom: 1px solid var(--border); }
.prose a:hover { color: var(--fg-muted); }
.prose .prose-meta { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); margin: 0; }

.note-index { list-style: none; padding-left: 0; margin: 8px 0 0; }
.note-empty {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
  border-left: 2px solid var(--border);
  padding-left: 12px;
}

@media (max-width: 768px) {
  .prose h1 { font-size: 22px; }
}


/* ============================================================
   methodology page (how-it-works) — sans prose, mono code + markers
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.m-header { max-width: 760px; margin: 0 0 28px; }
.m-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  margin: 0 0 8px;
}
.m-title {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 12px;
}
.m-desc {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-muted);
  margin: 0 0 10px;
  max-width: 640px;
}
.m-meta { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); margin: 0; }

.m-layout { display: grid; grid-template-columns: 168px 1fr; gap: 32px; align-items: start; }

.m-toc { position: sticky; top: 16px; font-family: var(--mono); font-size: 12px; line-height: 1.5; }
.m-toc ol { list-style: decimal; padding-left: 20px; margin: 0; color: var(--fg-faint); }
.m-toc li { margin: 0 0 6px; }
.m-toc a { color: var(--fg-muted); }
.m-toc a:hover { color: var(--fg); }

.m-content { max-width: 680px; min-width: 0; }
.m-section { margin: 0 0 28px; }
.m-section h2 {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 12px;
}

.m-para { display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: start; }
.m-mark { font-family: var(--mono); font-size: 10px; color: var(--fg-faint); padding-top: 5px; user-select: none; }
.m-para p {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  margin: 0 0 16px;
}
.m-para code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-elevated);
  padding: 1px 5px;
  border-radius: 3px;
}

.m-list {
  margin: 0 0 16px;
  padding-left: 18px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
}
.m-list li { margin: 0 0 8px; }

.m-code {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 0 0 16px;
  overflow-x: auto;
  color: var(--fg);
}

.m-callout {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  border-left: 2px solid var(--fg);
  padding-left: 12px;
  margin: 4px 0 16px;
}

.m-refs {
  margin: 0;
  padding-left: 18px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-muted);
}
.m-refs li { margin: 0 0 10px; }

@media (max-width: 768px) {
  .m-layout { grid-template-columns: 1fr; gap: 16px; }
  .m-toc { position: static; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 8px; }
  .m-para { grid-template-columns: 1fr; gap: 0; }
  .m-mark { display: none; }
}


/* ============================================================
   diagnostic debug panel (only visible with .active class via ?debug=1)
   ============================================================ */

.debug-panel {
  display: none;
  max-height: 120px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-faint);
  padding: 8px 16px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}

.debug-panel.active { display: block; }


/* ============================================================
   dev tune panel (?tune=1) — live ball-physics knobs, debug-styled
   ============================================================ */

.tune-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  font-family: var(--mono);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tune-title { font-size: 11px; color: var(--fg-faint); }
.tune-row { display: flex; flex-direction: column; gap: 4px; }
.tune-label { font-size: 13px; color: var(--fg); }
.tune-val { font-weight: 600; }
.tune-controls { display: flex; align-items: center; gap: 8px; }
.tune-slider { flex: 1; min-width: 0; }

.tune-btn {
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.tune-btn:active { background: var(--fg); color: var(--bg); }


/* ============================================================
   telemetry strip (live debug-style readout)
   ============================================================ */

.telemetry-strip {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-faint);
  padding: 12px 16px 4px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  letter-spacing: 0.02em;
  word-break: break-word;
}


/* ============================================================
   ymyl disclaimer (footer)
   ============================================================ */

.ymyl-disclaimer {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
  padding: 8px 16px 24px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  line-height: 1.6;
}


/* ============================================================
   mobile tweaks
   ============================================================ */

@media (max-width: 480px) {
  .topnav { padding: 12px 12px 12px; }
  .doc-chrome,
  .telemetry-strip,
  .ymyl-disclaimer { padding-left: 12px; padding-right: 12px; }
  .page { padding: 16px 12px; }
  .brand { font-size: 14px; }
  .navlinks { gap: 12px; font-size: 11px; }
}
