@font-face {
  font-family: "FretWolf Music";
  src: url("artwork/notation/Bravura.woff2") format("woff2");
  font-display: block;
}

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #252820;
  background: #faf9f6;
  font-synthesis: none;
  --muted: #696b61;
  --line: #e4e5dc;
  --orange: #aa421a;
  --green: #42604b;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; }
a { color: inherit; text-underline-offset: 0.2em; }
button, select { min-height: 44px; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
:focus-visible { outline: 3px solid #b64d22; outline-offset: 4px; }
.container { width: min(calc(100% - 3rem), 1240px); margin-inline: auto; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 0.5rem; border-bottom: 1px solid var(--line); }
.brand img { display: block; width: 102px; height: auto; mix-blend-mode: multiply; }
nav { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; }
nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
nav a:hover { text-decoration: underline; }
.intro { padding-block: 2.6rem 1.8rem; }
.eyebrow { margin: 0 0 0.65rem; font-size: 0.68rem; font-weight: 750; letter-spacing: 0.13em; text-transform: uppercase; color: var(--green); }
h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 650; letter-spacing: -0.065em; line-height: 1.08; }
.subtitle { color: var(--muted); line-height: 1.6; margin-bottom: 0; }
h2, h3 { margin: 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 326px; border: 1px solid var(--line); border-radius: 1.25rem; background: #fff; overflow: hidden; box-shadow: 0 12px 40px #25282004; }
.circle-panel { min-width: 0; padding: 1.5rem 1.5rem 1.1rem; }
.circle-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem; }
.circle-toolbar h2 { font-size: 1.05rem; letter-spacing: -0.025em; }
.clef-switch { display: flex; border: 1px solid var(--line); border-radius: 0.6rem; padding: 3px; margin: 0; background: #f6f6f1; }
.clef-switch label { position: relative; cursor: pointer; }
.clef-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.clef-switch span { display: grid; place-items: center; min-height: 38px; padding-inline: 0.9rem; border-radius: 0.4rem; font-size: 0.78rem; color: var(--muted); }
.clef-switch input:checked + span { background: #fff; color: #252820; box-shadow: 0 1px 5px #25282016; font-weight: 700; }
.clef-switch input:focus-visible + span { outline: 3px solid #b64d22; outline-offset: 2px; }
.circle-instruction { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.8rem; }
#circle { display: block; width: 100%; max-width: 790px; margin-inline: auto; overflow: visible; }
.key-sector { cursor: pointer; outline: none; }
.key-sector .sector { fill: #f4f2eb; stroke: #fff; stroke-width: 3; transition: fill 120ms ease; }
.key-sector.minor .sector { fill: #eeefe7; }
.key-sector.related .sector { fill: #dfeade; }
.key-sector.minor.related .sector { fill: #dceaf6; }
.key-sector.major.related:hover .sector { fill: #c9dec7; }
.key-sector.minor.related:hover .sector { fill: #c5dcee; }
.key-sector.tonic .sector { fill: #aa421a; }
.key-sector:hover .sector { fill: #e8d9c6; }
.key-sector.tonic:hover .sector { fill: #8f3515; }
.key-sector:focus-visible .sector { stroke: #252820; stroke-width: 4; }
.key-name { font-size: 26px; font-weight: 650; fill: #33372c; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.minor .key-name { font-size: 22px; }
.key-sector.tonic text { fill: #fff; }
.degree-label { font-size: 13px; font-weight: 700; fill: #4d6553; text-anchor: middle; pointer-events: none; }
.key-sector.minor.related .degree-label { fill: #365b78; }
.center-title { font-size: 32px; font-weight: 650; letter-spacing: -1px; fill: #30372c; text-anchor: middle; }
.center-caption { font-size: 13px; letter-spacing: 2px; fill: #747a6c; text-anchor: middle; }
.center-signature { font-size: 15px; fill: #666d5e; text-anchor: middle; }
.staff-line { stroke: #4e5549; stroke-width: 0.7; }
.music-glyph { font-family: "FretWolf Music"; fill: #30372c; }
.notation { visibility: hidden; }
body[data-notation="ready"] .notation { visibility: visible; }
.signature-count { font-size: 13px; fill: #747a6c; text-anchor: middle; }
.key-sector.diminished .sector { fill: #fff2cf; }
.key-sector.diminished:hover .sector { fill: #f5dfa2; }
.key-sector.diminished text { fill: #725110; }
.key-sector.diminished .key-name { font-size: 19px; }
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.2rem; font-size: 0.72rem; color: #555d4f; }
.legend > span { display: flex; align-items: center; gap: 0.45rem; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.swatch.selected { background: var(--orange); }
.swatch.related { background: #dfeade; border: 1px solid #b5cab5; }
.swatch.related-minor { background: #dceaf6; border: 1px solid #aac5dc; }
.swatch.diminished { background: #fff2cf; border: 1px solid #b58b2e; }
.hint { color: var(--muted); font-size: 0.76rem; line-height: 1.6; }
#circleHelp { text-align: center; margin: 0.8rem 0 0; }
.key-panel { border-left: 1px solid var(--line); background: #f6f7f1; padding: 1.7rem 1.5rem; }
.field-label { display: block; font-size: 0.76rem; font-weight: 650; margin-bottom: 0.5rem; }
select { width: 100%; border: 1px solid #d6d9cb; border-radius: 0.55rem; padding: 0.6rem 0.7rem; background: #fff; font-size: 0.85rem; }
.detail-eyebrow { margin-top: 2.1rem; }
#keyTitle { font-size: 2.3rem; font-weight: 600; letter-spacing: -0.06em; }
.scale-notes { margin-top: 0.65rem; color: #5c6454; font-size: 0.85rem; line-height: 1.7; }
.signature-card { margin-top: 1.5rem; padding: 1rem; border: 1px solid #dde1d3; border-radius: 0.8rem; background: #fff; }
.signature-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.signature-heading h3 { font-size: 0.8rem; }
.signature-heading span { color: var(--muted); font-size: 0.68rem; }
#selectedStaff svg { display: block; width: 100%; height: auto; margin-block: 0.2rem; }
#signatureSummary { font-size: 0.88rem; font-weight: 650; margin: 0; }
#signatureNotes { margin: 0.3rem 0 0; min-height: 1.6em; }
#notationStatus:empty { display: none; }
.relationships { margin: 1.5rem 0 0; }
.relationships > div { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding-block: 0.85rem; border-bottom: 1px solid var(--line); }
.relationships dt { font-size: 0.78rem; font-weight: 650; }
.relationships dt span { display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.65rem; font-weight: 400; }
.relationships dd { margin: 0; text-align: right; }
.relationships button { padding: 0.4rem 0; border: 0; background: transparent; color: var(--orange); text-decoration: underline; text-underline-offset: 0.2em; font-size: 0.78rem; font-weight: 600; }
.mode-note { margin-top: 1.3rem; color: var(--muted); font-size: 0.75rem; line-height: 1.7; }
.chord-section { padding-block: 2.5rem 1rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.2rem; }
.section-heading h2, .guide h2 { font-size: 1.55rem; font-weight: 600; letter-spacing: -0.045em; }
.volume-label { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.75rem; }
input[type="range"] { width: 110px; min-height: 44px; accent-color: var(--green); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 0.8rem; background: #fff; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 0.88rem; }
th { padding: 0.85rem 1.25rem; background: #f0f2e9; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.09em; color: #626a56; font-weight: 650; }
td { padding: 0.6rem 1.25rem; border-top: 1px solid #eeeee7; }
td:first-child { width: 17%; font-weight: 700; color: var(--green); }
td:nth-child(2) { width: 29%; font-weight: 600; }
td:nth-child(3) { color: #626859; white-space: nowrap; }
td:last-child { width: 1%; }
.play-chord { display: flex; align-items: center; gap: 0.5rem; border: 1px solid #dfe3d5; border-radius: 2rem; padding: 0.4rem 0.85rem; background: #f8faf4; color: #36513d; font-size: 0.75rem; }
.play-chord:hover { background: #e7efdf; }
.play-chord svg { width: 10px; height: 12px; fill: currentColor; }
.guide { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 2rem; padding-block: 2rem 3rem; }
.guide h2 { max-width: 230px; }
.guide h3 { font-size: 0.88rem; font-weight: 650; }
.guide p:not(.eyebrow) { color: var(--muted); font-size: 0.78rem; line-height: 1.8; }
footer { padding-block: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.7rem; line-height: 1.7; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.instructions { max-width: 900px; padding-bottom: 3rem; }
.instructions h2 { font-size: 1.55rem; font-weight: 600; letter-spacing: -0.045em; }
.instructions p { color: var(--muted); font-size: 0.88rem; line-height: 1.8; }
.instructions details { border-bottom: 1px solid var(--line); }
.instructions summary { padding-block: 1rem; cursor: pointer; font-size: 0.9rem; font-weight: 650; }
.error, [data-error="true"] { color: #a52820; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 960px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 285px; }
  .circle-panel { padding: 1rem; }
  .key-panel { padding: 1.3rem 1rem; }
  .guide { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .container { width: min(calc(100% - 2rem), 620px); }
  .workspace { grid-template-columns: 1fr; }
  .key-panel { border-left: 0; border-top: 1px solid var(--line); padding: 1.5rem; }
  .detail-eyebrow { margin-top: 1.3rem; }
  .signature-card { max-width: 390px; }
  #selectedStaff svg { max-height: 145px; }
  .intro { padding-block: 1.75rem 1.4rem; }
}
@media (max-width: 480px) {
  .container { width: calc(100% - 1.5rem); }
  .circle-panel { padding: 0.9rem 0.5rem 1rem; }
  .circle-toolbar, .circle-instruction { margin-inline: 0.4rem; }
  .circle-toolbar h2 { font-size: 0.9rem; }
  .clef-switch span { padding-inline: 0.7rem; }
  .circle-instruction { font-size: 0.7rem; }
  .perimeter-staff { display: none; }
  #circle { margin-block: 0.6rem; }
  .key-panel { padding: 1.2rem; }
  .guide { grid-template-columns: 1fr; gap: 1rem; }
  .guide h2 { max-width: none; }
  td, th { padding-inline: 0.7rem; }
  table { font-size: 0.8rem; }
  .play-chord { padding-inline: 0.65rem; }
  .legend { gap: 0.8rem; font-size: 0.67rem; }
}
@media (prefers-reduced-motion: reduce) {
  .key-sector .sector { transition: none; }
}
