:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --bg-alt: #f1eee7;
  --surface: #ffffff;
  --text: #1d1b20;
  --muted: #55525c;
  --accent: #3b3fb0;
  --accent-contrast: #ffffff;
  --border: #d9d5cb;
  --focus: #b4380f;
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121118;
    --bg-alt: #1a1922;
    --surface: #1f1e29;
    --text: #f1eff5;
    --muted: #b9b6c4;
    --accent: #a9acff;
    --accent-contrast: #121118;
    --border: #3a3846;
    --focus: #ffb38f;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-underline-offset: 0.2em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.narrow { max-width: 42rem; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 8px;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  min-height: 3.5rem;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text);
  text-decoration: none;
  padding: 0.5rem 0;
}
.nav-list { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: inline-block;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
}
.nav-list a:hover { background: var(--bg-alt); }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0; }
.hero-inner {
  display: grid;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 52rem) {
  .hero-inner { grid-template-columns: 1.1fr 1fr; }
}
.badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}
h1 {
  margin: 0;
  font-size: clamp(2.6rem, 9vw, 4.5rem);
  letter-spacing: 0.1em;
  line-height: 1.05;
}
.claim { margin: 0.75rem 0 0; font-size: clamp(1.3rem, 3.5vw, 1.8rem); font-weight: 600; }
.lead { margin: 1.25rem 0 0; color: var(--muted); max-width: 34rem; }

.hero-art svg { display: block; width: 100%; height: auto; max-width: 30rem; margin-inline: auto; }
.art-card { fill: var(--surface); stroke: var(--border); stroke-width: 2; }
.art-track { fill: var(--border); }
.art-played { fill: var(--accent); }
.art-loop { fill: var(--accent); fill-opacity: 0.18; stroke: var(--accent); stroke-width: 2; }
.art-head { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.art-marker rect { fill: var(--accent); }
.art-marker-text text { fill: var(--accent-contrast); font: 700 15px system-ui, sans-serif; }
.art-pill { fill: var(--bg-alt); }
.art-play { fill: var(--accent); }
.art-play-icon { fill: var(--accent-contrast); }
.art-tempo { fill: var(--text); font: 600 18px system-ui, sans-serif; }
.key-w { fill: #ffffff; stroke: #8a8794; stroke-width: 1.5; }
.key-b { fill: #1d1b20; }
.key-on { fill: #bfc2ff; }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-alt { background: var(--bg-alt); }
h2 { margin: 0 0 1.5rem; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; }
h3 { margin: 0 0 0.5rem; font-size: 1.2rem; line-height: 1.3; }
.section p { margin: 0 0 1rem; }

.feature-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card p { margin: 0; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); font-size: 0.95rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.footer-inner p { margin: 0; }
.footer-list { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (forced-colors: active) {
  .badge, .card { border: 1px solid CanvasText; }
}
