/* HarshNoise: dark, deep-blue palette taken from the label's CD artwork. */

:root {
  --bg: #05070d;
  --bg-2: #0a1430;
  --surface: #0e1a3d;
  --surface-2: #142553;
  --line: #1e336b;
  --royal: #2a55b0;
  --blue: #3f6fcc;
  --pale: #8fb5e8;
  --bolt: #7cc8ee;
  --text: #e8eefb;
  --muted: #95a8cf;
  --danger: #ff6b6b;
  --ok: #6fdca0;
  --warn: #f2c14e;

  --display: "Eurostile Extended", "Microgramma D Extended", "Microgramma", "Michroma", "Arial Black", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(42, 85, 176, .28), transparent 70%),
    radial-gradient(900px 400px at -10% 0%, rgba(124, 200, 238, .08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.6 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.has-player { padding-bottom: 88px; }

a { color: var(--pale); text-decoration-color: rgba(143, 181, 232, .4); text-underline-offset: 3px; }
a:hover { color: var(--bolt); text-decoration-color: currentColor; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--bolt); outline-offset: 2px; }

h1, h2, h3, .display {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.15;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--pale); }
h3 { font-size: 1rem; color: var(--pale); }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .9em; }
.small { font-size: .875rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Header / footer ---------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(10, 20, 48, .9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; padding-block: 10px; }
.brand img { height: 34px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--bolt); }

main { flex: 1; padding: 40px 0 64px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; padding: 28px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* ---- Buttons & forms ---------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 .95rem/1 var(--body);
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--royal);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--blue); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--blue); }
.btn-danger { background: #7a1f2b; }
.btn-danger:hover { background: #9c2737; }
.btn-small { padding: 8px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-bolt { background: var(--bolt); color: #06142e; }
.btn-bolt:hover { background: #a5dbf5; color: #06142e; }
.btn-link { background: none; border: 0; padding: 0; color: var(--pale); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

form.inline { display: inline; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.field .hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.field .error { color: var(--danger); font-size: .875rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=number], input[type=url], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(63, 111, 204, .3); }
textarea { min-height: 120px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }
.hp { position: absolute; left: -9999px; }

/* ---- Notices ------------------------------------------------------------ */

.flash { border-radius: var(--radius); padding: 12px 16px; margin: 0 0 24px; border: 1px solid var(--line); background: var(--surface); }
.flash-success { border-color: rgba(111, 220, 160, .5); }
.flash-error { border-color: rgba(255, 107, 107, .6); background: #2a0f18; }
.flash-info { border-color: var(--blue); }

/* ---- Home / catalog grid ------------------------------------------------ */

.hero { padding: 8px 0 36px; }
.hero h1 { max-width: 18ch; }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.hero .lede strong { color: var(--text); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.pills li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .85rem; color: var(--pale); background: rgba(14, 26, 61, .6); }
.pills .pill-donate { padding: 0; border-color: rgba(124, 200, 238, .45); transition: border-color .15s, background .15s; }
.pills .pill-donate a { display: block; padding: 4px 12px; color: var(--bolt); font-weight: 600; text-decoration: none; }
.pills .pill-donate span { display: inline-block; transition: transform .15s; }
.pills .pill-donate:hover { border-color: var(--bolt); background: rgba(124, 200, 238, .1); }
.pills .pill-donate:hover span { transform: translateX(2px); }

.release-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 40vw), 1fr)); gap: 28px 20px; }
.release-card { text-decoration: none; color: var(--text); display: block; }
.release-card .cover { aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); position: relative; }
.release-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s, filter .25s; }
.release-card:hover .cover img { transform: scale(1.03); filter: brightness(1.08); }
.release-card .meta { padding-top: 10px; }
.release-card .artist { font-weight: 700; line-height: 1.3; }
.release-card .title { color: var(--pale); line-height: 1.3; }
.release-card .catno { color: var(--muted); font: .78rem var(--mono); }
.cover-placeholder { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 12px; background: linear-gradient(135deg, var(--surface-2), var(--bg-2)); color: var(--pale); font: italic 800 1rem/1.2 var(--display); text-transform: uppercase; }

/* ---- Release page ------------------------------------------------------- */

.release { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .release { grid-template-columns: 1fr; gap: 28px; } }

.art-main { border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); aspect-ratio: 1; }
.art-main img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.art-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.art-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 4px; background: var(--surface); cursor: pointer; width: 72px; height: 72px; overflow: hidden; }
.art-thumbs button[aria-pressed="true"] { border-color: var(--bolt); }
.art-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.art-caption { color: var(--muted); font-size: .8rem; margin-top: 6px; }

.release-head .catno { font-family: var(--mono); color: var(--bolt); font-size: .9rem; letter-spacing: .05em; }
.release-head .artist-link { font-size: 1.15rem; font-weight: 700; color: var(--text); text-decoration: none; }
.release-head .artist-link:hover { color: var(--bolt); }
.release-head h1 { margin-top: 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: .9rem; margin-bottom: 22px; padding: 0; list-style: none; }

.download-box { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), var(--bg-2)); padding: 18px; margin-bottom: 28px; }
.download-box .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.download-box p { margin: 10px 0 0; color: var(--muted); font-size: .875rem; }

.tracklist { list-style: none; margin: 0 0 32px; padding: 0; border-top: 1px solid var(--line); }
.tracklist li { display: grid; grid-template-columns: 36px 28px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.tracklist li.playing { background: rgba(42, 85, 176, .18); }
.tracklist .pos { color: var(--muted); font: .85rem var(--mono); text-align: right; }
.tracklist .t-title { min-width: 0; overflow-wrap: anywhere; }
.tracklist .t-artist { color: var(--muted); font-size: .85rem; display: block; }
.tracklist .dur { color: var(--muted); font: .85rem var(--mono); }
.play-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; padding: 0; }
.play-btn:hover { border-color: var(--bolt); color: var(--bolt); }
.play-btn svg { width: 12px; height: 12px; fill: currentColor; }
.dl-btn { background: none; border: 1px solid transparent; color: var(--muted); border-radius: var(--radius); padding: 4px 8px; font: .78rem var(--mono); cursor: pointer; }
.dl-btn:hover { color: var(--bolt); border-color: var(--line); }

.prose { white-space: pre-line; color: #cfd9f0; }
.section { margin-top: 36px; }

/* ---- Donations ---------------------------------------------------------- */

.donate-panel { margin: 28px 0 32px; }
.donate-amounts { display: flex; flex-wrap: wrap; gap: 10px; }
.donate-amounts .btn-bolt { min-width: 72px; }
.donate-note { color: var(--muted); font-size: .875rem; margin: -14px 0 28px; }

/* ---- Artists ------------------------------------------------------------ */

.artist-list { columns: 3 240px; column-gap: 32px; padding: 0; list-style: none; }
.artist-list li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--line); }
.artist-list a { color: var(--text); text-decoration: none; font-weight: 600; }
.artist-list a:hover { color: var(--bolt); }

/* ---- Sign-in ------------------------------------------------------------ */

.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; gap: 32px; } }
.card { border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg, var(--surface), var(--bg-2)); padding: clamp(20px, 4vw, 32px); }
.card-tight { padding: 20px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 28px; }
.steps li { counter-increment: step; position: relative; padding: 0 0 16px 46px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%; background: var(--royal); color: #fff; display: grid; place-items: center; font: italic 800 .95rem var(--display); }
.steps strong { display: block; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; }
.checks li { padding: 4px 0 4px 28px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.checks.nope li::before { width: 12px; height: 2px; border: 0; background: var(--muted); transform: none; top: 15px; }
.big-input { font-size: 1.1rem !important; padding: 14px !important; }
.fine-print { color: var(--muted); font-size: .85rem; margin-top: 14px; }
.dev-note { border: 1px dashed var(--warn); color: var(--warn); padding: 12px; border-radius: var(--radius); margin-top: 20px; overflow-wrap: anywhere; font-size: .875rem; }

.quota { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted); }
.quota-dots { display: inline-flex; gap: 4px; }
.quota-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: block; }
.quota-dots i.on { background: var(--bolt); }

/* ---- Consent banner ----------------------------------------------------- */

.consent {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: 16px; z-index: 40;
  max-width: 520px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
.consent p { margin: 0 0 12px; font-size: .9rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.site-footer .btn-link { color: var(--muted); }

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

.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(8, 14, 34, .97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.player .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 72px; padding-block: 10px; }
.player-controls { display: flex; gap: 6px; align-items: center; }
.player-controls button { background: none; border: 0; color: var(--text); cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.player-controls button:hover { color: var(--bolt); }
.player-controls .pp { background: var(--bolt); color: #06142e; width: 42px; height: 42px; }
.player-controls .pp:hover { background: #a5dbf5; color: #06142e; }
.player-controls svg { width: 16px; height: 16px; fill: currentColor; }
.player-info { min-width: 0; }
.player-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-seek { display: flex; align-items: center; gap: 10px; font: .78rem var(--mono); color: var(--muted); }
.player-seek input { flex: 1; accent-color: var(--bolt); min-width: 60px; }
.player-close { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.4rem; line-height: 1; }
@media (max-width: 600px) { .player .wrap { grid-template-columns: auto minmax(0, 1fr); } .player-close { display: none; } }

/* ---- Lightbox ----------------------------------------------------------- */

dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog.lightbox::backdrop { background: rgba(2, 4, 10, .92); }
dialog.lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; }

/* ---- Tables (account / admin) ------------------------------------------ */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-2); }
tr:last-child td { border-bottom: 0; }
td input[type=text], td input[type=number] { padding: 7px 9px; }

/* ---- Admin -------------------------------------------------------------- */

.admin-bar { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 28px; }
.admin-bar a { text-decoration: none; font-weight: 600; color: var(--muted); }
.admin-bar a[aria-current="page"], .admin-bar a:hover { color: var(--bolt); }
.admin-bar .spacer { flex: 1; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 20px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font: 600 .72rem/1.6 var(--body); text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--line); color: var(--muted); }
.badge-published, .badge-ready, .badge-done { color: var(--ok); border-color: rgba(111, 220, 160, .45); }
.badge-draft, .badge-queued, .badge-uploading { color: var(--pale); }
.badge-processing, .badge-running { color: var(--warn); border-color: rgba(242, 193, 78, .5); }
.badge-pulled, .badge-error, .badge-failed { color: var(--danger); border-color: rgba(255, 107, 107, .5); }

.admin-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; align-items: start; }
@media (max-width: 960px) { .admin-grid { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--line); border-radius: 8px; background: rgba(14, 26, 61, .55); padding: 20px; margin-bottom: 24px; }
.panel h2 { margin-bottom: 14px; }

.dropzone { border: 2px dashed var(--line); border-radius: 8px; padding: 26px 16px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--bolt); background: rgba(124, 200, 238, .06); color: var(--text); }
.dropzone input[type=file] { display: none; }
.upload-list { list-style: none; padding: 0; margin: 14px 0 0; font-size: .875rem; }
.upload-list li { display: grid; grid-template-columns: minmax(0, 1fr) 120px 70px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.upload-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-list progress { width: 100%; accent-color: var(--bolt); }
.upload-list .state { text-align: right; font: .78rem var(--mono); color: var(--muted); }
.upload-list .state.err { color: var(--danger); }

.art-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.art-slot { border: 2px dashed var(--line); border-radius: 6px; padding: 10px; background: var(--bg); transition: border-color .15s, background .15s; }
.art-slot.pending .thumb img { opacity: .5; }
.art-slot.over { border-color: var(--bolt); background: rgba(124, 200, 238, .06); }
.art-slot .thumb { aspect-ratio: 1; background: var(--surface); border-radius: 4px; overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: .8rem; margin-bottom: 8px; }
.art-slot .thumb img { width: 100%; height: 100%; object-fit: cover; }
.art-slot .label { font-weight: 700; font-size: .875rem; }
.art-slot .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.art-slot label.btn { margin: 0; }
.art-slot input[type=file] { display: none; }

.danger-zone { border-color: rgba(255, 107, 107, .4); }
.stat-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 12px 18px; background: var(--bg-2); min-width: 140px; }
.stat b { display: block; font: italic 800 1.5rem var(--display); color: var(--bolt); }
.stat span { color: var(--muted); font-size: .8rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.check-label { font-weight: 400; display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.track-table td:nth-child(1) { width: 72px; }
.track-table td:nth-child(1) input { width: 60px; padding-inline: 6px; }
.track-table td:nth-child(2) { min-width: 220px; }
.track-table td:nth-child(3) { min-width: 120px; }
.track-table .filename { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
