@import url("https://fonts.googleapis.com/css2?family=Albert+Sans:wght@400;500;600;700&family=Bodoni+Moda:ital,opsz,wght@1,6..96,500&family=DM+Mono:wght@400;500&display=swap");

:root {
	--page: #0d0e10;
	--surface: #14161a;
	--surface-raised: #1b1d21;
	--ink: #f2efe8;
	--muted: #aaa8a2;
	--faint: #6f706f;
	--line: #303238;
	--line-soft: #24262b;
	--accent: #d8a64e;
	--accent-ink: #17130d;
	--focus: #f3c66f;
	--room-shadow: 0 38px 100px rgba(0,0,0,.42);
	color-scheme: dark;
	font-family: "Albert Sans", sans-serif;
}

html[data-theme="light"] {
	--page: #d8d5ce;
	--surface: #e8e5de;
	--surface-raised: #f2efe8;
	--ink: #191a1c;
	--muted: #5f6061;
	--faint: #858581;
	--line: #b5b3ad;
	--line-soft: #c8c5be;
	--accent: #8d4c28;
	--accent-ink: #fff9ef;
	--focus: #275fba;
	--room-shadow: 0 30px 70px rgba(44,38,29,.18);
	color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--page); color: var(--ink); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, a { color: inherit; font: inherit; }
button { cursor: pointer; }
a { text-underline-offset: .25em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 120; top: .75rem; left: .75rem; opacity: 0; pointer-events: none; background: var(--ink); color: var(--page); padding: .55rem .8rem; transition: opacity 160ms ease; }
.skip-link:focus { opacity: 1; pointer-events: auto; }
.lab-dock { position: relative; z-index: 80; display: flex; width: max-content; max-width: calc(100% - 2rem); margin: .75rem auto 0; align-items: center; gap: .2rem; padding: .3rem; border-radius: 999px; background: rgba(12,13,15,.94); box-shadow: 0 14px 42px rgba(0,0,0,.35); backdrop-filter: blur(14px); }
.lab-dock span, .lab-dock a { padding: .43rem .65rem; color: #d7d4cd; font-size: .64rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.lab-dock span { display: flex; align-items: center; gap: .4rem; letter-spacing: .06em; text-transform: uppercase; }
.lab-dock i { width: .4rem; height: .4rem; border-radius: 50%; background: #69d980; box-shadow: 0 0 9px rgba(105,217,128,.72); }
.lab-dock a[aria-current="page"] { border-radius: 999px; background: #eeeae2; color: #17181a; }

.site-header, main, .site-footer { width: min(100% - 3rem, 88rem); margin-inline: auto; }
.site-header { display: grid; grid-template-columns: 1fr auto 1fr; min-height: 5.6rem; align-items: center; border-bottom: 1px solid var(--line-soft); }
.site-name { font-size: .92rem; font-weight: 700; text-decoration: none; }
.primary-nav { display: flex; gap: 1.7rem; }
.primary-nav a, .header-actions a { color: var(--muted); font-size: .73rem; font-weight: 600; text-decoration: none; }
.primary-nav a:hover, .header-actions a:hover { color: var(--ink); }
.header-actions { display: flex; justify-self: end; align-items: center; gap: 1rem; }
.theme-toggle { display: grid; width: 2.35rem; height: 2.35rem; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.theme-toggle svg { width: 1rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.65; }

.room-intro { display: grid; grid-template-columns: 1.12fr .68fr; gap: clamp(4rem, 9vw, 9rem); align-items: end; padding-block: 3rem 2.3rem; }
.room-intro h1 { max-width: 50rem; margin: 0; font-size: clamp(3.2rem, 5.3vw, 4.8rem); font-weight: 500; letter-spacing: -.04em; line-height: .92; }
.room-intro h1 em, .why-music h2 em { color: var(--accent); font-family: "Bodoni Moda", serif; font-weight: 500; }
.room-intro > div > p { max-width: 42rem; margin: 1.8rem 0 0; color: var(--muted); }
.search { position: relative; z-index: 20; }
.search label { display: block; margin-bottom: .75rem; color: var(--muted); font-size: .7rem; font-weight: 600; }
.search-control { display: grid; grid-template-columns: 1.2rem 1fr auto auto; gap: .65rem; align-items: center; border-bottom: 1px solid var(--line); padding: .15rem 0 .8rem; transition: border-color .16s ease; }
.search-control:focus-within { border-color: var(--accent); }
.search-control svg { width: 1rem; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.6; }
.search-control input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .86rem; }
.search-control input::placeholder { color: var(--faint); opacity: 1; }
.search-clear { display: grid; width: 1.65rem; height: 1.65rem; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--faint); transition: background .14s ease, color .14s ease; }
.search-clear:hover { background: var(--line-soft); color: var(--ink); }
.search-clear svg { width: .75rem; stroke: currentColor; stroke-width: 1.9; }
.search-control kbd { border: 1px solid var(--line); border-radius: .3rem; padding: .05rem .35rem; color: var(--faint); font: .62rem "DM Mono", monospace; }
.search > p { margin: .8rem 0 0; color: var(--faint); font-size: .62rem; }
.search-results { position: absolute; z-index: 30; top: calc(100% - 1.1rem); right: 0; left: 0; overflow: hidden; border: 1px solid var(--line); border-radius: .75rem; background: color-mix(in srgb, var(--surface-raised) 96%, transparent); box-shadow: 0 18px 44px rgba(0,0,0,.34); padding: .35rem; }
.search-result { display: grid; width: 100%; min-height: 3.4rem; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; border: 0; border-radius: .5rem; background: transparent; padding: .38rem .55rem; color: var(--ink); text-align: left; transition: background .12s ease; }
.search-result:hover, .search-result[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 11%, var(--surface-raised)); }
.search-result img { display: block; width: 2.5rem; aspect-ratio: 1; border-radius: .18rem; object-fit: cover; }
.search-result-copy { min-width: 0; }
.search-result strong, .search-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result strong { font-size: .76rem; font-weight: 650; }
.search-result small { margin-top: .1rem; color: var(--muted); font-size: .64rem; }
.search-result > span:last-child { color: var(--faint); font: .57rem "DM Mono", monospace; }
.search-empty { display: grid; min-height: 7.5rem; place-content: center; padding: 1rem; text-align: center; }
.search-empty svg { width: 1.1rem; margin: 0 auto .7rem; fill: none; stroke: var(--faint); stroke-linecap: round; stroke-width: 1.5; }
.search-empty strong { font-size: .78rem; }
.search-empty span { margin-top: .15rem; color: var(--faint); font-size: .65rem; }

.record-library { padding-bottom: 8rem; }
.library-shell { position: relative; min-height: clamp(34rem, 56vw, 43rem); border-radius: 1rem; background: #111216; box-shadow: var(--room-shadow); overflow: hidden; isolation: isolate; }
.library-shell::before { content: ""; position: absolute; z-index: 2; inset: 1rem; border: 1px solid rgba(255,255,255,.07); border-radius: .65rem; pointer-events: none; }
.library-shell::after { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 50% 13%, rgba(214,169,101,.14), transparent 48%), linear-gradient(180deg, #17191e 0%, #0d0e11 76%); pointer-events: none; }
html[data-theme="light"] .library-shell::after { background: radial-gradient(ellipse at 50% 13%, rgba(183,119,66,.16), transparent 48%), linear-gradient(180deg, #77746e 0%, #4d4b47 76%); }
#record-canvas { position: absolute; z-index: 1; inset: 0; display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
#record-canvas.is-dragging { cursor: grabbing; }
.room-light { position: absolute; z-index: 0; top: -20%; left: 15%; width: 70%; height: 65%; border-radius: 50%; background: rgba(225,181,112,.09); filter: blur(80px); pointer-events: none; }
.canvas-loading, .canvas-fallback { position: absolute; z-index: 4; inset: 0; display: flex; align-items: center; justify-content: center; gap: .65rem; background: #111216; color: #aaa9a4; font-size: .72rem; }
.loader-grid { display: grid; grid-template-columns: repeat(3, .28rem); gap: .12rem; }
.loader-grid i { display: block; width: .28rem; height: .28rem; border-radius: .06rem; background: #f3c66f; opacity: .12; animation: loader-pixel .68s ease-in-out var(--delay) infinite; }
.loader-label { color: #d7d3cb; font-weight: 600; }
.loader-time { min-width: 2.8rem; color: #777a80; font: .64rem "DM Mono", monospace; font-variant-numeric: tabular-nums; }
@keyframes loader-pixel { 0%, 65%, 100% { opacity: .12; transform: scale(.86); } 26% { opacity: 1; transform: scale(1); } }
@keyframes loader-spin { to { transform: rotate(360deg); } }
.canvas-fallback { flex-direction: column; text-align: center; }
.canvas-fallback strong { color: #f1eee8; }
.canvas-fallback p { margin: 0; }

.browse-hud { position: absolute; z-index: 5; right: 2.3rem; bottom: 1rem; left: 2.3rem; display: flex; align-items: end; justify-content: space-between; gap: 2rem; transition: opacity .28s ease, transform .38s cubic-bezier(.16,1,.3,1); pointer-events: none; }
.browse-copy p { margin: 0 0 .45rem; color: rgba(255,255,255,.42); font: .6rem "DM Mono", monospace; }
.browse-copy h2 { max-width: 34rem; margin: 0; color: #f3f0ea; font-size: clamp(2rem, 3.4vw, 3.6rem); font-weight: 500; letter-spacing: -.04em; line-height: .92; overflow-wrap: anywhere; }
.browse-copy > span { display: block; margin-top: .65rem; color: rgba(255,255,255,.58); font-size: .8rem; }
.browse-actions { display: flex; align-items: center; gap: .7rem; pointer-events: auto; }
.browse-actions button { min-height: 2.9rem; border: 1px solid rgba(255,255,255,.2); background: rgba(15,16,19,.7); color: #f2efe8; backdrop-filter: blur(10px); }
.browse-actions button:not(.inspect-button) { display: grid; width: 2.9rem; place-items: center; border-radius: 50%; }
.browse-actions button:hover { border-color: rgba(255,255,255,.55); }
.browse-actions button:disabled { cursor: not-allowed; opacity: .3; }
.browse-actions svg { width: 1rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.browse-actions .inspect-button { border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); padding: .68rem 1.15rem; font-size: .72rem; font-weight: 700; }

.inspect-panel { position: absolute; z-index: 7; width: 20rem; max-width: calc(100% - 4rem); padding: 0; opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.library-shell[data-library-mode="inspect"] .inspect-panel { opacity: 1; transition-delay: .42s; pointer-events: auto; }
.library-shell[data-library-mode="inspect"] .browse-hud { opacity: 0; transform: translateY(1.5rem); pointer-events: none; }
.record-close { position: absolute; z-index: 8; top: 0; left: 0; display: grid; width: 2.35rem; height: 2.35rem; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: rgba(15,16,19,.86); color: #f3f0ea; box-shadow: 0 8px 24px rgba(0,0,0,.3); opacity: 0; transform: translate(-50%, -50%) scale(.82); transition: opacity .22s ease, transform .34s cubic-bezier(.16,1,.3,1), border-color .2s ease; pointer-events: none; backdrop-filter: blur(12px); }
.record-close:hover { border-color: rgba(255,255,255,.52); }
.record-close svg { width: 1rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.65; }
.library-shell[data-library-mode="inspect"] .record-close { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.spotify-player { position: relative; min-height: var(--record-player-height, 80px); margin: 0; filter: drop-shadow(0 9px 18px rgba(0,0,0,.24)); }
.spotify-player iframe { display: block; width: 100%; height: var(--record-player-height, 80px); border: 0; border-radius: .6rem; background: #121212; }
.player-loading { position: absolute; inset: 0; display: flex; gap: .6rem; align-items: center; justify-content: center; border-radius: .6rem; background: #1b1b1b; color: #aaa; font-size: .65rem; }
.player-loading span { width: .75rem; height: .75rem; border: 1px solid #555; border-top-color: #1ed760; border-radius: 50%; animation: loader-spin .7s linear infinite; }

.empty-state { position: absolute; z-index: 7; inset: 0; display: grid; place-content: center; background: rgba(14,15,18,.94); text-align: center; }
.empty-state h2 { margin: 0; color: #f3f0ea; font-size: clamp(2rem, 4vw, 3.8rem); font-weight: 500; letter-spacing: -.03em; }
.empty-state p { margin: .7rem 0 1.4rem; color: #aaa9a4; }
.empty-state button { width: max-content; margin: auto; border: 1px solid #4c4e53; border-radius: 999px; background: transparent; color: #f3f0ea; padding: .65rem 1rem; font-size: .7rem; }

.shelf-scrollbar { position: absolute; z-index: 5; right: 50%; bottom: 7.35rem; display: grid; width: min(56%, 50rem); grid-template-columns: 2.4rem minmax(10rem, 46rem) 2.4rem; gap: 1rem; align-items: center; color: rgba(255,255,255,.35); font: .58rem "DM Mono", monospace; transform: translateX(50%); transition: opacity .22s ease, transform .34s cubic-bezier(.16,1,.3,1); }
.library-shell[data-library-mode="inspect"] .shelf-scrollbar { opacity: 1; transform: translateX(50%); pointer-events: auto; }
.shelf-scrollbar > span:last-child { text-align: right; }
.scrubber-control { position: relative; display: grid; height: 2.4rem; align-items: center; cursor: ew-resize; }
.scrubber-control input { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; margin: 0; cursor: ew-resize; opacity: 0; }
.scrubber-control input:focus-visible + .scrubber-ticks { outline: 2px solid var(--focus); outline-offset: 5px; border-radius: .2rem; }
.scrubber-ticks { display: flex; height: 2.4rem; align-items: center; justify-content: space-between; pointer-events: none; }
.scrubber-ticks i { display: block; width: 1px; height: .45rem; background: rgba(255,255,255,.62); opacity: var(--tick-opacity, .28); transform: scaleY(var(--tick-scale, 1)); transition: transform .16s cubic-bezier(.16,1,.3,1), opacity .16s ease, background .16s ease; }
.scrubber-ticks i.is-current { width: 2px; background: #fff; box-shadow: 0 0 12px rgba(255,255,255,.38); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.library-instructions { display: flex; justify-content: space-between; gap: 2rem; padding: .7rem .2rem 1.3rem; color: var(--faint); font: .61rem "DM Mono", monospace; }
.library-instructions p { margin: 0; }
.record-rail { display: flex; gap: .75rem; overflow-x: auto; padding: .25rem .2rem 1.3rem; scroll-snap-type: x mandatory; scrollbar-color: var(--line) transparent; }
.rail-card { display: grid; flex: 0 0 12.5rem; grid-template-columns: 3.7rem 1fr; gap: .8rem; align-items: center; min-height: 4.7rem; scroll-snap-align: start; border: 1px solid var(--line-soft); border-radius: .75rem; background: transparent; padding: .45rem; color: inherit; text-align: left; transition: border-color .22s ease, background .22s ease, transform .28s cubic-bezier(.16,1,.3,1); }
.rail-card:hover { border-color: var(--line); transform: translateY(-2px); }
.rail-card[aria-selected="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.rail-card img { display: block; width: 3.7rem; aspect-ratio: 1; border-radius: .18rem; object-fit: cover; box-shadow: 0 8px 18px rgba(0,0,0,.24); }
.rail-card span { min-width: 0; }
.rail-card strong, .rail-card small { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.rail-card strong { font-size: .72rem; }
.rail-card small { margin-top: .22rem; color: var(--faint); font-size: .61rem; }
.live-region { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.why-music { display: grid; grid-template-columns: 1.05fr .75fr; gap: clamp(4rem, 10vw, 10rem); padding-block: 8rem; border-top: 1px solid var(--line-soft); }
.why-music h2 { margin: 0; font-size: clamp(2.8rem, 5vw, 5.2rem); font-weight: 500; letter-spacing: -.04em; line-height: .95; }
.why-music div { max-width: 34rem; color: var(--muted); }
.why-music p { margin: 0 0 1.5rem; }
.site-footer { display: flex; min-height: 8rem; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-soft); }
.site-footer p { font-weight: 700; }
.site-footer p span { margin-left: .7rem; color: var(--faint); font-size: .65rem; font-weight: 400; }
.site-footer div { display: flex; gap: 1.4rem; }
.site-footer a { color: var(--muted); font-size: .7rem; }

@media (max-width: 1100px) {
	.library-shell { min-height: 40rem; }
}

@media (max-width: 760px) {
	.site-header, main, .site-footer { width: min(100% - 2rem, 88rem); }
	.site-header { grid-template-columns: 1fr 1fr; }
	.primary-nav, .header-actions > a { display: none; }
	.room-intro { grid-template-columns: 1fr; gap: 2.8rem; padding-block: 4.8rem 3rem; }
	.search-results { top: calc(100% - 1rem); }
	.room-intro h1 { font-size: clamp(3.1rem, 14vw, 5rem); }
	.record-library { padding-bottom: 6rem; }
	.library-shell { min-height: 36rem; margin-inline: -.25rem; }
	.library-shell::before { inset: .7rem; }
	.browse-hud { right: 1.25rem; bottom: .75rem; left: 1.25rem; display: block; }
	.browse-copy h2 { max-width: 85%; font-size: clamp(2.3rem, 12vw, 3.8rem); }
	.browse-actions { margin-top: 1.2rem; }
	.library-instructions { display: block; }
	.library-instructions p + p { margin-top: .35rem; }
	.shelf-scrollbar { bottom: 11rem; width: calc(100% - 2.5rem); grid-template-columns: 1.8rem minmax(8rem, 1fr) 1.8rem; gap: .65rem; }
	.library-shell[data-library-mode="inspect"] .shelf-scrollbar { bottom: 12.5rem; }
	.rail-card { flex-basis: 11rem; }
	.why-music { grid-template-columns: 1fr; gap: 2.6rem; padding-block: 6rem; }
	.site-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: .75rem; }
}

@media (max-width: 480px) {
	.lab-dock .lab-status { display: none; }
	.lab-dock span, .lab-dock a { font-size: .59rem; }
	.library-shell { min-height: 34rem; }
	.browse-copy > span { max-width: 80%; }
	.browse-actions .inspect-button { flex: 1; }
	.browse-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

html[data-motion="reduced"] { scroll-behavior: auto; }
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
