/* Album Hub — mobile-first, white-label. Brand tokens are set at runtime from album.json or the artwork. */

:root {
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);

  /* runtime-overridable brand tokens */
  --accent-dark: #e8e8e8;
  --accent-light: #1a1a1a;
  --on-accent-dark: #000;
  --on-accent-light: #fff;
  --tint-dark: #121214;
  --tint-light: #f4f4f5;

  /* light mode */
  --accent: var(--accent-light);
  --on-accent: var(--on-accent-light);
  --bg: var(--tint-light);
  --surface: #ffffff;
  --surface-2: color-mix(in srgb, var(--tint-light) 70%, #e9e9ee);
  --text: #141416;
  --text-muted: #5b5b66;
  --border: rgba(0, 0, 0, 0.1);
  --press: rgba(0, 0, 0, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);

  --radius: 14px;
  --radius-sm: 10px;
  --col: 480px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: var(--accent-dark);
    --on-accent: var(--on-accent-dark);
    --bg: var(--tint-dark);
    --surface: color-mix(in srgb, var(--tint-dark) 80%, #1c1c20);
    --surface-2: color-mix(in srgb, var(--tint-dark) 55%, #2a2a30);
    --text: #f4f4f6;
    --text-muted: #a9a9b4;
    --border: rgba(255, 255, 255, 0.1);
    --press: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body {
  margin: 0;
  font: 16px/1.55 var(--font-body);
  color: var(--text);
  background: #0b0b0c;
  -webkit-font-smoothing: antialiased;
}
html.sheet-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { fill: currentColor; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- backdrop: blurred artwork (Linkfire pattern) ---------- */
.backdrop {
  position: fixed; inset: -60px;
  background: #111 center / cover no-repeat;
  filter: blur(48px) saturate(1.3) brightness(0.55);
  transform: scale(1.1);
  z-index: -1;
}

.app {
  max-width: var(--col);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.4);
}
@media (min-width: 560px) {
  .app { margin: 32px auto; min-height: auto; border-radius: 24px; overflow: clip; }
}
.loading { padding: 40vh 0; text-align: center; color: #aaa; margin: 0; }

/* ---------- draft banner ---------- */
.draft {
  background: #fff3c4; color: #3d2f00; font-size: 13px; padding: 10px 16px;
  border-bottom: 1px solid #e6d27a;
}
.draft summary { cursor: pointer; min-height: 24px; }
.draft ul { columns: 2; padding-left: 18px; margin: 6px 0 0; font-size: 12px; }
.draft code { font-size: 11px; }
code.ph {
  font: 600 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #fff3c4; color: #6b4e00; border: 1px dashed #c9a400;
  padding: 1px 5px; border-radius: 5px; white-space: nowrap; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 28px 24px 32px;
  text-align: center;
  color: #fff;
  isolation: isolate;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: -40px; z-index: -2;
  background: var(--hero-art) center / cover;
  filter: blur(36px) saturate(1.2);
  transform: scale(1.15);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.72));
}
.hero-art {
  width: min(78%, 300px); height: auto; aspect-ratio: 1; object-fit: cover; margin: 0 auto;
  border-radius: 12px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}
.hero-title { font: 800 26px/1.15 var(--font-heading); margin: 22px 0 4px; letter-spacing: -0.01em; text-wrap: balance; }
.hero-artist { margin: 0; font-size: 17px; font-weight: 600; opacity: 0.92; }
.hero-date { margin: 4px 0 0; font-size: 14px; opacity: 0.75; }
.hero-ctas { display: grid; gap: 10px; margin-top: 22px; }
.hero .btn-secondary { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.28); backdrop-filter: blur(8px); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.08s ease, background-color 0.15s ease, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.hero .btn-primary { background: #fff; color: #000; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); min-height: 44px; font-size: 15px; }
.btn-ghost svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.btn.is-disabled { opacity: 0.7; cursor: default; flex-wrap: wrap; }
.linklike { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; min-height: 44px; }

/* ---------- tabs ---------- */
.content { background: var(--bg); }
.tabbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 8px; }
[role=tab] {
  min-height: 52px; background: none; border: 0; cursor: pointer;
  font-weight: 650; font-size: 15px; color: var(--text-muted);
  position: relative;
}
[role=tab][aria-selected=true] { color: var(--text); }
[role=tab][aria-selected=true]::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent);
}
[role=tab]:focus-visible { outline-offset: -4px; }

.panel { padding: 20px 16px 28px; }
.panel-note { margin: 0 0 12px; color: var(--text-muted); font-size: 14px; }

/* ---------- cards / story ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-title { font: 750 13px/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 14px; }
.prose p { margin: 0 0 1em; font-size: 17px; line-height: 1.65; }
.prose p:first-child::first-letter { font: 800 3.1em/0.85 var(--font-heading); float: left; margin: 0.06em 0.08em 0 0; color: var(--accent); }
.credits dl { margin: 0; display: grid; gap: 12px; }
.credits dt { font-size: 13px; color: var(--text-muted); }
.credits dd { margin: 2px 0 0; font-weight: 600; }

/* ---------- tracks ---------- */
.tracklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.track { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: clip; scroll-margin-top: 64px; }
.track-head { margin: 0; font: inherit; }
.track-toggle {
  width: 100%; min-height: 60px; display: grid; grid-template-columns: 28px 1fr auto 24px; align-items: center; gap: 10px;
  padding: 10px 14px; background: none; border: 0; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.track-toggle:active { background: var(--press); }
.track-num { color: var(--text-muted); font-variant-numeric: tabular-nums; font-weight: 600; text-align: center; }
.track-meta { display: flex; flex-direction: column; min-width: 0; }
.track-title { font-weight: 650; }
.track-feat { font-size: 13px; color: var(--text-muted); }
.track-dur { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.chev { width: 24px; height: 24px; color: var(--text-muted); transition: transform 0.2s ease; }
[aria-expanded=true] .chev { transform: rotate(180deg); }
.track-toggle[aria-expanded=true] { border-bottom: 1px solid var(--border); }
.track-body { padding: 4px 14px 16px; }
.module { margin-top: 14px; }
.module p { margin: 0; }
.module-title { font: 750 12px/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }
.hint { font-size: 13px; color: var(--text-muted); margin: 6px 0 0 !important; }
.center { text-align: center; }

.media iframe { display: block; width: 100%; border: 0; border-radius: 12px; background: #000; }
.media-audio { min-height: 80px; border-radius: 12px; background: var(--surface-2); }
.media-audio iframe { height: 80px; }
.media-video iframe, .facade-video { aspect-ratio: 16 / 9; width: 100%; }
.facade-video:active { transform: scale(0.99); }
.facade-video {
  position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: #000; display: block;
}
.facade-video img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.15s; }
.facade-video:hover img { opacity: 1; }
.play-dot {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
}
.play-dot svg { width: 22px; height: 22px; margin-left: 2px; }
.play-dot.big { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); }
.play-dot.big svg { width: 30px; height: 30px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px; background: var(--surface-2); margin-bottom: 10px; }
.seg button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- streaming list ---------- */
.svc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.svc-more { margin-top: 10px; display: grid; gap: 10px; }
.svc-row {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px;
  min-height: 64px; padding: 10px 12px 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  transition: transform 0.08s ease, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
a.svc-row:active { transform: scale(0.985); background: var(--surface-2); }
a.svc-row:hover .pill { filter: brightness(1.08); }
.svc-row.is-disabled { opacity: 0.75; }
.svc-tile { width: 40px; height: 40px; border-radius: 10px; background: var(--c); display: grid; place-items: center; }
.svc-glyph { width: 22px; height: 22px; background: var(--fg); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.svc-mono { color: var(--fg); font: 800 19px/1 var(--font-body); }
.svc-name { font-weight: 650; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.svc-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); }
.pill { background: var(--accent); color: var(--on-accent); padding: 0 18px; min-height: 36px; display: inline-flex; align-items: center; border-radius: 999px; font-weight: 700; font-size: 14px; }
.is-disabled .pill { background: var(--surface-2); color: var(--text-muted); }

/* ---------- bottom sheet ---------- */
dialog.sheet {
  margin: auto auto 0; padding: 0; border: 0; width: 100%; max-width: var(--col);
  max-height: 88vh; border-radius: 20px 20px 0 0; background: var(--bg); color: var(--text);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
}
dialog.sheet[open] { animation: sheet-up 0.22s ease-out; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); }
@media (min-width: 560px) { dialog.sheet { margin: auto; border-radius: 20px; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-inner { padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); overflow: auto; max-height: 88vh; }
.sheet-inner::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 4px auto 12px; }
.sheet-head { display: grid; grid-template-columns: 48px 1fr 44px; gap: 12px; align-items: center; margin-bottom: 14px; }
.sheet-head img { border-radius: 8px; }
.sheet-head h2 { font: 750 16px/1.25 var(--font-heading); margin: 0; }
.sheet-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- press ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; }
.chip[aria-pressed=true] { background: var(--text); color: var(--bg); border-color: var(--text); }
.press-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.press-kicker { margin: 0 0 6px; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.press-type { color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; font-weight: 750; }
.press-headline { font: 750 18px/1.3 var(--font-heading); margin: 0 0 6px; text-wrap: pretty; }
.press-byline { margin: 0 0 10px; font-size: 13px; color: var(--text-muted); }
.press-summary { margin: 0 0 12px; font-size: 15px; }
.press-quote { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--accent); }
.press-quote p { margin: 0; font-style: italic; }
.press-quote cite { font-size: 13px; color: var(--text-muted); font-style: normal; }
.press-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--accent); text-decoration: none; }
.press-link svg { width: 16px; height: 16px; }
.link-disabled { color: var(--text-muted); font-size: 14px; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 44px; }

/* ---------- footer ---------- */
.footer { padding: 32px 16px calc(40px + env(safe-area-inset-bottom)); text-align: center; border-top: 1px solid var(--border); background: var(--bg); }
.socials { list-style: none; padding: 0; margin: 0 0 18px; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.socials a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.socials a:active { background: var(--press); }
.socials svg, .social-glyph { width: 22px; height: 22px; }
.social-glyph { background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.footer-links { display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); margin: 6px 0; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
.copyright { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }

/* ---------- consent ---------- */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-width: var(--col); margin: 0 auto;
  background: var(--surface); color: var(--text);
  border-radius: 18px 18px 0 0; border: 1px solid var(--border);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
}
@media (min-width: 560px) { .consent { bottom: 16px; border-radius: 18px; } }
.consent h2 { margin: 0 0 4px; font-size: 16px; }
.consent p { margin: 0 0 12px; font-size: 14px; color: var(--text-muted); }
.consent-options { display: grid; gap: 8px; margin-bottom: 12px; }
.consent-options label { display: grid; grid-template-columns: 24px 1fr; column-gap: 8px; align-items: center; font-weight: 600; font-size: 15px; min-height: 44px; }
.consent-options input { width: 20px; height: 20px; accent-color: var(--accent); }
.consent-options span { grid-column: 2; font-weight: 400; font-size: 13px; color: var(--text-muted); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.consent-actions .btn { padding: 0 10px; font-size: 14px; min-height: 44px; }

/* ---------- index ---------- */
.index { padding: 40px 24px; }

/* ---------- landing page ---------- */
.backdrop-mosaic {
  background-size: 50% 50%; background-repeat: no-repeat;
  background-position: 0 0, 100% 0, 0 100%, 100% 100%;
  filter: blur(70px) saturate(1.4) brightness(0.5);
}
.home-app { background: color-mix(in srgb, var(--bg) 92%, transparent); }
.home { padding: 40px 16px calc(40px + env(safe-area-inset-bottom)); }
.home-head { padding: 0 4px 20px; }
.home-head h1 { font: 800 30px/1.15 var(--font-heading); margin: 0 0 6px; letter-spacing: -0.01em; }
.home-head p { margin: 0; color: var(--text-muted); font-size: 15px; }
.album-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.album-card {
  display: grid; grid-template-columns: 72px 1fr 24px; align-items: center; gap: 14px;
  padding: 10px 12px 10px 10px; min-height: 92px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: transform 0.08s ease, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.album-card:hover { background: var(--surface-2); }
.album-card:active { transform: scale(0.985); }
.album-card img, .album-card-ph { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--surface-2); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
.album-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.album-card-title { font: 700 17px/1.25 var(--font-heading); text-wrap: balance; }
.album-card-artist { color: var(--text-muted); font-size: 15px; }
.album-card-chev { width: 24px; height: 24px; color: var(--text-muted); }

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

/* ---------- lyrics ---------- */
.lyrics-text { font-size: 16px; line-height: 1.6; background: var(--surface-2); border-radius: 12px; padding: 14px 16px; position: relative; }
.lyrics-text p { margin: 0 0 1em; }
.lyrics-text p:last-child { margin-bottom: 0; }
.lyrics-text.is-clamped { max-height: calc(1.6em * 12 + 28px); overflow: hidden; }
.lyrics-text.is-clamped::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
  background: linear-gradient(transparent, var(--surface-2)); border-radius: 0 0 12px 12px;
}
.lyrics .btn-block { margin-top: 8px; }
.lyrics-credit a { color: inherit; }

/* ---------- press images ---------- */
.press.has-image { padding-top: 0; overflow: hidden; }
.press-image { width: calc(100% + 36px); max-width: none; margin: 0 -18px 14px; aspect-ratio: 16 / 9; height: auto; object-fit: cover; background: var(--surface-2); }

/* ---------- privacy page ---------- */
.legal { padding: 28px 20px 40px; }
.legal h1 { font: 800 28px/1.2 var(--font-heading); margin: 0 0 4px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; }
.legal p, .legal li { font-size: 16px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.legal .updated { color: var(--text-muted); margin: 0 0 20px; font-size: 14px; }
.legal a { color: var(--accent); }

/* ---------- video picker (scrolls sideways when there are many) ---------- */
.seg-scroll {
  display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll button { flex: none; white-space: nowrap; scroll-snap-align: start; }
