/* Constellation: an audio instrument, drawn like a star chart.
   Paper and ink, one signal colour (International Klein Blue), hairline rules instead of
   cards and shadows, Geist for words and Geist Mono for anything measured. */

/* ---------- Tokens ---------- */
:root {
    color-scheme: light dark;

    --paper: #f3f3f1;
    --paper-2: #e9e9e5;
    --ink: #0d0d0d;
    --ink-2: #4a4a46;
    --ink-3: #85857e;
    --rule: #d3d3cd;
    --signal: #1d3bff;
    --on-signal: #ffffff;

    --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', 'Cascadia Code', monospace;
    --ease: cubic-bezier(0.2, 0.7, 0, 1);
    --gutter: clamp(16px, 4vw, 48px);
    --level: 0; /* live microphone loudness 0..1, set from JS */
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0b0b0b;
        --paper-2: #161616;
        --ink: #ecece8;
        --ink-2: #b2b2ab;
        --ink-3: #75756f;
        --rule: #2a2a27;
        --signal: #5e76ff;
        --on-signal: #ffffff;
    }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--ink);
    font: 400 16px/1.55 var(--font);
    font-feature-settings: 'ss01', 'cv11';
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
::selection { background: var(--signal); color: var(--on-signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Masthead ---------- */
.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px var(--gutter);
    border-bottom: 1px solid var(--rule);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.wordmark-glyph { width: 22px; height: 22px; }
.wordmark-glyph path { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.wordmark-glyph circle { fill: var(--ink); }
.wordmark-glyph .star { fill: var(--signal); }

.masthead-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--signal);
    animation: blink 2.4s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- Page ---------- */
main {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--gutter) 56px;
    display: grid;
    gap: 0;
    align-content: start;
}

/* ---------- Intro ---------- */
.intro {
    position: relative;
    padding: clamp(40px, 8vw, 96px) 0 clamp(32px, 5vw, 56px);
    display: grid;
    gap: 18px;
}

/* Chart paper: a faint field of points behind the headline */
.intro::before {
    content: '';
    position: absolute;
    inset: 0 calc(var(--gutter) * -1);
    z-index: -1;
    background-image: radial-gradient(var(--rule) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%, #000 70%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 35%, #000 70%, transparent);
    opacity: 0.9;
}

.kicker {
    color: var(--ink-2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.display {
    max-width: 15ch;
    font-size: clamp(2.8rem, 7.4vw, 6.6rem);
    font-weight: 500;
    line-height: 0.96;
    letter-spacing: -0.05em;
    margin-left: -0.03em;
}

.display-dot { color: var(--signal); }

/* How it works, in three steps people actually read */
.steps {
    display: grid;
    gap: 10px;
    max-width: 980px;
    margin-top: 6px;
    counter-reset: none;
}

.steps li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    color: var(--ink-2);
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    line-height: 1.45;
}

.steps strong { color: var(--ink); font-weight: 500; }

.step-n {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--ink);
    font-size: 0.72rem;
    translate: 0 -1px;
}

@media (min-width: 880px) {
    .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
    .steps li { flex-direction: column; gap: 10px; padding: 14px 24px 0 0; }
    .steps li + li { padding-left: 24px; border-left: 1px solid var(--rule); }
}

.intro-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 24px;
    margin-top: 10px;
}

.btn-large { min-height: 54px; padding: 0 26px; font-size: 1.02rem; }

.btn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 0 var(--signal);
    animation: ping 2s var(--ease) infinite;
}

.btn-primary:hover .btn-dot { background: var(--on-signal); }

@keyframes ping {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--signal) 60%, transparent); }
    100% { box-shadow: 0 0 0 10px transparent; }
}

.inline-link { font-size: 0.72rem; text-decoration: none; }
/* ---------- Panels: sections divided by rules, not boxes ---------- */
.panel {
    border-top: 1px solid var(--ink);
    padding: 22px 0 40px;
}

.panel-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 22px;
}

.index {
    color: var(--signal);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.panel-head h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.panel-head .panel-title-small {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.panel-status {
    flex: 1;
    color: var(--ink-3);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.panel-sub { color: var(--ink-2); margin: -10px 0 22px; max-width: 52ch; }

/* ---------- Console: search beside the instrument ---------- */
.console { display: grid; }

@media (min-width: 980px) {
    .console { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
    .console .listen { border-left: 1px solid var(--rule); padding-left: clamp(24px, 3vw, 48px); }
    .console .library { padding-right: clamp(24px, 3vw, 48px); }
}

/* ---------- 01 Library search ---------- */
.search {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid var(--ink);
    padding: 4px 0 10px;
    transition: border-color 0.2s;
}

.search:focus-within { border-color: var(--signal); }
.search svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--ink); stroke-width: 1.6; }

.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0;
    background: none;
    color: var(--ink);
    font: 400 clamp(1.15rem, 2vw, 1.45rem) var(--font);
    letter-spacing: -0.02em;
}

.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }

.search kbd {
    padding: 1px 7px;
    border: 1px solid var(--rule);
    color: var(--ink-3);
    font-size: 0.75rem;
}

.search:focus-within kbd { visibility: hidden; }
@media (hover: none) { .search kbd { display: none; } }

.library-hint {
    margin: 14px 0 6px;
    color: var(--ink-3);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.library-hint:empty { display: none; }
.library-results { max-height: 420px; overflow-y: auto; scrollbar-width: thin; }

/* A list row: glyph · title + artist · mono aside. Information only, not links. */
.rows li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--rule);
    animation: row-in 0.45s var(--ease) both;
}

.rows li:nth-child(2) { animation-delay: 0.03s; }
.rows li:nth-child(3) { animation-delay: 0.06s; }
.rows li:nth-child(4) { animation-delay: 0.09s; }
.rows li:nth-child(5) { animation-delay: 0.12s; }
.rows li:nth-child(n + 6) { animation-delay: 0.15s; }

@keyframes row-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.row-text { display: grid; min-width: 0; }
.row-text strong, .row-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text strong { font-weight: 500; letter-spacing: -0.01em; }
.row-text span { color: var(--ink-2); font-size: 0.88rem; }
.row-aside { color: var(--ink-3); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }

/* ---------- Constellation glyph (each song's own pattern of stars) ---------- */
.glyph {
    display: block;
    aspect-ratio: 1;
    border: 1px solid var(--rule);
    background: var(--paper);
}

.glyph svg { display: block; width: 100%; height: 100%; }
.glyph img { display: block; width: 100%; height: 100%; object-fit: cover; animation: cover-in 0.5s var(--ease) both; }
.glyph.has-image { border-color: transparent; background: var(--paper-2); }
@keyframes cover-in { from { opacity: 0; } }
.glyph line { stroke: var(--ink-3); stroke-width: 0.6; }
.glyph circle { fill: var(--ink); }
.glyph circle.star { fill: var(--signal); }
.glyph-large { width: clamp(96px, 14vw, 168px); }
/* Same stars, finer drawing at large size */
.glyph-large circle { transform-box: fill-box; transform-origin: center; scale: 0.55; }
.glyph-large circle.star { scale: 0.7; }
.glyph-large line { stroke-width: 0.35; }

/* ---------- 02 The instrument ---------- */
.instrument {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(20px, 3vw, 40px);
}

.dial {
    --size: clamp(220px, 22vw, 280px);
    position: relative;
    width: var(--size);
    height: var(--size);
    display: grid;
    place-items: center;
}

.orbit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    rotate: -90deg;
}

.orbit-track { fill: none; stroke: var(--rule); stroke-width: 0.6; stroke-dasharray: 1 3.2; }
body:not([data-state='listening']):not([data-state='starting']) .orbit-bar { opacity: 0; }
.orbit-bar {
    fill: none;
    transition: stroke-dashoffset 1s linear, opacity 0.4s var(--ease);
    stroke: var(--signal);
    stroke-width: 1.4;
    stroke-dasharray: 351.858;
    stroke-dashoffset: 351.858;
}

/* A single point circling the dial while idle: the instrument is on */
.satellite {
    position: absolute;
    inset: 0;
    animation: orbit 14s linear infinite;
    pointer-events: none;
}

.satellite::before {
    content: '';
    position: absolute;
    top: calc(50% - 46.6% - 3px);
    left: calc(50% - 3px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--signal);
}

@keyframes orbit { to { rotate: 360deg; } }

.sweep {
    position: absolute;
    width: 66%;
    height: 66%;
    border-radius: 50%;
    border: 1px solid var(--signal);
    opacity: 0;
}

.listen-button {
    position: relative;
    width: 66%;
    height: 66%;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    background: var(--ink);
    color: var(--paper);
    cursor: pointer;
    transition: background 0.35s var(--ease), transform 0.25s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.listen-button:hover { background: var(--signal); color: var(--on-signal); }
.listen-button:active { transform: scale(0.97); }

.listen-icon { width: 46px; height: 46px; overflow: visible; }
.listen-icon .icon-line { fill: none; stroke: currentColor; stroke-width: 1; opacity: 0.55; }
.listen-icon circle { fill: currentColor; }
.listen-icon :is(circle, .icon-line) { transition: opacity 0.2s; }
.listen-icon .stop-square { fill: currentColor; opacity: 0; transition: opacity 0.2s; }

.listen-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Listening: the dial turns signal blue, rings sweep outwards with the loudness */
body:is([data-state='listening'], [data-state='starting']) .listen-button { background: var(--signal); color: var(--on-signal); }
body:is([data-state='listening'], [data-state='starting']) .listen-icon :is(circle, .icon-line) { opacity: 0; }
body:is([data-state='listening'], [data-state='starting']) .listen-icon .stop-square { opacity: 1; }
body:is([data-state='listening'], [data-state='starting']) .satellite { opacity: 0; }
body:is([data-state='listening'], [data-state='starting']) .sweep { animation: sweep 2.4s var(--ease) infinite; scale: calc(1 + var(--level) * 0.25); }
body:is([data-state='listening'], [data-state='starting']) .sweep:nth-child(2) { animation-delay: 0.8s; }
body:is([data-state='listening'], [data-state='starting']) .sweep:nth-child(3) { animation-delay: 1.6s; }

@keyframes sweep {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.52); opacity: 0; }
}

.readout { display: grid; gap: 8px; min-width: 0; }

.status {
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.04em;
    overflow-wrap: anywhere;
}

.detail { color: var(--ink-2); overflow-wrap: anywhere; }

.gauges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
    border-top: 1px solid var(--rule);
    opacity: 0.4;
    transition: opacity 0.4s var(--ease);
}

body:not([data-state='idle']) .gauges { opacity: 1; }

.gauges > div { padding: 10px 0 0; }
.gauges dt { color: var(--ink-3); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
.gauges dd { font-size: 1.05rem; }
.gauge-wide { grid-column: 1 / -1; }
.gauge-wide dt { display: flex; justify-content: space-between; }
.gauge-wide dt span { color: var(--ink); }

.meter { display: block; height: 2px; margin-top: 10px; background: var(--rule); overflow: hidden; }
.meter-fill {
    display: block;
    height: 100%;
    background: var(--signal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease);
}

.best-guess { min-height: 1.5em; color: var(--ink-2); font-size: 0.9rem; overflow-wrap: anywhere; }

/* ---------- 03 Result ---------- */
.result-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: clamp(20px, 3vw, 40px);
    align-items: start;
}

.result-text { display: grid; gap: 6px; min-width: 0; }

.result-title {
    font-size: clamp(2.2rem, 6vw, 4.6rem);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.05em;
    overflow-wrap: anywhere;
}

.result-artist { color: var(--ink-2); font-size: clamp(1rem, 1.8vw, 1.25rem); overflow-wrap: anywhere; }

.facts {
    display: flex;
    flex-wrap: wrap;
    margin: 14px 0 0;
    color: var(--ink-2);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.facts li + li::before { content: '·'; margin: 0 10px; color: var(--ink-3); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* Reveal: the result is uncovered top to bottom */
.result:not([hidden]), .lyrics:not([hidden]), .notice:not([hidden]) { animation: uncover 0.7s var(--ease) both; }

@keyframes uncover {
    from { clip-path: inset(0 0 100% 0); opacity: 0.3; }
    to { clip-path: inset(0 0 0 0); opacity: 1; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: none;
    font: 500 0.95rem var(--font);
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.btn-quiet:hover { border-color: var(--signal); color: var(--signal); }

.text-button {
    border: 0;
    background: none;
    padding: 2px 0;
    color: var(--ink-2);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    border-bottom: 1px solid currentColor;
}

.text-button:hover { color: var(--signal); }
.text-button.inline { font: inherit; text-transform: none; letter-spacing: 0; color: var(--signal); }

/* ---------- 04 Lyrics ---------- */
.lyrics-body { display: grid; gap: 22px; }
@media (min-width: 980px) {
    .lyrics-body { grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: end; }
    .lyrics-aside .lyrics-note { margin-top: 0; }
}
.lyrics-window {
    position: relative;
    height: 320px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
}

.lyrics-lines {
    display: grid;
    gap: 10px;
    transition: transform 0.7s var(--ease);
    will-change: transform;
}

.lyric {
    color: var(--ink-3);
    font-size: clamp(1.3rem, 3vw, 2.1rem);
    font-weight: 500;
    line-height: 1.22;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
    transform-origin: left center;
    transition: color 0.45s var(--ease), opacity 0.45s var(--ease), filter 0.45s var(--ease);
}

.lyric.past { opacity: 0.35; }
.lyric.active { color: var(--ink); }
.lyric.active::before { content: ''; display: inline-block; width: 0.32em; height: 0.32em; margin: 0 0.35em 0.12em 0; border-radius: 50%; background: var(--signal); vertical-align: middle; }
.lyric-gap { letter-spacing: 0.3em; }

/* A repeated part of the song: later lines are not certain yet, so they stay soft */
.lyrics.uncertain .lyric:not(.past):not(.active) { opacity: 0.3; filter: blur(3px); }

.lyrics-plain { color: var(--ink-2); white-space: pre-line; font-size: 1.05rem; line-height: 1.75; }
.lyrics[data-kind='plain'] .lyrics-window { height: auto; max-height: 380px; overflow-y: auto; -webkit-mask-image: none; mask-image: none; }
.lyrics:is([data-kind='not-found'], [data-kind='instrumental']) .lyrics-window { height: auto; -webkit-mask-image: none; mask-image: none; }
.lyrics-empty { color: var(--ink-2); font-size: 1.15rem; }

.lyrics-note {
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
    max-width: 72ch;
    color: var(--ink-3);
    font-size: 0.82rem;
    line-height: 1.55;
}

.lyrics-credit { margin-top: 8px; color: var(--ink-3); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- No match ---------- */
.notice-text { color: var(--ink-2); max-width: 60ch; margin-bottom: 14px; }
.tips { display: grid; gap: 8px; margin-bottom: 22px; }
.tips li { padding-left: 22px; position: relative; color: var(--ink-2); }
.tips li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.tips strong { color: var(--ink); font-weight: 500; }

/* ---------- 05 Signal (spectrogram) ---------- */
.scope {
    position: relative;
    height: 240px;
    border: 1px solid var(--rule);
    overflow: hidden;
}

.scope-canvas { display: block; width: 100%; height: 100%; }

.freq-axis { position: absolute; inset: 0 auto 0 0; width: 44px; pointer-events: none; z-index: 1; }
.freq-axis span {
    position: absolute;
    left: 8px;
    transform: translateY(-50%);
    color: var(--ink-3);
    font-size: 0.62rem;
}

.scope-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--ink-3);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    pointer-events: none;
}

body[data-audio='seen'] .scope-empty { display: none; }

.scope-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: var(--ink-3);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-box { width: 12px; height: 12px; border: 1px solid var(--ink); transition: background 0.15s; }
.toggle input:checked + .toggle-box { background: var(--signal); border-color: var(--signal); }
.toggle input:focus-visible + .toggle-box { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ---------- 06 Recently identified ---------- */
.recent-list li { grid-template-columns: 36px minmax(0, 1fr) auto; }
.recent-empty { color: var(--ink-3); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Colophon ---------- */
.colophon {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 18px var(--gutter) 28px;
    border-top: 1px solid var(--rule);
    color: var(--ink-3);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.star-mark { color: var(--signal); margin-right: 4px; }

/* ---------- Arrival: the page assembles itself once ---------- */
.masthead, .intro > *, .console > .panel, .signal, .recent {
    animation: arrive 0.9s var(--ease) both;
}

.intro > :nth-child(2) { animation-delay: 0.06s; }
.intro > :nth-child(3) { animation-delay: 0.12s; }
.console > .panel:nth-child(1) { animation-delay: 0.18s; }
.console > .panel:nth-child(2) { animation-delay: 0.26s; }
.signal { animation-delay: 0.34s; }
.recent { animation-delay: 0.4s; }

@keyframes arrive {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
    .masthead-meta { font-size: 0.68rem; }
    .instrument { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .readout { justify-items: center; width: 100%; }
    .gauges { width: 100%; text-align: left; }
    .result-body { grid-template-columns: 1fr; }
    .facts { flex-direction: column; gap: 4px; }
    .facts li + li::before { content: none; }
    .lyrics-window { height: 260px; }
    .scope { height: 180px; }
    .panel-head .panel-status { flex-basis: 100%; order: 3; }
}

/* ---------- Motion sensitivity ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
