/* ═══════════════════════════════════════════════════════════
   COLOUR SYSTEM — Bauhaus / Kandinsky blue
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Core */
  --bg: #111318;
  --surface: #f2f1ed;
  --surface-2: #e4e2db;
  --surface-3: #eae8e2;
  --text: #111318;
  --text-muted: #5c5f6a;
  --border: #c4c1b6;

  /* Primary blue ramp */
  --accent: #2456a4;
  --accent-text: #f2f1ed;
  --accent-light: #3a6fbe;
  --accent-lighter: #6a9ad8;
  --accent-dark: #1a3f7a;
  --accent-subtle: rgba(36,86,164,0.10);
  --accent-hover: #1d4a92;

  /* Secondary warm accent */
  --secondary: #daa520;

  /* Grey ramp */
  --grey-50: #f6f5f3;
  --grey-100: #eae8e2;
  --grey-200: #d6d3cb;
  --grey-300: #bfbdb4;
  --grey-400: #9a9890;
  --grey-500: #76747a;
  --grey-600: #5c5f6a;
  --grey-700: #3e4048;
  --grey-800: #24262c;
  --grey-900: #111318;

  --focus: #2456a4;

  /* Diagram tokens */
  --diagram-bg: #f4f3ef;
  --diagram-bg-active: #e4e2db;
  --diagram-line: rgba(17,19,24,0.06);
  --diagram-strong: #111318;
  --diagram-fret: rgba(17,19,24,0.18);
  --diagram-string: rgba(17,19,24,0.35);
  --diagram-dot: #111318;
  --diagram-dot-text: #f4f3ef;
  --diagram-open: #daa520;
  --diagram-muted-text: #5c5f6a;
}

[data-theme="dark"] {
  --bg: #0a0b0f;
  --surface: #16181e;
  --surface-2: #1f2128;
  --surface-3: #1a1c22;
  --text: #e8e6df;
  --text-muted: #8a8d96;
  --border: #2e3038;

  --accent: #4a88dc;
  --accent-text: #16181e;
  --accent-light: #6aa0e8;
  --accent-lighter: #90b8f0;
  --accent-dark: #3468b4;
  --accent-subtle: rgba(74,136,220,0.12);
  --accent-hover: #5e96e2;

  --secondary: #daa520;

  --grey-50: #24262c;
  --grey-100: #2e3038;
  --grey-200: #3e4048;
  --grey-300: #555860;
  --grey-400: #72757e;
  --grey-500: #8a8d96;
  --grey-600: #a5a8b0;
  --grey-700: #c0c2c8;
  --grey-800: #d8d9de;
  --grey-900: #e8e6df;

  --focus: #4a88dc;

  --diagram-bg: #1a1c22;
  --diagram-bg-active: #252730;
  --diagram-line: rgba(232,230,223,0.06);
  --diagram-strong: #e8e6df;
  --diagram-fret: rgba(232,230,223,0.20);
  --diagram-string: rgba(232,230,223,0.40);
  --diagram-dot: #e8e6df;
  --diagram-dot-text: #1a1c22;
  --diagram-open: #daa520;
  --diagram-muted-text: #8a8d96;
}

/* ═══════════════════════════════════════════════════════════
   RESET & BODY
   ═══════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.25;
}

/* ═══════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════ */

#app {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 80px rgba(0,0,0,0.8);
}

#app::before, #app::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 8px;
  background: linear-gradient(to right, rgba(0,0,0,0.08), transparent);
  z-index: 2;
  pointer-events: none;
}
#app::before { left: 0; }
#app::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,0.08), transparent); }

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */

header {
  padding: 36px 40px 24px;
  border-bottom: 2px solid var(--border);
  position: relative;
  background: linear-gradient(to bottom, var(--surface-3), var(--surface));
}

.header-top {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding-right: 160px;
}

h1 {
  font-family: 'Pacifico', cursive;
  font-weight: 400;
  font-size: clamp(28px, 5vw, 44px);
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: none;
  line-height: 1.1;
}

.subtitle {
  font-weight: 300;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════
   HEADER CONTROLS
   ═══════════════════════════════════════════════════════════ */

.header-controls {
  position: absolute;
  top: 20px; right: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle .icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .icon-light { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark { display: inline; }

/* ═══════════════════════════════════════════════════════════
   TUNING TOGGLE
   ═══════════════════════════════════════════════════════════ */

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tuning-toggle {
  display: flex;
  gap: 0;
}

.tuning-btn {
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-right: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.tuning-btn:last-child { border-right: 1px solid var(--border); }
.tuning-btn:hover { background: var(--surface-2); }
.tuning-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.tuning-btn[aria-pressed="true"] + .tuning-btn { border-left-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════════════ */

.site-nav {
  display: flex;
  gap: 0;
}

.site-nav a {
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-right: none;
  transition: background 0.1s, color 0.1s;
}
.site-nav a:last-child { border-right: 1px solid var(--border); }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
   FIELDSET / LEGEND
   ═══════════════════════════════════════════════════════════ */

fieldset { border: none; margin: 0; padding: 0; }

legend {
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════
   INFO STRIP
   ═══════════════════════════════════════════════════════════ */

.info-strip {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  letter-spacing: 2px;
  padding: 8px 22px;
  transition: transform 0.25s;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 100;
  border-radius: 4px 4px 0 0;
}
.info-strip.show { transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

.site-footer {
  padding: 28px 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.site-footer p {
  margin-bottom: 4px;
}
.site-footer p:last-child { margin-bottom: 0; }

.footer-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.1s;
}
.footer-links a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════ */

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: var(--accent-text);
  padding: 8px 16px;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 1px;
  text-decoration: none;
  z-index: 2000;
  border-radius: 0 0 4px 4px;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 0;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  header { padding: 24px 16px 20px; }
  .header-top { padding-right: 52px; }
  .header-controls { top: 16px; right: 16px; }
  .site-footer { padding: 20px 16px; }
}

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