/* DeepMood public shell and components. Colours only via tokens.css. */
* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font: 14px/1.5 var(--font-ui); color: var(--text); background: var(--void); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
h2 .icon { color: var(--ember); }
.icon { width: 1.1em; height: 1.1em; vertical-align: -.2em; flex: none; }
.muted { color: var(--text-dim); }
.lead { color: var(--text-dim); max-width: 60ch; margin: 0 0 18px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layer 2: the app panel ---------- */
.app {
  position: relative; z-index: 3; max-width: 1400px; margin: calc(4vh + 64px) auto 5vh; width: calc(100% - 10vw);
  border: 1px solid var(--stroke); border-radius: var(--r-panel); box-shadow: var(--shadow-panel);
  --hole-top: 72px; --hole-mid: 250px; --hole-bottom: 430px;
}
/* The glass itself is a separate layer so the home page can cut a window into it:
   the hero then shows the live room, rain, lightning and parallax, unblurred. */
.app-bg { position: absolute; inset: 0; border-radius: inherit; z-index: 0; pointer-events: none; background: var(--panel); backdrop-filter: var(--panel-blur); -webkit-backdrop-filter: var(--panel-blur); }
body[data-page="home"] .app-bg {
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 var(--hole-top), transparent calc(var(--hole-top) + 1px), transparent var(--hole-mid), #000 var(--hole-bottom));
  mask-image: linear-gradient(180deg, #000 0, #000 var(--hole-top), transparent calc(var(--hole-top) + 1px), transparent var(--hole-mid), #000 var(--hole-bottom));
}
/* torch light warming the panel edges; opacity follows the torches */
.app::before, .app::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  transition: opacity 1s ease;
}
.app::before { background: radial-gradient(55% 45% at 0% 50%, var(--tint-warm), transparent 70%); opacity: var(--torch-l); }
.app::after { background: radial-gradient(55% 45% at 100% 50%, var(--tint-warm), transparent 70%); opacity: var(--torch-r); }
.app-header, .app-body { position: relative; z-index: 1; }
/* a warm light that follows the pointer across the glass */
.cursor-glow { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; opacity: var(--glow-on, 0); transition: opacity .5s;
  background: radial-gradient(420px 420px at var(--mx, 50%) var(--my, 30%), rgba(240,168,92,.13), rgba(240,168,92,.05) 40%, transparent 70%); mix-blend-mode: screen; }
/* entrance: the panel rises into place */
.app { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.logo { background: linear-gradient(100deg, var(--cream) 0%, #fff 40%, var(--cream) 50%, var(--ember) 80%, var(--cream) 100%); background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 9s linear infinite; }
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -130% 0; } }

.logo-tab {
  position: absolute; top: -1px; left: 50%; transform: translate(-50%, -100%); z-index: 2; padding: 10px 34px 8px;
  background: var(--panel); backdrop-filter: var(--panel-blur); -webkit-backdrop-filter: var(--panel-blur);
  border: 1px solid var(--stroke); border-bottom: 0; border-radius: var(--r-panel) var(--r-panel) 0 0;
  display: flex; flex-direction: column; align-items: center; box-shadow: var(--highlight);
}
.logo { font-family: var(--font-display); font-size: 30px; line-height: 1; }
.tagline { font-size: 9px; text-transform: uppercase; letter-spacing: .22em; color: var(--text-faint); margin-top: 6px; white-space: nowrap; }

.app-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; border-bottom: 1px solid var(--stroke); }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { color: var(--text-dim); transition: color .15s; padding: 4px 0; } .main-nav a:hover, .main-nav a.active { color: var(--text); }
.nav-home .icon { width: 18px; height: 18px; color: var(--ember); }
.header-right { display: flex; align-items: center; gap: 14px; }
.search { display: flex; align-items: center; gap: 8px; padding: 7px 14px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-pill); min-width: 220px; transition: border-color .15s, box-shadow .15s; }
.search .icon { color: var(--text-faint); }
.search input { background: none; border: 0; color: var(--text); font: inherit; width: 100%; outline: none; }
.search input::placeholder { color: var(--text-faint); }
.search:focus-within { border-color: var(--ember-line); box-shadow: 0 0 0 4px var(--ember-soft); }
.account { display: flex; align-items: center; gap: 8px; color: var(--text-dim); } .account:hover { color: var(--text); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-hi); border: 1px solid var(--stroke); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ember); }
.avatar .icon { width: 16px; height: 16px; }
.fx-toggle { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--stroke); background: var(--surface); color: var(--text-dim); display: grid; place-items: center; transition: color .15s, background .15s; }
.fx-toggle:hover { color: var(--text); background: var(--surface-hi); }
.fx-toggle[aria-pressed="true"] { color: var(--ember); border-color: var(--ember-line); }
.fx-toggle .icon { width: 16px; height: 16px; }

.app-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding: 0 24px 20px; }
.main { min-width: 0; }

/* Hero with the photographic bleed (home only) */
/* A soft scrim keeps the hero copy readable over the open window. */
body[data-page="home"] .app-body::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 380px; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, var(--scrim) 0%, rgba(5,7,10,.35) 45%, transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}
.hero { padding: 30px 0 14px; text-shadow: 0 2px 20px rgba(0,0,0,.6); }
.hero h1 { font-family: var(--font-display); font-weight: 500; font-size: 52px; line-height: 1.05; max-width: 520px; }
.hero p { color: var(--text-dim); font-size: 15px; margin: 10px 0 0; }

/* Chips & sort */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { display: inline-flex; align-items: center; padding: 7px 16px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--stroke); color: var(--text-dim); transition: background .15s, color .15s, border-color .15s; }
.chip:hover { background: var(--surface-hi); color: var(--text); }
.chip.active { background: var(--cream); color: var(--on-cream); border-color: transparent; font-weight: 500; }
.chip-sm { padding: 4px 11px; font-size: 12px; }
.chips-tags { margin-top: -4px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 10px; }
.section-head h1 { font-size: 26px; display: flex; align-items: center; gap: 10px; } .section-head h1 .icon { color: var(--ember); }
.segmented { display: inline-flex; padding: 3px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-pill); }
.segmented a { padding: 5px 14px; border-radius: var(--r-pill); color: var(--text-dim); font-size: 13px; transition: background .15s, color .15s; }
.segmented a.active { background: var(--surface-hi); color: var(--text); }
.grid-meta { font-size: 12px; margin-bottom: 8px; }
.empty-grid { padding: 40px 20px; text-align: center; color: var(--text-dim); background: var(--surface); border: 1px dashed var(--stroke); border-radius: var(--r-card); }
.see-all { margin: 14px 0 0; text-align: center; }

/* Sound cards */
.sound-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.sound-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-card); overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s; }
.sound-card:hover { transform: translateY(-2px); border-color: var(--stroke-hi); box-shadow: var(--shadow-card-hover); }
.sound-card.previewing { border-color: var(--ember-line); }
.sound-card .cover { position: relative; display: block; aspect-ratio: 4/3; background: var(--surface-hi); overflow: hidden; }
.sound-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.sound-card:hover .cover img { transform: scale(1.07); }
.sound-card .cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(115deg, transparent 30%, rgba(255,235,200,.18) 48%, transparent 62%); transform: translateX(-120%); transition: transform .8s ease; pointer-events: none; }
.sound-card:hover .cover::before { transform: translateX(120%); }
.sound-card .cover::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(180deg, transparent, var(--scrim)); }
.cover-empty { display: grid; place-items: center; height: 100%; color: var(--text-faint); } .cover-empty .icon { width: 34px; height: 34px; }
/* Generated noise has no artwork: paint it, in the same colours as the apps. */
/* per-track shaping: hidden until the loop button on the row is pressed */
.track-shape { display: none; border-top: 1px solid var(--stroke); margin-top: 6px; padding-top: 4px; }
.track.shaping .track-shape { display: block; }
.shape-label { font-size: 11px; color: var(--text-faint); width: 46px; flex: none; }
.cover-noise { background-image: linear-gradient(135deg, #1b2430, #55657a); }
.cover-noise-pink { background-image: linear-gradient(135deg, #3a2430, #7a4b5e); }
.cover-noise-brown { background-image: linear-gradient(135deg, #2a1f17, #6b4a2e); }
.cover-noise .cover-empty { color: rgba(255,255,255,.4); }
.sound-card .body { padding: 10px 12px 6px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sound-card .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sound-card .title:hover { color: var(--ember); }
.sound-card .cat, .sound-compact .cat, .track-cat { font-size: 12px; color: var(--text-dim); }
/* plays on the left, then Mix, heart and the play button pushed to the right;
   it has to survive a five-column grid, so everything here is compact. */
.sound-card .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; row-gap: 4px; padding: 6px 8px 10px; margin-top: auto; }
.sound-card .foot .plays { min-width: 0; overflow: hidden; }
.sound-card .foot .play-btn { width: 28px; height: 28px; }
.sound-card .foot .heart { padding: 3px; }
.play-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--stroke-hi); background: var(--surface-hi); display: grid; place-items: center; color: var(--text); flex: none; transition: background .15s, color .15s; }
.play-btn:hover { background: var(--cream); color: var(--on-cream); }
.play-btn .icon { width: 16px; height: 16px; }
.ic-pause { display: none; } [aria-pressed="true"] > .ic-pause { display: block; } [aria-pressed="true"] > .ic-play { display: none; }
.plays { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-dim); }
.add-btn { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; padding: 3px 9px; border-radius: var(--r-pill); border: 1px solid var(--stroke); background: transparent; color: var(--text-dim); font-size: 12px; transition: background .15s, color .15s; }
.add-btn:hover { background: var(--ember-soft); color: var(--ember); border-color: var(--ember-line); }
.add-btn.in-mix { color: var(--ember); border-color: var(--ember-line); }
.add-btn .icon { width: 13px; height: 13px; }
.heart { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px; color: var(--text-dim); font-size: 12px; transition: color .15s, transform .15s; }
.heart .icon { width: 18px; height: 18px; } .heart .ic-fill { display: none; }
.heart[aria-pressed="true"] { color: var(--ember); } .heart[aria-pressed="true"] .ic-fill { display: block; } .heart[aria-pressed="true"] .ic-out { display: none; }
.heart:active { transform: scale(1.2); }
.heart-lg { font-size: 14px; } .heart-lg .icon { width: 22px; height: 22px; }

/* Compact strip */
.compact-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.compact-strip.compact-wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); overflow: visible; }
.sound-compact { display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-card); min-width: 0; transition: border-color .15s; }
.sound-compact:hover { border-color: var(--stroke-hi); }
.sound-compact .thumb { width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--surface-hi); flex: none; }
.sound-compact .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sound-compact .meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; flex: 1; }
.sound-compact .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sound-compact .when { font-size: 11px; color: var(--text-faint); }
.sound-compact .add-btn { padding: 5px; margin-left: 0; } .sound-compact .add-btn .icon { width: 14px; height: 14px; }

/* Detail */
.crumbs { color: var(--text-faint); font-size: 12px; margin: 20px 0 10px; } .crumbs a:hover { color: var(--ember); }
.detail-grid { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; gap: 26px; align-items: start; }
.detail-cover { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r-card); border: 1px solid var(--stroke); display: block; }
.detail-body h1 { font-family: var(--font-display); font-weight: 500; font-size: 36px; line-height: 1.1; }
.detail-meta { color: var(--text-dim); margin: 8px 0; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.detail-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 18px; }
.detail-desc { color: var(--text-dim); max-width: 62ch; margin-bottom: 16px; }
.detail-facts { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; font-size: 13px; margin: 0; } .detail-facts dt { color: var(--text-faint); } .detail-facts dd { margin: 0; }

/* Author */
.added-by { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); margin: 4px 0 8px; }
.added-by:hover { color: var(--text); } .added-by b { color: var(--text); font-weight: 500; }
.added-by .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.author { padding-top: 6px; }
.author-head { display: flex; gap: 26px; align-items: flex-start; }
.author-avatar { width: 140px; height: 140px; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-hi); border: 1px solid var(--stroke); display: grid; place-items: center; font-family: var(--font-display); font-size: 56px; color: var(--ember); box-shadow: var(--shadow-card); }
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-body { min-width: 0; flex: 1; } .author-body .crumbs { margin-top: 8px; }
.author-body h1 { font-family: var(--font-display); font-weight: 500; font-size: 38px; line-height: 1.1; }
.author-since { margin: 6px 0 12px; }
.author-bio { color: var(--text-dim); max-width: 64ch; margin-bottom: 16px; }
.author-links { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-email { color: var(--ember); }
@media (max-width: 760px) { .author-head { flex-direction: column; gap: 14px; } .author-avatar { width: 96px; height: 96px; font-size: 40px; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--surface-hi); color: var(--text); font-weight: 500; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { background: var(--surface-hi2); border-color: var(--stroke-hi); }
.btn-pill { border-radius: var(--r-pill); }
.btn-primary { background: var(--cream); color: var(--on-cream); border-color: transparent; } .btn-primary:hover { background: var(--cream-hi); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); } .btn-ghost:hover { color: var(--text); background: var(--surface-hi); }
.btn-dashed { width: 100%; background: transparent; border: 1px dashed var(--stroke-hi); color: var(--text-dim); border-radius: 12px; }
.btn-dashed:hover { color: var(--text); background: var(--surface); }
.btn .icon { width: 16px; height: 16px; }

/* Right rail */
.rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; padding-top: 28px; }
.rail-bar { display: none; }
.rail-card { background: rgba(13, 17, 23, .55); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--stroke); border-radius: var(--r-card); padding: 16px; box-shadow: var(--highlight); }
.rail-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.rail-card h3 .count { font-size: 11px; color: var(--text-faint); font-weight: 400; }
.nowplaying .empty { color: var(--text-faint); font-size: 12px; margin: 0 0 12px; }
.tracks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.track { padding: 10px 8px; border-radius: 12px; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.track:hover { background: var(--surface); border-color: var(--stroke); }
.track.is-muted { opacity: .55; }
.track-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.track-thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: var(--surface-hi); flex: none; }
.track-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.track-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .track-title:hover { color: var(--ember); }
.track-btns { display: flex; gap: 3px; }
.mini { width: 24px; height: 24px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--text-faint); font-size: 11px; font-weight: 600; display: grid; place-items: center; transition: background .15s, color .15s; }
.mini:hover { background: var(--surface-hi); color: var(--text); }
.mini[aria-pressed="true"] { background: var(--ember-soft); color: var(--ember); border-color: var(--ember-line); }
.mini .icon { width: 14px; height: 14px; }
.track-ctl { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.track-ctl .icon { width: 14px; height: 14px; color: var(--text-faint); }
.track-ctl output { min-width: 34px; text-align: right; }
.lr { min-width: 40px; color: var(--text-faint); } .lr:last-child { text-align: right; }

/* Sliders: 4px track, ember fill, cream thumb that grows and glows while dragging */
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; --fill: 50%; }
.slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ember-glow) var(--fill), var(--surface-hi) var(--fill)); }
.slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface-hi); }
.slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ember-glow); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: var(--cream); border: 0; transition: transform .12s, box-shadow .12s; }
.slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--cream); border: 0; transition: transform .12s, box-shadow .12s; }
.slider:active::-webkit-slider-thumb, .slider:focus-visible::-webkit-slider-thumb { transform: scale(1.3); box-shadow: 0 0 0 6px var(--cream-glow); }
.slider:active::-moz-range-thumb, .slider:focus-visible::-moz-range-thumb { transform: scale(1.3); box-shadow: 0 0 0 6px var(--cream-glow); }
.slider:focus-visible { outline: none; }
.slider-balance::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--surface-hi) min(50%, var(--fill)), var(--ember-glow) min(50%, var(--fill)), var(--ember-glow) max(50%, var(--fill)), var(--surface-hi) max(50%, var(--fill))); }
.slider-balance::-moz-range-progress { background: transparent; }
.balance-wrap { position: relative; }
.balance-wrap .ticks { position: absolute; left: 6px; right: 6px; top: 50%; height: 8px; transform: translateY(-50%); pointer-events: none; display: flex; justify-content: space-between; }
.balance-wrap .ticks i { width: 1px; height: 100%; background: var(--stroke-hi); } .balance-wrap .ticks i:nth-child(3) { width: 2px; height: 12px; margin-top: -2px; background: var(--text-faint); }
.mixsettings .ctl { margin-bottom: 12px; }
.ctl-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.ctl-head output { color: var(--text-faint); }
.ctl-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); margin-bottom: 0 !important; }
.ctl-row .icon { width: 14px; height: 14px; }
.ctl-row select { margin-left: auto; font: inherit; color: var(--text); background: var(--surface-hi); border: 1px solid var(--stroke); border-radius: 8px; padding: 4px 8px; }
.ctl-row select option { background: var(--void); }
.countdown { color: var(--ember); font-variant-numeric: tabular-nums; }
.transport { display: flex; align-items: center; justify-content: space-around; }
.tbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--text-dim); display: grid; place-items: center; transition: color .15s, background .15s; }
.tbtn:hover { color: var(--text); background: var(--surface-hi); }
.tbtn[aria-pressed="true"] { color: var(--ember); background: var(--ember-soft); border-color: var(--ember-line); }
.tbtn .icon { width: 20px; height: 20px; }
.playbtn { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--cream); color: var(--on-cream); display: grid; place-items: center; box-shadow: 0 6px 20px var(--cream-glow); transition: transform .15s, box-shadow .15s; }
.playbtn:hover { transform: scale(1.05); box-shadow: 0 8px 28px var(--cream-glow); }
.playbtn .icon { width: 26px; height: 26px; }
.playbtn-lg { width: 88px; height: 88px; } .playbtn-lg .icon { width: 40px; height: 40px; }
.playbtn .ic-play { margin-left: 3px; } /* optical centring of the triangle */
.playbtn.is-playing { box-shadow: 0 0 0 4px var(--ember-soft), 0 6px 20px var(--cream-glow); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 4px var(--ember-soft), 0 6px 20px var(--cream-glow); } 50% { box-shadow: 0 0 0 9px var(--ember-soft), 0 6px 26px var(--cream-glow); } }
.stage-card { position: relative; }
.stage-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; }
.stage-card .btn-ghost { margin-top: 4px; }
.share { display: flex; flex-wrap: wrap; gap: 8px; } .share .btn { flex: 1; }

/* Picker dialog, stage overlay, toast */
.picker { width: min(560px, 92vw); max-height: 80vh; padding: 0; border: 1px solid var(--stroke-hi); border-radius: var(--r-panel); background: var(--void); color: var(--text); box-shadow: var(--shadow-panel); }
.picker::backdrop { background: var(--scrim); backdrop-filter: blur(6px); }
.picker-head { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--stroke); margin: 0; }
.picker-head .search { flex: 1; }
.picker-list { max-height: 60vh; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.stage { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--scrim); backdrop-filter: blur(10px); }
.stage-card { width: min(460px, 92vw); text-align: center; padding: 34px 30px; background: var(--panel); border: 1px solid var(--stroke-hi); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); }
.stage-kicker { text-transform: uppercase; letter-spacing: .2em; font-size: 10px; color: var(--ember); margin: 0 0 6px; }
.stage-card h2 { font-family: var(--font-display); font-weight: 500; font-size: 28px; justify-content: center; margin-bottom: 14px; }
.stage-list { list-style: none; padding: 0; margin: 0 0 22px; color: var(--text-dim); font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.stage-card .playbtn { margin: 0 auto 14px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: var(--r-pill); background: var(--cream); color: var(--on-cream); font-weight: 500; box-shadow: var(--shadow-card); }

.error-card { max-width: 520px; margin: 60px auto; padding: 34px 30px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-panel); text-align: center; }
.error-card h1 { font-family: var(--font-display); font-weight: 500; font-size: 34px; margin-bottom: 10px; }
.error-card .lead { margin: 0 auto 18px; }
.error-card .trace { text-align: left; font-size: 11px; background: var(--void); padding: 12px; border-radius: 10px; overflow: auto; }

/* Preview dock: a small player for single sounds, with its own remembered volume */
.preview-dock {
  position: fixed; left: 50%; bottom: 22px; z-index: 40; transform: translateX(-50%);
  width: min(720px, calc(100% - 32px)); display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(150px, 220px) auto auto; align-items: center; gap: 12px;
  padding: 10px 12px 10px 10px; border-radius: var(--r-panel);
  background: rgba(13, 17, 23, .82); backdrop-filter: var(--panel-blur); -webkit-backdrop-filter: var(--panel-blur);
  border: 1px solid var(--stroke-hi); box-shadow: var(--shadow-panel);
  animation: dock-in .35s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 18px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dock-toggle { width: 40px; height: 40px; background: var(--cream); color: var(--on-cream); border-color: transparent; }
.dock-toggle .icon { width: 20px; height: 20px; }
.dock-toggle[aria-pressed="false"] { background: var(--surface-hi); color: var(--text); border-color: var(--stroke-hi); }
.preview-dock.is-paused .dock-thumb { opacity: .6; }
.dock-thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--surface-hi); display: block; }
.dock-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dock-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dock-kicker { font-size: 10px; text-transform: uppercase; letter-spacing: .18em; color: var(--ember); }
.dock-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .dock-title:hover { color: var(--ember); }
.dock-cat { font-size: 12px; color: var(--text-dim); }
.dock-vol { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.dock-vol .icon { width: 16px; height: 16px; color: var(--text-faint); }
.dock-vol output { min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.dock-stop { width: 32px; height: 32px; }
@media (max-width: 760px) {
  .preview-dock { bottom: 76px; grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 8px; padding: 8px; }
  .preview-dock .dock-thumb { display: none; }
  .dock-vol { grid-column: 1 / -1; padding: 0 4px 2px; }
  .preview-dock .btn span { display: none; }
}

/* Mix & mixes pages */
.mix-page { padding-top: 10px; }
.mix-summary ul { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.mix-summary li { padding: 6px 12px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-pill); font-size: 13px; color: var(--text-dim); }
.mix-summary li b { color: var(--text); font-weight: 500; }
.mix-link { display: flex; gap: 8px; }
.mix-link input { flex: 1; font: 12px/1 ui-monospace, monospace; color: var(--text-dim); background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-pill); padding: 10px 14px; min-width: 0; }
.mix-list { display: flex; flex-direction: column; gap: 10px; }
.mix-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-card); flex-wrap: wrap; }
.mix-item h3 { font-size: 15px; } .mix-item p { margin: 2px 0 0; font-size: 12px; }
.mix-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination { display: flex; gap: 6px; margin: 18px 0 0; flex-wrap: wrap; }
.pagination a { padding: 5px 11px; border-radius: 9px; color: var(--text-dim); background: var(--surface); border: 1px solid var(--stroke); }
.pagination a.active { background: var(--cream); color: var(--on-cream); }
.flash { padding: 10px 14px; border-radius: 10px; margin: 14px 0; border: 1px solid var(--stroke); background: var(--surface); }
.library-full .section-head { margin-top: 26px; }
.site-footer { padding: 0 24px 14px; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--text-faint); flex-wrap: wrap; }
.site-footer a:hover { color: var(--text-dim); }

/* ---------- Breakpoints ---------- */
@media (max-width: 1100px) {
  .app-body { grid-template-columns: 1fr; }
  .sound-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rail { position: static; max-height: none; padding-top: 0; }
  .hero h1 { font-size: 42px; }
  body[data-page="home"] .app-body::after { height: 300px; }
  .app { --hole-mid: 220px; --hole-bottom: 380px; }
}
@media (max-width: 760px) {
  /* backdrop-filter would turn the panel into the containing block for the fixed bottom sheet, so it goes. */
  .app { width: 100%; margin: 0; border-radius: 0; border-left: 0; border-right: 0; min-height: 100vh; }
  .app-bg { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--panel-solid); }
  .logo-tab { backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; }
  .app::before, .app::after { border-radius: 0; }
  .logo-tab { position: static; transform: none; border-radius: 0; border: 0; border-bottom: 1px solid var(--stroke); width: 100%; padding: 12px; }
  .logo { font-size: 24px; }
  .app-header { flex-wrap: wrap; padding: 12px 16px; } .main-nav { gap: 14px; } .header-right { width: 100%; } .search { flex: 1; min-width: 0; }
  .app-body { padding: 0 16px 16px; gap: 20px; }
  .main { padding-bottom: 84px; }
  .hero { padding: 24px 0 14px; } .hero h1 { font-size: 34px; }
  .sound-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .detail-grid { grid-template-columns: 1fr; }
  .share .btn { flex-basis: 45%; }

  /* The mixer becomes a bottom sheet that grows from a compact now-playing bar. */
  .rail {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 30; max-height: 64px; overflow: hidden; gap: 12px;
    padding: 0 12px 16px; background: var(--panel); backdrop-filter: var(--panel-blur); -webkit-backdrop-filter: var(--panel-blur);
    border-top: 1px solid var(--stroke-hi); border-radius: 18px 18px 0 0; box-shadow: 0 -20px 60px rgba(0,0,0,.5);
    transition: max-height .3s ease;
  }
  body.rail-open .rail { max-height: 88vh; overflow-y: auto; }
  .rail-bar { display: flex; align-items: center; gap: 10px; height: 64px; position: sticky; top: 0; background: inherit; z-index: 1; }
  .rail-bar .playbtn { width: 40px; height: 40px; box-shadow: none; } .rail-bar .playbtn .icon { width: 20px; height: 20px; }
  .rail-bar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .rail-bar-text b { font-size: 13px; } .rail-bar-text small { color: var(--text-dim); font-size: 11px; }
  .rail-bar .tbtn .icon { transition: transform .3s; } body.rail-open .rail-bar .tbtn .icon { transform: rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .logo { animation: none; }
}

.sleep-own { width: 62px; padding: 4px 6px; text-align: center; border-radius: var(--r-pill); border: 1px solid var(--stroke); background: var(--surface); color: var(--text); font: inherit; font-size: 12px; }
.sleep-own::-webkit-outer-spin-button, .sleep-own::-webkit-inner-spin-button { appearance: none; margin: 0; }
.sleep-own { appearance: textfield; }
.sleep-own:focus { outline: 1px solid var(--ember); }

/* ---- your listening ---------------------------------------------------------- */
.listen-figures { display: flex; gap: 12px; margin: 14px 0 22px; }
.listen-figures > div { flex: 1; text-align: center; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-card); padding: 14px 8px; }
.listen-figures strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: 28px; color: var(--cream); line-height: 1.1; }
.listen-figures span { font-size: 12px; color: var(--text-dim); }
.listen-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-card); padding: 12px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.bar-value { font-size: 10px; color: var(--text-faint); }
.bar { width: 100%; max-width: 34px; background: var(--ember); border-radius: 4px; }
.bar-day { font-size: 11px; color: var(--text-dim); }
.listen-list { display: flex; flex-direction: column; gap: 8px; }
.listen-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-md); padding: 8px 12px 8px 8px; }
.listen-row .thumb { width: 38px; height: 38px; border-radius: 8px; overflow: hidden; background: var(--surface-hi); flex: none; }
.listen-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.listen-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listen-time { color: var(--text-dim); font-size: 13px; }

/* Performance mode: no blur, no shimmer, no entrance animation — the same calm,
   cheap room the apps switch to. */
html[data-perf="on"] .app-bg, html[data-perf="on"] .logo-tab, html[data-perf="on"] .rail-card {
  backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--panel-solid);
}
html[data-perf="on"] .app { animation: none; }
html[data-perf="on"] .logo { animation: none; }
html[data-perf="on"] .cursor-glow { display: none; }

/* ---- the app gate on phones ------------------------------------------------ */
.mobile-gate { display: none; }
html.phone body > *:not(.mobile-gate) { display: none !important; }
html.phone { overflow: hidden; }
html.phone .mobile-gate {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 100; padding: 24px;
  background: radial-gradient(120% 90% at 50% 0%, #131a24 0%, var(--bg) 60%);
  color: var(--text); overflow-y: auto;
}
.gate-card { max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gate-logo { font-family: var(--font-display); font-size: 34px; line-height: 1; }
.gate-card h1 { font-family: var(--font-display); font-weight: 500; font-size: 1.6rem; margin: 0; }
.gate-card p { color: var(--text-dim); line-height: 1.55; margin: 0; }
.gate-stores { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }
.store-badge {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 22px;
  border: 1px solid var(--stroke-hi); border-radius: 12px; background: #000; color: #fff; text-decoration: none;
}
.store-badge:hover { background: #111; }
.store-badge.is-soon { opacity: .45; }
.store-mark { width: 26px; height: 26px; flex: none; }
.store-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.store-text small { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.store-text b { font-size: 17px; font-weight: 600; }
.gate-soon { font-size: 13px; color: var(--text-faint); }
.gate-links { font-size: 12px; color: var(--text-faint); }
.gate-links a { color: var(--text-dim); }

/* ---- legal / support pages ------------------------------------------------ */
.legal { max-width: 72ch; }
.legal h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; margin: 28px 0 8px; color: var(--cream); }
.legal p, .legal li { color: var(--text-dim); line-height: 1.6; }
.legal ul { padding-left: 20px; margin: 0 0 12px; }
.legal li { margin: 0 0 8px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--ember); }
.legal code { font-size: 0.9em; }
.legal .support-contact { margin: 6px 0 22px; }
