/* ==========================================================================
   Brooklyn Radio – design tokens
   Direction: "Paper & ink". Light by default: warm paper, black ink, one
   accent. Editorial serif headlines (Instrument Serif), Geist for UI/body,
   Geist Mono for labels, timecodes and numbers.

   Everything visual is a token. Components never hard-code colours.
   See DESIGN.md for the system and how to change it.
   ========================================================================== */

/* --- Fonts (self-hosted, SIL OFL; see assets/fonts/LICENSE-*) ------------ */
@font-face {
  font-family: 'Geist';
  src: url('../fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/InstrumentSerif-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/InstrumentSerif-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* --- Colour: paper & ink (light) --------------------------------------- */
  --paper:        #f5f0e7;   /* page */
  --paper-2:      #ece6da;   /* raised surfaces: cards, player, drawer */
  --paper-3:      #e2dbcd;   /* pressed / hover surfaces */
  --ink:          #16140f;   /* text, primary buttons */
  --ink-2:        #4d4840;   /* secondary text */
  --ink-3:        #8c857a;   /* muted text, placeholders */
  --line:         rgba(22, 20, 15, 0.12);   /* hairlines */
  --line-strong:  rgba(22, 20, 15, 0.32);
  --accent:       #c7331f;   /* the one accent: stamp red. Swap here only. */
  --accent-ink:   #fff8f0;   /* text on accent */
  --accent-soft:  rgba(199, 51, 31, 0.10);
  --shadow:       0 1px 2px rgba(22, 20, 15, 0.06), 0 12px 32px -12px rgba(22, 20, 15, 0.25);
  --shadow-lift:  0 2px 4px rgba(22, 20, 15, 0.08), 0 24px 48px -16px rgba(22, 20, 15, 0.35);
  --cover-tint:   rgba(22, 20, 15, 0.06);  /* overlay on archived covers */

  /* --- Type -------------------------------------------------------------- */
  --font-sans:  'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', 'Iowan Old Style', 'Times New Roman', Georgia, serif;
  --font-mono:  'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Fluid scale (375px → 1280px). Serif steps run large: the face is light. */
  --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.90rem);
  --step-0:  clamp(1.00rem, 0.96rem + 0.18vw, 1.10rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.35vw, 1.40rem);
  --step-2:  clamp(1.50rem, 1.33rem + 0.72vw, 1.95rem);
  --step-3:  clamp(1.95rem, 1.62rem + 1.40vw, 2.80rem);
  --step-4:  clamp(2.50rem, 1.95rem + 2.35vw, 4.00rem);
  --step-5:  clamp(3.00rem, 2.10rem + 3.90vw, 5.50rem);

  --leading-tight: 1.05;
  --leading-snug:  1.2;
  --leading-body:  1.55;
  --tracking-caps: 0.08em;
  --measure: 66ch;

  /* --- Space (fluid) ----------------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  --space-8: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  --space-9: clamp(5rem, 3.5rem + 6vw, 9rem);

  --gutter:      clamp(1rem, 4vw, 2.5rem);
  --wrap:        80rem;    /* 1280px content column */
  --wrap-narrow: 44rem;    /* 704px reading column (blog) */
  --wrap-medium: 44rem;    /* episode lists on show pages; same as the blog column */

  /* --- Shape & motion ---------------------------------------------------- */
  --radius-s: 4px;
  --radius:   10px;
  --radius-l: 18px;
  --radius-pill: 999px;
  --hairline: 1px;

  --ease:     cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 120ms;
  --dur:      220ms;
  --dur-slow: 420ms;

  /* --- Chrome sizes ------------------------------------------------------ */
  --header-h: 3.75rem;
  --player-h: 4rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --control: 2.75rem;    /* 44px minimum tap target */
}

@media (min-width: 64em) {
  :root {
    --header-h: 4.25rem;
    --player-h: 4.5rem;
  }
}

/* --- Dark theme: ink & paper inverted, not "dark mode grey" --------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper:       #0f0e0c;   /* near-neutral black, same as the home hero */
    --paper-2:     #171613;
    --paper-3:     #211f1c;
    --ink:         #f1ebe0;
    --ink-2:       #bdb4a5;
    --ink-3:       #827a6e;
    --line:        rgba(241, 235, 224, 0.13);
    --line-strong: rgba(241, 235, 224, 0.34);
    --accent:      #e8513b;
    --accent-ink:  #1a0d0a;
    --accent-soft: rgba(232, 81, 59, 0.16);
    --shadow:      0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 24px 48px -16px rgba(0, 0, 0, 0.7);
    --cover-tint:  rgba(15, 14, 12, 0.25);
  }
}
/* .theme-dark scopes the same palette to one block (home hero) inside a light page. */
:root[data-theme="dark"], .theme-dark {
  color-scheme: dark;
  --paper:       #0f0e0c;   /* near-neutral black, same as the home hero */
  --paper-2:     #171613;
  --paper-3:     #211f1c;
  --ink:         #f1ebe0;
  --ink-2:       #bdb4a5;
  --ink-3:       #827a6e;
  --line:        rgba(241, 235, 224, 0.13);
  --line-strong: rgba(241, 235, 224, 0.34);
  --accent:      #e8513b;
  --accent-ink:  #1a0d0a;
  --accent-soft: rgba(232, 81, 59, 0.16);
  --shadow:      0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 24px 48px -16px rgba(0, 0, 0, 0.7);
  --cover-tint:  rgba(15, 14, 12, 0.25);
}

/* .theme-light scopes the light palette to one block inside a dark section (hero card). */
.theme-light {
  color-scheme: light;
  --paper:        #f5f0e7;
  --paper-2:      #ece6da;
  --paper-3:      #e2dbcd;
  --ink:          #16140f;
  --ink-2:        #4d4840;
  --ink-3:        #8c857a;
  --line:         rgba(22, 20, 15, 0.12);
  --line-strong:  rgba(22, 20, 15, 0.32);
  --accent:       #c7331f;
  --accent-ink:   #fff8f0;
  --accent-soft:  rgba(199, 51, 31, 0.10);
  --shadow:       0 1px 2px rgba(22, 20, 15, 0.06), 0 12px 32px -12px rgba(22, 20, 15, 0.25);
  --shadow-lift:  0 2px 4px rgba(22, 20, 15, 0.08), 0 24px 48px -16px rgba(22, 20, 15, 0.35);
  --cover-tint:   rgba(22, 20, 15, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
  }
}
