/* Interface Harmony 3 — "Ambient Liquid". Design: design/HANDOFF.md. */

@font-face { font-family: Sora; font-weight: 300 700; font-display: swap; src: url(../fonts/sora-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Sora; font-weight: 300 700; font-display: swap; src: url(../fonts/sora-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400 500; font-display: swap; src: url(../fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400 500; font-display: swap; src: url(../fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Each player's tint is set from its screenshot by app.js. Registering the properties lets them transition. */
@property --a-accent { syntax: '<color>'; inherits: true; initial-value: hsl(262 95% 71%); }
@property --a-soft   { syntax: '<color>'; inherits: true; initial-value: hsl(300 95% 74%); }
@property --a-glow   { syntax: '<color>'; inherits: true; initial-value: hsla(262, 95%, 60%, 0.45); }
@property --a-deep   { syntax: '<color>'; inherits: true; initial-value: hsla(262, 90%, 45%, 0.55); }
@property --a-deep2  { syntax: '<color>'; inherits: true; initial-value: hsla(300, 90%, 50%, 0.35); }
@property --b-accent { syntax: '<color>'; inherits: true; initial-value: hsl(262 95% 71%); }
@property --b-soft   { syntax: '<color>'; inherits: true; initial-value: hsl(300 95% 74%); }
@property --b-glow   { syntax: '<color>'; inherits: true; initial-value: hsla(262, 95%, 60%, 0.45); }
@property --b-deep   { syntax: '<color>'; inherits: true; initial-value: hsla(262, 90%, 45%, 0.55); }

:root {
  --bg: #050507;
  --text: #f2f1f6;
  --secondary: #cfcddb;
  --muted: #b8b5c6;
  --meta: #a9a6b8;
  --faint: #8b8899;
  --link: #c9c2ff;
  --error: #ffb3c0;
  --ink: #08080c;
  --sans: Sora, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
  transition: --a-accent 1s, --a-soft 1s, --a-glow 1s, --a-deep 1.4s ease, --a-deep2 1.4s ease,
              --b-accent 1s, --b-soft 1s, --b-glow 1s, --b-deep 1.4s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #fff; }
button { font-family: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font: 400 11px var(--mono); }
.muted { color: var(--meta); }
.glass { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.noscript { padding: 24px; color: var(--secondary); }

/* ---------- ambient background ---------- */
.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); transition: transform 0.12s linear; }
.blob-a { left: -12vw; top: -18vh; width: 62vw; height: 62vw; background: radial-gradient(circle, var(--a-deep), transparent 62%);
  animation: ih-drift-a 22s ease-in-out infinite alternate; }
.blob-b { right: -14vw; top: -10vh; width: 60vw; height: 60vw; background: radial-gradient(circle, var(--b-deep), transparent 62%);
  animation: ih-drift-b 26s ease-in-out infinite alternate; }
.blob-c { left: 25vw; bottom: -30vh; width: 50vw; height: 50vw; background: radial-gradient(circle, var(--a-deep2), transparent 60%);
  animation: ih-drift-c 30s ease-in-out infinite alternate; }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, rgba(5, 5, 7, 0) 0%, rgba(5, 5, 7, 0.6) 70%); }
@keyframes ih-drift-a { 0% { translate: 0 0; } 50% { translate: 6vw 4vh; } 100% { translate: -3vw 8vh; } }
@keyframes ih-drift-b { 0% { translate: 0 0; } 50% { translate: -6vw -3vh; } 100% { translate: 4vw 5vh; } }
@keyframes ih-drift-c { 0% { translate: 0 0; } 100% { translate: -8vw -6vh; } }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; transform: none !important; } }

.page { position: relative; z-index: 1; }

/* ---------- header ---------- */
.masthead { max-width: 1360px; margin: 0 auto; padding: 18px 28px 6px; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.logo { display: block; width: 50px; height: 50px; overflow: visible; transform: rotate(-35deg);
  filter: drop-shadow(0 0 8px var(--a-glow)) drop-shadow(0 0 16px var(--b-glow)); }
.stop-a { stop-color: var(--a-accent); }
.stop-b { stop-color: var(--b-accent); }
.brand-name { display: block; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand-tag { display: block; font-size: 12px; color: var(--meta); font-weight: 300; white-space: nowrap; }
.views { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 9px 20px; min-height: 38px;
  background: rgba(255, 255, 255, 0.05); color: var(--text); font: 500 13px var(--sans); text-decoration: none; }
.pill:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.pill[aria-current='page'] { background: #fff; color: var(--bg); }

.volume { display: flex; align-items: center; gap: 10px; font: 400 11px var(--mono); color: var(--meta); }
.volume output { width: 24px; }
.volume input { --vol: 80%; appearance: none; -webkit-appearance: none; width: 120px; height: 20px; margin: 0;
  background: transparent; cursor: pointer; }
.volume input::-webkit-slider-runnable-track { height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #fff var(--vol), rgba(255, 255, 255, 0.15) var(--vol)); }
.volume input::-moz-range-track { height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.15); }
.volume input::-moz-range-progress { height: 2px; border-radius: 2px; background: #fff; box-shadow: 0 0 10px #fff; }
.volume input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border: 0;
  border-radius: 50%; background: #fff; box-shadow: 0 0 12px #fff; }
.volume input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 12px #fff; }

/* ---------- Listen ---------- */
.listen { max-width: 1360px; margin: 0 auto; padding: 12px 28px 36px; }
.decks { display: grid; grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.deck-slot { display: flex; min-width: 0; }

.deck { --accent: var(--a-accent); --soft: var(--a-soft); --glow: var(--a-glow);
  position: relative; flex: 1; min-width: 0; padding: 20px; border-radius: 28px; background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1); -webkit-backdrop-filter: blur(28px) saturate(1.4); backdrop-filter: blur(28px) saturate(1.4);
  display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 80px -30px var(--glow); }
.deck[data-which='B'] { --accent: var(--b-accent); --soft: var(--b-soft); --glow: var(--b-glow); }

.deck-head { display: flex; align-items: center; gap: 14px; }
.letter { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent);
  color: var(--bg); font-weight: 700; font-size: 15px; box-shadow: 0 0 24px var(--glow); }
.deck-title { flex: 1; min-width: 0; }
.short { font-weight: 600; font-size: 21px; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05); color: var(--text); }
.round:hover { background: rgba(255, 255, 255, 0.1); }
.round[aria-disabled='true'] { opacity: 0.35; }

.wave { position: relative; aspect-ratio: 994 / 245; border-radius: 18px; overflow: hidden; background: #000; cursor: pointer; isolation: isolate; }
.wave.is-empty { cursor: default; }
.wave > * { position: absolute; }
.wave-fill { inset: 0; background: linear-gradient(90deg, var(--accent), var(--soft)); }
/* The plots include matplotlib axes; this crops to the plot area (verified across all 43 plots). */
.wave-img { left: -8.15%; top: 0; margin-top: -3.32%; width: 108.65%; max-width: none; filter: invert(1) grayscale(1) contrast(1.6); mix-blend-mode: multiply; }
/* Dark text: the accent gradient behind it is light (accent and soft pass 4.5:1 against bg). */
.wave-empty { inset: 0; display: grid; place-items: center; text-align: center; padding: 12px; font-weight: 700; font-size: 15px; color: var(--bg); z-index: 2; }
.wave-dim { top: 0; bottom: 0; right: 0; left: var(--progress, 0%); background: rgba(0, 0, 0, 0.62); opacity: 0; }
.wave-bars { inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; }
.wave-head { top: 0; bottom: 0; left: var(--progress, 0%); width: 2px; background: #fff; box-shadow: 0 0 14px #fff; opacity: 0; }
.deck.is-playing .wave-dim, .deck.is-playing .wave-head { opacity: 1; }

.now { display: flex; align-items: center; gap: 16px; }
.thumb { position: relative; flex: none; width: 92px; height: 62px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.thumb-glow { filter: blur(14px) saturate(2); opacity: 0.8; }
.thumb-img { border: 1px solid rgba(255, 255, 255, 0.18); }
.now-text { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.sound-name { font-weight: 600; font-size: 16px; line-height: 1.3; text-wrap: pretty; }
.time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent), var(--soft));
  color: var(--bg); font-size: 16px; letter-spacing: -2px; box-shadow: 0 0 36px var(--glow); }
.play:active:not(:disabled), .both:active { transform: scale(0.94); }
.play:disabled { opacity: 0.35; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab, .chip, .target { border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.05); color: var(--text); }
.tab:hover, .chip:hover, .target:hover { background: rgba(255, 255, 255, 0.1); }
.tab[aria-pressed='true'], .chip[aria-pressed='true'], .target[aria-pressed='true'] { background: #fff; border-color: #fff; color: var(--bg); }
.tab { padding: 7px 14px; min-height: 32px; font: 500 12px var(--sans); }

.status { display: grid; gap: 6px; }
.status:not(:has(:not(:empty))) { display: none; }
.status > :empty { display: none; }
.badge { justify-self: start; white-space: nowrap; font: 400 10px var(--mono); letter-spacing: 0.06em; padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28); }
.status-text { font-size: 12.5px; line-height: 1.5; color: var(--secondary); text-wrap: pretty; }
.error { font-size: 12.5px; line-height: 1.5; font-weight: 600; color: var(--error); }

.deck-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08); }
.moves { min-width: 0; flex: 1; }
.eyebrow { font: 400 10px var(--mono); letter-spacing: 0.12em; color: var(--accent); }
.icon-name { font-weight: 600; font-size: 15px; margin-top: 4px; }
.icon-name a { color: inherit; text-decoration: none; }
.icon-name a:hover { text-decoration: underline; }
.icon-note { font-size: 12px; line-height: 1.5; color: var(--muted); font-weight: 300; margin-top: 4px; text-wrap: pretty; }
.target { flex: none; padding: 7px 12px; min-height: 32px; font: 500 11px var(--sans); white-space: nowrap; }

.centre { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.both { width: 76px; height: 76px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, var(--a-accent), var(--b-accent)); color: var(--bg); font-size: 15px; letter-spacing: -3px;
  box-shadow: 0 0 40px var(--a-glow), 0 0 40px var(--b-glow); }
.centre-label { font-size: 11px; color: var(--meta); text-align: center; line-height: 1.3; font-weight: 300; }
.swap { margin-top: 10px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06); color: var(--text); font-size: 16px; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.swap:hover { background: rgba(255, 255, 255, 0.12); }

.timeline { margin-top: 20px; padding: 14px 14px 12px; border-radius: 24px; }
.timeline-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 6px 10px; }
.timeline-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.timeline-title h2 { font-weight: 600; font-size: 14px; }
.timeline-title .muted { font-size: 12px; font-weight: 300; }
.targets { display: flex; gap: 4px; }
.chip { width: 32px; height: 28px; font: 600 12px var(--sans); }
.strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 6px 6px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
.tile { position: relative; flex: none; width: 96px; padding: 5px 5px 8px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05); color: var(--text); display: grid; gap: 6px; text-align: left; }
.tile:hover { background: rgba(255, 255, 255, 0.1); }
.tile[aria-pressed='true'] { background: #fff; border-color: #fff; color: var(--bg); }
.tile img { width: 100%; aspect-ratio: 147 / 100; object-fit: cover; border-radius: 9px; display: block; }
.tile-cap { font: 400 10px var(--mono); padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { position: absolute; top: 9px; font: 600 9px var(--sans); background: #fff; color: var(--bg); border-radius: 4px; padding: 1px 4px; }
.tag-a { left: 9px; }
.tag-b { right: 9px; }

@media (max-width: 900px) {
  .masthead, .listen { padding-left: 16px; padding-right: 16px; }
  .decks { grid-template-columns: minmax(0, 1fr); }
  .centre { flex-direction: row; flex-wrap: wrap; gap: 10px 14px; }
  .centre .swap { margin-top: 0; }
  #deck-b { order: 3; }
}
@media (max-width: 480px) {
  .deck { padding: 16px; border-radius: 24px; }
  .now { gap: 12px; }
  .thumb { width: 72px; height: 49px; }
}

/* ---------- Research ---------- */
.research { max-width: 1120px; margin: 0 auto; padding: 40px 28px 72px; display: grid; gap: 48px; }
.research h2 { font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.r-intro { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 40px; align-items: end; }
.r-intro-lead { display: grid; gap: 18px; }
.r-eyebrow { font: 400 11px var(--mono); letter-spacing: 0.12em; color: var(--link); }
.r-intro h1 { font-size: clamp(38px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 600; text-wrap: balance; }
.r-intro p { text-wrap: pretty; }
.r-about { display: grid; gap: 14px; font-size: 16px; line-height: 1.7; color: var(--secondary); font-weight: 300; }
.r-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.r-stats div { padding: 20px 0; }
.r-stats strong { display: block; font-size: 40px; font-weight: 600; letter-spacing: -0.03em; }
.r-stats span { font: 400 11px var(--mono); color: var(--meta); }
.r-method { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.r-card { padding: 22px; border-radius: 20px; display: grid; gap: 10px; align-content: start; }
.r-card .n { font: 400 12px var(--mono); color: var(--link); }
.r-card h3 { font-size: 19px; font-weight: 600; }
.r-card p { font-size: 14px; line-height: 1.6; color: var(--muted); font-weight: 300; text-wrap: pretty; }
.r-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 40px; }
.r-col { display: grid; gap: 10px; align-content: start; }
.r-col > p { font-size: 14px; line-height: 1.65; color: var(--secondary); font-weight: 300; text-wrap: pretty; }
.r-glossary { display: grid; gap: 8px; margin: 0; }
.r-glossary div { font-size: 14px; line-height: 1.55; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.r-glossary dt { font-weight: 600; }
.r-glossary dd { margin: 0; color: var(--muted); font-weight: 300; text-wrap: pretty; }
.r-icons { display: grid; gap: 18px; }
.r-icons > h2 { font-size: 30px; letter-spacing: -0.02em; margin: 0; }
.r-icons > p { font-size: 15px; line-height: 1.65; color: var(--muted); max-width: 70ch; font-weight: 300; text-wrap: pretty; }
.r-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.r-icon { padding: 18px 20px; border-radius: 18px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid; gap: 8px; align-content: start; scroll-margin-top: 24px; }
.r-icon:target { border-color: var(--link); }
.r-icon-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.r-icon-head h3 { font-weight: 600; font-size: 15px; }
.r-icon-head span { font: 400 11px var(--mono); color: var(--link); }
.r-icon .short-def { font-size: 14px; font-weight: 500; line-height: 1.45; }
.r-icon .meaning { font-size: 13px; line-height: 1.6; color: var(--muted); font-weight: 300; text-wrap: pretty; }
.r-credits { display: grid; gap: 8px; align-content: start; font-size: 13px; line-height: 1.55; }
.r-person { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.r-person h3 { font-size: 15px; font-weight: 600; }
.r-person p { color: var(--secondary); font-weight: 300; text-wrap: pretty; }
.r-sources-title { margin-top: 10px; font: 400 11px var(--mono); color: var(--meta); }
.r-sources { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.r-sources span { color: var(--faint); }
.r-rights { margin-top: 12px; color: var(--meta); font-weight: 300; }
.r-cite { margin-top: 6px; font-size: 12px; line-height: 1.5; opacity: 0.85; text-wrap: pretty; }

@media (max-width: 640px) {
  .research { padding: 28px 16px 56px; gap: 40px; }
  .r-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
