/* Ce nu mai auzi.
   The instrument sits in a dark, quiet room; the argument is set on paper.
   Amber is not decoration: it is the colour a cathode-ray tube glowed, and the
   television is the one sound this page is really about. */

:root {
  --bg: #17181b;
  --bg-2: #1e2024;
  --panel: #26282d;
  --ink: #f2f1ee;
  --ink-2: #c0bfba;
  --ink-3: #8e8d88;
  --rule: #34363b;
  --amber: #e0a642;
  --amber-2: #f2c14e;
  --amber-dim: #7d6230;
  --you: #ffffff;
  --warn: #cc7a52;
  --cool: #6f8fa8;
  --paper: #ece9e2;
  --paper-2: #ded9cf;
  --paper-ink: #1e2024;
  --paper-muted: #5c5a54;
  --paper-rule: #c6c1b6;
  --paper-link: #6b3f16;
  --paper-link-visited: #4d3a63;
  --maxw: 45rem;
  --wide: 62rem;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --utility: "IBM Plex Sans Condensed", "Arial Narrow", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Components below set display, which would otherwise beat the hidden
   attribute and leave covers and controls on screen after they are dismissed. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  font-feature-settings: "kern" 1;
  overflow-wrap: break-word;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: .6rem 1rem;
  z-index: 20;
}
.skip:focus { left: .5rem; top: .5rem; }

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

.top {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.25rem 1.25rem .5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.kicker {
  margin: 0;
  font: 600 .72rem/1.2 var(--utility);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.langnav a,
.foot a {
  color: var(--ink-2);
  font: 500 .82rem/1 var(--utility);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}
.langnav a:hover,
.foot a:hover { color: var(--ink); border-color: currentColor; }

/* -------------------------------------------------------------------- text */

main { max-width: none; margin: 0 auto; padding: 0 0 4rem; }

section {
  max-width: calc(var(--maxw) + 2.5rem);
  margin: 0 auto 3.25rem;
  padding-inline: 1.25rem;
}
section.act,
section.reveal,
section.chain,
section.above,
section.two { max-width: calc(var(--wide) + 2.5rem); }

.hero {
  max-width: calc(var(--wide) + 2.5rem);
  margin-bottom: 2.5rem;
}
/* The band that leaves: full amber at the conversational end, gone at the top. */
.hero::after {
  content: "";
  display: block;
  height: 5px;
  margin-top: 1.6rem;
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber) 34%, var(--amber-dim) 62%, #2a2b2f 92%);
}

h1 {
  margin: .4rem 0 .5rem;
  font-size: clamp(2.1rem, 6.2vw, 3.9rem);
  line-height: 1.03;
  font-family: var(--display);
  font-weight: 400;
  font-variation-settings: "opsz" 110;
  letter-spacing: -.018em;
}

.deck {
  margin: 0 0 1.4rem;
  font: 500 clamp(1.05rem, 2.4vw, 1.35rem)/1.4 var(--utility);
  color: var(--ink-2);
  max-width: 44ch;
}

.lead {
  margin: 0 0 1.75rem;
  max-width: 42ch;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink);
}

h2 {
  margin: 0 0 .75rem;
  font-size: clamp(1.35rem, 3.4vw, 1.95rem);
  line-height: 1.18;
  font-family: var(--display);
  font-weight: 400;
  font-variation-settings: "opsz" 72;
  letter-spacing: -.014em;
}

h3 {
  margin: 1.5rem 0 .4rem;
  font: 600 .74rem/1.2 var(--utility);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

p { margin: 0 0 1rem; max-width: 64ch; }

.note {
  font-size: .93rem;
  color: var(--ink-2);
  border-left: 2px solid var(--rule);
  padding-left: .9rem;
}

.hint { font: 400 .88rem/1.45 var(--utility); color: var(--ink-3); }

.warn {
  font-size: .95rem;
  color: var(--warn);
  border-left: 2px solid var(--warn);
  padding-left: .9rem;
}

/* ------------------------------------------------------------ evidence strip */

.strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: .1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.strip li { padding: .75rem .9rem .75rem 0; min-width: 0; }

.strip b {
  display: block;
  font: 600 .95rem/1.3 var(--utility);
  color: var(--ink);
}

.strip span {
  display: block;
  margin-top: .15rem;
  font: 500 .68rem/1.25 var(--utility);
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* -------------------------------------------------------------- the buttons */

.btn {
  font: 600 .8rem/1 var(--utility);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .75rem 1.15rem;
  min-height: 44px;
  border-radius: 2px;
  border: 1px solid transparent;
  background: var(--ink);
  color: #17181a;
  cursor: pointer;
}
.btn:hover { background: #fff; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--rule); }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink-3); }
.btn.ghost:disabled:hover { color: var(--ink-2); border-color: var(--rule); }
.btn.big { font-size: .92rem; padding: .95rem 1.5rem; }

/* A tone button says out loud that it makes a sound, and shows when it does. */
.tone {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: .7rem 1.1rem;
  border: 1px solid var(--amber-dim);
  border-radius: 2px;
  background: var(--bg-2);
  color: var(--amber-2);
  font: 600 .82rem/1 var(--utility);
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
}
.tone:hover { border-color: var(--amber); background: #24262a; }
.tone:disabled { opacity: .38; cursor: not-allowed; }
.tone:disabled:hover { border-color: var(--amber-dim); background: var(--bg-2); }
.tone-wide { width: 100%; justify-content: center; }
.tone-ico {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--amber-dim);
  flex: none;
}
.tone.on { border-color: var(--amber); color: var(--amber-2); }
.tone.on .tone-ico { background: var(--amber); box-shadow: 0 0 0 4px rgba(224, 166, 66, .22); }

/* ------------------------------------------------------------------ the rig */

.rig {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: clamp(1rem, 3vw, 1.6rem);
  margin: 1.5rem 0 1rem;
  max-width: var(--maxw);
}

.rig-head {
  margin: 0 0 .7rem;
  font: 600 .72rem/1.2 var(--utility);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.check {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 44px;
  padding: .35rem 0;
  font: 400 .95rem/1.45 var(--utility);
  color: var(--ink-2);
  cursor: pointer;
}
.check input {
  margin: 0;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--amber);
  flex: none;
}

.rig-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem .8rem;
  margin: 1rem 0 .5rem;
}

.nojs { display: none; }

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

.stage {
  background: #101114;
  border: 1px solid var(--rule);
  border-radius: 2px;
  margin: 1.5rem 0 .5rem;
  padding: clamp(1.6rem, 5vw, 3rem) clamp(1rem, 4vw, 2.5rem);
  min-height: 17rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stage-cover,
.stage-run { width: 100%; max-width: 34rem; }
.stage-cover p { margin: 0 auto 1.2rem; max-width: 34ch; color: var(--ink-2); }

.trial {
  margin: 0 0 1rem;
  font: 600 .74rem/1.2 var(--utility);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.dots {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: .45rem;
  margin: 0 0 1.6rem;
  padding: 0;
}
.dots li {
  width: 1.5rem;
  height: 3px;
  background: var(--rule);
}
.dots li.done { background: var(--amber-dim); }
.dots li.now { background: var(--amber); }

/* Lit while a tone is running. It carries no level information on purpose:
   a moving meter would let the eye answer the question instead of the ear. */
.pulse {
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto 1.6rem;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: #15161a;
}
.pulse.live {
  border-color: var(--amber);
  background: radial-gradient(circle, rgba(224, 166, 66, .35), transparent 70%);
}

.stage-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem .8rem;
}

/* ---------------------------------------------------------- the audiogram */

.audio {
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 400;
  display: block;
  margin: 1.5rem 0 .75rem;
  overflow: visible;
}

.gl { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ax { fill: var(--ink-3); font: 500 13px var(--utility); }
.axtitle {
  fill: var(--ink-3);
  font: 600 12px var(--utility);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.agecurve { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; opacity: .82; }
.agelabel { font: 600 13px var(--utility); }
.youline {
  fill: none;
  stroke: var(--you);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.youdot { fill: var(--you); }
.youdot.censored { fill: none; stroke: var(--you); stroke-width: 2; stroke-dasharray: 2 2; }

.keys {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  margin: 0 0 1.25rem;
  padding: 0;
  font: 500 .78rem/1.3 var(--utility);
  color: var(--ink-2);
}
.keys li { display: flex; align-items: center; gap: .4rem; }
.keys i { width: 1rem; height: 3px; display: inline-block; }
.k-you { background: var(--you); }

.verdict {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--you);
  padding-left: .9rem;
}

/* ------------------------------------------------------------- the pickers */

.picker { margin: 1.75rem 0 .6rem; }
.picker-head {
  display: block;
  margin-bottom: .5rem;
  font: 600 .72rem/1.2 var(--utility);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.segs { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.seg {
  min-height: 44px;
  padding: .6rem .95rem;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  color: var(--ink-2);
  font: 500 .84rem/1 var(--utility);
  cursor: pointer;
  border-radius: 2px;
}
.seg:hover { color: var(--ink); border-color: var(--ink-3); }
.seg.on { background: var(--amber); border-color: var(--amber); color: #17181a; font-weight: 600; }

/* ----------------------------------------------------------------- the tilt */

.tilt {
  margin: 2rem 0 1rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--amber);
  border-radius: 2px;
}
.tilt h3 { margin-top: 0; color: var(--amber-2); }
.tilt p { max-width: 60ch; }

.tilt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .5rem;
  margin: 1.25rem 0 .75rem;
  font: 500 .84rem/1.4 var(--utility);
  color: var(--ink-2);
}
.tilt-row input[type="range"] { width: 100%; accent-color: var(--amber); height: 44px; }
.tilt-row output {
  font: 600 .95rem/1 var(--utility);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tilt-result {
  margin: 0;
  font: 400 clamp(1.4rem, 4vw, 2rem)/1.15 var(--display);
  font-variation-settings: "opsz" 90;
  color: var(--ink);
}

/* --------------------------------------------------------------- the ladder */

.ladder {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
  gap: .9rem;
  margin: 1.25rem 0;
  padding: 0;
}
.ladder li {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: .8rem;
}
.mark { display: flex; gap: 2px; margin-top: .6rem; }
.mark .seg { flex: 1; text-align: center; }

/* ----------------------------------------------------------- visual scenes */

.scene-light,
.method-scene,
.sources-scene {
  max-width: none;
  padding-block: clamp(2.75rem, 7vw, 5.25rem);
  padding-inline: max(1.25rem, calc((100% - var(--wide)) / 2));
  color: var(--paper-ink);
  background: var(--paper);
}

.scene-light + .scene-light { margin-top: -3.25rem; border-top: 1px solid var(--paper-rule); }
.scene-light > *,
.method-scene > *,
.sources-scene > * { margin-inline: auto; max-width: var(--wide); }
/* Prose on paper keeps the measure of the body column but stays flush with the
   headings above it, rather than floating in the middle of the wide band. */
.scene-light > p,
.method-scene > p,
.sources-scene > p { max-width: var(--maxw); margin-inline: 0; }

.scene-light h3,
.method-scene h3,
.sources-scene h3 { color: var(--paper-muted); }
.scene-light .note,
.method-scene .note,
.sources-scene .note { color: var(--paper-muted); border-color: var(--paper-rule); }

.method-scene {
  margin-top: -3.25rem;
  margin-bottom: 3.25rem;
  background: var(--paper-2);
}
.method-scene + .method-scene { margin-top: -3.25rem; border-top: 1px solid var(--paper-rule); }
.sources-scene { margin-top: -3.25rem; margin-bottom: 0; }

.tv-scene {
  max-width: none;
  padding-block: clamp(3rem, 8vw, 6rem);
  padding-inline: max(1.25rem, calc((100% - var(--maxw)) / 2));
  background:
    radial-gradient(ellipse at 50% 40%, rgba(224, 166, 66, .13), transparent 62%),
    #121316;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.mosquito-scene { border-left: 3px solid var(--warn); }

/* ------------------------------------------------------------ the figures */

.fig { margin: 1.5rem 0 1rem; }
.shift, .resp { width: 100%; height: auto; display: block; }
.shift { aspect-ratio: 1000 / 300; }
.resp { aspect-ratio: 1000 / 420; }
.cap {
  margin: .6rem 0 0;
  font: 400 .9rem/1.5 var(--utility);
  color: var(--paper-muted);
  max-width: 66ch;
}

/* On paper the two sexes are one dark bar and one pale, so the figure survives
   printing, greyscale and colour blindness without a second encoding. */
.bm { fill: #3f3c37; }
.bf { fill: #9c968b; }
/* The empty part of a track is the ears that gave no answer at all. */
.track { fill: #d6d1c6; }
.rowlab {
  fill: var(--paper-ink);
  font: 600 16px var(--utility);
}
.pct {
  fill: var(--paper-muted);
  font: 500 13px var(--utility);
  font-variant-numeric: tabular-nums;
}
.resp .ax { font-size: 13px; }
.scene-light .gl { stroke: var(--paper-rule); }
.scene-light .ax, .scene-light .axtitle { fill: var(--paper-muted); }

/* -------------------------------------------------------------- two columns */

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-top-width: 2px;
  border-radius: 2px;
  padding: 1.1rem;
}
.card.ok { border-top-color: var(--amber); }
.card.open { border-top-color: var(--cool); }
.card h3 { margin-top: 0; }
.card p { margin: 0; color: var(--ink-2); font-size: .98rem; }

/* ------------------------------------------------------------------ tables */

.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font: 400 .92rem/1.4 var(--utility);
}
.tbl caption {
  text-align: left;
  font: 600 .72rem/1.2 var(--utility);
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--paper-muted);
  padding-bottom: .5rem;
}
.tbl th,
.tbl td {
  text-align: left;
  padding: .5rem .7rem .5rem 0;
  border-bottom: 1px solid var(--paper-rule);
  font-variant-numeric: tabular-nums;
}
.method-scene .tbl { max-width: 50rem; }
.tbl th { color: var(--paper-muted); font-weight: 600; font-size: .78rem; }
.tbl td { color: var(--paper-ink); }

/* ----------------------------------------------------------------- sources */

.srcs { list-style: none; margin: 0; padding: 0; }
.srcs li { padding: .85rem 0; border-bottom: 1px solid var(--paper-rule); }
.srcs a {
  color: var(--paper-link);
  font: 500 .98rem/1.4 var(--utility);
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.srcs a:visited { color: var(--paper-link-visited); }
.srcs a:hover { text-decoration-thickness: 2px; }
.srcs a:focus-visible { outline: 3px solid var(--paper-link); outline-offset: 4px; }
.srcs p { margin: .35rem 0 0; font-size: .92rem; color: var(--paper-muted); max-width: 70ch; }

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

.foot {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
}
.foot p { margin: 0; font: 400 .84rem/1.5 var(--utility); color: var(--ink-3); }

.totop {
  position: fixed;
  right: max(.85rem, env(safe-area-inset-right));
  bottom: max(.85rem, env(safe-area-inset-bottom));
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: .5rem .7rem;
  font: 600 .68rem/1 var(--utility);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 8;
}
.totop.on { opacity: 1; pointer-events: auto; }
.totop:hover { color: var(--ink); }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ------------------------------------------------------------- without js */

/* No script means no instrument. The controls that would do nothing are
   removed rather than left dead, and the reason is stated once. */
.no-js .rig,
.no-js .stage,
.no-js .ladder,
.no-js .rig-row { display: none; }
.no-js .nojs {
  display: block;
  font-size: .95rem;
  color: var(--ink-2);
  border-left: 2px solid var(--amber-dim);
  padding-left: .9rem;
  max-width: 60ch;
}
.no-js .totop {
  position: static;
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------- 404 */

.notfound { max-width: var(--maxw); margin: 0 auto; padding: 5rem 1.25rem; }
.notfound a { color: var(--ink); }

/* ------------------------------------------------------------- responsive */

@media (min-width: 34rem) {
  .tilt-row {
    grid-template-columns: minmax(0, 18rem) minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
  }
}

@media (max-width: 44rem) {
  .audio { aspect-ratio: 1000 / 460; }
  /* Type inside an SVG shrinks with the drawing, so on a phone the labels are
     set in viewBox units large enough to survive the scale. The curve labels
     go entirely: the legend underneath already names every colour. */
  .audio .ax { font-size: 27px; }
  .audio .axtitle { font-size: 24px; }
  .agelabel { display: none; }
  .shift .ax { font-size: 26px; }
  .shift .axtitle { font-size: 24px; }
  .resp .ax { font-size: 26px; }
  .resp .rowlab { font-size: 28px; }
  .resp .pct { font-size: 22px; }
  .tbl thead { display: none; }
  .tbl tr { display: block; padding: .55rem 0; border-bottom: 1px solid var(--paper-rule); }
  .tbl td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .18rem 0; }
  .tbl td::before {
    content: attr(data-h);
    color: var(--paper-muted);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .08em;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
