/* SoundEscape — a cyanotype listening chart.
   The field is the exposed emulsion (Prussian blue, pale ink); the key is the
   unexposed paper margin (paper white, Prussian ink). One warm accent: the sun,
   for "you" and for what's live. */

/* Fonts are served from this site, not Google, so no visitor IP goes to a third
   party (SIL OFL 1.1, see THIRD-PARTY-NOTICES.md). Latin and Latin Extended only. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 400 500;
  font-stretch: 87.5%;
  font-display: swap;
  src: url("../fonts/martian-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 400 500;
  font-stretch: 87.5%;
  font-display: swap;
  src: url("../fonts/martian-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --field-hi: #22508f;
  --field: #183f7d;
  --field-lo: #0c2756;
  --on-field: #eaf1fb;
  --on-field-2: #bccde9;
  --on-field-3: rgba(234, 241, 251, 0.56);
  --chart: rgba(234, 241, 251, 0.2);
  --chart-strong: rgba(234, 241, 251, 0.42);
  --sun: #ffc94d;

  --paper: #eef1f2;
  --paper-2: #e2e8eb;
  --ink: #11316a;
  --ink-2: #435f8e;
  --rule: rgba(17, 49, 106, 0.13);
  --rule-strong: rgba(17, 49, 106, 0.32);

  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --num: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --key-w: 392px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1a31;
    --paper-2: #16253f;
    --ink: #e4ecf8;
    --ink-2: #a8bad7;
    --rule: rgba(228, 236, 248, 0.1);
    --rule-strong: rgba(228, 236, 248, 0.26);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.45 var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font: inherit; color: inherit; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--key-w);
  height: 100vh;
  height: 100svh;
}

/* ------------------------------------------------------------------ field */

.field {
  position: relative;
  overflow: hidden;
  color: var(--on-field);
  background-color: var(--field);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='720'%3E%3Cfilter id='m' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0042 0.0058' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.03 0 0 0 0 0.1 0 0 0 0 0.27 2.4 0 0 0 -0.95'/%3E%3C/filter%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.92 0 0 0 0 0.95 0 0 0 0 1 0 0 0 1.6 -0.92'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.22'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 70% 68% at 50% 50%, var(--field-hi) 0%, var(--field) 52%, var(--field-lo) 100%);
  background-size: 720px 720px, 100% 100%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.field__air,
.field__chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.field__chart { pointer-events: none; overflow: visible; }

.field__sources { position: absolute; inset: 0; }

.chart__axis { fill: none; stroke: var(--chart); stroke-width: 1; stroke-dasharray: 1 6; }
.chart__ring { fill: none; stroke: rgba(234, 241, 251, 0.15); stroke-width: 1; }
.chart__core { fill: rgba(234, 241, 251, 0.05); stroke: var(--chart); stroke-width: 1; stroke-dasharray: 2 4; }
.chart__edge { fill: none; stroke: var(--chart-strong); stroke-width: 1.25; }
.chart__ticks { fill: none; stroke: var(--chart-strong); stroke-width: 1; }
.chart__db {
  transition: opacity 0.25s;
  font: 400 10px/1 var(--num);
  fill: var(--on-field-2);
  paint-order: stroke;
  stroke: var(--field);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.chart__edge-label {
  transition: opacity 0.3s var(--ease);
  font: 500 12px/1 var(--sans);
  letter-spacing: 0.02em;
  fill: var(--on-field-2);
}

.listener__icon { fill: var(--sun); }
/* The edge caption explains the empty chart; open groups need the orbit's room. */
.has-open .chart__edge-label { opacity: 0; }
.listener__lr { font: 500 9.5px/1 var(--num); fill: var(--sun); text-anchor: middle; }

.field__hint {
  position: absolute;
  left: 50%;
  top: calc(50% + 40px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(82%, var(--hint-w, 420px));
  margin: 0;
  text-align: center;
  text-wrap: balance;
  font-size: 14px;
  line-height: 1.45;
  color: var(--on-field);
  text-shadow: 0 0 6px var(--field), 0 0 2px var(--field);
  pointer-events: none;
}

.field__hint { transition: opacity 0.6s var(--ease); }
/* Once a group is open, the hint moves on to its second step, and takes less room. */
.hint--open { display: none; }
.has-open .hint--closed { display: none; }
.has-open .hint--open { display: inline; }
.app:not(.is-empty) .field__hint { opacity: 0; }

.field__brand { display: none; }

.field__edge {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  pointer-events: none;
}
.edge__paper { fill: var(--paper); }

/* sound marks ------------------------------------------------------------ */

.src {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.src__dot {
  position: absolute;
  left: -21px;
  top: -21px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--field);
  border: 1.25px dashed rgba(234, 241, 251, 0.5);
  color: rgba(234, 241, 251, 0.78);
  transition:
    background-color 0.35s var(--ease),
    color 0.35s var(--ease),
    border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    scale 0.3s var(--ease);
}

.src__dot .glyph { width: 22px; height: 22px; }

.src__spin {
  position: absolute;
  inset: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  opacity: 0;
  pointer-events: none;
}
.src__spin circle {
  fill: none;
  stroke: var(--sun);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 22 108;
}

.src__label {
  position: absolute;
  left: 0;
  top: 27px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 5px var(--field), 0 0 2px var(--field);
}
.src__name {
  font-size: 13px;
  font-weight: 560;
  line-height: 1.15;
  color: var(--on-field-2);
  transition: color 0.3s;
}
.src__short { display: none; }
.shelf-short .src:not(.is-in) .src__full { display: none; }
.shelf-short .src:not(.is-in) .src__short { display: inline; }
.src__level {
  font: 500 10.5px/1.2 var(--num);
  color: var(--on-field);
  min-height: 1.2em;
}
.src__level:empty { display: none; }

@media (hover: hover) {
  .src:hover .src__dot { border-color: var(--on-field); color: var(--on-field); }
  .src:hover .src__name { color: var(--on-field); }
}

.src.label-up .src__label { top: auto; bottom: 27px; }

.src.is-in .src__dot {
  background: var(--on-field);
  border: 1.25px solid var(--on-field);
  color: var(--field);
  box-shadow: 0 8px 20px -8px rgba(3, 14, 38, 0.75);
}
.src.is-in .src__name { color: var(--on-field); font-weight: 650; }
@media (hover: hover) {
  .src.is-in:hover .src__dot { scale: 1.06; }
}

.src.is-held { cursor: grabbing; z-index: 3; }
.src.is-held .src__dot { scale: 1.12; box-shadow: 0 14px 28px -10px rgba(3, 14, 38, 0.8); }

.src.is-loading .src__spin { opacity: 1; animation: spin 1.1s linear infinite; }
.src.is-error .src__dot {
  background: var(--field);
  border: 1.5px solid var(--on-field);
  color: var(--on-field);
}
.src.is-error .src__level { color: var(--on-field); font-family: var(--sans); font-size: 11.5px; }

.src:focus { outline: none; }
.src:focus-visible .src__dot { outline: 2px solid var(--sun); outline-offset: 4px; }

.is-dragging, .is-dragging * { cursor: grabbing !important; }

@keyframes spin { to { rotate: 360deg; } }

/* Sounds tucked into a closed category: they fly in, then fade. The shrink goes on
   the dot, never on .src: .src is placed by `transform`, and a `scale` there would
   scale that placement from the field's corner, so sounds would fly in from it. */
.src { transition: opacity 0.3s var(--ease); }
.src.is-tucked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease 0.28s, visibility 0s linear 0.62s;
}
.src.is-tucked .src__dot { scale: 0.5; }

/* category marks ---------------------------------------------------------- */

.cat {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cat__dot {
  position: absolute;
  left: -24px;
  top: -24px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--field);
  border: 1.5px solid rgba(234, 241, 251, 0.78);
  color: var(--on-field);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), scale 0.3s var(--ease);
}
.cat__dot .glyph { width: 24px; height: 24px; }
.cat.is-open .cat__dot { background: #2b5694; border-color: var(--on-field); }
/* On an orbit too small to share, an open group has it to itself: the other
   categories step away until it closes. */
.cat { transition: opacity 0.3s var(--ease); }
.cat.is-away {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), visibility 0s linear 0.2s;
}

.cat__chip {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--on-field);
  color: var(--field);
  transition: rotate 0.35s var(--ease);
}
.cat__chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.cat.is-open .cat__chip { rotate: 45deg; }

.cat__label {
  position: absolute;
  left: 0;
  top: 31px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 5px var(--field), 0 0 2px var(--field);
}
.cat.label-up .cat__label { top: auto; bottom: 31px; }
.cat__name { font-size: 13.5px; font-weight: 680; line-height: 1.15; color: var(--on-field); }
.cat__count { font: 500 10.5px/1.2 var(--num); color: var(--sun); }
.cat__count:empty { display: none; }

.cat:focus { outline: none; }
.cat:focus-visible .cat__dot { outline: 2px solid var(--sun); outline-offset: 4px; }

@media (hover: hover) {
  .cat:hover .cat__dot { scale: 1.05; border-color: var(--on-field); }
}

/* -------------------------------------------------------------------- key */

.key {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
  --pad-top: 44px;
  padding: var(--pad-top) 36px 36px 26px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.07 0 0 0 0 0.19 0 0 0 0 0.42 0 0 0 1.4 -0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.35'/%3E%3C/svg%3E");
}

.wordmark {
  margin: 0;
  font-size: 46px;
  line-height: 0.92;
  font-weight: 760;
  font-variation-settings: "wdth" 76;
  letter-spacing: -0.03em;
}

/* "Sound" light, "Escape" heavy: the capital E must read, or it's "soundscape". */
.brand__sound { font-weight: 360; letter-spacing: -0.02em; }

.lede {
  margin: 14px 0 0;
  max-width: 33ch;
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* transport */

.transport {
  position: sticky;
  top: calc(-1 * var(--pad-top)); /* sticky insets count from inside the key's padding */
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 20px 0;
  margin-block: -1px 0;
  border-block: 1px solid var(--rule);
  background: var(--paper);
}

.play {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  box-shadow: 0 10px 22px -12px rgba(9, 28, 66, 0.8);
  transition: scale 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
@media (hover: hover) {
  .play:hover { scale: 1.04; }
}
.play:active { scale: 0.97; }
.play:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.play__icon { width: 26px; height: 26px; fill: currentColor; }
.play__label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.play__bars { display: none; }
.is-playing .play__tri { display: none; }
.is-playing .play__bars { display: inline; }

.transport__meta { display: grid; gap: 8px; min-width: 0; }

.transport__status {
  margin: 0;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.3;
  text-wrap: pretty;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.transport__status::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rule-strong);
  transform: translateY(-1px);
  transition: background 0.3s;
}
.is-playing:not(.is-empty) .transport__status::before {
  background: var(--sun);
  box-shadow: 0 0 0 3px rgba(255, 201, 77, 0.28);
}

.volume { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.volume__label { font-size: 12px; color: var(--ink-2); }

/* range inputs: a hairline track filled in ink, a ring thumb */

.range {
  --fill: 50%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--ink) var(--fill), var(--rule-strong) var(--fill));
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  transition: scale 0.15s;
}
.range:active::-webkit-slider-thumb { scale: 1.15; }
.range::-moz-range-track { height: 2px; border-radius: 2px; background: var(--rule-strong); }
.range::-moz-range-progress { height: 2px; border-radius: 2px; background: var(--ink); }
.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}
.range:focus { outline: none; }
.range:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* option rows, set like a printed key: name, dotted leader, value */

.tools { display: grid; margin-top: -12px; }

.tool {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 6px 2px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  text-align: left;
}
button.tool { cursor: pointer; }
.tool__name { font-size: 14px; font-weight: 520; }
.tool__left {
  font: 400 11px/1 var(--num);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tool__value {
  margin-left: auto;
  font-size: 13.5px;
  font-weight: 560;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.tool:focus { outline: none; }
.tool:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 6px; }

.seg {
  margin-left: auto;
  display: inline-flex;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  overflow: hidden;
}
.seg__opt {
  min-width: 34px;
  padding: 5px 7px;
  border: 0;
  border-left: 1px solid var(--rule);
  background: none;
  font: 500 11.5px/1 var(--num);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.seg__opt:first-child { border-left: 0; font-family: var(--sans); font-size: 12.5px; }
.seg__opt[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg__opt:focus { outline: none; }
.seg__opt:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }

.switch {
  margin-left: auto;
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  transition: background-color 0.2s var(--ease);
}
.switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink);
  transition: translate 0.25s var(--ease), background-color 0.2s;
}
[role="switch"][aria-checked="true"] .switch { background: var(--ink); }
[role="switch"][aria-checked="true"] .switch__knob { translate: 14px 0; background: var(--paper); }

@media (hover: hover) {
  button.tool:hover .tool__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
  .seg__opt:not([aria-pressed="true"]):hover { background: var(--paper-2); color: var(--ink); }
}

/* sound list */

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  font-variation-settings: "wdth" 84;
  letter-spacing: -0.015em;
}

.family { margin-top: 16px; }
.family__title {
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.rows { list-style: none; margin: 0; padding: 0; }
.row { border-top: 1px solid var(--rule); }
.row:last-child { border-bottom: 1px solid var(--rule); }

.row__toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 6px 8px 2px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s;
}
@media (hover: hover) {
  .row__toggle:hover { background: var(--paper-2); }
}
.row__toggle:focus { outline: none; }
.row__toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.row__glyph {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed var(--rule-strong);
  color: var(--ink-2);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.row__glyph .glyph { width: 17px; height: 17px; }
.row__name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__state {
  font: 400 11px/1.2 var(--num);
  color: var(--ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.row__state.is-words { font: 400 12.5px/1.2 var(--sans); }
.row.is-in .row__glyph { background: var(--ink); border: 1px solid var(--ink); color: var(--paper); }
.row.is-in .row__name { font-weight: 640; }
.row.is-in .row__state { color: var(--ink); }
.row.is-error .row__glyph { background: none; border: 1.5px solid var(--ink); color: var(--ink); }
.row.is-error .row__state { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.row__level {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 0 6px 10px 44px;
}
.row__level[hidden] { display: none; }
.row__far,
.row__near { font-size: 11.5px; color: var(--ink-2); }

/* starting points */

.clear {
  border: 0;
  background: none;
  padding: 4px 2px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  border-radius: 4px;
}
@media (hover: hover) {
  .clear:hover { color: var(--ink); }
}
.clear:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.is-empty .clear { visibility: hidden; }

.mixes__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.mix {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 11px 12px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
@media (hover: hover) {
  .mix:hover { background: var(--paper-2); border-color: var(--ink); }
}
.mix:active { background: var(--paper-2); }
.mix:focus { outline: none; }
.mix:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mix__name { font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.mix__glyphs { display: flex; gap: 4px; color: var(--ink-2); }
.mix__glyphs .glyph { width: 16px; height: 16px; }

/* footer */

.key__foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.key__foot p { margin: 0 0 8px; max-width: 46ch; }
.key__foot p:last-child { margin-bottom: 0; }
.key__foot strong { color: var(--ink); font-weight: 600; }
.key__foot a, .consent a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.key__foot a:focus-visible, .consent a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

/* Consent for anonymous counts (EU, EEA, UK, Switzerland). A note on paper, not a
   wall: the field stays usable, and both answers weigh the same. */
.consent {
  position: fixed;
  z-index: 30;
  left: 20px;
  bottom: 20px;
  width: min(360px, calc(100vw - 40px));
  padding: 16px 16px 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  box-shadow: 0 18px 40px -22px rgba(3, 14, 38, 0.75);
}
.consent[hidden] { display: none; }
.consent__title { margin: 0 0 4px; font-size: 15px; font-weight: 650; }
.consent__text { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.consent__btn {
  padding: 9px 10px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
@media (hover: hover) {
  .consent__btn:hover { background: var(--paper-2); }
}
.consent__btn:focus { outline: none; }
.consent__btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 860px) {
  .consent { left: 12px; right: 12px; width: auto; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 4px;
  margin-inline: 1px;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 500 10.5px/1.4 var(--num);
  text-align: center;
  color: var(--ink);
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
}

/* --------------------------------------------------------------- compact */

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100svh;
  }

  .field { height: min(118vw, 66svh); min-height: 360px; }

  .field__edge { top: auto; bottom: 0; left: 0; width: 100%; height: 30px; }

  .field__brand {
    display: block;
    position: absolute;
    top: calc(14px + env(safe-area-inset-top, 0px));
    left: 18px;
    margin: 0;
    font-size: 22px;
    font-weight: 760;
    font-variation-settings: "wdth" 76;
    letter-spacing: -0.03em;
    color: var(--on-field);
  }

  .field__hint { top: calc(50% + 30px); font-size: 13px; }

  .src__dot { left: -17px; top: -17px; width: 34px; height: 34px; }
  .src__dot .glyph { width: 19px; height: 19px; }
  .src__label { top: 21px; }
  .src__name { font-size: 12px; }
  .cat__dot { left: -20px; top: -20px; width: 40px; height: 40px; }
  .cat__dot .glyph { width: 21px; height: 21px; }
  .cat__label { top: 26px; }
  .cat.label-up .cat__label { bottom: 26px; }
  .cat__name { font-size: 12.5px; }
  /* Small field: an open category's sounds name it already; the × closes it. */
  .cat.is-open .cat__label { display: none; }
  .src__full { display: none; }
  .src__short { display: inline; }
  .src:not(.is-in) .src__name { font-size: 10.5px; }
  .src.label-up .src__label { bottom: 21px; }

  .key {
    overflow: visible;
    padding: 18px 20px calc(118px + env(safe-area-inset-bottom, 0px));
    gap: 24px;
  }
  .wordmark { display: none; }
  .lede { margin-top: 0; font-size: 15px; }

  .transport {
    position: fixed;
    top: auto;
    margin: 0;
    z-index: 10;
    left: 0;
    right: 0;
    bottom: 0;
    gap: 14px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--paper);
    border-top: 1px solid var(--rule);
    border-bottom: 0;
    box-shadow: 0 -10px 30px -18px rgba(9, 28, 66, 0.55);
  }
  .play { width: 54px; height: 54px; }
  .play__icon { width: 22px; height: 22px; }
  .transport__status { font-size: 13.5px; }

  .tools { margin-top: 0; }
}

@media (max-width: 380px) {
  .mixes__list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .src.is-loading .src__spin { animation: none; stroke-dasharray: 4 6; }
}
