:root {
  --fg: #f3f5ff;
  --dim: rgba(243, 245, 255, 0.62);
  --faint: rgba(243, 245, 255, 0.54);
  --line: rgba(255, 255, 255, 0.11);
  --line-2: rgba(255, 255, 255, 0.2);
  --glass: rgba(8, 9, 18, 0.36);
  --glass-2: rgba(8, 9, 18, 0.62);
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Geist", ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --irid: linear-gradient(100deg, #8af3ff 0%, #a493ff 24%, #ff9fd6 48%, #ffd59a 70%, #9dffc8 88%, #8af3ff 100%);
  --spec: linear-gradient(90deg, #ff5d3d 0%, #ffad4a 18%, #f3ee72 34%, #7dffb2 52%, #5ad7ff 70%, #8d8bff 86%, #e48dff 100%);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --hud: 11px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; } /* clip: not even scrollIntoView may scroll sideways */
body {
  background: #05060c;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body { overflow: hidden; height: 100vh; } /* no view scrolls the page; the result changes screens instead (pager in main.js) */
button, input { font: inherit; color: inherit; }
/* dragging across the page stirs the fluid; don't select decorative text */
.hud, .hero h1, .tagline, .hint, .ld, .ident .label, .stats { -webkit-user-select: none; user-select: none; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: rgba(164, 147, 255, 0.45); }

#fluid {
  position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0;
  background: radial-gradient(120% 90% at 50% 40%, #1a1440, #05060c);
}
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 6, 12, 0.62) 0%, rgba(5, 6, 12, 0.28) 38%, rgba(5, 6, 12, 0.18) 60%, rgba(5, 6, 12, 0.34) 100%);
  opacity: 0; transition: opacity 1.2s var(--ease);
}
body[data-view="result"] .veil { opacity: 1; }

/* ---------------------------------------------------------------- HUD */
.label, .hud, .tick, .hud-btn, .pill, .tag, .log {
  font-family: var(--mono);
  font-size: var(--hud);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.tick::before {
  content: ""; display: inline-block; width: 3px; height: 9px; margin-right: 7px;
  background: currentColor; vertical-align: -1px; opacity: 0.85;
}

.hud { position: fixed; left: 0; right: 0; z-index: 20; display: flex; align-items: center; padding: 14px 18px; }
.hud-top { top: 0; justify-content: space-between; gap: 16px; }
.hud-bottom { bottom: 0; gap: 22px; white-space: nowrap; }
.hud::before { content: ""; position: absolute; left: 0; right: 0; height: 90px; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.8s; }
.hud-top::before { top: 0; background: linear-gradient(to bottom, rgba(5, 6, 12, 0.7), transparent); }
.hud-bottom::before { bottom: 0; background: linear-gradient(to top, rgba(5, 6, 12, 0.8), transparent); }
body[data-view="result"] .hud::before { opacity: 1; }
.hud b { font-weight: 400; color: var(--fg); margin-left: 6px; }
.hud-bottom .tick { color: var(--dim); }
.credit { margin-left: 6px; color: var(--dim); } /* sits with tempo, tom and espectro on the left */
.author { color: var(--fg); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a.author[href]:hover { text-decoration-color: transparent; }

.crumb { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.crumb .arrow { color: var(--faint); }
.mark { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.hud-right { display: flex; align-items: center; gap: 18px; }
.hud-btn {
  background: none; border: 0; padding: 4px 0; color: var(--fg);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.hud-btn:hover { border-color: var(--fg); }
#lib-count { color: var(--dim); margin-left: 4px; }

.live { display: inline-flex; align-items: center; gap: 7px; color: var(--dim); }
.live .dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--faint); transition: all 0.4s; }
.live.on { color: var(--fg); }
.live[hidden] { display: none; }
.live.on .dot { border-color: transparent; background: #8affc8; }

.mini { flex: 0 1 380px; opacity: 0; pointer-events: none; transition: opacity 0.6s var(--ease); }
body:not([data-view="result"]):not([data-view="error"]) .mini { display: none; }
.crumb, .live, .hud-btn, .sound-btn { white-space: nowrap; }
body[data-view="result"] .mini, body[data-view="error"] .mini { opacity: 1; pointer-events: auto; }
.mini input {
  width: 100%; background: rgba(8, 9, 18, 0.35); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-family: var(--mono); font-size: var(--hud); letter-spacing: 0.04em;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); outline: none; transition: border-color 0.3s;
}
.mini input:focus { border-color: var(--line-2); }
.mini input::placeholder { color: var(--faint); text-transform: uppercase; }

/* spectrum stroke: a native range input, so click, drag and arrow keys all work */
.sw { display: inline-flex; align-items: center; }
.hue {
  -webkit-appearance: none; appearance: none; width: 150px; height: 18px; margin: 0 0 0 10px; padding: 0;
  background: transparent; cursor: crosshair;
}
.hue::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, hsl(0 85% 62%), hsl(60 85% 62%), hsl(120 85% 62%), hsl(180 85% 62%), hsl(240 85% 66%), hsl(300 85% 66%), hsl(359 85% 62%));
}
.hue::-moz-range-track {
  height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, hsl(0 85% 62%), hsl(60 85% 62%), hsl(120 85% 62%), hsl(180 85% 62%), hsl(240 85% 66%), hsl(300 85% 66%), hsl(359 85% 62%));
}
.hue::-webkit-slider-thumb {
  -webkit-appearance: none; width: 3px; height: 13px; margin-top: -5px; border-radius: 1px; background: var(--fg);
  transition: transform 0.2s var(--ease);
}
.hue::-moz-range-thumb { width: 3px; height: 13px; border: 0; border-radius: 1px; background: var(--fg); }
.hue:hover::-webkit-slider-thumb, .hue:active::-webkit-slider-thumb { transform: scaleY(1.35); }
.hue:focus { outline: none; }
.hue:focus-visible { outline: 1px solid var(--line-2); outline-offset: 3px; border-radius: 2px; }

/* background music: equaliser bars bounce at the station's tempo */
.sound { position: relative; }
.sound-btn { display: inline-flex; align-items: center; gap: 8px; }
#sound-label { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.eq i { width: 2px; height: 3px; background: currentColor; opacity: 0.75; }
.sound.on .eq i { animation: eq var(--beat, 0.5s) ease-in-out infinite alternate; }
.sound.on .eq i:nth-child(2) { animation-delay: calc(var(--beat, 0.5s) * -0.5); }
.sound.on .eq i:nth-child(3) { animation-delay: calc(var(--beat, 0.5s) * -0.25); }
.sound.on .eq i:nth-child(4) { animation-delay: calc(var(--beat, 0.5s) * -0.75); }
@keyframes eq { from { height: 2px; } to { height: 10px; } }
.sound-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; z-index: 30; display: grid; gap: 8px; padding: 12px;
  background: rgba(7, 8, 15, 0.8); border: 1px solid var(--line); border-radius: 8px;
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.sound-menu[hidden] { display: none; }
.sound-list { display: grid; }
.sound-opt {
  display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 8px; border: 0; border-radius: 4px;
  background: none; color: var(--dim); text-align: left;
  font-family: var(--mono); font-size: var(--hud); letter-spacing: 0.06em; text-transform: uppercase;
}
.sound-opt small { font-size: 11px; color: var(--faint); }
.sound-opt:hover, .sound-opt:focus-visible { background: rgba(255, 255, 255, 0.06); color: var(--fg); outline: none; }
.sound-opt[aria-checked="true"] { color: var(--fg); }
.sound-opt[aria-checked="true"] span::before { content: "▸ "; }
.sound-opt.off { border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; padding-top: 12px; }

/* the analysed track: a controller only (the official player lives off-screen) */
/* the services' players: inside the viewport (a lazy iframe off screen never loads) but invisible and behind everything */
.track-host { position: fixed; left: 0; bottom: 0; width: 320px; height: 180px; opacity: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.np { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center; max-width: 440px; }
.np-btn {
  position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--fg);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.np-btn:hover:not(:disabled) { transform: scale(1.06); }
.np-btn:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
.np-btn:disabled { opacity: 0.35; cursor: default; }
.np-btn::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-36%, -50%);
  border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent #07080f;
}
.np-btn.playing::before, .np-btn.playing::after {
  content: ""; position: absolute; top: 50%; width: 4px; height: 14px; border: 0; background: #07080f; transform: translate(-50%, -50%);
}
.np-btn.playing::before { left: calc(50% - 4px); }
.np-btn.playing::after { left: calc(50% + 4px); }
.np-btn.loading { animation: np-wait 1.4s ease-in-out infinite; }
@keyframes np-wait { 50% { opacity: 0.45; } }
.np-top { display: flex; justify-content: space-between; gap: 12px; color: var(--dim); margin-bottom: 6px; }
.np-bar { position: relative; height: 16px; cursor: pointer; }
.np-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; border-radius: 2px; background: var(--line-2); }
.np-bar i {
  position: absolute; left: 0; top: 7px; height: 2px; width: 0; border-radius: 2px;
  background: var(--irid); background-size: 220% 100%; animation: sheen 6s linear infinite;
}
.np-bar i::after { content: ""; position: absolute; right: -1px; top: -4px; width: 2px; height: 10px; background: var(--fg); }
.np-bar:focus-visible { outline: 1px solid var(--line-2); outline-offset: 4px; }
.np-embed { display: block; }
.np-embed iframe { display: block; width: 100%; border: 0; border-radius: 4px; }
.ident { overflow-y: auto; scrollbar-width: none; }
.ident::-webkit-scrollbar { display: none; }
.beat { display: inline-flex; }
#beat { width: 7px; height: 7px; border-radius: 50%; background: var(--fg); opacity: 0.12; transition: opacity 0.25s, transform 0.25s; }
#beat.on { opacity: 1; transform: scale(1.5); transition: none; }

/* ---------------------------------------------------------------- views */
main { position: relative; z-index: 5; }
.view { display: none; }
body[data-view="home"] #home,
body[data-view="loading"] #loading,
body[data-view="error"] #error { display: grid; min-height: 100vh; place-items: center; padding: 72px 18px; animation: fade 0.9s var(--ease) both; }
body[data-view="result"] #result { display: grid; animation: fade 0.9s var(--ease) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* home */
#home { position: relative; }
/* above the hexagons passing behind it, below the ones passing in front */
.hero {
  position: relative; z-index: 20; width: min(980px, 100%); min-width: 0; text-align: center; animation: rise 1.2s var(--ease) both;
  /* one spacing scale for the whole block: groups 40 apart, pairs 24 (search ↔ notes). The logo
     sits in the middle with the same air above and below (--gap-logo: tagline → logo = logo → search), and the two notes read as one paragraph, 4 apart */
  --gap-logo: calc(var(--gap-pair) + var(--gap-group));
  --col: 780px;            /* width shared by the search and the notes (≈ the tagline's line) */
  --gap-group: 40px;
  --gap-pair: 24px;
  --gap-tight: 4px;
}
.hero .url, .hero .hint, .hero .ai-note { max-width: var(--col); margin-left: auto; margin-right: auto; }
@media (max-width: 900px) { .hero { --gap-group: 32px; --gap-pair: 20px; } }
/* the name, set like the HUD (mono, caps) but at poster size */
/* the name: wide geometric caps drawn on a canvas (logo.js). The <h1> keeps only the word's
   size in the layout; the canvas spills around it so the pixel motion has room. */
/* centred on the hero's middle even when it is wider than the hero column */
.wordmark { position: relative; left: 50%; transform: translateX(-50%); width: min(900px, 88vw); aspect-ratio: 592 / 40; margin: 0 0 var(--gap-logo); cursor: crosshair; }
.wordmark[data-h="2"] { aspect-ratio: 592 / 80; }   /* twice the height, same width */
.wordmark canvas { position: absolute; left: -10%; top: -90%; width: 120%; height: 280%; display: block; pointer-events: none; }
.wordmark[data-h="2"] canvas { top: -45%; height: 190%; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tagline {
  margin: 0 0 var(--gap-logo); font-weight: 300; font-size: clamp(20px, 2.7vw, 36px); line-height: 1.12; letter-spacing: -0.025em;
}
.br-m { display: none; } /* one line on desktop, two on phones */
.tagline em, .irid-text {
  font-style: normal;
  background: var(--irid); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 12s linear infinite;
}
@keyframes sheen { to { background-position: 220% 0; } }

.url {
  position: relative; display: flex; align-items: center; gap: 8px;
  background: rgba(8, 9, 18, 0.38); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 6px 6px 24px;
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.url::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: var(--irid); background-size: 220% 100%; animation: sheen 6s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.5s var(--ease); pointer-events: none;
}
.url:focus-within::before { opacity: 1; }
.url input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 17px; padding: 12px 0;
}
.url input::placeholder { color: var(--faint); }
.url button, .pill {
  border: 0; border-radius: 999px; background: var(--fg); color: #07080f; padding: 16px 22px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  transition: transform 0.3s var(--ease), background 0.3s;
  /* label truly centred: flex centring, caps trimmed to their own height (no ascender/descender
     slack), and the trailing letter-space after the last glyph cancelled */
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7em; line-height: 1;
  text-box: trim-both cap alphabetic;
}
.url button > :last-child, .pill > :last-child { margin-right: -0.08em; }
.pill:hover { transform: translateX(2px); }
/* DECOMPOR: it stays put on hover; an iridescent glow spreads out from behind it and a thin ring
   ripples outward like a speaker cone. Both sit under the button (z-index -1 inside .url). */
.url button { position: relative; padding-right: calc(22px - 0.08em);
  transition: box-shadow 0.5s var(--ease), background 0.3s, scale 0.2s var(--ease); }
.url button::before, .url button::after {
  content: ""; position: absolute; border-radius: inherit; z-index: -1; pointer-events: none; opacity: 0;
  background: var(--irid); background-size: 220% 100%;
}
.url button::before { inset: -4px; filter: blur(18px); scale: 0.8;
  transition: opacity 0.6s var(--ease), scale 0.7s var(--ease); }
.url button::after { inset: -1px; padding: 2px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; }
.url button:hover, .url button:focus-visible {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 0 28px 4px rgba(255, 255, 255, 0.45); }
.url button:hover::before, .url button:focus-visible::before {
  opacity: 1; scale: 1.3; animation: sheen 5s linear infinite; }
.url button:hover::after, .url button:focus-visible::after { animation: ripple 1.4s var(--ease) infinite, sheen 5s linear infinite; }
.url button:active { scale: 0.97; }
@keyframes ripple {
  0% { inset: -1px; opacity: 1; }
  100% { inset: -22px; opacity: 0; }
}
.pill.ghost { background: none; color: var(--fg); border: 1px solid var(--line-2); }
/* the two notes under the search: same size, line height and width, one right after the other */
.hint, .ai-note { color: var(--dim); font-size: 14px; line-height: 1.5; text-wrap: balance; }
.hint { margin-top: var(--gap-pair); margin-bottom: 0; }
/* what the tool is for: learning, not generating music */
.ai-note { margin-top: var(--gap-tight); margin-bottom: 0; }
/* what Decomposer does: four columns, the icon on top and the text under it (two columns on a phone) */
.ic-defs { position: absolute; width: 0; height: 0; }
.what { list-style: none; margin: calc(var(--gap-pair) + 8px) auto 0; padding: 0; max-width: 980px; text-align: center;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 30px; }
.what li { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.what-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: rgba(8, 9, 18, 0.3); }
.what-ic svg { width: 18px; height: 18px; fill: none; stroke: url(#ic-irid); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.what p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.45; text-wrap: pretty; }
.what b { color: var(--fg); font-weight: 500; }
/* short computer screens: less air around the logo (and a smaller logo when very short), so the home fits */
@media (min-width: 701px) and (max-height: 760px) { .hero { --gap-logo: 40px; } .what { margin-top: 20px; } }
@media (min-width: 701px) and (max-height: 640px) { .hero { --gap-logo: 26px; } .wordmark { max-width: 64vw; } }
/* phones: the four items in two columns take room, so a little less air around a slightly smaller logo */
@media (max-width: 700px) { .hero { --gap-logo: 34px; } .wordmark { max-width: 68vw; } .what p { font-size: 12px !important; } }
/* short phones: tighter around the logo, a smaller logo and tighter lines, so the home still fits;
   if it still doesn't, the home scrolls instead of cutting the end */
@media (max-width: 700px) and (max-height: 760px) {
  .hero { --gap-logo: 22px; }
  .wordmark { max-width: 54vw; }
  .what { margin-top: 12px; gap: 10px 14px !important; }
  .what li { gap: 5px !important; }
  .what-ic { width: 26px !important; height: 26px !important; } .what-ic svg { width: 14px !important; height: 14px !important; }
  .what p { font-size: 12px !important; line-height: 1.32 !important; }
  body[data-view="home"] #home { padding-top: 62px; padding-bottom: 52px; }
}
@media (max-width: 700px) {
  body[data-view="home"] #home { height: 100vh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  body[data-view="home"] #home::-webkit-scrollbar { display: none; }
  .home-float { overflow: hidden; } /* hexagons leaving the screen must not make it scroll */
}
@media (max-width: 700px) {
  .what { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; max-width: 460px; }
  .what li { gap: 8px; }
  .what-ic { width: 30px; height: 30px; } .what-ic svg { width: 16px; height: 16px; }
  .what p { font-size: 12.5px; line-height: 1.4; }
}
.ai-note strong { font-weight: 500; color: var(--fg); }
/* home: the songs already decomposed orbit the centre (moved by main.js), one per artist.
   No z-index on the layer, so each hexagon can pass behind or in front of .hero */
.home-float { position: absolute; inset: 0; pointer-events: none; }
.hh {
  position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto;
  opacity: 0; transform-origin: 50% 50%; will-change: transform, opacity;
}
/* --blur (set by main.js) softens only the photo when it passes very close to the screen */
.hh .hex { --hs: inherit; display: block; filter: blur(var(--blur, 0px)); transition: scale 0.35s var(--ease); }
/* behind the globe: a little greyer */
.hh.is-back .hex { filter: blur(var(--blur, 0px)) saturate(0.5) brightness(0.72); }
.hh:hover .hex, .hh:focus-visible .hex { scale: 1.12; filter: brightness(1.18); }
.hh:focus-visible { outline: none; }
/* the name shows only on hover / focus */
.hh-tip {
  position: absolute; left: 50%; top: calc(100% + 10px); display: grid; gap: 2px; padding: 7px 10px; border-radius: 6px;
  background: rgba(8, 9, 18, 0.82); white-space: nowrap; text-align: center; pointer-events: none;
  opacity: 0; transform: translate(-50%, -4px); transition: opacity 0.25s, transform 0.25s var(--ease);
}
.hh-tip b { font-size: 13px; font-weight: 500; color: var(--fg); }
.hh-tip small { font: 500 10px/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.hh:hover .hh-tip, .hh:focus-visible .hh-tip { opacity: 1; transform: translate(-50%, 0); }
.hh.tip-up .hh-tip { top: auto; bottom: calc(100% + 10px); } /* low on the screen: the name goes above */
/* shown when the monthly cap on new analyses is reached */
.limit-note {
  margin: 16px auto 0; max-width: 520px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid rgba(255, 213, 154, 0.45); background: rgba(255, 213, 154, 0.08);
  color: #ffe2b8; font-size: 14px;
}
.limit-note[hidden] { display: none; }

/* loading */
.ld { width: min(620px, 100%); display: grid; gap: 34px; }
.track-id { display: flex; gap: 20px; align-items: center; animation: rise 0.9s var(--ease) both; }
.cover {
  width: 84px; height: 84px; flex: none; border-radius: 3px; overflow: hidden;
  background: var(--glass); border: 1px solid var(--line); background-size: cover; background-position: center;
}
.ld-title { font-size: clamp(24px, 3vw, 34px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; margin: 6px 0 4px; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; min-height: 160px; }
.log li { color: var(--faint); animation: rise 0.6s var(--ease) both; }
.log li:last-child { color: var(--fg); }
.log li:last-child::after { content: "▍"; margin-left: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* error */
.err { width: min(620px, 100%); display: grid; gap: 18px; }
.err h2 { font-weight: 300; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.03em; margin: 0; line-height: 1.05; }
.fix p { margin: 0 0 10px; }
.code {
  font-family: var(--mono); font-size: 14px; background: var(--glass-2); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 12px 16px; text-align: left; width: 100%;
}
.code::after { content: "copiar"; float: right; color: var(--faint); font-size: var(--hud); text-transform: uppercase; letter-spacing: 0.06em; }
.code.copied::after { content: "copiado"; color: #8affc8; }
.detail {
  font-family: var(--mono); font-size: 12px; color: var(--dim); white-space: pre-wrap; margin: 0;
  background: var(--glass); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; max-height: 180px; overflow: auto;
}
.err-actions { display: flex; gap: 10px; }

/* ---------------------------------------------------------------- result */
#result { grid-template-columns: minmax(340px, 40%) minmax(0, 1fr); min-height: 100vh; }
.ident {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center;
  gap: 22px; padding: 80px 4vw 70px 7vw;
}
.ident > * { animation: rise 1s var(--ease) both; }
.ident > *:nth-child(2) { animation-delay: 0.08s; }
.ident > *:nth-child(3) { animation-delay: 0.16s; }
.ident > *:nth-child(4) { animation-delay: 0.24s; }
.ident > *:nth-child(5) { animation-delay: 0.32s; }
.ident > *:nth-child(6) { animation-delay: 0.4s; }
.id-top { display: flex; gap: 16px; align-items: center; }
.id-top .cover { width: 56px; height: 56px; }
.id-state { display: grid; gap: 4px; }
.track-title { font-size: clamp(34px, 4.4vw, 64px); font-weight: 300; letter-spacing: -0.04em; line-height: 0.98; margin: 0; }
.track-artist { font-size: 18px; color: var(--dim); margin-top: 8px; }
.genre-path { font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; }
.genre-path .arrow { color: var(--faint); margin: 0 8px; }

.stats { display: flex; flex-wrap: wrap; row-gap: 14px; }
.stat { flex: 1 0 auto; min-width: 84px; padding: 2px 18px 2px 12px; border-left: 1px solid var(--line-2); display: grid; gap: 6px; align-content: start; }
.stat .v { font-size: 26px; font-weight: 300; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.stat .v small { font-size: 12px; color: var(--dim); margin-left: 3px; letter-spacing: 0; }
.meter { height: 3px; background: var(--line); margin-top: 8px; position: relative; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--irid); }

/* section menu: horizontal, at the base of the right-hand area */
.toc { position: absolute; left: 4vw; right: 7vw; bottom: 52px; z-index: 6; display: flex; border-top: 1px solid var(--line-2); pointer-events: auto; }
.toc a {
  flex: 1 1 0; position: relative; padding: 12px 14px 2px 0; white-space: nowrap; text-decoration: none;
  font-family: var(--mono); font-size: var(--hud); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); transition: color 0.3s;
}
.toc a .n { margin-right: 8px; }
.toc a::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 14px; height: 2px; background: var(--irid);
  transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease);
}
.toc a:hover { color: var(--dim); }
.toc a.on { color: var(--fg); }
.toc a.on::before { transform: none; }
.id-foot { display: flex; gap: 16px; flex-wrap: wrap; color: var(--faint); }
.id-foot button { background: none; border: 0; padding: 0; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }

.panels { position: relative; height: 100vh; pointer-events: none; }
/* one screen at a time: every block is stacked in place; a scroll gesture swaps the active one.
   A block taller than the screen scrolls inside its own stage. */
.pstage {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 84px 7vw 132px 4vw;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  opacity: 0; visibility: hidden; transform: translateY(40px);
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease), visibility 0s linear 0.6s;
}
.pstage.is-before { transform: translateY(-40px); }
/* a long block scrolling inside its stage fades out before reaching the top bar and the section menu */
.pstage {
  -webkit-mask-image: linear-gradient(to bottom, transparent 44px, #000 84px, #000 calc(100% - 136px), transparent calc(100% - 90px));
  mask-image: linear-gradient(to bottom, transparent 44px, #000 84px, #000 calc(100% - 136px), transparent calc(100% - 90px));
}
.pstage.is-active {
  opacity: 1; visibility: visible; transform: none; pointer-events: auto;
  transition: opacity 0.6s var(--ease) 0.15s, transform 0.8s var(--ease) 0.15s, visibility 0s;
}
.pstage > .panel { margin-block: auto; min-width: 0; } /* centred when short, from the top when tall */
/* no box around a panel: the space between the columns does the separating */
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 26px; }
.panel-head h3 { margin: 0; font-weight: 300; font-size: clamp(28px, 2.5vw, 44px); line-height: 1.05; letter-spacing: -0.03em; }
.panel-head h3 span { margin-right: 14px; font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 0.06em; color: var(--faint); vertical-align: 0.5em; }
.panel-head .aside { color: var(--faint); }
.lead { max-width: 34em; font-size: clamp(20px, 1.6vw, 30px); font-weight: 300; letter-spacing: -0.01em; line-height: 1.36; margin: 0 0 22px; }
p { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: var(--hud); letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 11px; color: var(--dim);
}
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin-top: 20px; align-items: baseline; }
.kv .label { color: var(--faint); }

/* layers intro: the minimal structure, made with what ships with Live */
.lyr-intro { display: grid; gap: 14px; margin: 0 0 26px; }
.lyr-intro .lead { margin: 0; }
.lyr-intro .lead b { font-weight: 500; }
.native { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 15px; line-height: 1.45; color: var(--fg); }
.native .tag { flex: none; padding: 4px 8px; }

/* spectrum */
.spectrum { margin: 4px 0 0; --bmin: 128px; } /* --bmin: narrow bands still show 16 readable steps */
/* columns: switch | name (up to 2 lines) | band | solo | info, with breathing room at both ends of the row */
.spec-head, .spec-row { display: grid; grid-template-columns: 48px 160px minmax(0, 1fr) 40px 40px; padding: 0 14px; }
.spec-head { grid-template-areas: "ncap ncap axis scap icap"; align-items: end; }
.spec-ncap { grid-area: ncap; color: var(--faint); white-space: nowrap; }
.spec-scap { grid-area: scap; justify-self: end; color: var(--faint); }
.spec-icap { grid-area: icap; justify-self: end; color: var(--faint); }
/* header labels sit on the same line as the Hz ticks (same size, line height and distance from the rule) */
.spec-ncap, .spec-scap, .spec-icap { padding-bottom: 6px; font-size: 11px; line-height: 1; border-bottom: 1px solid transparent; }
/* legend under the chart: how to read the bands */
.spec-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 14px 0 0; padding: 0 14px; color: var(--faint); }
.spec-legend span { display: inline-flex; align-items: center; gap: 7px; }
.spec-legend .lg { width: 10px; height: 12px; border-radius: 2px; background: rgba(6, 7, 14, 0.66); box-shadow: inset 0 0 0 1px var(--line-2); }
.spec-legend .lg.x { background: var(--irid); box-shadow: none; }
.spec-legend .lg.h { background: linear-gradient(rgba(6, 7, 14, 0.38), rgba(6, 7, 14, 0.38)), var(--irid); box-shadow: none; }
.spec-axis { grid-area: axis; position: relative; height: 18px; border-bottom: 1px solid var(--line); }
.spec-axis span {
  position: absolute; bottom: 6px; transform: translateX(-50%); line-height: 1;
  font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: 0.04em;
}
.spec-axis span:first-child { transform: none; }
.spec-axis span:last-child { transform: translateX(-100%); } /* 20k ends at the axis end, clear of the solo column */
.spec-row { grid-template-areas: "sw nm lane solo info"; align-items: center; min-height: 56px; padding-top: 6px; padding-bottom: 6px; cursor: pointer; }
/* a layer is one block: the row and, when open, its explanation share one surface.
   The whole row is a button; the block lights up on hover and stays lit while open. */
.lgroup { margin: 2px 0; border: 1px solid transparent; border-radius: 10px; transition: background 0.25s, border-color 0.25s; }
.lgroup:hover { background: rgba(255, 255, 255, 0.05); }
.lgroup.open { background: rgba(255, 255, 255, 0.075); border-color: var(--line-2); }
.spec-row .lsw { grid-area: sw; }
.spec-row .lsolo { grid-area: solo; }
.spec-row .nm {
  grid-area: nm; min-width: 0; padding-right: 14px; line-height: 1.4;
  font-family: var(--mono); font-size: var(--hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--dim);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; transition: color 0.3s;
}
/* the info button closes the row: a circled "i" that turns into × while the explanation is open */
.linfo {
  grid-area: info; justify-self: end; display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 1px solid rgba(243, 245, 255, 0.6); border-radius: 50%; background: none; color: var(--fg); cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.linfo::before { content: "i"; font: italic 700 13px/1 Georgia, "Times New Roman", serif; }
.lgroup:hover .linfo, .linfo[aria-expanded="true"] { background: var(--fg); border-color: var(--fg); color: #07080f; }
.linfo[aria-expanded="true"]::before { content: "×"; font: 400 16px/1 var(--mono); }
.linfo:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
.spec-row.open .nm { color: var(--fg); }
.lane { grid-area: lane; position: relative; height: 100%; background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px); }
.band {
  position: absolute; top: 11px; bottom: 11px; border-radius: 999px; background-image: var(--spec);
  width: max(var(--bw), var(--bmin));
  left: clamp(0px, calc(var(--bc) - max(var(--bw), var(--bmin)) / 2), calc(100% - max(var(--bw), var(--bmin))));
  transition: top 0.4s var(--ease), bottom 0.4s var(--ease), opacity 0.4s;
  animation: grow 1.1s var(--ease) both; transform-origin: left center;
}
.band::after { content: ""; position: absolute; inset: -6px 0; background: inherit; filter: blur(12px); opacity: 0.55; z-index: -1; border-radius: inherit; }
.band.opt { opacity: 0.5; }
.spec-row:hover .nm, .spec-row.on .nm { color: var(--fg); }
.spec-row:hover .band, .spec-row.on .band, .spec-row.open .band { top: 8px; bottom: 8px; opacity: 1; }
/* the attack inside the band: 16 steps of one bar. Lit = plays, half-lit = note held, dark = rest.
   The playhead column (.now) runs through every band in time with the music. */
.steps.bsteps { position: absolute; inset: 0; display: flex; gap: 0; margin: 0; max-width: none; border-radius: inherit; overflow: hidden; }
.steps.bsteps i {
  flex: 1 1 0; max-width: none; aspect-ratio: auto; height: 100%; margin: 0; border: 0; border-radius: 0;
  background: rgba(6, 7, 14, 0.66); transition: background 0.12s;
}
.steps.bsteps i + i { box-shadow: inset 1px 0 rgba(6, 7, 14, 0.5); }
.steps.bsteps i:nth-child(4n+1):not(:first-child) { box-shadow: inset 2px 0 rgba(6, 7, 14, 0.85); }
.steps.bsteps i.x { background: transparent; }
.steps.bsteps i.o { background: rgba(6, 7, 14, 0.24); }
.steps.bsteps i.h { background: rgba(6, 7, 14, 0.38); }
.steps.bsteps i.now { background: rgba(6, 7, 14, 0.42); transform: none; }
.steps.bsteps i.x.now, .steps.bsteps i.o.now { background: rgba(255, 255, 255, 0.6); transform: none; }
@keyframes grow { from { transform: scaleX(0); opacity: 0; } }

/* layer mixer: play the sketch, switch layers on/off, solo */
.sk {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, 0.03);
}
.sk-title { font-size: 16px; margin-bottom: 3px; }
/* the sketch is not the song split into stems: said in full, bright and underlined */
.sk-warn { margin-top: 6px; font-size: 13.5px; line-height: 1.6; color: var(--fg); }
.sk-warn span { padding-bottom: 2px; background: var(--irid) 0 100% / 100% 1.5px no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sk > div:nth-child(2) { display: grid; justify-items: start; }
.sk-all { display: flex; gap: 14px; }
.lsw { position: relative; width: 28px; height: 16px; padding: 0; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; transition: background 0.2s, border-color 0.2s; }
.lsw::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--faint); transition: transform 0.2s var(--ease), background 0.2s;
}
.lsw[aria-checked="true"] { background: var(--fg); border-color: var(--fg); }
.lsw[aria-checked="true"]::after { transform: translateX(12px); background: #07080f; }
.lsw:focus-visible, .lsolo:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
.lsolo {
  justify-self: end; width: 24px; height: 20px; padding: 0; border: 1px solid var(--line-2); border-radius: 3px;
  background: none; color: var(--faint); font-family: var(--mono); font-size: 11px;
}
.lsolo:hover { color: var(--fg); }
.lsolo[aria-pressed="true"] { background: #ffd59a; border-color: transparent; color: #07080f; }
.spec-row.off .band { opacity: 0.12; }
.spec-row.off .nm { color: var(--faint); text-decoration: line-through; }
.layer.off { opacity: 0.45; }
/* a hit flashes only its step; the band keeps its size */
.steps.bsteps i.flash { animation: step-flash 0.32s var(--ease); }
@keyframes step-flash { 0% { background: rgba(255, 255, 255, 0.92); } }

/* layers */
.layers { display: grid; gap: 10px; }
.layer {
  border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; display: grid; gap: 10px;
  background: rgba(255, 255, 255, 0.02); transition: border-color 0.4s, background 0.4s;
  scroll-margin-top: 90px;
}
.layer.on { border-color: var(--line-2); background: rgba(255, 255, 255, 0.05); }
.layer[hidden] { display: none; }
/* the explanation continues the row: no box of its own, text aligned with the name column, band end on the right */
.spectrum .layer, .spectrum .layer.on {
  margin: 0; padding: 0 94px 22px 62px; border: 0; border-radius: 0; background: none; animation: info-in 0.35s var(--ease) both;
}
.spectrum .layer header { padding-top: 16px; border-top: 1px solid var(--line); }
@keyframes info-in { from { opacity: 0; transform: translateY(-8px); } }
.layer header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 10px; }
.layer h4 { margin: 0; font-size: 19px; font-weight: 400; letter-spacing: -0.01em; }
.layer .idx { font-family: var(--mono); font-size: var(--hud); color: var(--faint); }
.layer .freq { margin-left: auto; font-family: var(--mono); font-size: var(--hud); color: var(--dim); }
.tag { border: 1px solid var(--line-2); border-radius: 3px; padding: 2px 6px; color: var(--dim); font-size: 11px; }
.tag.ess { border-color: transparent; background: var(--irid); color: #08090f; }
.layer .desc { color: var(--fg); }
.layer .how { color: var(--dim); font-size: 14px; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.dev {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em; padding: 5px 9px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
}
.dev.inst { border-color: var(--line-2); color: var(--fg); }
.chain .to { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.steps { display: flex; gap: 3px; align-items: center; margin-top: 4px; max-width: 360px; }
.steps i {
  flex: 1 1 0; min-width: 0; max-width: 18px; aspect-ratio: 1; border-radius: 2px; border: 1px solid var(--line-2);
  transition: transform 0.12s, box-shadow 0.12s;
}
.steps i:nth-child(4n+1) { margin-left: 6px; }
.steps i:first-child { margin-left: 0; }
.steps i.x { background: var(--fg); border-color: var(--fg); }
.steps i.o { background: rgba(243, 245, 255, 0.35); border-color: transparent; }
.steps i.now { box-shadow: 0 0 0 1px #8af3ff; }
.steps i.x.now { transform: scale(1.18); background: #8af3ff; }
.notes { font-family: var(--mono); font-size: 12px; color: var(--dim); letter-spacing: 0.02em; word-spacing: 4px; }
.notes .label { margin-right: 10px; word-spacing: 0; }

/* build steps */
/* the steps as square blocks: number on top, title and how-to at the bottom */
/* every block the same height: all rows take the tallest one; content starts at the top so titles line up */
.build { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.build li {
  min-height: 220px; display: flex; flex-direction: column; justify-content: flex-start; gap: 18px; padding: 18px 18px 20px;
  border: 1px solid var(--line-2); border-radius: 10px; background: rgba(255, 255, 255, 0.04); transition: background 0.3s, border-color 0.3s;
}
.build li:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(243, 245, 255, 0.3); }
.build .n { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; color: var(--faint); }
.build h5 { margin: 0 0 8px; font-size: clamp(17px, 1.25vw, 20px); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.build p { color: var(--dim); font-size: 13.5px; line-height: 1.45; }


.sub { margin: 32px 0 14px; font-weight: 400; font-size: clamp(17px, 1.3vw, 21px); letter-spacing: -0.01em; color: var(--fg); }

/* arrangement */
.arr { display: flex; align-items: flex-end; gap: 4px; height: clamp(150px, 30vh, 300px); } /* the arrangement has a screen of its own */
.arr .blk {
  position: relative; min-width: 8px; border-radius: 3px 3px 0 0; background: var(--irid); background-size: 400% 100%;
  opacity: 0.55; transition: opacity 0.3s; cursor: default; animation: up 1s var(--ease) both; transform-origin: bottom;
}
.arr .blk:hover, .arr .blk.on { opacity: 1; }
@keyframes up { from { transform: scaleY(0); } }
.arr-labels { display: flex; gap: 3px; margin-top: 8px; }
.arr-labels span {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 8px;
}
.arr-cap { margin-top: 18px; color: var(--dim); font-size: clamp(15px, 1.2vw, 19px); line-height: 1.45; min-height: 3em; }
.arr-hint { margin-top: 18px; }
.arr-cap b { color: var(--fg); font-weight: 500; }

/* what makes it sound like this: a big iridescent word, the description under it */
/* samples the track uses (how to make it) */
.samples { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 36px; }
.samples li { display: grid; align-content: start; gap: 7px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.samples .t b { font-weight: 500; font-size: 17px; letter-spacing: -0.01em; }
.samples .t small { margin-left: 8px; color: var(--faint); font-family: var(--mono); font-size: 11px; }
.samples p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.5; }
.samples p.smp-live { color: var(--fg); }
.samples p.smp-live .label { margin-right: 8px; }
.samples li > * { min-width: 0; }
.samples li:only-child { grid-column: 1 / -1; max-width: 760px; }
.samples .links { display: flex; gap: 14px; }
.samples .links a { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); text-decoration: none; }
.samples .links a:hover { color: var(--fg); }
.samples-none { margin: 0; color: var(--dim); font-size: 14.5px; }
.samples-src { margin-top: 14px; }
@media (max-width: 900px) { .samples { grid-template-columns: 1fr; } }
.secrets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 36px; }
.secrets li { display: grid; align-content: start; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.secrets b { justify-self: start; font-size: clamp(22px, 1.9vw, 32px); font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; }
.secrets span { color: var(--dim); font-size: 14.5px; line-height: 1.45; }

/* references */
.refs { list-style: none; margin: 0; padding: 0; }
/* each reference: number, the artist's photo in a hexagon, track and why */
.refs li {
  display: grid; grid-template-columns: 30px 56px minmax(0, 1fr) auto; column-gap: 16px; row-gap: 5px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.refs li:first-child { border-top: 0; padding-top: 0; }
.refs .n { grid-column: 1; grid-row: 1 / span 2; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.refs .hex { grid-column: 2; grid-row: 1 / span 2; }
.refs .t { grid-column: 3; grid-row: 1; align-self: end; font-size: 16px; }
.refs .t small { color: var(--faint); font-family: var(--mono); font-size: 11px; margin-left: 8px; }
.refs .why { grid-column: 3 / span 2; grid-row: 2; align-self: start; color: var(--dim); font-size: 14px; }
.refs .links { grid-column: 4; grid-row: 1; align-self: end; display: flex; gap: 12px; }

/* the hexagon portrait: iridescent rim, the photo (or initials while it loads) inside */
.hex {
  --hs: 52px; position: relative; flex: none; width: var(--hs); height: calc(var(--hs) * 1.1547);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--irid); background-size: 220% 100%;
}
.hex i {
  position: absolute; inset: 2px; display: grid; place-items: center; clip-path: inherit;
  background: #120f22 center 25% / cover; font: 500 13px/1 var(--mono); font-style: normal; letter-spacing: 0.04em; color: var(--dim);
  transition: color 0.3s;
}
.hex.has-photo i { color: transparent; }
/* key artists: bigger portraits with the name under them */
.keyartists { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 22px 26px; }
.keyartists li { display: grid; justify-items: center; gap: 12px; width: 104px; text-align: center; }
.keyartists .hex { --hs: 76px; }
.keyartists .hex i { font-size: 18px; }
.keyartists b { font: 500 12px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg); }
.refs .links a { font-family: var(--mono); font-size: var(--hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--dim); text-decoration: none; }
.refs .links a:hover { color: var(--fg); }

/* library drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 40;
  background: rgba(7, 8, 15, 0.72); border-left: 1px solid var(--line);
  backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
  transform: translateX(102%); transition: transform 0.7s var(--ease), visibility 0s linear 0.7s; display: flex; flex-direction: column;
  visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; transition: transform 0.7s var(--ease); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.lib-list { list-style: none; margin: 0; padding: 8px 0; overflow-y: auto; }
.lib-list li button {
  width: 100%; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; text-align: left;
  background: none; border: 0; padding: 10px 20px; transition: background 0.3s;
}
.lib-list li button:hover { background: rgba(255, 255, 255, 0.05); }
.lib-list .cover { width: 44px; height: 44px; }
.lib-list .ti { font-size: 15px; line-height: 1.25; }
.lib-list .mt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.lib-empty { padding: 20px; color: var(--dim); font-size: 14px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  :root { --hud: 11px; }
  .hud { padding: 12px 16px; }
  .mini { display: none; }
  .hud-bottom { gap: 14px; overflow: hidden; }
  .hud-bottom .sw, .credit-what, .live #live-label { display: none; }
  .crumb .arrow, #crumb { display: none; }
  .br-m { display: inline; }
  .hud-right { gap: 14px; }
  #sound-label { max-width: 34vw; }
  body[data-view="result"] #result { display: block !important; }
  /* phone: the track info is the first screen, then the 4 panels, all stacked in place */
  #result { position: relative; height: 100svh; }
  .ident, .pstage {
    position: absolute; inset: 0; height: auto; overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; visibility: hidden; transform: translateY(40px);
    transition: opacity 0.45s var(--ease), transform 0.6s var(--ease), visibility 0s linear 0.6s;
  }
  .ident { justify-content: safe center; padding: 84px 16px 110px; }
  .ident.is-before, .pstage.is-before { transform: translateY(-40px); }
  .ident.is-active, .pstage.is-active {
    opacity: 1; visibility: visible; transform: none; pointer-events: auto;
    transition: opacity 0.6s var(--ease) 0.15s, transform 0.8s var(--ease) 0.15s, visibility 0s;
  }
  .panels { position: absolute; inset: 0; height: auto; }
  .pstage { padding: 64px 16px 110px; }
  .ident, .pstage {
    -webkit-mask-image: linear-gradient(to bottom, transparent 40px, #000 64px, #000 calc(100% - 118px), transparent calc(100% - 82px));
    mask-image: linear-gradient(to bottom, transparent 40px, #000 64px, #000 calc(100% - 118px), transparent calc(100% - 82px));
  }
  .toc { left: 16px; right: 16px; bottom: 42px; }
  .toc a { padding: 10px 6px 2px 0; }
  .toc a .n { display: none; }
  .toc a::before { right: 6px; }
  /* phone: name on one line, the band (with its attack) full width under it */
  .spectrum { --bmin: 96px; }
  .spec-axis .minor { display: none; }
  .spec-head, .spec-row { grid-template-columns: 44px minmax(0, 1fr) 36px 36px; padding: 0 10px; }
  .spec-head { grid-template-areas: "ncap ncap scap icap" ". axis axis axis"; row-gap: 8px; }
  .spec-legend { padding: 0 10px; }
  /* phone: the switch spans both lines; name, solo and info on top, the band under them */
  .spec-row { grid-template-areas: "sw nm solo info" "sw lane lane lane"; min-height: 0; row-gap: 4px; padding: 8px 10px; }
  .spec-row .lane { height: 30px; }
  .spectrum .layer, .spectrum .layer.on { padding: 0 10px 18px; }
  .build { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .build li { padding: 14px; gap: 10px; }
  .build h5 { font-size: 14.5px; }
  .build p { font-size: 12.5px; }
  .secrets { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sk { grid-template-columns: 44px minmax(0, 1fr); }
  .sk-all { grid-column: 1 / -1; }
    .kv { grid-template-columns: 1fr; gap: 4px; }
  .refs li { grid-template-columns: 22px 46px minmax(0, 1fr); column-gap: 12px; }
  .refs .n, .refs .hex { grid-row: 1 / span 3; }
  .refs .hex { --hs: 44px; }
  .refs .why { grid-column: 3; grid-row: 2; }
  .refs .links { grid-column: 3; grid-row: 3; }
  .keyartists { gap: 18px 14px; }
  .keyartists li { width: 88px; }
  .keyartists .hex { --hs: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}


/* ---------------------------------------------------------------- limit: no search, big library button */
.cta {
  display: inline-flex; align-items: center; gap: 12px; margin: 4px auto 0; padding: 18px 32px; border: 0; border-radius: 999px;
  background: var(--fg); color: #07080f; font-family: var(--mono); font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: transform 0.3s var(--ease);
}
.cta:hover { transform: translateY(-2px); }
.cta:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }
.cta[hidden] { display: none; }
body.is-limit #url-form, body.is-limit .hero .hint, body.is-limit .mini { display: none; }

/* ---------------------------------------------------------------- library: spectrum map */
body[data-view="libview"] #libview {
  display: flex; flex-direction: column; height: 100vh; padding: 62px 18px 46px; animation: fade 0.9s var(--ease) both;
}
.lib-head { display: grid; justify-items: center; text-align: center; padding: 4px 2vw 8px; }
/* the title is the logo engine spelling it (library.js); the canvas spills around the box for the glow */
.lib-title { position: relative; margin: 14px auto 6px; cursor: crosshair; }
.lib-title canvas { position: absolute; display: block; pointer-events: none; }
.lib-sub { max-width: 640px; font-size: 14px; margin: 8px auto 0; text-wrap: balance; }
.mcard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: 240px; padding: 6px 14px 6px 6px; border: 1px solid var(--line-2); border-radius: 999px; text-align: left;
  background: rgba(8, 9, 18, 0.6); color: var(--fg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: drift 6s ease-in-out infinite; animation-delay: var(--d, 0s); transition: border-color 0.3s, background 0.3s;
}
@keyframes drift { 0%, 100% { transform: translate(-50%, -50%) translateY(0); } 50% { transform: translate(-50%, -50%) translateY(-7px); } }
.mcard:hover, .mcard:focus-visible { z-index: 2; border-color: var(--c); background: rgba(8, 9, 18, 0.85); outline: none; animation-play-state: paused; }
.mc-cover { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--c); background: var(--glass) center / cover; }
.mc-txt { display: grid; min-width: 0; line-height: 1.2; }
.mc-txt b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-txt small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- player card */
.pc-wrap {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: rgba(5, 6, 12, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade 0.4s var(--ease) both;
}
.pc-wrap[hidden] { display: none; }
.pcard {
  width: min(320px, 92vw); padding: 2px; color: var(--fg); background: var(--irid); background-size: 220% 100%;
  clip-path: polygon(50% 0, 100% 5%, 100% 91%, 50% 100%, 0 91%, 0 5%); animation: rise 0.6s var(--ease) both, sheen 9s linear infinite;
}
.pc-in {
  position: relative; padding: 0; clip-path: polygon(50% 0, 100% 5%, 100% 91%, 50% 100%, 0 91%, 0 5%);
  background: linear-gradient(165deg, color-mix(in srgb, var(--c1) 55%, #0b0c16) 0%, color-mix(in srgb, var(--c0) 85%, #05060c) 55%, #05060c 100%);
}
/* the artist photo, edge to edge under the shield's peak; it fades into the card at the bottom */
.pc-hero {
  position: relative; height: 222px; background: rgba(255, 255, 255, 0.06) center 22% / cover;
  -webkit-mask-image: linear-gradient(to bottom, #000 64%, transparent); mask-image: linear-gradient(to bottom, #000 64%, transparent);
}
.pc-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 70% at 0% 0%, rgba(5, 6, 12, 0.6), transparent 60%); }
.pc-hero.is-cover { background-position: center; }
.pc-ovr { position: absolute; top: 34px; left: 22px; display: grid; justify-items: center; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55); }
.pc-ovr b { font-size: 48px; font-weight: 300; line-height: 0.9; letter-spacing: -0.03em; }
.pc-ovr span {
  margin-top: 7px; padding: 2px 7px 1px; border-radius: 4px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.12em;
  color: #05060c; background: var(--c2); text-shadow: none;
}
.pc-body { position: relative; margin-top: -30px; padding: 0 22px; }
.pc-name { text-align: center; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; text-wrap: balance; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }
.pc-sub { margin-top: 3px; text-align: center; color: var(--dim); font-size: 13px; }
.pc-attrs { display: grid; grid-template-columns: 1fr 1fr; margin: 14px 0 0; border-block: 1px solid var(--line); }
.pc-attr { display: grid; grid-template-columns: 30px 1fr; align-items: baseline; column-gap: 9px; row-gap: 6px; padding: 8px 14px 9px 2px; }
.pc-attr:nth-child(n+3) { border-top: 1px solid var(--line); }
.pc-attr:nth-child(even) { padding: 8px 2px 9px 14px; border-left: 1px solid var(--line); }
.pc-attr b { font-size: 22px; font-weight: 500; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.pc-attr span { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; color: var(--dim); }
.pc-attr i {
  grid-column: 1 / -1; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--c1), var(--c2)) 0 0 / var(--v) 100% no-repeat, rgba(255, 255, 255, 0.08);
}
.pc-radar { display: block; width: 100%; max-width: 160px; margin: 6px auto 0; }
.pc-ring { fill: none; stroke: rgba(255, 255, 255, 0.12); }
.pc-spoke { stroke: rgba(255, 255, 255, 0.08); }
.pc-shape { fill-opacity: 0.35; stroke-width: 2; }
.pc-axis { font-family: var(--mono); font-size: 11px; fill: var(--dim); }
.pc-foot { margin-top: 2px; text-align: center; color: var(--faint); }
/* share: round icon on the photo, top right */
.pc-share {
  position: absolute; top: 36px; right: 20px; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.28); color: #fff; cursor: pointer;
  background: rgba(5, 6, 12, 0.42); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s var(--ease);
}
.pc-share:hover { background: rgba(5, 6, 12, 0.66); border-color: rgba(255, 255, 255, 0.5); transform: scale(1.06); }
.pc-share:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; }
.pc-share .ico { width: 18px; height: 18px; }
.pc-share .i-done, .pc-share.is-done .i-share { display: none; }
.pc-share.is-done .i-done { display: block; }
.pc-share.is-done { color: #05060c; background: var(--c2); border-color: transparent; }
.pc-tip {
  position: absolute; top: calc(100% + 6px); right: 0; padding: 3px 7px; border-radius: 4px; white-space: nowrap; pointer-events: none;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: rgba(5, 6, 12, 0.78);
  opacity: 0; transform: translateY(-3px); transition: opacity 0.25s, transform 0.25s;
}
.pc-share.is-tip .pc-tip { opacity: 1; transform: none; }
/* open: the whole bottom of the shield, tip included */
.pc-open {
  display: flex; align-items: center; justify-content: center; gap: 0.5em; width: 100%; height: 88px; margin-top: 14px; padding: 0 0 30px;
  border: 0; border-radius: 0; cursor: pointer; color: #05060c; font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  background: var(--irid); background-size: 220% 100%; animation: sheen 9s linear infinite; transition: filter 0.3s var(--ease);
}
.pc-open:hover { filter: brightness(1.1) saturate(1.1); }
.pc-open span { transition: transform 0.3s var(--ease); }
.pc-open:hover span { transform: translateX(4px); }
.pc-open:focus-visible { outline: 2px solid #05060c; outline-offset: -8px; }

@media (max-width: 900px) {
  body[data-view="libview"] #libview { padding: 58px 10px 40px; }
  .lib-head { padding: 0 4px 10px; }
  .lib-sub { font-size: 13px; }
  .mcard { max-width: 150px; gap: 7px; padding: 4px 10px 4px 4px; }
  .mc-cover { width: 26px; height: 26px; }
  .mc-txt b { font-size: 12.5px; }
}


/* ---------------------------------------------------------------- library: octagonal spectrum */
.oct-wrap { flex: 1; min-height: 0; display: grid; place-items: center; container-type: size; }
/* the octagon fills the space: wider on wide screens, taller on tall ones (between 0.7:1 and 2.2:1) */
.oct { position: relative; width: min(100cqw, 220cqh); height: min(100cqh, 143cqw); }
.oct-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.oct-edge, .oct-ring, .oct-axis { vector-effect: non-scaling-stroke; } /* lines stay crisp when the shape stretches */
.oct-edge { fill: rgba(8, 9, 18, 0.32); stroke: var(--line-2); stroke-width: 1.5; }
.oct-ring { fill: none; stroke: var(--line); stroke-dasharray: 3 7; }
.oct-axis { stroke: var(--line); }
.oct-pole { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; text-align: center; pointer-events: none; }
.oct-pole b { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg); }
.oct-pole small { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.oct-cards { position: absolute; inset: 0; }
@media (max-width: 900px) {
  .oct-pole small { display: none; }
  .oct-pole b { letter-spacing: 0.04em; }
}


/* ---------------------------------------------------------------- fundamentos (learn.js + glyph3d.js) */
/* same reading model as an analysis: gear in 3D on the left, one screen of text at a time on the right */
body[data-view="learn"] #learnview { display: grid; animation: fade 0.9s var(--ease) both; }
body[data-view="learn"] .veil { opacity: 1; }
body[data-view="learn"] .hud::before { opacity: 1; }
#learnview { grid-template-columns: minmax(340px, 42%) minmax(0, 1fr); height: 100vh; }
.lv-stage { position: relative; height: 100vh; }
.lv-canvas {
  position: absolute; top: 64px; left: 3vw; display: block; width: calc(100% - 3vw); height: calc(100% - 170px);
  touch-action: none; cursor: grab; animation: fade 1.2s var(--ease) both;
}
.lv-canvas.is-drag { cursor: grabbing; }
.lv-cap {
  position: absolute; left: 7vw; right: 2vw; bottom: 52px; display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 6px 16px; align-items: baseline; padding-top: 12px; border-top: 1px solid var(--line-2);
}
.lv-nogl { position: absolute; top: 45%; left: 7vw; right: 4vw; font-size: 14px; }

/* timeline: big light year, title and one line of context */
.lv-tl { list-style: none; margin: 0; padding: 0; }
.lv-tl li { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.lv-tl li:first-child { border-top: 0; padding-top: 2px; }
.lv-year { font-size: clamp(22px, 1.8vw, 30px); font-weight: 300; line-height: 1; letter-spacing: -0.03em; color: var(--fg); padding-top: 2px; }
.lv-tl b { display: block; font-weight: 500; font-size: clamp(16px, 1.2vw, 19px); letter-spacing: -0.01em; line-height: 1.25; }
.lv-tl div span { display: block; margin-top: 4px; max-width: 46em; color: var(--dim); font-size: 14.5px; line-height: 1.45; }

/* concepts: the iridescent word + text, like "o que faz soar assim" */
.lv-words { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.lv-words b { font-size: clamp(20px, 1.6vw, 26px); }

/* signal path chips */
.lv-path { display: grid; gap: 10px; margin: 0 0 30px; }
.lv-path > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lv-arrow { color: var(--faint); }

/* 16 steps: one bar; the light runs in the background track's tempo */
.lv-steps { display: grid; gap: 8px; max-width: 680px; }
.lv-steps-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 12px; }
.lv-cells { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; }
.lv-cells i { aspect-ratio: 1; border-radius: 3px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); transition: background 0.12s, box-shadow 0.12s; }
.lv-cells i:nth-child(4n + 1) { border-color: var(--line-2); }
.lv-cells i.on { border-color: transparent; background: rgba(243, 245, 255, 0.72); }
.lv-cells i.now { box-shadow: 0 0 0 1px var(--fg); background: rgba(255, 255, 255, 0.18); }
.lv-cells i.on.now { background: var(--irid); background-size: 300% 100%; }
.lv-hint { margin: 12px 0 0; font-size: 14px; line-height: 1.45; max-width: 40em; }

/* the programs: name and platforms, what it is good at, a line on it */
.lv-progs { list-style: none; margin: 0; padding: 0; }
.lv-progs li {
  display: grid; grid-template-columns: 160px 190px minmax(0, 1fr); grid-template-areas: "n g d" "p g d";
  column-gap: 22px; row-gap: 3px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line);
}
.lv-progs li:first-child { border-top: 0; padding-top: 2px; }
.lv-progs b { grid-area: n; font-weight: 500; font-size: 17px; letter-spacing: -0.01em; }
.lv-progs .label { grid-area: p; }
.lv-good { grid-area: g; font-size: 14.5px; }
.lv-progs .dim { grid-area: d; font-size: 14px; line-height: 1.45; }

.lv-note {
  margin: 24px 0 0; padding: 2px 0 2px 16px; max-width: 42em; color: var(--dim); font-size: 15px; line-height: 1.5;
  border-left: 2px solid; border-image: var(--irid) 1;
}
.lv-build { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lv-build li { min-height: 0; gap: 12px; }
.lv-cta { display: grid; justify-items: start; gap: 14px; margin-top: 30px; }
.lv-cta p { margin: 0; font-size: 15px; }
.lv-cta .cta { margin: 0; }

/* section menu with 11 entries: numbers only, the current one also shows its name */
.toc-many a { flex: 0 0 auto; padding-right: 12px; }
.toc-many a .n { margin-right: 6px; }
.toc-many a .t { display: none; }
.toc-many a.on { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.toc-many a.on .t { display: inline; }

/* "fundamentos": the way into the learning pages, so it stands out: bright, heavier, iridescent underline */
.ai-note a, .what a { color: var(--fg); font-weight: 600; text-decoration: none; padding-bottom: 2px;
  background: var(--irid) 0 100% / 220% 1.5px no-repeat; animation: sheen-line 6s linear infinite; transition: text-shadow 0.3s; }
.ai-note a:hover, .ai-note a:focus-visible, .what a:hover, .what a:focus-visible { text-shadow: 0 0 12px rgba(255, 255, 255, 0.55); background-size: 220% 2px; }
@keyframes sheen-line { to { background-position: 220% 100%; } }

@media (max-width: 1200px) {
  .lv-build { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lv-progs li { grid-template-columns: 150px minmax(0, 1fr); grid-template-areas: "n g" "p d"; }
}
@media (max-width: 900px) {
  #learn-btn { display: none; } /* phones reach it from the home screen */
  body[data-view="learn"] #learnview { display: block; position: relative; height: 100svh; }
  /* phone: the gear on top, the text screens under it */
  .lv-stage { position: absolute; left: 0; right: 0; top: 48px; height: 34svh; }
  .lv-canvas { top: 0; left: 0; width: 100%; height: 100%; }
  .lv-cap { display: none; }
  #learnview .panels { position: absolute; inset: 0; height: auto; }
  #learnview .pstage {
    top: calc(34svh + 44px); padding: 16px 16px 110px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 118px), transparent calc(100% - 82px));
    mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 118px), transparent calc(100% - 82px));
  }
  #learnview .toc a .n { display: inline; }
  #learnview .toc-many a { padding-right: 7px; }
  .lv-tl li { grid-template-columns: 62px minmax(0, 1fr); column-gap: 12px; }
  .lv-steps-row { grid-template-columns: 52px minmax(0, 1fr); gap: 8px; }
  .lv-cells { gap: 2px; }
  .lv-progs li { grid-template-columns: minmax(0, 1fr); grid-template-areas: "n" "p" "g" "d"; }
  .lv-build { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- PT / EN switch (i18n.js) */
.lang { display: inline-flex; align-items: baseline; gap: 0; }
.lang b { font-weight: 400; color: var(--faint); transition: color 0.3s; }
.lang b + b::before { content: "/"; margin: 0 5px; color: var(--faint); }
.lang b.on { color: var(--fg); }
.lang:hover b:not(.on) { color: var(--dim); }
/* the analysis text is being translated (or could not be, for now) */
.tr-note { color: var(--fg); animation: trpulse 1.6s ease-in-out infinite; }
@keyframes trpulse { 50% { opacity: 0.45; } }
/* narrow phones: the sound button keeps only its animated bars (the menu still names the stations),
   so the top bar fits the PT/EN switch */
@media (max-width: 440px) {
  #sound-label { display: none; }
  .hud-right { gap: 12px; }
}

/* ---------------------------------------------------------------- sketch tempo and key */
.sk-tune {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.sk-ctl { display: inline-flex; align-items: center; gap: 8px; }
.sk-ctl > .label { min-width: 26px; }
.sk-step {
  width: 28px; height: 28px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: transparent;
  color: var(--fg); font-size: 16px; line-height: 1; cursor: pointer; touch-action: manipulation; user-select: none;
  -webkit-user-select: none; transition: border-color 0.2s, background 0.2s;
}
.sk-step:hover { border-color: var(--fg); }
.sk-step:active { background: rgba(255, 255, 255, 0.12); }
.sk-val { min-width: 3ch; text-align: center; font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.sk-keyv { min-width: 10em; }
/* moved away from the analysis: the value turns iridescent */
.sk-val.moved {
  background: var(--irid); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 12s linear infinite;
}
.sk-reset { margin-left: auto; }
@media (max-width: 900px) {
  .sk-tune { gap: 10px 16px; }
  .sk-keyv { min-width: 8.5em; }
  .sk-reset { margin-left: 0; }
}
