/* Webcamp — light professional instrument design system */

/* Self-hosted: no third-party request, no render-blocking @import. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/archivo-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/archivo-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
}

:root {
  --paper: #ffffff;
  --ground: #f4f6f9;
  --ground-2: #eaeef3;

  --ink: #101720;
  --ink-2: #39434f;
  --muted: #5d6774;
  --faint: #616b78;

  --rule: #dfe4eb;
  --rule-soft: #eceff4;

  --stage: #131920;
  --stage-2: #1b222b;

  --accent: #0d6a7e;
  --accent-dark: #095566;
  --accent-wash: #edf5f7;

  --live: #0e7a63;
  --warn: #a97a1c;
  --fail: #b33744;
  --fail-wash: #fdf2f3;
  --live-wash: #eef7f4;

  --bar-1: #c2a02a;
  --bar-2: #1d8b9c;
  --bar-3: #3d8a51;
  --bar-4: #95487f;
  --bar-5: #bd414d;
  --bar-6: #35559a;

  --lift: 0 1px 1px rgba(16, 23, 32, .04);
  --lift-2: 0 1px 2px rgba(16, 23, 32, .05), 0 8px 20px -14px rgba(16, 23, 32, .22);

  --wrap: 1140px;
}

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

/* The hidden attribute must beat any explicit display rule, or elements
   marked hidden in markup (download button, consent panel) render anyway. */
[hidden] { display: none !important; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

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

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: 'Archivo', system-ui, sans-serif;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 0 0 .5em;
  color: var(--ink);
}

h1 { font-weight: 700; font-size: clamp(1.85rem, 3.6vw, 2.5rem); letter-spacing: -.028em; }
h2 { font-weight: 600; font-size: clamp(1.3rem, 2.2vw, 1.6rem); margin-top: 2.2em; }
h3 { font-weight: 600; font-size: 1.06rem; margin-top: 1.9em; letter-spacing: -.008em; }

p { margin: 0 0 1.1em; }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .69rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .9em;
}

/* ---------- header ---------- */

.site-head {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 40;
}

.head-row { display: flex; align-items: center; gap: 18px; min-height: 62px; flex-wrap: wrap; }

.brand {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 1.04rem;
  letter-spacing: -.022em;
  color: var(--ink);
  text-decoration: none;
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
}
.brand:hover { color: var(--ink); }

.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px var(--live-wash);
}

.nav { display: flex; gap: 1px; flex-wrap: wrap; margin-left: auto; }

/* one scrollable row on narrow screens: keeps the sticky header short */
@media (max-width: 860px) {
  .head-row { flex-wrap: nowrap; gap: 12px; min-height: 56px; }
  .nav {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; scroll-snap-align: end; }
}

.nav a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .73rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 3px;
}
.nav a:hover { color: var(--ink); background: var(--ground-2); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-wash); }

/* ---------- stage ---------- */

.stage-band { background: var(--paper); border-bottom: 1px solid var(--rule); padding: 40px 0 44px; }

.stage-head { max-width: 64ch; margin-bottom: 28px; }
.stage-head p { color: var(--ink-2); font-size: 1.05rem; margin-bottom: 0; max-width: 60ch; }

.rig { display: grid; grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.rig > * { min-width: 0; }

@media (max-width: 720px) { .rig { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 721px) and (max-width: 900px) { .rig { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; } }

/* signature: test-pattern signal strip */

.signal {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--rule);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  background: var(--paper);
}

.seg { text-align: center; border-right: 1px solid var(--rule-soft); }
.seg:last-child { border-right: 0; }

.seg-bar { height: 6px; background: var(--ground-2); transition: background .3s ease; }
.seg[data-on="1"] .seg-bar { background: currentColor; }

.seg:nth-child(1) { color: var(--bar-1); }
.seg:nth-child(2) { color: var(--bar-2); }
.seg:nth-child(3) { color: var(--bar-3); }
.seg:nth-child(4) { color: var(--bar-4); }
.seg:nth-child(5) { color: var(--bar-5); }
.seg:nth-child(6) { color: var(--bar-6); }

.seg-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .585rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 7px 3px 8px;
  transition: color .3s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg[data-on="1"] .seg-label { color: var(--ink-2); }

/* video well stays dark: video needs the contrast */

.viewport {
  position: relative;
  background: #fbfcfd;
  background-image: radial-gradient(var(--rule) 1px, transparent 1px);
  background-size: 16px 16px;
  border: 1px solid var(--rule);
  border-radius: 0 0 4px 4px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .25s ease;
}

/* the well only goes dark once real video is in it */
.viewport[data-live="1"] { background: var(--stage); background-image: none; }

.viewport video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.viewport video.mirrored { transform: scaleX(-1); }
.viewport video[hidden] { display: none; }

.placeholder { text-align: center; padding: 30px 26px; max-width: 42ch; }
.placeholder p { color: var(--muted); font-size: .91rem; margin: 10px 0 0; }
.placeholder strong {
  color: var(--ink); display: block; font-size: 1rem;
  font-family: 'Archivo', sans-serif; font-weight: 600;
}

/* controls */

.controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }

.btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .745rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  cursor: pointer;
  background: var(--paper);
  color: var(--ink-2);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--lift);
}
.btn:hover { background: var(--ground-2); color: var(--ink); border-color: #cfd6df; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { background: var(--paper); border-color: var(--rule); color: var(--ink-2); }

.btn-go { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-go:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.btn-light { background: var(--paper); }

/* readout panel — reads as a spec sheet */

.readout { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }

.readout-head {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .655rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  background: #fbfcfd;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}

.lamp { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.lamp::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #c3cad3; }
.lamp[data-state="live"] { color: var(--live); }
.lamp[data-state="live"]::before { background: var(--live); animation: pulse 2s ease-in-out infinite; }
.lamp[data-state="fail"] { color: var(--fail); }
.lamp[data-state="fail"]::before { background: var(--fail); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.rows { margin: 0; padding: 4px 0; }

.row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 8px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .755rem;
  align-items: baseline;
  border-bottom: 1px solid var(--rule-soft);
}
.row:last-child { border-bottom: 0; }
.row dt { color: var(--muted); letter-spacing: .03em; flex-shrink: 0; }
.row dd { margin: 0; color: var(--ink); text-align: right; word-break: break-word; font-weight: 500; }

.picker { padding: 13px 16px; border-top: 1px solid var(--rule); background: #fbfcfd; }
.picker label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .645rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 7px;
}
.picker select {
  width: 100%;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 9px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .755rem;
}
.picker select:disabled { background: var(--ground-2); color: var(--muted); }

.assure {
  margin-top: 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 14px 15px;
  display: flex; gap: 11px; align-items: flex-start;
  box-shadow: var(--lift);
}
.assure-mark {
  flex-shrink: 0; margin-top: 4px;
  width: 13px; height: 13px; border-radius: 3px;
  border: 1px solid var(--live);
  background: var(--live-wash);
  position: relative;
}
.assure-mark::after {
  content: ''; position: absolute; left: 3px; top: 1px;
  width: 4px; height: 7px;
  border: solid var(--live); border-width: 0 1.5px 1.5px 0;
  transform: rotate(42deg);
}
.assure p { margin: 0; font-size: .845rem; line-height: 1.55; color: var(--muted); }
.assure strong { color: var(--ink); font-weight: 600; display: block; }

/* status message */

.status {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--muted);
  background: var(--paper);
  color: var(--ink-2);
  font-size: .92rem;
}
.status[hidden] { display: none; }
.status[data-tone="fail"] { border-left-color: var(--fail); background: var(--fail-wash); border-color: #f2dade; color: #6f2530; }
.status[data-tone="ok"] { border-left-color: var(--live); background: var(--live-wash); border-color: #d5e9e2; color: #14503f; }
.status strong { display: block; margin-bottom: 2px; color: var(--ink); font-weight: 600; }

/* ---------- meters ---------- */

.meter-block { margin-top: 16px; }

.meter {
  height: 32px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  padding: 4px;
  gap: 2px;
}
.meter-lg { height: 54px; }
.tick { flex: 1; background: var(--ground-2); border-radius: 1px; transition: background .06s linear; }
.tick[data-lit="1"] { background: var(--live); }
.tick[data-lit="1"].hot { background: var(--warn); }
.tick[data-lit="1"].peak { background: var(--fail); }

.meter-scale {
  display: flex; justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .6rem; color: var(--faint); letter-spacing: .08em;
  margin-top: 6px;
}

/* ---------- content ---------- */

.content { background: var(--ground); padding: 54px 0 24px; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 48px; align-items: start; }
@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .aside {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    align-items: start;
  }
  .card { margin-bottom: 0; }
}

.prose { max-width: 68ch; color: var(--ink-2); overflow-wrap: break-word; }
.prose li, .prose td, .prose p { overflow-wrap: break-word; }
.prose h2, .prose h3 { color: var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.15em; margin: 0 0 1.15em; }
.prose li { margin-bottom: .45em; }
.prose strong { font-weight: 600; color: var(--ink); }

.note {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 16px 19px;
  margin: 1.7em 0;
  font-size: .94rem;
  box-shadow: var(--lift);
}
.note p:last-child { margin-bottom: 0; }

.tw {
  margin: 1.5em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 4px;
}
.tw table { margin: 0; min-width: 420px; }

table {
  width: 100%; border-collapse: collapse; margin: 1.5em 0;
  font-size: .89rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule-soft); }
th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .655rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  background: #fbfcfd;
  border-bottom: 1px solid var(--rule);
}
td { color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }

/* numbered steps */

.steps { list-style: none; padding: 0; margin: 1.5em 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-left: 42px; margin-bottom: 1.15em; }
.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: 2px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem; font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 3px;
  width: 29px; height: 25px;
  display: flex; align-items: center; justify-content: center;
}

/* sidebar */

.aside { position: sticky; top: 80px; }
@media (max-width: 900px) { .aside { position: static; } }

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 15px 16px;
  margin-bottom: 14px;
  box-shadow: var(--lift);
}
.card h2, .card h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .655rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  margin: 0 0 10px;
}
.card ul { list-style: none; padding: 0; margin: 0; }
.card li { margin-bottom: 0; }
.card li a {
  display: block; padding: 6px 8px; margin: 0 -8px;
  border-radius: 3px;
  font-size: .885rem;
  text-decoration: none; color: var(--ink-2);
}
.card li a:hover { background: var(--ground-2); color: var(--ink); }
.card li a[aria-current="page"] { color: var(--accent); font-weight: 500; background: var(--accent-wash); }
.card p { font-size: .875rem; color: var(--ink-2); margin-bottom: 0; }

/* tool grid */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; margin: 1.6em 0; }
.tile {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 15px 16px;
  text-decoration: none;
  display: block;
  box-shadow: var(--lift);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tile:hover { border-color: var(--accent); box-shadow: var(--lift-2); }
.tile b {
  font-family: 'Archivo', sans-serif;
  font-weight: 600; font-size: .97rem;
  display: block; color: var(--ink); margin-bottom: 3px;
  letter-spacing: -.012em;
}
.tile span { font-size: .84rem; color: var(--muted); display: block; line-height: 1.5; }

/* faq */

details {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin-bottom: 7px;
}
summary {
  cursor: pointer;
  padding: 13px 16px;
  font-weight: 500;
  font-size: .95rem;
  color: var(--ink);
  list-style: none;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-family: 'IBM Plex Mono', monospace; color: var(--accent); font-size: 1.1rem; flex-shrink: 0; }
details[open] summary { border-bottom: 1px solid var(--rule-soft); }
details[open] summary::after { content: '\2212'; }
details > div { padding: 13px 16px; font-size: .93rem; color: var(--ink-2); }
details > div p:last-child { margin-bottom: 0; }

/* breadcrumbs */

.crumbs {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .685rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint);
  padding: 16px 0 0;
  display: flex; flex-wrap: wrap; align-items: center;
  overflow-wrap: anywhere;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span { margin: 0 6px; }
.crumbs span[aria-current] { margin: 0; }

.page-head { padding: 4px 0 8px; }
.page-head h1 { margin-bottom: .35em; }

/* screen test overlay */

.fullscreen-pad { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; cursor: pointer; }
.fullscreen-pad[data-open="1"] { display: flex; }
.fullscreen-pad .hint {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .73rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 15px; border-radius: 4px;
  background: rgba(0,0,0,.55); color: #fff;
  pointer-events: none;
}

.swatches { display: flex; gap: 7px; flex-wrap: wrap; margin: 16px 0 0; }
.swatch { width: 44px; height: 38px; border-radius: 4px; border: 1px solid var(--rule); cursor: pointer; padding: 0; }
.swatch:hover { border-color: var(--accent); }

/* ---------- keyboard test ---------- */

.kb {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0 0 4px 4px;
  padding: 13px;
  overflow-x: auto;
}
.kb-row { display: flex; gap: 4px; margin-bottom: 4px; min-width: 640px; }
.kb-row:last-child { margin-bottom: 0; }

.key {
  flex: 1 1 0;
  min-width: 29px;
  height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: #fbfcfd;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  color: var(--ink-2);
  transition: background .1s ease, color .1s ease, border-color .1s ease;
  user-select: none;
}
.key[data-state="done"] { background: var(--live-wash); border-color: #b6d8cd; color: var(--live); }
.key[data-state="down"] { background: var(--live); border-color: var(--live); color: #fff; }

.k-Space { flex: 6 1 0; }
.k-Backspace, .k-Enter, .k-CapsLock, .k-ShiftLeft, .k-ShiftRight, .k-Tab { flex: 1.7 1 0; }

/* ---------- mouse test ---------- */

.mousepad {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0 0 4px 4px;
  min-height: 268px;
  display: flex; align-items: center; justify-content: center;
  cursor: crosshair;
  user-select: none;
}
.mouse-figure { display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none; }
.mouse-body {
  width: 104px; height: 148px;
  border: 1px solid var(--rule);
  border-radius: 52px 52px 40px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 60px 1fr;
  overflow: hidden;
  background: #fbfcfd;
}
.mouse-btn { border: 1px solid var(--rule-soft); transition: background .12s ease; }
.mouse-btn[data-state="done"] { background: var(--live); }
#btn-left { border-radius: 50px 0 0 0; }
#btn-right { border-radius: 0 50px 0 0; }
#btn-middle {
  position: absolute; left: 50%; top: 28px; transform: translateX(-50%);
  width: 15px; height: 32px; border-radius: 8px;
  background: var(--paper); border: 1px solid var(--rule);
}
.mouse-wrap { position: relative; }
.mouse-side { display: flex; gap: 6px; }
.mouse-side div {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .6rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 5px 10px;
  border: 1px solid var(--rule); border-radius: 3px; background: #fbfcfd;
}
.mouse-side div[data-state="done"] { background: var(--live); color: #fff; border-color: var(--live); }
.mousepad p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .645rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); margin: 0;
}

/* ---------- recorder ---------- */

.playback { width: 100%; margin-top: 14px; border-radius: 4px; border: 1px solid var(--rule); background: #000; display: block; }
.playback[hidden] { display: none; }
.opt {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .715rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 0 4px;
}
.opt input { accent-color: var(--accent); width: 15px; height: 15px; }

/* ---------- footer ---------- */

.site-foot {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  padding: 44px 0 28px;
  margin-top: 56px;
  font-size: .88rem;
}
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 28px; margin-bottom: 30px; }
.foot-grid h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .645rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 11px; font-weight: 600;
}
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 5px; }
.foot-grid a { color: var(--ink-2); text-decoration: none; font-size: .86rem; }
.foot-grid a:hover { color: var(--accent); text-decoration: underline; }
.foot-base {
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem; letter-spacing: .05em;
  color: var(--faint);
}
.foot-base a { color: var(--muted); text-decoration: none; }
.foot-base a:hover { color: var(--accent); text-decoration: underline; }
.foot-base > :last-child { margin-left: auto; }

@media (max-width: 720px) {
  .foot-base > :last-child { margin-left: 0; }
}

/* ---------- touch devices ---------- */

@media (pointer: coarse) {
  .btn { min-height: 44px; padding: 12px 16px; }
  .nav a { min-height: 40px; display: flex; align-items: center; }
  .card li a { min-height: 40px; display: flex; align-items: center; }
  summary { min-height: 48px; }
  .picker select { min-height: 44px; }
  .swatch { width: 52px; height: 46px; }
  .foot-grid a { display: flex; align-items: center; min-height: 40px; }
  .foot-grid li { margin-bottom: 0; }
  .brand { min-height: 44px; }
  .crumbs a { display: inline-block; padding: 6px 0; }
  .key { height: 42px; }
}

/* ---------- tablet ---------- */

@media (max-width: 1024px) {
  .wrap { padding: 0 20px; }
  .cols { gap: 36px; grid-template-columns: minmax(0, 1fr) 260px; }
  .stage-band { padding: 32px 0 38px; }
}

@media (max-width: 900px) {
  /* the video well should not push the readout off the screen */
  .viewport { max-height: 58vh; }
  .aside { position: static; }
}

/* ---------- large phone ---------- */

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  body { font-size: 15.5px; }
  .stage-band { padding: 26px 0 32px; }
  .stage-head { margin-bottom: 22px; }
  .content { padding: 40px 0 16px; }
  .site-foot { padding: 36px 0 24px; margin-top: 44px; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  h2 { margin-top: 1.9em; }
  .controls { gap: 7px; }
  .viewport { max-height: none; }
  .prose { max-width: none; }
}

/* ---------- phone ---------- */

@media (max-width: 560px) {
  .seg-label { font-size: .5rem; letter-spacing: .04em; padding: 5px 1px 6px; }
  .btn { font-size: .705rem; padding: 11px 13px; }
  .row { font-size: .715rem; padding: 8px 13px; }
  .readout-head { padding: 11px 13px; }
  .picker { padding: 12px 13px; }
  .note { padding: 14px 15px; margin: 1.4em 0; }
  .steps li { padding-left: 36px; }
  .steps li::before { width: 26px; height: 23px; font-size: .66rem; }
  th, td { padding: 9px 11px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .foot-base { font-size: .66rem; gap: 8px; }
}

/* ---------- small phone ---------- */

@media (max-width: 400px) {
  .wrap { padding: 0 14px; }
  h1 { font-size: 1.65rem; }
  .stage-head p { font-size: .98rem; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .controls .btn { flex: 1 1 auto; text-align: center; }
  .seg-label { font-size: .46rem; }
  .assure { padding: 12px 13px; }
}

/* ---------- keyboard test: horizontal scroll with an affordance ---------- */

.kb-scroll { position: relative; }
.kb-hint {
  display: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); text-align: center; padding: 7px 0 0;
}

@media (max-width: 760px) {
  .kb { padding: 10px; }
  .kb-row { min-width: 560px; gap: 3px; }
  .kb-row { margin-bottom: 3px; }
  .key { min-width: 25px; font-size: .6rem; }
  .kb-hint { display: block; }
}

@media (max-width: 420px) {
  .kb-row { min-width: 470px; }
  .key { min-width: 21px; height: 36px; font-size: .55rem; }
}

/* ---------- mouse test: needs a real pointing device ---------- */

.touch-note {
  display: none;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--warn);
  border-radius: 4px;
  background: #fdfaf3;
  font-size: .89rem;
  color: var(--ink-2);
}
.touch-note strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

@media (pointer: coarse) {
  .touch-note { display: block; }
  .mousepad { min-height: 190px; cursor: default; }
  .mousepad p { display: none; }
}

/* ---------- landscape phones: reclaim vertical space ---------- */

@media (max-height: 480px) and (orientation: landscape) {
  .site-head { position: static; }
  .stage-band { padding: 18px 0 24px; }
  .viewport { max-height: 70vh; }
}

/* ---------- print ---------- */

@media print {
  .site-head, .site-foot, .aside, .controls, .signal, .assure { display: none; }
  body { background: #fff; font-size: 11pt; }
  .cols { grid-template-columns: 1fr; }
  a[href^="/"]::after { content: " (test-webcamp.com" attr(href) ")"; font-size: .85em; color: #666; }
}

/* ---------- legal ---------- */

.foot-legal {
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  padding: 22px 0 0;
  border-top: 1px solid var(--rule);
}
.foot-legal a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .715rem; letter-spacing: .06em;
  color: var(--muted); text-decoration: none;
}
.foot-legal a:hover { color: var(--accent); text-decoration: underline; }
.foot-legal a[aria-current="page"] { color: var(--ink); }
.foot-legal + .foot-base { border-top: 0; padding-top: 16px; }

.toc {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 16px 18px;
  margin: 0 0 2em;
  box-shadow: var(--lift);
}
.toc h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .655rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 10px;
}
.toc ol { margin: 0; padding-left: 1.25em; font-size: .92rem; }
.toc li { margin-bottom: .3em; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.prose h2[id] { scroll-margin-top: 78px; }

.updated {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .715rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--ground-2);
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 1.6em;
}

@media (pointer: coarse) { .foot-legal a { min-height: 40px; display: flex; align-items: center; } }

/* ---------- contact ---------- */

.contact-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 20px 22px;
  margin: 0 0 2em;
  box-shadow: var(--lift);
}
.contact-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .655rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.contact-mail { margin: 0 0 10px; }
.contact-mail a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.05rem, 3vw, 1.42rem);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact-mail a:hover { text-decoration: underline; }
.contact-note { margin: 0; font-size: .9rem; color: var(--muted); }

/* ---------- consent ---------- */

.consent {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -6px 28px -18px rgba(16, 23, 32, .34);
}
.consent[data-open="1"] { display: block; }

.consent-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 32px;
  align-items: start;
}

.consent-text h2 {
  font-family: 'Archivo', sans-serif;
  font-size: 1.02rem; font-weight: 600;
  margin: 0 0 5px; letter-spacing: -.01em;
}
.consent-text p { margin: 0; font-size: .89rem; color: var(--ink-2); max-width: 68ch; }

.consent-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
/* accept and reject carry equal weight, as consent law requires */
.consent-actions .btn-go { min-width: 168px; text-align: center; }

.consent-detail {
  margin-top: 14px;
  border-top: 1px solid var(--rule-soft);
  padding-top: 14px;
  display: grid; gap: 10px;
}
.consent-opt {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: .86rem; color: var(--ink-2);
  cursor: pointer;
}
.consent-opt-fixed { cursor: default; opacity: .82; }
.consent-opt input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.consent-opt strong { display: block; color: var(--ink); font-weight: 600; }

.consent-reopen {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .715rem; letter-spacing: .06em;
  color: var(--muted);
  background: none; border: 0; padding: 0; cursor: pointer;
}
.consent-reopen:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 860px) {
  .consent-inner { grid-template-columns: minmax(0, 1fr); padding: 16px 18px; gap: 14px; }
  .consent-actions .btn-go { min-width: 0; flex: 1 1 auto; }
  .consent { max-height: 82vh; overflow-y: auto; }
}
@media (pointer: coarse) {
  .consent-opt input { width: 20px; height: 20px; }
  .consent-reopen { min-height: 40px; display: flex; align-items: center; }
}

/* ---------- related pages ---------- */

.related {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 40px 0 44px;
}
.related > h2, .rel-grid { max-width: var(--wrap); margin-left: auto; margin-right: auto; padding: 0 24px; }
.related > h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .655rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 auto 18px;
}
.rel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 26px; }
.rel-col h3 {
  font-family: 'Archivo', sans-serif;
  font-size: .95rem; font-weight: 600; margin: 0 0 9px; color: var(--ink);
  letter-spacing: -.01em;
}
.rel-col ul { list-style: none; padding: 0; margin: 0; }
.rel-col li { margin-bottom: 3px; }
.rel-col a { font-size: .88rem; color: var(--ink-2); text-decoration: none; display: block; padding: 3px 0; }
.rel-col a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 720px) {
  .related { padding: 32px 0 34px; }
  .related > h2, .rel-grid { padding: 0 18px; }
  .rel-grid { gap: 20px; }
}
@media (max-width: 400px) { .related > h2, .rel-grid { padding: 0 14px; } }
@media (pointer: coarse) { .rel-col a { min-height: 40px; display: flex; align-items: center; } }
