/* Music Studio design tokens and base components (the design system's source of truth in code).
   Palette: Bright. Main buttons an indigo-to-mint gradient; mint teal for links and selection, on Hall (soft
   cool grey, no bright white); Brass marks what is live or next. Every text colour meets WCAG AA on its background.
   Type: Bricolage Grotesque for headings, Atkinson Hyperlegible for reading. */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,650;12..96,800&display=swap');

:root {
  --ink: #24304a;          /* text, deep slate */
  --ink-2: #5a6478;        /* secondary text */
  --hall: #eef3f6;         /* page, soft cool grey (no bright white) */
  --surface: #f6f9fb;      /* cards, panels */
  --surface-2: #e3ebf0;    /* quiet fills */
  --line: #d6e0e7;
  --velvet: #0b7d67;       /* links, selected tabs: mint teal */
  --velvet-ink: #ffffff;
  --velvet-soft: #e3f5ef;
  --grad: linear-gradient(115deg, #4f46e5 0%, #0d8f76 100%); /* main buttons: indigo to mint */
  --grad-ink: #ffffff;
  --brass: #b07a1f;        /* live and next: the only warm colour */
  --brass-soft: #f8ecd6;
  --positive: #237a57;
  --positive-soft: #e2f2ea;
  --danger: #b3362f;
  --danger-soft: #f8e3e1;
  --focus: #4f46e5;

  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;

  /* Type scale (ratio ~1.25, body 17px) */
  --t-xs: 0.8125rem; --t-sm: 0.9375rem; --t-md: 1.0625rem; --t-lg: 1.3125rem;
  --t-xl: 1.625rem; --t-2xl: 2.125rem; --t-3xl: clamp(2.5rem, 5vw, 3.75rem);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(23, 20, 43, 0.06), 0 8px 24px -12px rgba(23, 20, 43, 0.18);
  --measure: 68ch;
}
:root[data-theme='dark'] {
  --ink: #e9eef7; --ink-2: #a3adc2; --hall: #1a1f2c; --surface: #232a3a; --surface-2: #2b3346; --line: #364057;
  --velvet: #4fe0b8; --velvet-ink: #1a1f2c; --velvet-soft: #1d3a35; --brass: #e3ae55; --brass-soft: #3a2f1c;
  --grad: linear-gradient(115deg, #8c84ff 0%, #4fe0b8 100%); --grad-ink: #1a1f2c;
  --positive: #5cc796; --positive-soft: #183328; --danger: #f08a80; --danger-soft: #3a1f1d; --focus: #8c84ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #e9eef7; --ink-2: #a3adc2; --hall: #1a1f2c; --surface: #232a3a; --surface-2: #2b3346; --line: #364057;
    --velvet: #4fe0b8; --velvet-ink: #1a1f2c; --velvet-soft: #1d3a35; --brass: #e3ae55; --brass-soft: #3a2f1c;
    --grad: linear-gradient(115deg, #8c84ff 0%, #4fe0b8 100%); --grad-ink: #1a1f2c;
    --positive: #5cc796; --positive-soft: #183328; --danger: #f08a80; --danger-soft: #3a1f1d; --focus: #8c84ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--hall); color: var(--ink); font: 400 var(--t-md)/1.55 var(--font-body); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 var(--s3); }
h1 { font-size: var(--t-2xl); } h2 { font-size: var(--t-xl); } h3 { font-size: var(--t-lg); }
p { margin: 0 0 var(--s4); max-width: var(--measure); }
a { color: var(--velvet); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-sm); }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s5);
  border-radius: var(--r-pill); border: 1px solid transparent; font: 700 var(--t-sm)/1 var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--grad); color: var(--grad-ink); transition: transform 0.08s ease, background-color 0.15s ease; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { background: var(--surface-2); filter: none; }
.btn-live { background: var(--brass); color: #1a1205; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 var(--s4); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.card + .card { margin-top: var(--s4); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }

/* Forms */
.field { display: grid; gap: var(--s1); margin-bottom: var(--s4); }
.field > span { font-weight: 700; font-size: var(--t-sm); }
.field small { color: var(--ink-2); font-size: var(--t-xs); }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='datetime-local'], input[type='time'], select, textarea {
  width: 100%; min-height: 44px; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font: inherit; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.check { display: flex; gap: var(--s2); align-items: flex-start; margin-bottom: var(--s3); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--velvet); }

/* Status */
.pill { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 700;
  background: var(--surface-2); color: var(--ink-2); }
.pill-live { background: var(--brass-soft); color: var(--brass); }
.pill-ok { background: var(--positive-soft); color: var(--positive); }
.pill-bad { background: var(--danger-soft); color: var(--danger); }
.pill-velvet { background: var(--velvet-soft); color: var(--velvet); }
.notice { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); border-left: 4px solid var(--ink-2); margin-bottom: var(--s4); }
.notice-stale { border-left-color: var(--brass); background: var(--brass-soft); }
.notice-error { border-left-color: var(--danger); background: var(--danger-soft); }
.notice-ok { border-left-color: var(--positive); background: var(--positive-soft); }

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