:root {
  color-scheme: dark;
  --ct-text: #faf7f2;
  --ct-page: #000;
  --ct-surface: #171717;
  --fire-accent: #ff8a3d;
  --ct-focus: var(--fire-accent);
  --fire-dock-height: 112px;
}
* { box-sizing: border-box; }
html { background: #000; color: #faf7f2; scroll-padding-top: calc(var(--fire-dock-height) + 20px); scroll-padding-bottom: calc(var(--player-height, 0px) + 16px); }
body { margin: 0; padding-bottom: var(--player-height, 0px); font: 17px/1.6 system-ui, sans-serif; }
a { color: var(--fire-accent); text-underline-offset: .25em; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--fire-accent); outline-offset: 5px; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--fire-accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
main:focus { outline: none; }
.fire-header, main, .fire-footer { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.fire-dock { position: fixed; inset: 0 0 auto; z-index: 20; background: rgba(0,0,0,.92); }
.fire-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 20px; }
.fire-brand { display: flex; align-items: center; gap: 12px; color: #faf7f2; font-weight: 750; text-decoration: none; }
.fire-brand img { display: block; }
.fire-brand > span, #fire-title, .fire-footer > span { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400; }
.fire-brand > span:last-child { font-size: clamp(1.2rem, 2vw, 1.5rem); }
.fire-masthead { position: relative; isolation: isolate; overflow: hidden; background: #000; padding-top: var(--fire-dock-height); }
.fire-masthead::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,.9), rgba(0,0,0,.78) 38%, rgba(0,0,0,.2) 78%), linear-gradient(0deg, #000, transparent 28%, transparent 75%, rgba(0,0,0,.45)); }
.fire-hero { width: min(1120px, calc(100% - 48px)); margin-inline: auto; padding-block: 32px 28px; }
.fire-intro { max-width: 580px; }
.fire-background { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.fire-background img, .fire-background canvas { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 62% center; }
.fire-background canvas, .native-logo { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
[data-rendered="true"] canvas { visibility: visible; }
.fire-logo { display: block; position: relative; flex: 0 0 72px; width: 72px; height: 72px; }
.native-logo { width: 100%; height: 100%; }
#fire-filters-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; }
#fire-filters-toggle[aria-expanded="true"] { border-color: var(--fire-accent); color: var(--fire-accent); }
#fire-filters-panel { width: min(1120px, calc(100% - 48px)); max-height: calc(100dvh - var(--fire-dock-height) - var(--player-height, 0px) - 20px); overflow-y: auto; padding: 20px; margin: 0 auto 16px; border: 1px solid #383838; border-radius: 6px; background: #101010; }
.fire-eyebrow { color: var(--fire-accent); text-transform: uppercase; letter-spacing: .16em; font-size: .8rem; font-weight: 700; }
h1 { font-size: clamp(2.5rem, 5.5vw, 4.5rem); line-height: 1.06; letter-spacing: -.045em; margin-block: 16px 24px; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.2; margin-block: 12px 20px; }
p { max-width: 55ch; }
.fire-lead { font-size: clamp(1.65rem, 3vw, 2.45rem); line-height: 1.25; margin-block: 20px 8px; }
.fire-ancient { display: inline-block; color: #f0e5d6; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400; }
.fire-fresh { display: inline-block; color: var(--fire-accent); font-weight: 800; letter-spacing: -.035em; margin-left: .15em; }
.fire-subline { color: #d9c9b8; font-size: clamp(1rem, 1.8vw, 1.15rem); letter-spacing: .035em; margin-block: 0; }
.fire-tagline { margin: 16px 0 20px; max-width: 48ch; color: #f0e5d6; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.65; border-left: 2px solid var(--fire-accent); padding-left: 20px; }
.fire-tagline cite { display: inline; white-space: nowrap; margin-left: .45em; color: #e4bb95; font-family: system-ui, sans-serif; font-size: .72em; font-style: normal; }
.fire-mark { display: block; width: 100%; height: auto; }
.fire-action { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 48px; padding: 12px 20px; margin-top: 16px; background: var(--fire-accent); color: #000; font-weight: 750; text-decoration: none; border-radius: 4px; }
.fire-section { border-top: 1px solid #383838; padding-block: 48px; scroll-margin-top: calc(var(--fire-dock-height) + 20px); }
#listen { border-top: 0; padding-top: 24px; }
#listen > .fire-eyebrow { margin-top: 0; margin-bottom: 8px; }
#playback-gap { margin-block: 8px 12px; }
.fire-note { color: #c7c2bb; font-size: .9rem; }
.song-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.filter-field { display: grid; gap: 6px; flex: 1 1 220px; min-width: 0; }
input, select, button { font: inherit; color: #faf7f2; background: #171717; border: 1px solid #777; border-radius: 4px; min-height: 44px; padding: 8px 12px; }
input, select { width: 100%; min-width: 0; }
button, summary { cursor: pointer; }
.song-filters p { flex-basis: 100%; margin: 0; }
.book-picker { flex: 1 1 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.book-picker legend { padding: 0; margin-bottom: 6px; }
.book-group { margin-top: 12px; }
.book-group > p { margin-bottom: 6px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.book-tile { position: relative; display: inline-block; min-width: 64px; cursor: pointer; }
.book-tile input { min-height: 0; padding: 0; }
.book-tile-face { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; min-height: 44px; padding: 4px; border: 1px solid #777; border-radius: 4px; background: #171717; font-size: .85rem; }
.book-count { font-size: .7rem; color: #c7c2bb; }
.book-tile:has(:checked) .book-tile-face { border-color: var(--fire-accent); background: var(--fire-accent); color: #000; font-weight: 700; }
.book-tile:has(:checked) .book-count { color: #000; }
.book-tile:has(:focus-visible) .book-tile-face { outline: 3px solid var(--fire-accent); outline-offset: 3px; }
.book-tile:has(:disabled) { cursor: not-allowed; }
.book-tile:has(:disabled) .book-tile-face { opacity: .5; }
.reset-filters { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; }
.song-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; padding: 0; list-style: none; }
.song-card { position: relative; isolation: isolate; overflow: hidden; min-width: 0; align-self: start; border: 1px solid #383838; border-radius: 6px; background: #000; overflow-wrap: anywhere; font-size: .85rem; line-height: 1.4; }
.song-caption { padding: 12px; background: #000; }
.song-caption-footer { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.song-genre { flex: 1; min-width: 0; }
.song-source { color: #b9a08b; font-size: .75em; margin-left: .35em; }
.song-card h3 { min-height: 44px; margin: 0; font-size: 1rem; line-height: 1.25; }
.song-card h3 a { display: flex; align-items: center; min-height: 44px; color: #faf7f2; text-decoration: none; }
.song-card h3 a:hover { text-decoration: underline; }
.song-card p { margin-block: 4px; }
.song-card .fire-note { font-size: .8rem; }
.song-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: radial-gradient(ellipse at 95% 50%, #4a210a, #111 75%); }
.song-front { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 12px; }
.song-front img { flex: 0 0 36px; }
.song-front .song-artwork { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.song-waves { position: absolute; top: 48px; bottom: 24px; left: 38%; right: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding-right: 12px; overflow: hidden; }
.song-waves i { flex: 0 0 4px; height: var(--wave-height); border-radius: 4px; background: linear-gradient(#ffc57b, #ff792d, #a72b08); animation: song-wave-flow 2.8s ease-in-out var(--wave-delay) infinite alternate; animation-play-state: paused; }
[data-wave-visible="true"] .song-waves i { animation-play-state: running; }
@keyframes song-wave-flow { from { transform: scaleY(.5); opacity: .45; } to { transform: scaleY(1); opacity: .9; } }
.song-card:has(details[open]) .song-front { visibility: hidden; pointer-events: none; }
.song-details summary { position: absolute; inset: 0; z-index: 3; list-style: none; padding: 0; cursor: pointer; }
.song-details[open] summary { bottom: auto; height: 44px; z-index: 5; }
.song-details summary::-webkit-details-marker { display: none; }
.song-details summary:focus-visible { outline: 2px solid var(--fire-accent); outline-offset: -2px; }
.song-details:has(summary:focus-visible) .song-back { outline: 2px solid var(--fire-accent); outline-offset: -2px; }
.song-back { position: absolute; inset: 0; z-index: 4; padding: 20px; overflow-y: auto; background: #211b16; }
.song-back .liner-label { color: var(--fire-accent); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.song-back:focus-visible { outline: 2px solid var(--fire-accent); outline-offset: 0; }
.song-controls { display: flex; flex: none; }
.song-controls .open-player { border: 0; border-radius: 50%; background: var(--fire-accent); color: #000; }
.song-controls button:hover { background: #ffad76; }
.open-player { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; }
.current-song { border-color: var(--fire-accent); }
.library-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.library-actions button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 10px; }
.global-player { position: fixed; inset: auto 0 0; z-index: 25; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 1.4fr) auto; align-items: center; gap: 0 24px; padding: 10px max(24px, calc((100% - 1120px) / 2)) max(8px, env(safe-area-inset-bottom)); border-top: 1px solid #63503f; background: #15110f; box-shadow: 0 -8px 24px #0008; }
.player-emberline { position: absolute; inset: -20px 0 0; z-index: -1; overflow: hidden; pointer-events: none; }
.player-emberline::before { content: ""; position: absolute; inset: 20px 0 0; border-top: 1px solid #efaa59; background: linear-gradient(#ef6e171c, transparent 48px); }
.player-emberline[data-rendered="true"]::before { display: none; }
.player-emberline canvas { display: block; width: 100%; height: 100%; visibility: hidden; }
.player-emberline[data-rendered="true"] canvas { visibility: visible; }
.now-playing { display: flex; align-items: center; gap: 12px; min-width: 0; }
.now-playing img { flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.now-playing > div { min-width: 0; }
.now-playing p { margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
#player-title { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.player-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
#player-queue { flex: none; font-size: .75rem; font-variant-numeric: tabular-nums; color: #d3b99f; white-space: nowrap; }
.transport-buttons { display: flex; justify-content: center; gap: 8px; }
.global-player button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 10px; }
.global-player #player-size { width: auto; max-width: 100%; height: auto; min-height: 44px; flex: 0 1 auto; justify-content: start; gap: 8px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; line-height: 1.3; }
#player-size svg { flex: none; }
#player-play { background: var(--fire-accent); color: #000; border-color: var(--fire-accent); }
.global-player button:disabled { opacity: .45; cursor: default; }
.player-progress { display: flex; align-items: center; gap: 8px; font-size: .75rem; font-variant-numeric: tabular-nums; }
.global-player input[type="range"] { padding: 0; accent-color: var(--fire-accent); cursor: pointer; }
.player-progress span { min-width: 4ch; }
.player-actions { position: relative; display: flex; align-items: center; justify-self: end; gap: 4px; }
.player-panel { position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 1; width: 224px; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid #9a8069; border-radius: 6px; background: #211a15; box-shadow: 0 4px 24px #000a; }
.player-volume { display: flex; align-items: center; gap: 8px; }
.player-volume input { flex: 1; min-width: 44px; }
.player-panel a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding-inline: 8px; font-size: .9rem; }
#player-status:not(.sr-only) { grid-column: 1 / -1; margin: 4px 0 0; font-size: .8rem; }
summary { min-height: 44px; padding-block: 10px; }
.fire-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-block: 32px; border-top: 1px solid #383838; font-size: .9rem; }
.fire-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.fire-footer .niv-note { flex-basis: 100%; max-width: none; margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .song-waves i { animation: none; }
}
@media (max-width: 600px) {
  :root { --fire-dock-height: 76px; }
  .fire-header, main, .fire-footer { width: calc(100% - 32px); }
  .fire-header { gap: 8px; padding-block: 14px; }
  .fire-brand { gap: 8px; }
  .fire-brand > span:last-child { font-size: 1.05rem; }
  .fire-hero { width: calc(100% - 32px); padding-block: 24px 20px; }
  .fire-logo { flex-basis: 48px; width: 48px; height: 48px; }
  .fire-background img, .fire-background canvas { object-position: 58% center; }
  .fire-masthead::after { background: linear-gradient(90deg, rgba(0,0,0,.87), rgba(0,0,0,.65)), linear-gradient(0deg, #000, transparent 45%); }
  .fire-masthead h1 { font-size: clamp(2.35rem, 9vw, 3.5rem); }
  #fire-filters-panel { width: calc(100% - 32px); padding: 16px; }
  .fire-section { padding-block: 32px; }
  .song-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-player { grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 8px 16px max(4px, env(safe-area-inset-bottom)); }
  .now-playing { gap: 8px; }
  .now-playing img { width: 36px; height: 36px; }
  .now-playing p, .global-player #player-size { font-size: .8rem; }
  .now-playing .fire-note { font-size: .65rem; }
  .player-transport { display: contents; }
  .transport-buttons { grid-column: 1 / -1; grid-row: 2; gap: 2px; }
  .player-progress { grid-column: 1 / -1; grid-row: 3; }
  .player-actions { grid-column: 2; grid-row: 1; }
}
@media (max-width: 360px) {
  .now-playing img { display: none; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .global-player { grid-template-columns: minmax(0, 1fr) minmax(160px, 1fr) auto; gap: 0 12px; }
}
@media (orientation: landscape) and (max-height: 450px) {
  :root { --fire-dock-height: 76px; }
  .fire-header { padding-block: 14px; }
  .fire-logo { flex-basis: 48px; width: 48px; height: 48px; }
  .global-player { grid-template-columns: minmax(0, 1.3fr) minmax(136px, 1fr) auto; gap: 0 8px; padding-block: 6px max(4px, env(safe-area-inset-bottom)); }
  .now-playing { gap: 8px; }
  .now-playing img { width: 36px; height: 36px; }
  .now-playing p, .global-player #player-size { font-size: .8rem; }
  .now-playing .fire-note { font-size: .65rem; }
  .player-transport { display: block; grid-column: 2; grid-row: 1; }
  .transport-buttons, .player-progress { grid-column: auto; grid-row: auto; }
  .player-actions { grid-column: 3; grid-row: 1; }
}
.global-player.is-collapsed { grid-template-columns: minmax(0, 1fr) 44px; gap: 0 8px; padding-block: 4px max(7px, env(safe-area-inset-bottom)); }
.is-collapsed .now-playing img, .is-collapsed #player-reference, .is-collapsed #player-queue,
.is-collapsed #player-previous, .is-collapsed #player-next, .is-collapsed .player-progress,
.is-collapsed .player-actions { display: none; }
.is-collapsed .player-transport, .is-collapsed .transport-buttons { display: contents; }
.is-collapsed #player-play { grid-column: 2; grid-row: 1; }
.is-collapsed .player-heading { display: block; }
.is-collapsed #player-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-collapsed #player-size svg { transform: rotate(180deg); }
#player-compact-progress { position: absolute; inset: auto 0 0; width: 100%; height: 3px; border: 0; border-radius: 0; appearance: none; background: #63503f; color: var(--fire-accent); }
#player-compact-progress::-webkit-progress-bar { background: #63503f; }
#player-compact-progress::-webkit-progress-value { background: var(--fire-accent); }
#player-compact-progress::-moz-progress-bar { background: var(--fire-accent); }
.is-collapsed #player-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
