:root {
  --bg: #050608;
  --bg-soft: #0b0d12;
  --panel: #111319;
  --panel-soft: #171a22;
  --panel-raise: #1b1f29;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f4f6;
  --text-soft: #a3a9b7;
  --text-dim: #7d8392;
  --accent: #f4b000;
  --accent-soft: rgba(244, 176, 0, 0.16);
  --note: #7f8392;
  --note-dim: rgba(127, 131, 146, 0.28);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", "Helvetica Neue", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at top center, rgba(244, 176, 0, 0.06), transparent 20%),
    linear-gradient(180deg, #06070a 0%, #030407 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.35;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1520px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 1.5rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.82rem 0;
  background: rgba(5, 6, 8, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent);
  color: #111319;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.brand-copy {
  display: grid;
  gap: 0.08rem;
}

.brand-mark {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-copy p,
.page-lead,
.panel-note,
.theory-body,
.theory-block p,
.related-group a,
.footer-note,
.section-head p,
.panel-copy p {
  margin: 0;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.brand-copy p {
  font-size: 0.9rem;
  line-height: 1.3;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem;
  align-items: center;
}

.filter-field {
  display: grid;
  gap: 0.3rem;
  flex: 1 1 180px;
  min-width: 160px;
}

.filter-field span,
.eyebrow,
.section-kicker,
.meta-chip span,
.theory-block span {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-field select,
.position-chip,
.copy-button {
  min-height: 50px;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #101218;
  color: var(--text);
}

.filter-field select {
  appearance: none;
  width: 100%;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.3rem;
}

.content-nav,
.footer-utility {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.content-nav {
  justify-content: flex-end;
  align-items: center;
}

.content-nav a,
.footer-utility a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #101319;
  color: var(--text-soft);
}

.content-nav a.is-active,
.footer-utility a.is-active {
  background: rgba(244, 176, 0, 0.12);
  border-color: rgba(244, 176, 0, 0.22);
  color: var(--text);
}

.topbar--content {
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
}

.dashboard {
  display: grid;
  gap: 1rem;
  padding-top: 1rem;
}

.dashboard > * {
  min-width: 0;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}

.heading-copy {
  display: grid;
  gap: 0.35rem;
}

.heading-copy h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.page-lead {
  max-width: 48rem;
  font-size: 0.94rem;
  line-height: 1.55;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.meta-chip,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(19, 22, 29, 0.98), rgba(14, 16, 22, 0.98));
  box-shadow: var(--shadow);
}

.meta-chip {
  flex: 1 1 180px;
  min-width: 160px;
  padding: 0.82rem 0.95rem;
}

.meta-chip strong {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.98rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.panel {
  min-width: 0;
  padding: 1.4rem;
}

.panel-toolbar,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
}

.panel-copy h2,
.section-head h2 {
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.position-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  max-width: 560px;
}

.position-chip {
  min-height: 42px;
  padding: 0.66rem 0.92rem;
  background: #171a21;
  color: var(--text-soft);
}

.fretboard-panel .panel-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1.35rem;
}

.fretboard-panel .panel-copy {
  max-width: 33rem;
}

.fretboard-panel .panel-copy p {
  font-size: 0.92rem;
  line-height: 1.45;
}

.fretboard-panel .position-bar {
  flex-wrap: nowrap;
  justify-content: flex-end;
  max-width: none;
  overflow-x: auto;
  padding: 0.18rem 0 0.18rem 0.8rem;
}

.fretboard-panel .position-chip {
  flex: 0 0 auto;
}

.position-chip.is-active {
  background: var(--accent);
  color: #0d1015;
  border-color: rgba(244, 176, 0, 0.3);
  font-weight: 800;
}

.fretboard-shell {
  margin-top: 1.15rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.fretboard-frame {
  width: max-content;
  min-width: 1320px;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #141720 0%, #10131a 100%);
}

.fretboard-board {
  display: grid;
  gap: 0;
}

.fretboard-row {
  position: relative;
  display: grid;
  grid-template-columns: 86px repeat(22, minmax(44px, 1fr));
  align-items: center;
}

.fretboard-row--numbers {
  margin-bottom: 0.4rem;
}

.fretboard-empty {
  min-height: 22px;
}

.fret-marker {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.open-string,
.fret-slot {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fretboard-row:not(.fretboard-row--numbers)::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 32px;
  right: 0;
  z-index: 1;
  border-top: 2px solid rgba(226, 229, 236, 0.54);
  transform: translateY(-50%);
}

.fretboard-row:not(.fretboard-row--numbers)::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 83px;
  width: 6px;
  z-index: 0;
  background: rgba(229, 232, 239, 0.85);
}

.open-string {
  z-index: 2;
  justify-content: flex-start;
  gap: 0.7rem;
  padding-right: 0;
}

.fret-slot::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: -1px;
  width: 2px;
  background: rgba(210, 214, 224, 0.32);
}

.fret-slot.is-window {
  background: rgba(255, 255, 255, 0.016);
}

.string-name {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  padding-right: 0.15rem;
  background: #141720;
  color: var(--text-soft);
  font-weight: 700;
  text-align: center;
}

.note-dot {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--note);
  color: #f8f9fb;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.note-dot--root {
  background: var(--accent);
  color: #12151c;
}

.note-dot--dim {
  background: var(--note-dim);
  color: rgba(243, 244, 246, 0.26);
  box-shadow: none;
}

.note-dot--ghost {
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: transparent;
  box-shadow: none;
}

.fretboard-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  color: var(--text-soft);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.legend-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
}

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

.legend-dot--scale {
  background: var(--note);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

.tabs-panel,
.theory-panel,
.chord-panel,
.related-panel {
  min-width: 0;
}

.copy-button {
  min-height: 42px;
  padding: 0.7rem 1rem;
  background: var(--panel-raise);
  color: var(--text);
}

.copy-button.is-copied {
  background: var(--accent);
  color: #0e1117;
  border-color: rgba(244, 176, 0, 0.28);
}

.tabs-panel .panel-note {
  margin-top: 1rem;
  padding: 0 0.2rem 0.45rem;
  line-height: 1.5;
}

.tab-pre {
  margin: 1rem 0 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #0d1015;
  color: #e9ebf0;
  font-family: var(--mono);
  font-size: 1.02rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

.theory-body {
  margin-top: 1rem;
  line-height: 1.75;
}

.theory-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.theory-block p {
  margin-top: 0.45rem;
  line-height: 1.7;
}

.note-pills,
.pill-list,
.footer-index {
  list-style: none;
  padding: 0;
  margin: 0;
}

.note-pills,
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.note-pills {
  margin-top: 1rem;
}

.note-pill,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 700;
}

.note-pill {
  background: rgba(244, 176, 0, 0.08);
  border-color: rgba(244, 176, 0, 0.12);
}

.chord-panel .section-head {
  margin-bottom: 0.25rem;
}

.chord-panel .panel-note {
  margin-top: 0.15rem;
  margin-bottom: 1rem;
  padding-right: 0.25rem;
}

.pill span {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

.content-panel {
  max-width: 980px;
}

.content-media {
  margin: 0 0 1.25rem;
  max-width: 260px;
}

.content-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #0f1218;
}

.content-media figcaption {
  margin-top: 0.55rem;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.content-intro {
  margin: 0;
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.8;
}

.content-sections {
  display: grid;
  gap: 1.35rem;
  margin-top: 1.35rem;
}

.content-section {
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.content-section h2 {
  margin: 0 0 0.8rem;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.content-section p {
  margin: 0.6rem 0 0;
  color: var(--text-soft);
  line-height: 1.78;
}

.content-section a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.related-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  padding: 1rem;
}

.related-group h3 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
}

.related-group ul {
  display: grid;
  gap: 0.55rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-group a {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: #0e1117;
}

.page-footer {
  margin-top: 1.15rem;
  padding: 1.15rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-utility {
  justify-content: center;
  margin-bottom: 1rem;
}

.footer-note {
  margin-bottom: 1rem;
  text-align: center;
}

.footer-index {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.7rem;
}

.footer-index a {
  display: block;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f1218;
  color: var(--text-soft);
}

@media (max-width: 1220px) {
  .content-grid,
  .related-grid,
  .footer-index {
    grid-template-columns: 1fr;
  }

  .dashboard-head,
  .panel-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .position-bar {
    justify-content: flex-start;
  }

  .meta-strip {
    justify-content: flex-start;
  }

  .fretboard-panel .panel-toolbar {
    display: flex;
  }

  .fretboard-panel .position-bar {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-left: 0;
  }
}

@media (max-width: 1040px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .filter-form {
    justify-content: flex-start;
    width: 100%;
  }

  .content-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: calc(100% - 1rem);
  }

  .topbar {
    padding: 0.9rem 0;
  }

  .brand-block {
    gap: 0.8rem;
  }

  .brand-icon {
    width: 48px;
    height: 48px;
  }

  .filter-form {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .filter-field {
    width: 100%;
    min-width: 0;
  }

  .panel {
    padding: 1rem;
  }

  .heading-copy h1 {
    max-width: none;
  }

  .meta-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 0.65rem;
  }

  .meta-chip {
    min-width: 0;
  }

  .meta-chip:last-child {
    grid-column: 1 / -1;
  }

  .panel-toolbar,
  .section-head {
    gap: 0.75rem;
  }

  .position-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: none;
  }

  .fretboard-panel .position-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow-x: visible;
    padding-left: 0;
  }

  .position-chip {
    width: 100%;
    justify-content: center;
  }

  .fretboard-frame {
    min-width: 920px;
    padding: 0.85rem;
  }

  .fretboard-row {
    grid-template-columns: 68px repeat(22, 36px);
  }

  .fretboard-row:not(.fretboard-row--numbers)::before {
    left: 29px;
  }

  .fretboard-row:not(.fretboard-row--numbers)::after {
    left: 74px;
  }

  .open-string,
  .fret-slot {
    min-height: 46px;
  }

  .string-name {
    width: 20px;
  }

  .note-dot {
    width: 31px;
    height: 31px;
    font-size: 0.8rem;
  }

  .tab-pre {
    font-size: 0.92rem;
  }
}

@media (max-width: 520px) {
  .brand-copy p {
    font-size: 0.94rem;
  }

  .heading-copy h1 {
    font-size: clamp(1.85rem, 12vw, 2.7rem);
  }

  .meta-strip {
    grid-template-columns: 1fr;
  }

  .meta-chip:last-child {
    grid-column: auto;
  }

  .position-bar {
    grid-template-columns: 1fr;
  }

  .fretboard-panel .position-bar {
    grid-template-columns: 1fr;
  }

  .footer-utility a {
    flex: 1 1 calc(50% - 0.35rem);
    justify-content: center;
  }

  .fretboard-frame {
    min-width: 860px;
    padding: 0.75rem;
  }

  .fretboard-row {
    grid-template-columns: 62px repeat(22, 34px);
  }

  .fretboard-row:not(.fretboard-row--numbers)::before {
    left: 27px;
  }

  .fretboard-row:not(.fretboard-row--numbers)::after {
    left: 67px;
    width: 5px;
  }

  .note-dot {
    width: 28px;
    height: 28px;
    font-size: 0.74rem;
  }
}
