:root {
  color-scheme: light;
  --ink: #181716;
  --muted: #716c66;
  --line: #e3ded6;
  --paper: #f6f3ec;
  --panel: #ffffff;
  --amber: #d9973f;
  --green: #1f7a67;
  --red: #bc4b42;
  --blue: #355f91;
  --night: #11100f;
  --shadow: 0 18px 52px rgba(46, 36, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #11100f 0, #11100f 620px, var(--paper) 620px),
    var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 16, 15, 0.78);
  color: #fffaf1;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #fffaf1;
  color: var(--ink);
  font-weight: 800;
}

.brand small {
  display: block;
  color: rgba(255, 250, 241, 0.58);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(255, 250, 241, 0.68);
  text-decoration: none;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fffaf1;
}

main {
  width: 100%;
  margin: 0;
}

.hero-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-height: calc(100svh - 72px);
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: clamp(28px, 6vw, 92px);
  align-items: center;
  overflow: hidden;
  padding: clamp(52px, 9vw, 120px) clamp(20px, 5vw, 86px) clamp(64px, 9vw, 120px);
  background:
    radial-gradient(circle at 72% 48%, rgba(31, 122, 103, 0.38), transparent 34%),
    radial-gradient(circle at 24% 22%, rgba(217, 151, 63, 0.18), transparent 28%),
    #11100f;
  color: #fffaf1;
}

.hero-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(17, 16, 15, 0.86));
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.hero-copy .eyebrow {
  color: #f2c36b;
}

.hero-copy h1 {
  max-width: 880px;
  margin-bottom: 0;
  font-size: clamp(48px, 7vw, 86px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy h1 span {
  display: block;
}

.hero-copy .lead {
  max-width: 700px;
  color: rgba(255, 250, 241, 0.72);
  font-size: clamp(17px, 1.8vw, 22px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.hero-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fffaf1;
  color: var(--ink);
  padding: 0 18px;
  font-weight: 900;
  text-decoration: none;
}

.hero-button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fffaf1;
}

.hero-visual {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: min(64vw, 620px);
  place-items: center;
}

.stage-glow {
  position: absolute;
  width: min(66vw, 760px);
  aspect-ratio: 1.25;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 195, 107, 0.22), rgba(31, 122, 103, 0.2) 38%, transparent 68%);
  filter: blur(8px);
}

.hero-fretboard {
  position: relative;
  width: min(86vw, 760px);
  height: clamp(260px, 42vw, 500px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, transparent 0 13.9%, rgba(255, 255, 255, 0.18) 14%, transparent 14.3%),
    linear-gradient(110deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02)),
    #211c18;
  box-shadow: 0 38px 90px rgba(0, 0, 0, 0.36);
  transform: perspective(900px) rotateX(58deg) rotateZ(-8deg);
  transform-origin: center;
}

.string-line {
  position: absolute;
  left: 4%;
  right: 4%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 250, 241, 0.74), transparent);
}

.string-line:nth-child(1) { top: 16%; }
.string-line:nth-child(2) { top: 29%; }
.string-line:nth-child(3) { top: 42%; }
.string-line:nth-child(4) { top: 55%; }
.string-line:nth-child(5) { top: 68%; }
.string-line:nth-child(6) { top: 81%; }

.hero-fretboard i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #f2c36b;
  color: #211c18;
  box-shadow: 0 0 30px rgba(242, 195, 107, 0.72);
  font-style: normal;
  font-weight: 900;
  animation: notePulse 2.8s ease-in-out var(--d) infinite;
}

.hero-meter {
  position: absolute;
  right: 4%;
  bottom: 12%;
  display: grid;
  gap: 3px;
  min-width: 190px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(17, 16, 15, 0.72);
  padding: 14px 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

.hero-meter span {
  color: rgba(255, 250, 241, 0.58);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-meter strong {
  color: #5be0a9;
  font-size: 30px;
  line-height: 1;
}

@keyframes notePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.72;
  }
  45% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.tool-layout {
  display: grid;
  width: min(1440px, calc(100% - 32px));
  grid-template-columns: minmax(300px, 400px) 1fr;
  gap: 24px;
  margin: 0 auto;
  min-height: auto;
  padding: 44px 0 42px;
}

.control-panel,
.result-panel,
.band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.control-panel {
  align-self: start;
  padding: 26px;
}

.result-panel {
  padding: 24px;
}

.reveal-section {
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal-ready .reveal-section {
  opacity: 1;
  transform: translateY(18px);
}

.reveal-ready .reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 38px);
}

h3 {
  margin-bottom: 8px;
}

.lead,
.section-copy {
  color: var(--muted);
  line-height: 1.7;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 16px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: #3b332d;
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary:hover {
  background: #efe8dc;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.summary-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #f3ede2;
}

#currentChord {
  display: block;
  margin-bottom: 8px;
  font-size: 34px;
  font-weight: 900;
}

.summary-box p {
  margin-bottom: 6px;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.dot,
.mute {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  margin-right: 4px;
  border-radius: 50%;
  color: white;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.dot.root {
  background: var(--red);
}

.dot.tone {
  background: var(--blue);
}

.mute {
  background: #958a7e;
}

.voicing-grid,
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.chord-card,
.mode-card,
.support-grid article,
.progression-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.chord-card {
  padding: 16px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--green);
}

.icon-button:hover {
  background: #1d6658;
}

.badge {
  border-radius: 999px;
  background: #efe2cf;
  color: #76522b;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.fretboard {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.fretboard text {
  font-family: inherit;
  font-weight: 800;
}

.fret-notes {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.band {
  width: min(1440px, calc(100% - 32px));
  margin-right: auto;
  margin-left: auto;
  margin-bottom: 22px;
  padding: 28px;
}

.tuner-band {
  display: grid;
  grid-template-columns: minmax(260px, 410px) 1fr;
  gap: 24px;
  align-items: center;
}

.tuner-panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171513;
  color: #f8efe2;
  padding: 18px;
}

.tuner-display {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 50% 10%, rgba(36, 122, 104, 0.22), transparent 55%);
}

.tuner-label {
  color: #a8a096;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#detectedNote {
  color: #fff9ef;
  font-size: clamp(56px, 10vw, 92px);
  line-height: 0.9;
}

#detectedOctave {
  color: #d7ccbd;
  font-weight: 800;
}

.tuner-meter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  color: #b8afa5;
  font-size: 13px;
}

.meter-arc {
  position: relative;
  height: 86px;
  overflow: hidden;
  border-bottom: 5px solid #3b3630;
}

.meter-arc::before {
  content: "";
  position: absolute;
  inset: 18px 16px -54px;
  border: 5px solid #3b3630;
  border-bottom: 0;
  border-radius: 160px 160px 0 0;
}

.meter-arc b {
  position: absolute;
  bottom: -3px;
  left: 50%;
  width: 10px;
  height: 78px;
  border-radius: 999px;
  background: rgba(34, 160, 107, 0.25);
  transform: translateX(-50%);
}

.meter-arc i {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 4px;
  height: 78px;
  border-radius: 999px;
  background: var(--red);
  transform: translateX(-50%) rotate(0deg);
  transform-origin: bottom center;
  transition: transform 160ms ease, background 160ms ease;
}

.tuner-readout {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.tuner-readout strong {
  color: #fff9ef;
  font-size: 26px;
}

.tuner-readout {
  color: #c8bdb0;
}

.tuner-buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.string-button {
  position: relative;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #2a2520;
  color: #f8efe2;
  overflow: hidden;
}

.string-button small {
  display: block;
  color: #c8bdb0;
  font-size: 10px;
  font-weight: 800;
}

.string-button::after {
  content: "";
  position: absolute;
  inset: auto 12px 8px;
  height: 2px;
  border-radius: 99px;
  background: rgba(214, 134, 44, 0.55);
  transform: scaleX(0.28);
  transition: transform 180ms ease, background 180ms ease;
}

.string-button:hover,
.string-button.active {
  background: #315c50;
}

.string-button.active::after {
  background: #f2c36b;
  transform: scaleX(1);
}

#tunerLight {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #b9aea1;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5);
}

#tunerLight.in-tune {
  background: #22a06b;
  box-shadow: 0 0 18px rgba(34, 160, 107, 0.45);
}

.tuner-level {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #2a2520;
}

.tuner-level span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d6862c, #22a06b);
  transition: width 80ms linear;
}

.mode-card,
.support-grid article,
.progression-card {
  padding: 18px;
}

.mode-card p,
.support-grid p,
.progression-card p {
  color: var(--muted);
  line-height: 1.65;
}

.intervals,
.chord-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.intervals span,
.chord-pills span {
  border-radius: 999px;
  background: #edf4f1;
  color: var(--green);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.mode-controls {
  display: grid;
  width: min(100%, 520px);
  gap: 10px;
}

.mode-focus {
  display: block;
}

.mode-focus .mode-card {
  padding: 22px;
}

.mode-focus h3 {
  font-size: clamp(28px, 4vw, 44px);
}

.scale-board {
  display: grid;
  grid-template-columns: 34px repeat(13, minmax(0, 1fr));
  gap: 3px;
  margin-top: 14px;
}

.scale-cell {
  display: grid;
  min-width: 0;
  min-height: 36px;
  place-items: center;
  border-radius: 6px;
  background: #f3ede2;
  color: #a09487;
  font-size: 12px;
  font-weight: 800;
}

button.scale-cell {
  border: 0;
  cursor: pointer;
  padding: 0;
}

button.scale-cell:hover,
button.scale-cell.playing {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.scale-cell.string-name {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fffdf8;
  color: var(--muted);
}

.scale-cell.in-scale {
  background: #e5f0eb;
  color: var(--green);
}

.scale-cell.scale-root {
  background: var(--red);
  color: white;
}

.fret-row {
  display: contents;
}

.mode-notes {
  margin-top: 12px;
  color: var(--ink);
  font-weight: 800;
}

.mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.fret-header .scale-cell {
  min-height: 22px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.progression-card .card-top {
  margin-bottom: 4px;
}

.support {
  background: #11100f;
  color: #fffaf1;
}

.support .section-copy,
.support-grid p {
  color: rgba(255, 250, 241, 0.66);
}

.support-grid article {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.support-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
  margin-bottom: 20px;
}

.support-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fffaf1;
  color: var(--ink);
  padding: 0 18px;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.support-button:hover {
  background: #eadfce;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 410px) 1fr;
  gap: 24px;
}

.key-picker {
  max-width: 180px;
}

.progression-list {
  display: grid;
  gap: 12px;
}

.degree-line {
  color: var(--amber);
  font-weight: 900;
}

.seo-main {
  display: grid;
  gap: 0;
}

.seo-hero {
  display: grid;
  min-height: 58vh;
  align-content: center;
  gap: 18px;
  padding: 72px clamp(18px, 5vw, 64px);
  background: #fffdf8;
}

.seo-hero h1 {
  max-width: 920px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.95;
}

.seo-hero .lead {
  max-width: 760px;
}

.seo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.seo-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 0 16px;
  font-weight: 900;
  text-decoration: none;
}

.seo-action.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.seo-content {
  display: grid;
  gap: 26px;
  padding: 44px clamp(18px, 5vw, 64px);
}

.seo-content article {
  max-width: 900px;
}

.seo-content h2,
.seo-content h3 {
  margin-bottom: 10px;
}

.seo-content p,
.seo-content li {
  color: var(--muted);
  line-height: 1.75;
}

.seo-content ul,
.seo-content ol {
  display: grid;
  gap: 8px;
  padding-left: 22px;
}

.seo-link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.seo-link-grid a,
.seo-note-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 16px;
}

.seo-link-grid strong,
.seo-note-box strong {
  display: block;
  margin-bottom: 6px;
}

.seo-note-box {
  max-width: 900px;
}

.footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 28px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-nav div {
  display: grid;
  gap: 8px;
  align-content: start;
}

.footer-nav strong {
  margin-bottom: 6px;
  color: rgba(255, 250, 241, 0.92);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-nav a {
  color: rgba(255, 250, 241, 0.62);
  text-decoration: none;
}

.footer-nav a:hover {
  color: #f2c36b;
}

@media (max-width: 860px) {
  .topbar,
  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .support-main {
    grid-template-columns: 1fr;
  }

  .tool-layout,
  .tuner-band,
  .split,
  .hero-stage {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: auto;
  }

  .hero-visual {
    min-height: 380px;
  }

  h1 {
    font-size: 40px;
    line-height: 1.08;
    word-break: break-all;
  }
}

@media (max-width: 560px) {
  main {
    width: 100%;
  }

  .control-panel,
  .result-panel,
  .band {
    padding: 18px;
  }

  .search-row,
  .select-grid {
    grid-template-columns: 1fr;
  }

  .nav a {
    padding-left: 6px;
    padding-right: 6px;
  }

  .scale-board {
    grid-template-columns: 30px repeat(13, 32px);
    overflow-x: auto;
  }

  .seo-link-grid,
  .footer-nav {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    padding-top: 42px;
    gap: 28px;
  }

  .hero-copy {
    min-width: 0;
  }

  .hero-copy h1 {
    max-width: 100%;
    font-size: 38px;
    line-height: 1.02;
    overflow-wrap: anywhere;
  }

  .hero-copy .lead {
    max-width: 100%;
    font-size: 16px;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-button {
    min-height: 44px;
    padding: 0 15px;
  }

  .hero-visual {
    min-height: 320px;
    overflow: visible;
  }

  .hero-fretboard {
    width: min(118vw, 520px);
    height: 260px;
    transform: perspective(720px) rotateX(58deg) rotateZ(-8deg) translateX(-20px);
  }

  .hero-fretboard i {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .hero-meter {
    right: auto;
    left: 18px;
    bottom: 12px;
    min-width: 146px;
    max-width: calc(100% - 44px);
    padding: 11px 12px;
  }

  .hero-meter strong {
    font-size: 25px;
  }
}
