/* A light page, on purpose: CHIMERA's own is a dark vector display, and this is not CHIMERA.
   Paper, ink and one green; the one orange is whatever is sounding now.
   The section is drawn as a duct and not as a body: the air is what has a colour, what is cut
   through is the card's own, and what moves in it has one step of the paper's. */
:root {
  --paper: #f6f4ee;
  --card: #fffefb;
  --ink: #22262b;
  --soft: #5f6670;
  --line: #d8d3c7;
  --band: #f7f5ee;
  --accent: #0b6b62;
  --accent-ink: #ffffff;
  --mark: #c2410c;
  --air: #cfe8e3;
  --flesh: #fffefb;
  --tongue: #ebe7dc;
  --lip: #ebe7dc;
  --tooth: #fffefb;
  --wall: #4c5760;
  --hard: #9aa0a6;
  --faint: #c9c3b5;
  --sans: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.65 var(--sans);
  padding-block: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.top, .lineage, .wall, footer { max-width: 76rem; margin-inline: auto; }
.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.75rem 1.5rem; padding-block: 1.4rem 0.4rem; }
.brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.9rem; min-width: 0; }
h1 { margin: 0; font-size: 1.5rem; letter-spacing: 0.06em; }
.tagline { margin: 0; color: var(--soft); }
.lineage { margin-block: 0.2rem 1rem; color: var(--soft); max-width: 76rem; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 2px; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.1rem; }
.links a { font-size: 0.88rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.links a::after { content: " \2197"; font-weight: 400; }
.links a:hover { text-decoration: underline; }
.hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 2px; }
.segmented button { border: 0; background: transparent; padding: 0.25rem 0.95rem; border-radius: 999px; font: inherit; color: var(--soft); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.wall { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1rem; align-items: start; }
.right { display: grid; gap: 1rem; min-width: 0; }
.screen { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem 1rem; min-width: 0; }
.s-tract { position: sticky; top: 0.75rem; }
.bar { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.5rem; }
.bar.inner { margin-top: 0.9rem; }
h2 { margin: 0; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.sub { color: var(--soft); font-size: 0.8rem; }
.toggle { margin-left: auto; padding: 0.05rem 0.7rem; border-radius: 999px; font-size: 0.78rem; color: var(--soft); white-space: nowrap; }
.toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

canvas { display: block; width: 100%; }
.tract { aspect-ratio: 124 / 128; max-height: 60vh; }
.tube { height: 84px; }
.score { height: 400px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }

.readouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem 0.6rem; margin: 0.5rem 0 0; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.readouts div { min-width: 0; }
.readouts div.wide { grid-column: span 2; }
.readouts dt { font-size: 0.72rem; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readouts dd { margin: 0; font-size: 0.95rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); }

textarea { width: 100%; padding: 0.6rem 0.75rem; font: inherit; font-size: 1.05rem; border: 1px solid var(--line); border-radius: 8px; resize: vertical; background: #fff; color: var(--ink); }
textarea:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.6rem; }
button { font: inherit; padding: 0.4rem 1.3rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; min-width: 6.5rem; }
button:disabled { opacity: 0.45; cursor: default; }
#status { color: var(--soft); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.phones { margin: 0.6rem 0 0; font-family: var(--mono); font-size: 0.82rem; color: var(--soft); overflow-wrap: anywhere; line-height: 1.9; }
.phones span { padding: 0.1rem 0.18rem; border-radius: 4px; }
.phones span.now { background: var(--mark); color: #fff; }
.phones span.quiet { opacity: 0.45; }
.examples { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.examples button { padding: 0.15rem 0.7rem; border-radius: 999px; font-size: 0.82rem; color: var(--soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dials { display: grid; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); gap: 0.9rem 1.75rem; }
.dial label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.dial output { font-weight: 400; color: var(--soft); font-variant-numeric: tabular-nums; }
.dial input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0.2rem 0 0; }
.dial .check { display: inline; font-weight: 400; white-space: nowrap; }
.note { margin: 0.1rem 0 0; font-size: 0.78rem; color: var(--soft); }
.note.live::before { content: ""; display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--mark); margin-right: 0.4em; vertical-align: 0.08em; }
.s-score .note { margin-top: 0.5rem; }

footer { padding-block: 1rem 2.5rem; color: var(--soft); font-size: 0.82rem; }
footer p { margin: 0 0 0.4rem; }

@media (max-width: 900px) {
  /* one column, the text first: the body is drawn right under the button that makes it speak */
  .wall { grid-template-columns: minmax(0, 1fr); }
  .right { display: contents; }
  .s-say { order: 1; }
  .s-tract { position: static; order: 2; }
  .s-voice { order: 3; }
  .s-score { order: 4; }
  .tract { max-height: 46vh; }
  .score { height: 360px; }
}
