/* AntJanus FM — music player metaphor.
   Articles are tracks, collections are albums, the site chrome is a player. */

:root {
  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --side-w: 288px;
  --player-h: 88px;
  --radius: 12px;
  --radius-sm: 8px;
  --read-scale: 1;

  /* light: record-sleeve paper */
  --bg: #efebe4;
  --side: #e6e0d6;
  --surface: #fbfaf7;
  --surface-2: #f1ede6;
  --hover: #e7e1d7;
  --ink: #15171c;
  --dim: #525a66;
  --line: #d6cfc3;
  --accent: #c23a24;
  --accent-ink: #a8301c;
  --on-accent: #ffffff;
  --brand: #364f6a;
  --gold: #8a5a06;
  --player: #15171c;
  --player-ink: #f3f1ec;
  --player-dim: #aeb4bf;
  --player-line: #343944;
  --code-bg: #15171c;
  --code-ink: #e6e8ee;
  --shadow: 0 10px 30px -12px rgba(30, 24, 14, .35);
  --tint: #364f6a;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #07080b;
  --side: #0d0f14;
  --surface: #13161d;
  --surface-2: #1b1f28;
  --hover: #232835;
  --ink: #f2f4f8;
  --dim: #a6afbe;
  --line: #2a303c;
  --accent: #ff7058;
  --accent-ink: #ff8a76;
  --on-accent: #1a0906;
  --brand: #6f92bd;
  --gold: #e3b45c;
  --player: #000000;
  --player-ink: #f2f4f8;
  --player-dim: #a6afbe;
  --player-line: #2c313c;
  --code-bg: #0b0d12;
  --code-ink: #e6e8ee;
  --shadow: 0 12px 36px -12px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07080b;
    --side: #0d0f14;
    --surface: #13161d;
    --surface-2: #1b1f28;
    --hover: #232835;
    --ink: #f2f4f8;
    --dim: #a6afbe;
    --line: #2a303c;
    --accent: #ff7058;
    --accent-ink: #ff8a76;
    --on-accent: #1a0906;
    --brand: #6f92bd;
    --gold: #e3b45c;
    --player: #000000;
    --player-ink: #f2f4f8;
    --player-dim: #a6afbe;
    --player-line: #2c313c;
    --code-bg: #0b0d12;
    --code-ink: #e6e8ee;
    --shadow: 0 12px 36px -12px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

.tint-ai { --tint: #6d4bd1; }
.tint-garden { --tint: #1f7a58; }
.tint-tools { --tint: #b0701a; }
.tint-iai { --tint: #9e2f3a; }
.tint-brand { --tint: #364f6a; }
.tint-patterns { --tint: #2a5c8f; }
.tint-about { --tint: #4d6b3c; }

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: .75rem 1rem; border-radius: 8px; font-weight: 700;
}
.skip:focus { left: 8px; }

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

.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: currentColor; }

/* ---------- App shell ---------- */

.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  gap: 8px;
  padding: 8px 8px calc(var(--player-h) + 8px);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 8px;
  align-self: start;
  height: calc(100vh - var(--player-h) - 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem .75rem;
}

.side-library { flex: 1; overflow-y: auto; min-height: 0; }

.lockup {
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none; padding: .25rem .5rem 1rem;
}
.monogram { width: 44px; height: 44px; flex: none; }
.lockup-words { display: flex; flex-direction: column; line-height: 1.1; }
.lockup-small { font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .12em; color: var(--dim); }
.lockup-big { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: .02em; }
.lockup-big span { color: var(--accent-ink); }

.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-list a {
  display: flex; align-items: center; gap: 1rem;
  padding: .625rem .75rem; min-height: 44px;
  border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 700; color: var(--dim);
  transition: color .15s, background-color .15s;
}
.nav-list a:hover { color: var(--ink); background: var(--hover); }
.nav-list a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav-list a[aria-current="page"] .icon { color: var(--accent-ink); }
.nav-list .ext { margin-left: auto; font-size: .8125rem; font-weight: 500; }

.side-search { display: flex; gap: .5rem; margin-top: .75rem; }
.side-search input { flex: 1; min-width: 0; }

.field {
  font: inherit; font-size: 1rem;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .625rem 1rem; min-height: 44px;
}
.field::placeholder { color: var(--dim); opacity: 1; }
.field:focus-visible { outline-offset: 1px; }

.lib-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 .5rem .75rem; color: var(--dim); font-weight: 700;
}
.lib-head h2 { margin: 0; font-size: 1rem; display: flex; gap: .75rem; align-items: center; }
.lib-chips { display: flex; gap: .5rem; flex-wrap: wrap; padding: 0 .5rem .75rem; }

.lib-list { list-style: none; margin: 0; padding: 0; }
.lib-list a {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: .75rem; align-items: center;
  padding: .5rem; border-radius: var(--radius-sm); text-decoration: none;
}
.lib-list a:hover { background: var(--hover); }
.lib-list .mini-cover { width: 48px; height: 48px; border-radius: 6px; }
.lib-list a > span:last-child { min-width: 0; }
.lib-title { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-sub { display: block; color: var(--dim); font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chip {
  display: inline-flex; align-items: center; gap: .375rem;
  font: inherit; font-size: .875rem; font-weight: 600;
  padding: .375rem .875rem; min-height: 36px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Mobile top bar ---------- */

.topbar { display: none; }

@media (max-width: 1023px) {
  .app { display: block; padding: 0 0 calc(72px + 1rem); }
  .side { display: none; }
  .topbar {
    display: block;
    position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-row { display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem; }
  .topbar .lockup { padding: 0; margin-right: auto; }
  .topbar .monogram { width: 36px; height: 36px; }
  .topbar-nav {
    display: flex; gap: .5rem; overflow-x: auto; padding: 0 1rem .75rem;
    scrollbar-width: none; list-style: none; margin: 0;
  }
  .topbar-nav::-webkit-scrollbar { display: none; }
  .topbar-nav a { white-space: nowrap; }
  .topbar-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 999px;
  background: transparent; color: inherit; border: 0; cursor: pointer;
  text-decoration: none;
  transition: background-color .15s, transform .15s;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { transform: scale(.94); }

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Main view ---------- */

.view {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
  position: relative;
}
@media (max-width: 1023px) { .view { border-radius: 0; } }

.view-top {
  display: flex; justify-content: flex-end; align-items: center; gap: .5rem;
  padding: .75rem 1rem 0; position: absolute; right: 0; top: 0; z-index: 5;
}
@media (max-width: 1023px) { .view-top { display: none; } }
.view-top .icon-btn { background: rgba(0, 0, 0, .45); color: #fff; }
.view-top .icon-btn:hover { background: rgba(0, 0, 0, .7); }

.wash {
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 70%, var(--surface)) 0%, color-mix(in srgb, var(--tint) 18%, var(--surface)) 62%, var(--surface) 100%);
}

.section { padding: 1.5rem clamp(1rem, 3vw, 2rem); }
.section + .section { padding-top: .5rem; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.section-head h2 {
  margin: 0; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.5rem, 2.4vw, 1.875rem); letter-spacing: -.01em; line-height: 1.15;
}
.section-head p { margin: .25rem 0 0; color: var(--dim); }
.see-all {
  font-weight: 700; color: var(--dim); text-decoration: none; white-space: nowrap;
  padding: .5rem 0;
}
.see-all:hover { color: var(--ink); text-decoration: underline; }

.eyebrow {
  font-family: var(--font-mono); font-size: .8125rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
}

/* ---------- Album / artist header ---------- */

.album-head {
  display: grid;
  grid-template-columns: clamp(160px, 22vw, 232px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: end;
  padding: clamp(4rem, 8vw, 5.5rem) clamp(1rem, 3vw, 2rem) 1.75rem;
}
.album-head .cover-lg { box-shadow: 0 16px 48px -8px rgba(0, 0, 0, .55); border-radius: var(--radius-sm); }
.album-head h1 {
  margin: .25rem 0 .75rem;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.25rem, 6vw, 5rem); line-height: .98; letter-spacing: -.03em;
}
.album-head .lede { margin: 0 0 1rem; font-size: 1.125rem; max-width: 62ch; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; font-weight: 600; }
.byline .dot::before { content: "•"; color: var(--dim); }
.byline .muted { color: var(--dim); font-weight: 500; }
.byline img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

@media (max-width: 640px) {
  .album-head { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .album-head .cover-lg { width: min(260px, 72vw); justify-self: center; }
}

/* artist banner (home + about) */

.artist {
  position: relative; min-height: clamp(420px, 56vw, 560px);
  display: flex; align-items: flex-end;
  color: #fff; isolation: isolate;
}
.artist-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 30%; z-index: -2;
}
.artist::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(8, 9, 12, 0) 20%, rgba(8, 9, 12, .55) 55%, rgba(8, 9, 12, .82) 100%),
              linear-gradient(0deg, rgba(8, 9, 12, .88) 0%, rgba(8, 9, 12, 0) 55%);
}
.artist-inner { padding: 2rem clamp(1rem, 3vw, 2rem); max-width: 760px; margin-left: auto; }
.verified { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9375rem; }
.verified svg { width: 22px; height: 22px; }
.artist h1 {
  margin: .5rem 0 .75rem;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.25rem, 5.4vw, 4.5rem); line-height: 1; letter-spacing: -.03em;
  text-wrap: balance;
}
.artist p { margin: 0 0 .75rem; font-size: 1.125rem; color: #e9ebf0; max-width: 56ch; }
.artist .listeners { font-family: var(--font-mono); font-size: .9375rem; color: #d6dae2; }
.artist .listeners b { color: #fff; }

@media (max-width: 640px) {
  .artist { min-height: 560px; }
  .artist-photo { object-position: 22% 20%; }
  .artist::after { background: linear-gradient(0deg, rgba(8, 9, 12, .95) 0%, rgba(8, 9, 12, .75) 45%, rgba(8, 9, 12, 0) 75%); }
  .artist-inner { margin-left: 0; }
}

/* action row */

.actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem;
  padding: 1.25rem clamp(1rem, 3vw, 2rem);
}
.play-xl {
  display: inline-grid; place-items: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  border: 0; cursor: pointer; text-decoration: none;
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform .15s, filter .15s;
}
.play-xl:hover { transform: scale(1.05); filter: brightness(1.06); }
.play-xl:active { transform: scale(.96); }
.play-xl .icon { width: 28px; height: 28px; }
.play-label { display: flex; flex-direction: column; line-height: 1.25; text-decoration: none; }
.play-label b { font-size: 1.0625rem; }
.play-label span { color: var(--dim); font-size: .9375rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-weight: 700; font-size: 1rem;
  padding: .625rem 1.25rem; min-height: 44px;
  border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink);
  text-decoration: none; cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .15s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn-solid:hover { filter: brightness(1.15); }
.btn-accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-quiet { border-color: transparent; color: var(--dim); padding-inline: .5rem; }
.btn-quiet:hover { color: var(--ink); border-color: transparent; text-decoration: underline; }
.btn-on-photo { color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-on-photo:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.btn-link-photo { color: #e9ebf0; border-color: transparent; padding-inline: .25rem; }
.btn-link-photo:hover { color: #fff; text-decoration: underline; border-color: transparent; }

/* ---------- Covers ---------- */

.cover {
  aspect-ratio: 1; width: 100%;
  border-radius: 6px; overflow: hidden; position: relative;
  background: var(--surface-2);
}
.cover > img { width: 100%; height: 100%; object-fit: cover; }
.cover-wide > img { object-fit: cover; object-position: center; }

/* generated covers: typography on a colored sleeve */
.gen {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 12%; color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .22), transparent 55%),
    repeating-radial-gradient(circle at 120% 120%, rgba(0, 0, 0, .0) 0 6px, rgba(0, 0, 0, .08) 6px 7px),
    var(--sleeve, #364f6a);
}
.gen .gen-k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.gen { container-type: inline-size; }
.gen .gen-t { font-family: var(--font-display); font-weight: 800; line-height: 1; letter-spacing: -.02em; font-size: 13cqi; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cover-lg .gen-t { font-size: 14cqi; }
.mini-cover.gen { padding: 0; display: grid; place-items: center; background: var(--sleeve); }
.mini-cover.gen .gen-t { font-size: 1rem; }

.cover-label {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(8, 9, 12, .78); color: #fff;
  font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .25rem .5rem; border-radius: 4px;
}

.mini-cover { width: 44px; height: 44px; border-radius: 4px; overflow: hidden; flex: none; background: var(--surface-2); }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Shelf (grid of album/track cards) ---------- */

.shelf {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.shelf-wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 480px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .shelf-wide { grid-template-columns: 1fr; }
}

.card {
  position: relative; padding: .75rem; border-radius: var(--radius-sm);
  transition: background-color .15s;
}
.card:hover, .card:focus-within { background: var(--hover); }
.card .cover { margin-bottom: .75rem; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 .25rem; font-size: 1.0625rem; line-height: 1.3; font-weight: 700; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-sm); }
.card h3 a:focus-visible { outline: none; }
.card:has(h3 a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.card p { margin: 0; color: var(--dim); font-size: .9375rem; line-height: 1.45; }
.card .clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: .5rem; font-family: var(--font-mono); font-size: .8125rem; color: var(--dim); }

.hover-play {
  position: absolute; right: 8px; bottom: 8px;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.card:hover .hover-play, .card:focus-within .hover-play { opacity: 1; transform: none; }
@media (hover: none) { .hover-play { opacity: 1; transform: none; width: 40px; height: 40px; } }

/* ---------- Tracklist ---------- */

.section, .grid-2 > div, .after-track > section, .queue { container-type: inline-size; }
.tracks { list-style: none; margin: 0; padding: 0; counter-reset: track; }
.tracks-head, .track {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) minmax(0, 13rem) 8.5rem;
  gap: 1rem; align-items: center;
  padding: .5rem 1rem;
}
.tracks-head {
  color: var(--dim); border-bottom: 1px solid var(--line); margin-bottom: .5rem;
  font-size: .875rem; font-weight: 600;
}
.tracks-head .r, .track .r { text-align: right; }
.track {
  position: relative; border-radius: var(--radius-sm);
  transition: background-color .15s;
}
.track:hover, .track:focus-within { background: var(--hover); }
.track .n {
  font-family: var(--font-mono); color: var(--dim); text-align: right; font-size: .9375rem;
  position: relative;
}
.track .n .pi { display: none; width: 1rem; height: 1rem; margin-left: auto; color: var(--ink); }
.track:hover .n .num, .track:focus-within .n .num { visibility: hidden; }
.track:hover .n .pi, .track:focus-within .n .pi { display: block; position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.track-main { display: flex; align-items: center; gap: .875rem; min-width: 0; }
.track-text { min-width: 0; }
.track-title { font-weight: 700; font-size: 1rem; line-height: 1.35; text-decoration: none; display: block; }
.track-title::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-sm); }
.track-title:focus-visible { outline: none; }
.track:has(.track-title:focus-visible) { outline: 3px solid var(--accent); outline-offset: 1px; }
.track-sub { color: var(--dim); font-size: .9375rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.track .album, .track .date { color: var(--dim); font-size: .9375rem; }
.track .date { font-family: var(--font-mono); font-size: .875rem; }
.track .album { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .inline-links { position: relative; z-index: 2; }
.track.is-current .track-title { color: var(--accent-ink); }
.track.is-unreleased { opacity: .78; }
.track.is-unreleased .track-title::after { display: none; }

.badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: .8125rem; font-weight: 500; letter-spacing: .04em;
  padding: .0625rem .5rem; border-radius: 4px;
  background: var(--surface-2); color: var(--dim); border: 1px solid var(--line);
  vertical-align: middle;
}
.badge-new { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.badge-upd { color: var(--ink); border-color: var(--ink); background: transparent; }
.badge-e { background: var(--dim); color: var(--surface); border-color: var(--dim); font-weight: 700; }

@container (max-width: 760px) {
  .tracks-head, .track { grid-template-columns: 2rem minmax(0, 1fr) 6.5rem; }
  .tracks-head .c-album, .track .album { display: none; }
}
@container (max-width: 480px) {
  .tracks-head { display: none; }
  .track { grid-template-columns: 1.5rem minmax(0, 1fr); gap: .75rem; padding: .625rem .5rem; }
  .track .date { grid-column: 2; text-align: left; margin-top: -.5rem; font-size: .8125rem; }
  .track .r { text-align: left; }
}

/* equalizer marker for "now playing" */
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--accent-ink); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(1) { height: 60%; }
.eq i:nth-child(2) { height: 100%; animation-delay: -.3s; }
.eq i:nth-child(3) { height: 40%; animation-delay: -.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
.eq i { transform-origin: bottom; }

/* ---------- Generic panels ---------- */

.panel {
  background: var(--surface-2); border-radius: var(--radius); padding: 1.5rem;
}
.panel h3 { margin: 0 0 .5rem; font-family: var(--font-display); font-size: 1.375rem; }

.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

.stats-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stats-strip > div { background: var(--surface); padding: 1rem 1.25rem; }
.stats-strip b { display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1.1; }
.stats-strip span { color: var(--dim); font-size: .9375rem; }
@media (max-width: 480px) { .stats-strip b { font-size: 1.5rem; } .stats-strip > div { padding: .75rem; } }

.link-rows { list-style: none; margin: 0; padding: 0; }
.link-rows a {
  display: flex; align-items: center; gap: .875rem; padding: .625rem .5rem; min-height: 48px;
  border-radius: var(--radius-sm); text-decoration: none;
}
.link-rows a:hover { background: var(--hover); }
.link-rows small { display: block; color: var(--dim); font-size: .875rem; }
.link-rows .ic {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); flex: none;
}

.dark-card {
  background: var(--player); color: var(--player-ink); border-radius: var(--radius); padding: 1.75rem;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1rem;
}
.dark-card h3 { font-family: var(--font-display); font-size: 1.75rem; margin: 0 0 .5rem; line-height: 1.1; }
.dark-card p { margin: 0; color: var(--player-dim); font-size: 1.0625rem; }
.dark-card .btn { align-self: flex-start; background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.notice {
  display: flex; gap: .875rem; align-items: flex-start;
  padding: 1rem 1.25rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.notice b { color: var(--ink); }

.consult {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--surface-2);
}
.consult p { margin: 0; font-size: 1.0625rem; }

/* ---------- Newsletter ---------- */

.newsletter { display: grid; gap: .75rem; }
.newsletter form { display: flex; gap: .5rem; flex-wrap: wrap; }
.newsletter .field { flex: 1 1 220px; }
.newsletter .ok { display: none; }
.newsletter.is-done form { display: none; }
.newsletter.is-done .ok { display: block; }
.newsletter .ok b { display: block; font-size: 1.125rem; }

/* ---------- Footer ---------- */

.foot {
  padding: 2.5rem clamp(1rem, 3vw, 2rem) 2rem; border-top: 1px solid var(--line); margin-top: 2rem;
  display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr 1.6fr;
}
.foot h2 { font-size: 1rem; margin: 0 0 .75rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.foot ul a { color: var(--dim); text-decoration: none; display: inline-block; padding: .25rem 0; }
.foot ul a:hover { color: var(--ink); text-decoration: underline; }
.foot p { color: var(--dim); margin: .75rem 0 0; }
.foot-bottom { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1.25rem; color: var(--dim); font-size: .9375rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 1100px) { .foot { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot { grid-template-columns: 1fr; } }

/* ---------- Player bar ---------- */

.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--player-h);
  background: var(--player); color: var(--player-ink);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center; gap: 1rem; padding: 0 1rem;
  border-top: 1px solid var(--player-line);
}
.np { display: flex; align-items: center; gap: .875rem; min-width: 0; text-decoration: none; }
.np img, .np .mini-cover { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; }
.np-text { min-width: 0; display: flex; flex-direction: column; }
.np-text > span { display: block; }
.np-kicker { font-family: var(--font-mono); font-size: .8125rem; color: var(--player-dim); letter-spacing: .06em; text-transform: uppercase; }
.np-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-title:hover { text-decoration: underline; }
.np-sub { color: var(--player-dim); font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.transport { display: grid; justify-items: center; gap: .25rem; }
.transport-btns { display: flex; align-items: center; gap: .5rem; }
.player .icon-btn { color: var(--player-dim); }
.player .icon-btn:hover { color: var(--player-ink); background: rgba(255, 255, 255, .08); }
.player .icon-btn[aria-pressed="true"] { color: var(--accent); }
.play-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: var(--player-ink); color: var(--player);
  text-decoration: none; transition: transform .15s;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn .icon-pause { display: none; }
.play-btn[aria-pressed="true"] .icon-play { display: none; }
.play-btn[aria-pressed="true"] .icon-pause { display: block; }

.scrub { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem; align-items: center; gap: .5rem; width: 100%; }
.scrub time, .scrub span.t { font-family: var(--font-mono); font-size: .8125rem; color: var(--player-dim); text-align: center; }
.bar { height: 4px; border-radius: 4px; background: var(--player-line); position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--player-ink); border-radius: 4px; }
.scrub:hover .bar i { background: var(--accent); }

.player-right { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
.vol { display: flex; align-items: center; gap: .5rem; color: var(--player-dim); }
.vol label { font-family: var(--font-display); font-weight: 800; font-size: 1rem; }
.vol input[type="range"] { width: 96px; accent-color: var(--accent); }

.queue {
  position: fixed; right: 8px; bottom: calc(var(--player-h) + 8px); z-index: 41;
  width: min(380px, calc(100vw - 16px)); max-height: 70vh; overflow: auto;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem;
}
.queue[hidden] { display: none; }
.queue h2 { font-size: 1.125rem; margin: 0 0 .75rem; }
.queue h3 { font-size: .9375rem; color: var(--dim); margin: 1rem 0 .25rem; font-weight: 600; }

@media (max-width: 1023px) {
  :root { --player-h: 72px; }
  .player {
    left: 8px; right: 8px; bottom: 8px; border-radius: 10px; border: 0;
    height: 64px; grid-template-columns: minmax(0, 1fr) auto; padding: 0 .5rem 0 .5rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
    background: color-mix(in srgb, var(--player) 88%, var(--brand));
  }
  .np img, .np .mini-cover { width: 44px; height: 44px; }
  .np-text .np-kicker { display: none; }
  .transport { order: 2; }
  .transport-btns .skip-btn, .scrub time, .scrub span.t { display: none; }
  .scrub { position: absolute; left: 10px; right: 10px; bottom: 0; display: block; width: auto; }
  .scrub .bar { height: 3px; }
  .player-right { display: none; }
  .queue { bottom: 80px; }
}

/* ---------- Article ---------- */

.read-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 3rem;
  padding: 0 clamp(1rem, 3vw, 2rem) 2rem;
}
@media (max-width: 1180px) { .read-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; } }

.chapters { position: sticky; top: 1.5rem; align-self: start; }
.chapters h2 { font-size: 1rem; margin: 0 0 .5rem; display: flex; justify-content: space-between; }
.chapters ol { list-style: none; margin: 0; padding: 0; counter-reset: ch; }
.chapters a {
  display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; gap: .5rem; align-items: baseline;
  padding: .5rem .5rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--dim);
}
.chapters a:hover { background: var(--hover); color: var(--ink); }
.chapters a .cn { font-family: var(--font-mono); font-size: .8125rem; }
.chapters a .ct { font-family: var(--font-mono); font-size: .8125rem; }
.chapters a[aria-current="true"] { color: var(--ink); background: var(--surface-2); font-weight: 700; }
.chapters a[aria-current="true"] .cn { color: var(--accent-ink); }
@media (max-width: 1180px) {
  .chapters { position: static; order: -1; }
  .chapters details { background: var(--surface-2); border-radius: var(--radius); padding: .5rem 1rem; }
  .chapters summary { cursor: pointer; font-weight: 700; padding: .5rem 0; min-height: 44px; display: flex; align-items: center; }
}
@media (min-width: 1181px) {
  .chapters summary { list-style: none; pointer-events: none; font-weight: 700; margin-bottom: .5rem; }
  .chapters summary::-webkit-details-marker { display: none; }
}

.prose {
  font-size: calc(1.125rem * var(--read-scale));
  line-height: 1.7; max-width: 70ch;
}
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: calc(1.875rem * var(--read-scale)); line-height: 1.15; letter-spacing: -.015em;
  margin: 2.2em 0 .6em; scroll-margin-top: 5rem;
  display: flex; align-items: baseline; gap: .75rem;
}
.prose h2 .tn { font-family: var(--font-mono); font-size: .9rem; font-weight: 500; color: var(--accent-ink); letter-spacing: 0; }
.prose a { color: var(--accent-ink); text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ol, .prose ul { padding-left: 1.4em; margin-top: .6em; }
.prose li + li { margin-top: .35em; }
.prose :not(pre) > code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: .05em .35em;
}
.prose em { font-style: italic; }

.callout {
  margin: 1.5em 0 0; padding: 1rem 1.25rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border-left: 4px solid var(--brand);
}
.callout p { margin: 0; }
.callout-label {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); margin-bottom: .375rem;
}
.callout-why { border-left-color: var(--accent); }
.callout-q { border-left-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.callout-skill { border-left-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }

.code {
  margin: 1.5em 0 0; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--player-line);
}
.code-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: .375rem .5rem .375rem 1rem; border-bottom: 1px solid #262b35;
  font-family: var(--font-mono); font-size: .8125rem; color: #aeb4bf;
}
.code-bar .deck { display: flex; align-items: center; gap: .625rem; }
.code-bar .deck i { width: 10px; height: 10px; border-radius: 50%; background: #3a404c; display: inline-block; }
.code-bar .deck i:first-child { background: var(--accent); }
.copy-btn {
  font: inherit; font-size: .8125rem; color: #e6e8ee; background: #222733;
  border: 1px solid #343a47; border-radius: 6px; padding: .375rem .75rem; min-height: 36px; cursor: pointer;
}
.copy-btn:hover { background: #2c3240; }
.code pre { margin: 0; padding: 1rem 1.25rem; overflow-x: auto; }
.code code { font-family: var(--font-mono); font-size: .9375rem; line-height: 1.6; tab-size: 2; }

.hljs-keyword, .hljs-built_in { color: #ff8f7a; }
.hljs-string, .hljs-template-variable { color: #9fd89a; }
.hljs-comment { color: #8b93a3; font-style: italic; }
.hljs-title, .hljs-title.function_, .hljs-title.class_ { color: #8fc2ff; }
.hljs-attr, .hljs-property, .hljs-params { color: #e8c07a; }
.hljs-name, .hljs-tag { color: #c6a4ff; }
.hljs-literal, .hljs-number { color: #f0b36b; }
.hljs-type { color: #7fd7d0; }

.after-track { padding: 0 clamp(1rem, 3vw, 2rem); display: grid; gap: 1.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.share-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- Patterns ---------- */

.stems { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stems > div { background: var(--surface-2); padding: 1.25rem; }
.stems h3 { margin: .25rem 0 .375rem; font-size: 1.125rem; display: flex; align-items: center; gap: .5rem; }
.stems p { margin: 0; color: var(--dim); }
.stems-foot { grid-column: 1 / -1; }
.stems-foot p { color: var(--ink); }
@media (max-width: 760px) { .stems { grid-template-columns: 1fr; } }

.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.filters .field { flex: 1 1 340px; }
.filters select.field { flex: 0 0 auto; border-radius: 999px; }
.result-line { display: flex; gap: .75rem; align-items: center; color: var(--dim); margin: .5rem 0 1rem; min-height: 44px; }
.empty { padding: 2rem 1rem; text-align: center; }
.empty[hidden] { display: none; }
.empty b { display: block; font-size: 1.125rem; margin-bottom: .25rem; }
.empty p { color: var(--dim); margin: 0 0 1rem; }

.glyph { width: 44px; height: 44px; border-radius: 6px; display: grid; place-items: center; flex: none; color: #fff; }
.glyph svg { width: 24px; height: 24px; }
.g-data { background: #2a5c8f; }
.g-layout { background: #1f7a58; }
.g-interaction { background: #6d4bd1; }
.g-forms { background: #a8431f; }
.g-color { background: #8a5a06; }

.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: .5rem .5rem 0; }
.tab {
  font: inherit; font-weight: 700; color: var(--dim);
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: .625rem .875rem; min-height: 44px; cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.pane-box { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.pane-tools { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pane-tools .right { display: flex; gap: .5rem; padding: .5rem; margin-left: auto; }
.pane { padding: 1.25rem; }
.pane[hidden] { display: none; }
.pane pre { margin: 0; background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; }
.pane pre code { font-family: var(--font-mono); font-size: .9375rem; line-height: 1.6; }
.pane .note { color: var(--dim); margin: 0 0 1rem; }
.prompt-text { max-width: 70ch; font-size: 1.0625rem; line-height: 1.7; }
.prompt-text p { margin: 0 0 1em; }

.stage { background: var(--bg); border-radius: var(--radius-sm); padding: 1.25rem; display: grid; gap: 1rem; }
.stage .cap { margin: 0; color: var(--dim); }

/* the demo pattern itself, using the pattern tokens mapped onto this theme */
.hss-strip {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  grid-template-columns: 1fr;
}
@container (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 42rem) { .hss-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 50rem) { .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hss-wrap { container-type: inline-size; }
.hss-tile { background: var(--surface); padding: .875rem 1rem; text-align: left; font: inherit; color: var(--ink); border: 0; min-width: 0; }
.hss-label { display: block; font-family: var(--font-mono); font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.hss-fig { display: block; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; margin: .125rem 0; }
.hss-fig.none { color: var(--dim); }
.hss-sub { display: block; color: var(--dim); font-size: .9375rem; }
button.hss-tile { cursor: pointer; }
button.hss-tile:hover { background: var(--hover); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: inset 0 -3px 0 var(--accent); }
.dl-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dl-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .625rem 1rem; background: var(--surface); border-top: 1px solid var(--line); }
.dl-list li:first-child { border-top: 0; }
.dl-list li[hidden] { display: none; }
.dl-list .st { font-family: var(--font-mono); font-size: .875rem; color: var(--dim); white-space: nowrap; }

.uses { columns: 2 260px; margin: 0; padding-left: 1.25rem; }
.uses li { margin-bottom: .375rem; break-inside: avoid; }

/* ---------- About ---------- */

.credits { display: grid; gap: 1.5rem; }
.era { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1.25rem; }
.era .cover { box-shadow: var(--shadow); }
.era h3 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; }
.era .yr { font-family: var(--font-mono); color: var(--dim); font-size: .9375rem; }
.era p { margin: .375rem 0 .75rem; color: var(--dim); max-width: 66ch; }
.era ul { list-style: none; margin: 0; padding: 0; }
.era li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.era li span { font-family: var(--font-mono); font-size: .875rem; color: var(--dim); white-space: nowrap; }
@media (max-width: 560px) { .era { grid-template-columns: 1fr; } .era .cover { width: 120px; } .era li { grid-template-columns: 1fr; gap: 0; } }

.career-bar { display: flex; gap: 2px; border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1.5rem; }
.career-bar span {
  padding: .625rem .75rem; font-size: .875rem; font-weight: 600; background: var(--surface-2); color: var(--ink);
  white-space: nowrap; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.career-bar span small { display: block; font-family: var(--font-mono); font-weight: 400; color: var(--dim); font-size: .8125rem; }
.career-bar span:first-child { background: var(--accent); color: var(--on-accent); }
.career-bar span:first-child small { color: var(--on-accent); }
@media (max-width: 860px) { .career-bar { flex-wrap: wrap; } .career-bar span { flex: 1 1 40%; } }

.liner {
  background: var(--player); color: var(--player-ink); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem);
}
.liner ol { margin: 0; padding: 0; list-style: none; counter-reset: p; display: grid; gap: .25rem; }
.liner li {
  counter-increment: p; display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem;
  padding: .75rem 0; border-top: 1px solid var(--player-line);
  font-family: var(--font-display); font-size: clamp(1.25rem, 2.2vw, 1.625rem); line-height: 1.25; font-style: italic;
}
.liner li::before { content: "A" counter(p); font-family: var(--font-mono); font-style: normal; font-size: .9375rem; color: var(--accent); padding-top: .35rem; }
.liner li:nth-child(n+4)::before { content: "B" counter(p); }
.liner a { color: var(--player-ink); }

.skills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.skills span { font-size: .9375rem; padding: .25rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: stretch; }
.split img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); min-height: 320px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; scroll-behavior: auto !important; }
}

.prose-fig { margin: 1.6em 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.prose-fig img { display: block; width: 100%; height: auto; }
.prose blockquote.callout { margin-inline: 0; }
.prose .callout p + p { margin-top: .7em; }
.prose code { overflow-wrap: anywhere; }
.prose > * + p { margin-top: 1.1em; }
.prose a.btn-solid { color: var(--surface); text-decoration: none; }
