/* Chordscope. Fretboard and web keep the uploaded drawing.
   Colors, type, borders, and shadows are the approved light page.
   Fonts live next to this file so the folder can be a site root. */

@font-face {
  font-family: "Trash";
  src: url("fonts/Trash-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Trash";
  src: url("fonts/Trash-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Trash";
  src: url("fonts/Trash-Regular-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Trash";
  src: url("fonts/Trash-Bold-Italic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #f3efe6;
  --sheet: #fffdf8;
  --ink: #0f1220;
  --muted: #586070;
  --line: #e6e9ef;
  --yellow: #ffce00;
  --blue: #076dc3;
  --font: "Trash", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

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

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

button,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* ---------- quiet header ---------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: visible;
  color: var(--ink);
  font-family: "Apple Symbols", "Segoe UI Symbol", "Noto Music", "Bravura", "FreeSerif", serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.brand-name {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

.controls {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  min-width: 0;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chip-row {
  display: flex;
  gap: 4px;
}

.chip {
  min-width: 28px;
  padding: 2px 6px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--sheet);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.chip.is-current {
  background: var(--yellow);
  color: var(--ink);
}

select {
  background: var(--sheet);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 700;
}

.segmented {
  display: inline-flex;
  border: 2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  background: var(--sheet);
}

.segmented button {
  padding: 3px 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.segmented button.is-current {
  background: var(--ink);
  color: var(--sheet);
}

/* ---------- stage ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.92fr);
  gap: 20px;
  align-items: start;
  padding: 4px 28px 28px;
}

.col-main,
.col-side {
  min-width: 0;
}

.chord-id {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 4px 0 12px;
}

.chord-symbol {
  font-weight: 900;
  font-size: 4.5rem;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.chord-quality-name {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.tone-chip-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tone-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sheet);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.tone-chip .tone-deg {
  color: var(--muted);
  font-size: 11px;
}

.panel {
  background: var(--sheet);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 7px 7px 0 0 var(--ink);
  padding: 14px 16px 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-head h2 {
  font-weight: 900;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legend {
  display: flex;
  gap: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

.swatch-root {
  background: var(--ink);
}

.swatch-tone {
  background: var(--sheet);
  border: 2px solid var(--ink);
}

.instrument-panel {
  margin-bottom: 16px;
}

.instrument-view {
  overflow: hidden;
}

/* ---------- fretboard: strings run along the neck ---------- */

.fretboard-svg {
  display: block;
  width: 100%;
  height: auto;
}

.fretboard-svg .fret {
  stroke: var(--ink);
  stroke-width: 2;
}

.fretboard-svg .nut {
  fill: var(--ink);
}

.fretboard-svg .pos-marker {
  fill: var(--ink);
  opacity: 0.18;
}

.fretboard-svg .fret-num,
.fretboard-svg .string-label {
  fill: var(--muted);
  font-family: var(--font);
  font-weight: 700;
}

.fretboard-svg .muted-mark {
  fill: var(--ink);
  font-family: var(--font);
  font-weight: 700;
}

.fretboard-svg .string {
  stroke: var(--ink);
  stroke-width: 1.6;
}

.fretboard-svg .string.str-0 { stroke-width: 3; }
.fretboard-svg .string.str-1 { stroke-width: 2.6; }
.fretboard-svg .string.str-2 { stroke-width: 2.2; }
.fretboard-svg .string.str-3 { stroke-width: 1.8; }
.fretboard-svg .string.str-4 { stroke-width: 1.5; }
.fretboard-svg .string.str-5 { stroke-width: 1.25; }

.note-root {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 2;
}

.note-tone {
  fill: var(--sheet);
  stroke: var(--ink);
  stroke-width: 2;
}

.note-name {
  fill: var(--ink);
  font-family: var(--font);
  font-weight: 700;
}

.note-root + .note-name {
  fill: var(--sheet);
}

.note-degree {
  fill: var(--muted);
  font-family: var(--font);
  font-weight: 700;
}

/* ---------- secondary voicing cards ---------- */

.voicing-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.voicing-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.voicing-card {
  background: var(--sheet);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 0 var(--ink);
  padding: 10px 12px;
  min-width: 0;
}

.voicing-card.is-current {
  border-width: 3px;
}

.voicing-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 1.2em;
}

.voicing-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.voicing-notes {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.voicing-why {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.dots {
  display: inline-flex;
  gap: 3px;
  margin-top: 6px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
}

.dot.on {
  background: var(--ink);
}

/* ---------- relationship web ---------- */

.web-caption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: -2px 0 8px;
}

.network-svg {
  display: block;
  width: 100%;
  height: auto;
}

.net-center {
  fill: var(--sheet);
  stroke: var(--ink);
  stroke-width: 3;
}

.net-center-label {
  fill: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.net-edge {
  stroke: var(--ink);
  stroke-opacity: 0.28;
  stroke-width: 1.5;
}

.net-edge.near {
  stroke-opacity: 0.85;
  stroke-width: 2.5;
}

.net-node circle {
  fill: var(--sheet);
  stroke: var(--ink);
  stroke-width: 2;
}

.net-label {
  fill: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.net-label-long {
  font-size: 11px;
  letter-spacing: -0.05em;
}

.net-node.is-selected circle {
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 3;
}

.net-node.is-selected .net-label {
  fill: var(--ink);
}

.btn-forward {
  flex: none;
  background: var(--blue);
  color: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 0 var(--ink);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-forward:disabled {
  opacity: 0.45;
  cursor: default;
}

.voicing-card,
.tone-chip,
.net-node {
  cursor: pointer;
}

.note-name,
.note-degree,
.net-label,
.net-center-label {
  pointer-events: none;
}

.piano-svg {
  display: block;
  width: 100%;
  height: auto;
}

.piano-svg .piano-white {
  fill: var(--sheet);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.piano-svg .piano-black {
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 1;
}

.piano-svg .octave-label {
  fill: var(--muted);
  font-family: var(--font);
  font-weight: 700;
}

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