/* Palette, type stacks, spacing and radii come from brs-theme.css, which every
   Backwerd Rhythm Shop app carries its own copy of. Only the names Staff Spot's
   own rules use are mapped here. */
:root {
  color-scheme: dark;
  --ink: var(--brs-ink);
  --panel: var(--brs-ink-lifted);
  --raised: var(--brs-ink-raised);
  --text: var(--brs-warm-white);
  --tan: var(--brs-tan);
  --brick: var(--brs-brick);
  --terra: var(--brs-terra);
  --forest: var(--brs-forest-light);
  --focus: var(--brs-focus);
  --bad: var(--brs-error);
}
* { box-sizing: border-box; }
/* .button sets an explicit display, which would otherwise beat the browser's
   [hidden] rule and reveal controls that are meant to stay hidden. */
[hidden] { display: none !important; }
body { margin: 0; padding: var(--brs-space-5); }
.site-head, main, footer { width: min(1040px, 100%); margin-inline: auto; }
.site-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; padding: 20px 0 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
h1, h2, h3 { margin: 0; text-transform: uppercase; line-height: .95; }
h1 { font-size: clamp(38px, 5.5vw, 66px); } h1 span { color: var(--terra); }
h1.page-title { font-size: clamp(30px, 4vw, 48px); }
h2 { font-size: clamp(24px, 3.4vw, 36px); } h3 { font-size: 20px; color: var(--tan); }
p { line-height: 1.55; }
a { color: var(--tan); }
.eyebrow { margin: 0 0 8px; color: var(--tan); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 13px; }
.eyebrow a { color: inherit; }
.lede { margin: 10px 0 0; color: var(--muted); font-size: 19px; max-width: 60ch; }
.quiet-link { color: var(--tan); font-weight: 700; text-underline-offset: 4px; }
main { padding: 24px 0; }

/* Skip link and screen-reader text */
.skip-link { position: absolute; left: -9999px; top: 0; padding: 12px 18px; background: var(--raised); border: 1px solid var(--tan); border-radius: 0 0 10px 0; font-weight: 800; z-index: 20; }
.skip-link:focus { left: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Primary navigation */
.brand { display: flex; align-items: center; gap: var(--brs-space-3); }
.brand-mark { flex: none; width: 48px; height: 48px; border: 1px solid rgba(210,180,140,.28); border-radius: var(--brs-radius-md); }
.brand-text { min-width: 0; }

.site-nav ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); color: var(--text); font-weight: 800; text-decoration: none; letter-spacing: .02em; }
.site-nav a:hover { border-color: var(--tan); color: var(--tan); }
.site-nav a[aria-current="page"] { border-color: var(--terra); color: var(--terra); box-shadow: inset 0 -3px 0 var(--terra); }

/* Panels and shared blocks */
.panel { margin-bottom: var(--brs-space-4); padding: clamp(16px, 3vw, 24px); border: 1px solid var(--line); border-radius: var(--brs-radius-lg); background: var(--panel); box-shadow: 0 14px 36px rgba(0,0,0,.28); }
.settings, .filters { border-top: 3px solid var(--brs-forest-light); }
.question { border-top: 4px solid var(--terra); }
.result { border-top: 4px solid var(--forest); }
.hero, .locked, .sequence-banner { border-top: 4px solid var(--terra); }
.intro { border-top: 3px solid var(--brs-forest-light); }
.section-head, .question-meta, .button-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.button-row { justify-content: flex-start; }
.status, .instruction, .question-meta, .boundary p, .status-line, footer { color: var(--muted); }
.status-line { margin: 10px 0 0; font-weight: 700; }
/* Segmented controls, the shape the suite's other dark app uses for its
   settings. Marked up as a radiogroup rather than toggle buttons: one setting
   is one choice, so it keeps a single tab stop and answers to the arrow keys
   the way the select it replaced did. */
.field { display: grid; gap: var(--brs-space-2); flex: 0 1 auto; min-width: 0; }
.lbl { color: var(--tan); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.seg { display: flex; flex-wrap: wrap; gap: var(--brs-space-2); }
.seg button { flex: 0 0 auto; padding: 0 14px; font-weight: 700; cursor: pointer; }
.seg button:hover:not(:disabled) { border-color: var(--tan); }
.seg button[aria-checked="true"] { background: var(--brick); border-color: var(--brick); color: var(--text); }
.seg button:disabled { opacity: .55; cursor: not-allowed; }
.seg[aria-disabled="true"] button[aria-checked="true"] { background: var(--raised); border-color: var(--tan); color: var(--tan); }

/* Each group sizes to its own pills, so a segmented control sits on one row
   and the groups wrap between themselves rather than mid-control. */
.controls { display: flex; flex-wrap: wrap; gap: var(--brs-space-5) var(--brs-space-6); margin: var(--brs-space-5) 0; }
textarea, .button, .seg button { min-height: 46px; border: 1px solid var(--line); border-radius: var(--brs-radius-md); color: var(--text); background: var(--raised); font: inherit; }
textarea { width: 100%; margin: 18px 0; padding: 14px; line-height: 1.45; resize: vertical; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; }
.button:hover { border-color: var(--tan); }
.button.primary { background: var(--brick); border-color: var(--brick); color: var(--text); }
.button.primary:hover { border-color: var(--terra); }
.button.large { min-height: 58px; padding: 0 28px; font-size: 20px; }
.button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* Homepage entry points */
.hero p { max-width: 68ch; }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 18px; }
.entry { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; border-top: 3px solid var(--tan); }
.entry p { margin: 0; color: var(--muted); }
.entry .button-row { margin-top: auto; }

/* Chips, facts, meters */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.chip { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); color: var(--tan); font-size: 14px; font-weight: 800; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 16px 0; }
.fact-grid > div { padding: var(--brs-space-3); border: 1px solid var(--line); border-radius: var(--brs-radius-sm); background: var(--raised); }
.fact-grid dt { color: var(--tan); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.fact-grid dd { margin: 4px 0 0; color: var(--text); }
.meter { height: 10px; margin: 10px 0; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); overflow: hidden; }
.meter > span { display: block; width: var(--progress, 0%); height: 100%; background: var(--forest); }

/* Level trails */
.level-trail { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.trail-step { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); color: var(--muted); font-weight: 700; }
.trail-step.is-done { border-color: var(--forest); color: var(--text); }
.trail-step.is-current { border-color: var(--terra); border-style: dashed; color: var(--text); }
.trail-mark { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 999px; font-size: 14px; font-weight: 800; }
.trail-state { color: var(--muted); font-weight: 600; }
.level-trail.compact .trail-step { padding: 6px; }

/* Teaching Sequences */
.sequence-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.sequence-card { display: flex; flex-direction: column; margin-bottom: 0; border-top: 3px solid var(--terra); }
.sequence-card .objective { color: var(--muted); margin: 10px 0; }
.sequence-card .progress-line { margin: 12px 0 0; }
.sequence-card .button-row { margin-top: auto; padding-top: 12px; }
.level-list { margin: 0; padding: 0; list-style: none; }
.level-item { margin-bottom: var(--brs-space-4); padding: clamp(16px, 2.6vw, 24px); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--brs-radius-lg); background: var(--panel); }
.level-item.is-done { border-left-color: var(--forest); }
.level-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.level-number { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 2px solid var(--tan); border-radius: 999px; color: var(--tan); font-weight: 800; font-size: 18px; }
.is-done .level-number { border-color: var(--forest); color: var(--forest); }
.level-state { margin-left: auto; color: var(--muted); font-weight: 700; }
.level-item p { color: var(--muted); }

/* Assignment catalog */
.assignment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.assignment { display: flex; flex-direction: column; margin-bottom: 0; border-top: 3px solid var(--tan); }
.assignment p { margin: 0 0 4px; color: var(--muted); }
.assignment .button-row { margin-top: auto; padding-top: 12px; }
.assignment .fact-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.used-in { font-size: 15px; }
.copy-status { min-height: 24px; color: var(--forest); font-weight: 700; }

/* Exercise */
.staff-host { overflow-x: auto; margin: var(--brs-space-5) 0 var(--brs-space-3); padding: var(--brs-space-3) var(--brs-space-4); border: 1px solid #5a554d; border-radius: var(--brs-radius-md); background: #302e2a; }
.staff-svg { display: block; width: min(620px, 100%); min-width: 360px; height: auto; margin: auto; }
.staff-line, .ledger-line { stroke: #f3eee7; stroke-width: 2; }
.ledger-line { stroke-width: 2.4; }
.notehead { fill: var(--terra); stroke: var(--brs-ink); stroke-width: 1.5; }
.clef { fill: #f3eee7; font-family: "Times New Roman", serif; font-size: 62px; }
.accidental { fill: #f3eee7; font-family: serif; font-size: 34px; }
/* Everything drawn on the staff is decoration: the notehead overlaps the
   position targets nearest it, and without this it swallows their clicks. */
.staff-line, .ledger-line, .notehead, .accidental, .clef { pointer-events: none; }
.position-zone { fill: transparent; stroke: transparent; stroke-width: 2; cursor: pointer; }
.position-zone:hover { fill: rgba(210,180,140,.16); }
.position-zone.is-selected { fill: rgba(226,114,91,.18); stroke: var(--terra); }
.position-zone:focus-visible { fill: rgba(120,174,252,.24); stroke: var(--focus); outline: none; }
.position-zone.is-locked { cursor: default; }
.answers { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0; }
.answer { min-width: 62px; min-height: 54px; font-size: 20px; }
.placement-controls { display: grid; gap: 12px; justify-items: center; }
.placement-controls .button-row { justify-content: center; }
.accidental-choice.is-active { border-color: var(--terra); color: var(--terra); }
.feedback { min-height: 26px; font-weight: 700; }
.feedback.good { color: var(--forest); } .feedback.bad { color: var(--bad); }
.result-score { margin-bottom: 4px; font-size: 28px; font-weight: 800; }
.result-status { margin-top: 0; font-weight: 700; }
.result-status.good { color: var(--forest); } .result-status.bad { color: var(--bad); }
.next-steps { margin: 18px 0 24px; }
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.evidence-grid > div { padding: var(--brs-space-4); border: 1px solid var(--line); border-radius: var(--brs-radius-md); background: var(--raised); }
.evidence-grid p { margin-bottom: 0; color: var(--muted); }
footer { padding: 8px 0 36px; font-size: 13px; }

@media (max-width: 720px) {
  body { padding: 12px; }
  .site-head { align-items: flex-start; flex-direction: column; }
  .evidence-grid { grid-template-columns: 1fr; }
  .fact-grid { grid-template-columns: 1fr; }
  .level-state { margin-left: 0; width: 100%; }
  .button-row .button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
