/* base.css — Song of the Week
 * Reset, page chrome, typography defaults, noise overlay. */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
}

/* Paper noise overlay — sits above everything but below text. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2' seed='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.16 0'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

/* ─── Headings — default to display but keep line-heights tight ─── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: var(--ls-display);
  margin: 0;
}

h1 { font-size: var(--fs-display-xl); letter-spacing: var(--ls-display-tight); }
h2 { font-size: var(--fs-display-lg); }
h3 { font-size: var(--fs-display-md); }
h4 { font-size: var(--fs-display-sm); }

p { margin: 0; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent); }

ul, ol { margin: 0; padding: 0; list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
}

hr {
  border: none;
  border-top: var(--border-width) solid var(--ink);
  margin: 0;
}

/* ─── Page container ─── */
.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--sp-8);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page__main {
  flex: 1;
  padding-bottom: var(--sp-10);
}

/* ─── Utility text classes ─── */
.stamp {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono-lg);
  color: var(--dim);
  text-transform: uppercase;
}
.stamp--sm { font-size: var(--fs-micro-sm); }
.stamp--xs { font-size: var(--fs-micro-xs); }
.stamp--accent { color: var(--accent); }

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono-sm);
}
.mono-sm { font-family: var(--font-mono); font-size: var(--fs-micro-sm); }
.mono-xs { font-family: var(--font-mono); font-size: var(--fs-micro-xs); }

.hand {
  font-family: var(--font-hand);
  font-size: var(--fs-hand-md);
}

.display-sm { font-family: var(--font-display); font-size: var(--fs-display-sm); line-height: 1.1; }
.display-md { font-family: var(--font-display); font-size: var(--fs-display-md); line-height: 1.05; }
.display-lg { font-family: var(--font-display); font-size: var(--fs-display-lg); line-height: 1.05; letter-spacing: var(--ls-display-tight); }

.dim { color: var(--dim); }
.accent { color: var(--accent); }
.accent-2 { color: var(--accent-2); }
.soft { color: var(--soft); }

.num-tabular { font-variant-numeric: tabular-nums; }

/* ─── Screen-reader only ─── */
.sr-only {
  position: absolute !important;
  clip: rect(0, 0, 0, 0);
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ─── Focus ring — square, ink offset ─── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Body-copy link affordance ─────────────────────────────────────
   Inline anchors get an explicit teal underline so they read as links
   even when nested in .stamp / .mono-sm / .dim wrappers that otherwise
   flatten them to ink. Scoped to prose contexts; button-like anchors
   and card hit-area overlays are excluded so they stay untouched. */
.page__main p a:not(.btn):not(.btn-88x31):not(.group-card__link):not(.past-round-card):not(.listen-btn),
.page__main li a:not(.btn):not(.btn-88x31):not(.group-card__link):not(.past-round-card):not(.listen-btn),
.phase-aside__block a:not(.btn),
.masthead__subcopy a,
.stamp a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}
.page__main p a:hover,
.page__main li a:hover,
.phase-aside__block a:hover,
.masthead__subcopy a:hover,
.stamp a:hover { color: var(--accent); }

/* ─── Mobile type-scale floor ───────────────────────────────────────
   At phone widths the 9–10px mono tokens are unreadable. Lift the
   micro tokens to an 11px floor (and body-sm to 14px) so every
   .stamp / .mono-sm / .mono-xs / .stamp--sm / .stamp--xs across the
   app bumps up without per-rule hunting. Desktop is unchanged. */
@media (max-width: 560px) {
  :root {
    --fs-micro-xs: 11px;
    --fs-micro-sm: 11px;
    --fs-micro:    12px;
    --fs-body-sm:  14px;
  }
}
