/* ===== Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}
img, svg { display: block; max-width: 100%; }
ul[role='list'] { list-style: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; }
p { text-wrap: pretty; }
::selection { background: color-mix(in oklab, var(--color-primary) 30%, transparent); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
button { cursor: pointer; background: none; border: none; }
a, button, select, input {
  transition: color 180ms cubic-bezier(0.16,1,0.3,1), background 180ms cubic-bezier(0.16,1,0.3,1),
    border-color 180ms cubic-bezier(0.16,1,0.3,1), box-shadow 180ms cubic-bezier(0.16,1,0.3,1);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--color-primary); color: #fff;
  padding: var(--space-2) var(--space-4); z-index: 100;
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

/* ===== Tokens ===== */
: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.25rem);

  --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;

  --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.875rem; --radius-xl: 1.25rem; --radius-full: 9999px;

  --font-display: 'Clash Display', 'Arial Black', sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;

  --content-wide: 1180px;

  /* Brand */
  --color-brand: #3ecf6e;
  --color-brand-hover: #57e884;
  --color-maple: #d5333f;
}

/* ===== Dark theme (default) ===== */
[data-theme='dark'] {
  --color-bg: #0a0f0c;
  --color-surface: #121a15;
  --color-surface-2: #17201a;
  --color-border: #263229;
  --color-divider: #1f2921;
  --color-text: #f1f3ef;
  --color-text-muted: #9aa79e;
  --color-text-faint: #66766c;
  --color-primary: var(--color-brand);
  --color-primary-hover: var(--color-brand-hover);
  --shadow-md: 0 8px 24px rgb(0 0 0 / 0.45);
}

/* ===== Light theme ===== */
[data-theme='light'] {
  --color-bg: #f6f8f4;
  --color-surface: #ffffff;
  --color-surface-2: #eef3ea;
  --color-border: #dbe3d6;
  --color-divider: #e6ede2;
  --color-text: #101812;
  --color-text-muted: #55635a;
  --color-text-faint: #8b9a8f;
  --color-primary: #1f8a4c;
  --color-primary-hover: #17703c;
  --shadow-md: 0 8px 24px rgb(0 0 0 / 0.08);
}

/* ===== Layout shell ===== */
.site-header {
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-bg);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: var(--space-3);
  text-decoration: none; color: var(--color-text);
}
.brand-mark {
  flex-shrink: 0;
  width: 108px;
  height: 108px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
}
@media (max-width: 480px) {
  .brand-mark { width: 84px; height: 84px; }
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: 0.04em;
}
.tagline {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  font-weight: 500;
  flex: 1 1 200px;
  min-width: 160px;
}
.header-controls {
  display: flex; align-items: center; gap: var(--space-3);
  margin-left: auto;
}
.icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: var(--color-surface);
}
.icon-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

.week-select-wrap { display: flex; }
.week-select {
  height: 38px;
  padding: 0 var(--space-8) 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9a8f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right var(--space-2) center / 16px 16px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}
.week-select:hover, .week-select:focus { border-color: var(--color-primary); outline: none; }

/* ===== Stats bar ===== */
.stats-bar {
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-2);
}
.stats-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-text);
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.search-wrap {
  position: relative;
  margin-left: auto;
  flex: 1 1 240px;
  max-width: 320px;
}
.search-icon {
  position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%);
  color: var(--color-text-faint);
  pointer-events: none;
}
#search-input {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-10);
  font-size: var(--text-sm);
  color: var(--color-text);
}
#search-input:focus { border-color: var(--color-primary); }

/* ===== Lineup table ===== */
.lineup-wrap {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-10) var(--space-6) var(--space-20);
}
.lineup-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.lineup-table { display: flex; flex-direction: column; }
.lineup-row {
  display: grid;
  grid-template-columns: 2fr 1.6fr 1fr 1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
}
.lineup-row:last-child { border-bottom: none; }
.lineup-row[hidden] { display: none; }
.lineup-head {
  background: var(--color-surface-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}
.lineup-body-row.is-filtered-empty { display: none; }

.col-song { font-weight: 600; font-size: var(--text-sm); color: var(--color-text); overflow-wrap: anywhere; }
.col-artist { font-size: var(--text-sm); color: var(--color-text-muted); overflow-wrap: anywhere; }
.col-website, .col-spotify { display: flex; }

.col-song mark, .col-artist mark {
  background: color-mix(in oklab, var(--color-primary) 35%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  text-decoration: none;
  white-space: nowrap;
}
.pill-link:hover {
  background: var(--color-primary);
  color: var(--color-bg);
}
.pill-link svg { flex-shrink: 0; }
.pill-link.spotify-link {
  color: #ffc404;
  border-color: #ffc404;
}
.pill-link.spotify-link:hover {
  background: #ffc404;
  color: #241a00;
}
.no-link {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-16) var(--space-6);
}

@media (max-width: 760px) {
  .lineup-wrap { padding: var(--space-8) var(--space-4) var(--space-16); }
  .lineup-head { display: none; }
  .lineup-row:not(.lineup-head) {
    grid-template-columns: 1fr;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
  }
  .col-artist::before { content: "by "; }
  .col-website, .col-spotify { gap: var(--space-2); }
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-xs);
}
