:root {
  /* Dark "studio" theme (default) */
  --bg: #0e1116;
  --surface: #161b22;
  --surface-alt: #12161d;
  --text: #e6edf3;
  --muted: #8b949e;
  --border: #30363d;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --good: #3fb950;
  --good-soft: rgba(63, 185, 80, 0.16);
  --danger: #f85149;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.4), 0 14px 32px rgba(0, 0, 0, 0.5);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  /* Layered "studio" texture: ambient glows + a faint vertical sheen. */
  background-image:
    radial-gradient(1100px 520px at 12% -8%, rgba(45, 212, 191, 0.13), transparent 60%),
    radial-gradient(1000px 520px at 88% -4%, rgba(99, 102, 241, 0.10), transparent 58%),
    radial-gradient(900px 640px at 50% 118%, rgba(45, 212, 191, 0.07), transparent 62%),
    linear-gradient(180deg, #10161d 0%, #0b0f14 45%, #0e1116 100%);
  background-attachment: fixed;
}

/* Film-grain overlay for tactile texture. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 140px 140px;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(22, 27, 34, 0.85);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #06241f;
}
.brand-logo {
  display: block;
  height: 40px;
  width: auto;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--text); background: var(--surface-alt); }
.site-nav a.active { color: var(--accent); background: var(--accent-soft); }
.lang-toggle {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  font-family: var(--font);
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Banner ---------- */
.banner { position: relative; margin-top: 32px; }
.banner-viewport {
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.banner-track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.banner-slide {
  flex: 0 0 100%;
  text-align: center;
  margin: 0;
}
.banner-slide img { width: 100%; height: auto; display: block; }
.banner-btn { margin: 18px 0 0; }
.banner-arrow {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.banner-arrow:hover { background: var(--accent); color: #06241f; opacity: 1; }
.banner-arrow.prev { left: 12px; }
.banner-arrow.next { right: 12px; }
.banner-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--border);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.banner-dot:hover { background: var(--muted); }
.banner-dot.active { background: var(--accent); transform: scale(1.25); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; text-align: center; }
.hero-inner { max-width: 760px; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.hero-sub {
  font-size: 1.18rem;
  color: var(--muted);
  margin: 0 0 30px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #06241f; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--surface-alt); }
.section-title {
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}
.card-grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.card-icon { font-size: 2rem; line-height: 1; }
.card h3 { margin: 14px 0 6px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Split / lists ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.checklist, .benefits { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 14px;
}
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--good);
  font-weight: 700;
}
.benefits li { margin-bottom: 14px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 760px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1.3rem;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* ---------- Tool pages ---------- */
.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.tool-header h1 { margin: 0; font-size: 1.8rem; }
.tool-header p { margin: 4px 0 0; color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.panel h2 { margin: 0 0 16px; font-size: 1.15rem; }
.panel label { display: block; font-weight: 600; margin-bottom: 8px; }

.readout {
  font-family: var(--mono);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.readout .unit { font-size: 1.1rem; color: var(--muted); font-weight: 500; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }

/* inputs */
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="number"], select, textarea {
  font-family: var(--font);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text);
  width: 100%;
}
textarea { resize: vertical; min-height: 200px; font-family: var(--mono); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

/* segmented / pill buttons */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
}
.pill:hover { border-color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #06241f; }

/* tuner gauge */
.gauge-wrap { position: relative; padding: 12px 0 8px; }
.gauge {
  position: relative;
  height: 34px;
  background: linear-gradient(to right, rgba(248, 113, 113, 0.35), var(--good-soft) 50%, rgba(248, 113, 113, 0.35));
  border-radius: 999px;
  overflow: hidden;
}
.gauge-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--good);
  transform: translateX(-50%);
}
.gauge-needle {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 4px;
  border-radius: 3px;
  background: var(--text);
  transform: translateX(-50%);
  transition: left 0.06s linear;
}

/* metronome beat dots */
.beat-dots { display: flex; gap: 8px; align-items: center; }
.beat-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  transition: background 0.08s ease, transform 0.08s ease;
}
.beat-dot.accent { border-width: 2px; }
.beat-dot.on { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }

/* chord diagram */
.chord-figure { display: inline-block; }
.chord-figure svg { display: block; }
.chord-meta { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }

/* fretboard trainer */
.fretboard {
  display: grid;
  grid-template-columns: 42px repeat(12, 1fr);
  gap: 4px;
  max-width: 780px;
  overflow-x: auto;
}
.fret-label {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
}
.fret {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: transparent;
  border-radius: 6px;
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.08s ease, color 0.08s ease;
}
.fret:hover { border-color: var(--accent); }
.fret.reveal { color: var(--muted); }
.fret.correct { background: var(--good); border-color: var(--good); color: #06120a; }
.fret.wrong { background: var(--danger); border-color: var(--danger); color: #fff; }

.hint { color: var(--muted); font-size: 0.9rem; }
.note { color: var(--muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 48px 0;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.footer-grid h4 { margin: 0 0 12px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.footer-grid a { display: block; color: var(--text); text-decoration: none; padding: 4px 0; font-size: 0.95rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-tagline .tagline { font-weight: 600; }
.footer-tagline .copyright { color: var(--muted); font-size: 0.9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .header-inner { flex-direction: column; align-items: flex-start; padding: 12px 0; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .readout { font-size: 2.5rem; }
  .panel { padding: 20px; }
}

/* ---------- Light theme (only when the OS prefers light) ---------- */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8f7;
    --surface: #ffffff;
    --surface-alt: #eef2f0;
    --text: #1f2429;
    --muted: #6b7280;
    --border: #e2e7e5;
    --accent: #0d9488;
    --accent-strong: #0f766e;
    --accent-soft: #e0f2ef;
    --good: #16a34a;
    --good-soft: #e2f5e8;
    --danger: #dc2626;
    --shadow-sm: 0 1px 2px rgba(31, 36, 41, 0.06);
    --shadow-md: 0 2px 4px rgba(31, 36, 41, 0.05), 0 12px 28px rgba(31, 36, 41, 0.08);
  }
  .site-header { background: rgba(255, 255, 255, 0.9); }
  body {
    background-color: #f6f8f7;
    background-image:
      radial-gradient(1100px 520px at 12% -8%, rgba(13, 148, 136, 0.08), transparent 60%),
      radial-gradient(1000px 520px at 88% -4%, rgba(99, 102, 241, 0.06), transparent 58%),
      radial-gradient(900px 640px at 50% 118%, rgba(13, 148, 136, 0.05), transparent 62%),
      linear-gradient(180deg, #ffffff 0%, #f3f7f6 50%, #f6f8f7 100%);
  }
  body::after { opacity: 0.025; }
  .brand-mark { color: #ffffff; }
  .btn-primary { color: #ffffff; }
  .pill.active { color: #ffffff; }
  .fret.correct { color: #ffffff; }
}
