/* Share pages /beats/<id> (scripts/build-beat-pages.mjs). Tokens copied from style.css. */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 8rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  --font-display: 'Cabinet Grotesk', 'Satoshi', sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;

  --header-h: 4.25rem;
  --player-h: 4.75rem;
}

:root,
[data-theme='light'] {
  --color-bg: #f3eee6;
  --color-surface: #faf6ef;
  --color-surface-2: #fffdf8;
  --color-surface-offset: #ebe4d8;
  --color-divider: #ddd4c6;
  --color-border: oklch(0.28 0.03 60 / 0.14);
  --color-text: #1c1712;
  --color-text-muted: #6d6458;
  --color-text-faint: #9a9184;
  --color-text-inverse: #f7f1e8;
  --color-primary: #a34b1a;
  --color-primary-hover: #833910;
  --color-primary-active: #64280b;
  --color-error: #a12c7b;
  --color-success: #3d6b22;
  --shadow-sm: 0 1px 2px oklch(0.28 0.03 60 / 0.08);
  --shadow-md: 0 6px 20px oklch(0.28 0.03 60 / 0.1);
  --shadow-lg: 0 16px 40px oklch(0.28 0.03 60 / 0.14);
}

[data-theme='dark'] {
  --color-bg: #070b14;
  --color-surface: #0d1422;
  --color-surface-2: #121a2b;
  --color-surface-offset: #162033;
  --color-divider: #1e2a40;
  --color-border: oklch(0.75 0.06 250 / 0.18);
  --color-text: #e8eef8;
  --color-text-muted: #9aa8c0;
  --color-text-faint: #6f7f99;
  --color-text-inverse: #070b14;
  --color-primary: #3db4ff;
  --color-primary-hover: #6cc7ff;
  --color-primary-active: #1a8fd9;
  --color-error: #d163a7;
  --color-success: #6daa45;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35);
  --shadow-md: 0 8px 28px oklch(0.45 0.12 250 / 0.25);
  --shadow-lg: 0 18px 48px oklch(0 0 0 / 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #100e0c;
    --color-surface: #181512;
    --color-surface-2: #1f1b17;
    --color-surface-offset: #241f1a;
    --color-divider: #2c2722;
    --color-border: oklch(0.9 0.02 80 / 0.12);
    --color-text: #ede6da;
    --color-text-muted: #9a9184;
    --color-text-faint: #6e675c;
    --color-text-inverse: #161310;
    --color-primary: #e09458;
    --color-primary-hover: #f0ab72;
    --color-primary-active: #c56a2d;
    --color-error: #d163a7;
    --color-success: #6daa45;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.28);
    --shadow-md: 0 8px 24px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 18px 48px oklch(0 0 0 / 0.5);
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 550;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-primary:active {
  background: var(--color-primary-active);
  transform: translateY(1px);
}

.btn-ghost {
  border-color: var(--color-border);
  color: var(--color-text);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--color-surface-offset);
}

.btn-small {
  min-height: 40px;
  padding: 0 var(--space-4);
}


/* ---------- beat page ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body.bp { overflow-x: hidden; }
body.bp {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% -10%, color-mix(in oklab, var(--color-primary) 18%, transparent), transparent 60%), var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
}
.btn { cursor: pointer; font-family: inherit; transition: background var(--transition-interactive); }
.bp-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); max-width: var(--content-wide); margin: 0 auto; padding: var(--space-4) var(--space-5); }
.bp-brand { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.12em; color: var(--color-text); text-decoration: none; font-size: var(--text-lg); }
.bp-back { color: var(--color-text-muted); text-decoration: none; font-size: var(--text-sm); font-weight: 500; }
.bp-back:hover { color: var(--color-text); }
.bp-main { max-width: var(--content-default); margin: 0 auto; padding: var(--space-4) var(--space-5) var(--space-16); }
.bp-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-10); align-items: center; }
.bp-cover-wrap { aspect-ratio: 1; border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--color-surface); }
.bp-cover { display: block; width: 100%; height: 100%; object-fit: cover; }
.bp-info { min-width: 0; }
.bp-kicker { margin: 0; color: var(--color-primary); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.bp-title { margin: var(--space-1) 0 0; font-family: var(--font-display); font-size: var(--text-3xl); line-height: 1; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.bp-credit { margin: var(--space-2) 0 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.bp-facts { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: var(--space-4) 0 0; }
.bp-facts li { padding: var(--space-1) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: 600; background: var(--color-surface); }
.bp-player { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-6); }
.bp-play { flex: none; width: 88px; height: 88px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--color-primary); color: var(--color-text-inverse); cursor: pointer; box-shadow: var(--shadow-md); transition: transform var(--transition-interactive), background var(--transition-interactive); touch-action: manipulation; }
.bp-play:hover { background: var(--color-primary-hover); transform: scale(1.04); }
.bp-play:active { transform: scale(0.96); }
.bp-play:focus-visible { outline: 3px solid var(--color-text); outline-offset: 3px; }
.bp-play svg { width: 36px; height: 36px; }
.bp-play .i-play { margin-left: 4px; }
.bp-play .i-pause, .bp-play[aria-pressed='true'] .i-play { display: none; }
.bp-play[aria-pressed='true'] .i-pause { display: block; }
.bp-progress { flex: 1; min-width: 0; }
.bp-wave { --p: 0; display: flex; align-items: center; gap: 2px; height: 64px; cursor: pointer; touch-action: none; }
.bp-wave i { flex: 1; min-width: 0; border-radius: 2px; background: var(--color-text-faint); opacity: 0.55; }
.bp-wave i.on { background: var(--color-primary); opacity: 1; }
.bp-bar { --p: 0; height: 10px; border-radius: var(--radius-full); background: var(--color-surface-offset); cursor: pointer; position: relative; margin: 27px 0; touch-action: none; }
.bp-bar-fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); border-radius: inherit; background: var(--color-primary); }
.bp-times { display: flex; justify-content: space-between; color: var(--color-text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.bp-note { margin: var(--space-3) 0 0; color: var(--color-text-faint); font-size: var(--text-xs); }
.bp-copy { margin-top: var(--space-4); }
.bp-licenses { margin-top: var(--space-12); }
.bp-licenses h2 { font-family: var(--font-display); font-size: var(--text-xl); margin: 0 0 var(--space-4); }
.bp-lic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.bp-lic { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); min-width: 0; }
.bp-lic-ex { border-color: color-mix(in oklab, var(--color-primary) 55%, transparent); }
.bp-lic-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.bp-lic-name { margin: 0; font-weight: 700; }
.bp-lic-price { margin: 0; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.bp-lic-files { margin: 0; color: var(--color-text-muted); font-size: var(--text-xs); flex: 1; }
.bp-lic-btns { display: grid; gap: var(--space-2); }
.bp-lic-btns .btn { width: 100%; padding: 0 var(--space-3); }
.bp-pay-note, .bp-sold-note { color: var(--color-text-muted); font-size: var(--text-sm); }
.bp-sold-note { color: var(--color-error); font-weight: 600; }
.bp-more { margin-top: var(--space-10); text-align: center; }
.bp.is-sold .bp-lic-grid { opacity: 0.4; pointer-events: none; }
@media (max-width: 900px) { .bp-lic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .bp-hero { grid-template-columns: 1fr; gap: var(--space-6); }
  .bp-cover-wrap { max-width: 420px; width: 100%; margin: 0 auto; }
  .bp-title { font-size: var(--text-2xl); }
  .bp-play { width: 80px; height: 80px; }
}
@media (max-width: 480px) {
  .bp-main { padding-inline: var(--space-4); }
  .bp-lic-grid { grid-template-columns: 1fr; }
  .bp-copy { width: 100%; }
}

/* Copy-link toast (shared with the catalog in style.css) */
.ty-toast { position: fixed; left: 50%; bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); z-index: 1000; max-width: calc(100vw - 2rem); padding: var(--space-3) var(--space-5); border-radius: var(--radius-full); background: var(--color-text); color: var(--color-bg); font-weight: 600; font-size: var(--text-sm); box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.ty-toast.show { opacity: 1; transform: translate(-50%, 0); }
