/* ==========================================================================
   Composer Forge — design tokens
   Matched to curriculum.composerforge.com: system font stack (no custom
   webfonts), indigo accent, gray-800/500/400 text scale, light theme.
   Track colours are the one place colour carries extra meaning.

   TWO DIALS FOR YOU TO ADJUST WITHOUT TOUCHING SELECTORS:
   --font-scale   multiplies every font-size on the site. 1 = as shipped.
                  Try 1.1 or 1.15 if everything still reads small to you —
                  every --text-* token below is calc()'d from this one number.
   --logo-height  controls the logo size in the top bar on every page.
   Both live right at the top of :root, just below this comment.
   ========================================================================== */

:root {
  --font-scale: 1;
  --logo-height: 34px;

  /* type scale — all derived from --font-scale, so bumping that one
     variable grows every size below proportionally. Override an individual
     --text-* line instead if you want to change just one thing. */
  --text-2xs: calc(11px * var(--font-scale));   /* module numbers, kind labels, level labels */
  --text-xs:  calc(12.5px * var(--font-scale)); /* eyebrows, breadcrumbs, meta text */
  --text-sm:  calc(13.5px * var(--font-scale)); /* buttons */
  --text-base: calc(15px * var(--font-scale));  /* module-row titles, card blurbs */
  --text-md:  calc(16px * var(--font-scale));   /* body copy, lesson rows, lesson body text */
  --text-lg:  calc(18px * var(--font-scale));   /* track column headings */
  --text-xl:  calc(20px * var(--font-scale));   /* lesson subheads */
  --text-2xl: calc(24px * var(--font-scale));   /* — */
  --text-3xl: calc(30px * var(--font-scale));   /* module/lesson page h1 */
  --text-4xl: calc(32px * var(--font-scale));   /* curriculum-map page h1 */

  /* track identity — real values from curriculum.composerforge.com's index.js */
  --theory: #667eea;
  --composition: #f56565;
  --orchestration: #48bb78;
  --production: #ed8936;
  --business: #9f7aea;

  --ink: #1a202c;        /* headings */
  --body: #2d3748;       /* primary text */
  --muted: #4a5568;      /* secondary text */
  --faint: #718096;      /* small print, numbers */
  --faint-2: #a0aec0;    /* extra faint, borders on white */
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f7fafc;
  --accent: #667eea;
  --accent-hover: #5568d3;
  
  --correct: #2f855a;
  --correct-bg: #f0fdf4;
  --incorrect: #c53030;
  --incorrect-bg: #fef2f2;

  --radius: 8px;
  --radius-sm: 6px;

  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;

  --shadow-sm: 0 1px 2px rgba(26, 32, 44, 0.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-alt);
  color: var(--body);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

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

/* ---------- top bar (all pages) ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar__logo {
  height: var(--logo-height);
  width: auto;
  display: block;
}

.topbar__brand a.wordmark {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.topbar__crumbs {
  font-size: var(--text-xs);
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__crumbs a { color: var(--muted); }
.topbar__crumbs a:hover { color: var(--ink); text-decoration: underline; }

.topbar__progress {
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- staff-line divider ----------
   five thin rules — a quiet nod to the subject, used only as a section
   divider under level headings, never decoratively elsewhere. */

.staff {
  height: 8px;
  margin: 8px 0 12px;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--border) 0px,
    var(--border) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.8;
}

/* ---------- orientation band ("before you start") ---------- */

.orientation {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
}

.orientation__label {
  font-size: var(--text-2xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 10px;
}

.orientation__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.orientation__card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.orientation__card:hover { border-color: var(--accent); }

.orientation__card-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}

.orientation__card-blurb {
  font-size: var(--text-base);
  color: var(--faint);
}

/* ---------- grid page ---------- */

.page-head {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 28px 8px;
}

.page-head h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

.page-head p {
  font-size: var(--text-md);
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}

.grid {
  max-width: 1400px;
  margin: 20px auto 64px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 20px;
  align-items: start;
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; padding: 0 16px; }
  .page-head, .orientation { padding: 24px 16px 8px; }
  .topbar { padding: 12px 16px; }
}

.track-col {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.track-col__head {
  padding: 18px 18px 16px;
  color: #fff;
  background: var(--track-color, var(--accent));
}

.track-col__head h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 4px;
}

.track-col__head p {
  margin: 0;
  font-size: var(--text-base);
  opacity: 0.92;
}

.track-col__body { padding: 14px 16px 18px; }

.level-label {
  font-size: var(--text-2xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
  margin-top: 16px;
}

.level-label:first-child { margin-top: 0; }

/* fixed-height rows: same footprint whether the title is 2 words or 8,
   and it keeps every column the same total height since every level has
   exactly 12 modules. Titles wrap to 2 lines rather than truncate. */
.module-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px;
  margin: 0 -6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.module-row:hover { background: var(--bg-alt); }

.module-row__num {
  font-size: var(--text-2xs);
  color: var(--faint-2);
  width: 20px;
  flex-shrink: 0;
}

.module-row__title {
  flex: 1;
  font-size: var(--text-base);
  color: var(--body);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.module-row__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--faint-2);
  flex-shrink: 0;
}

.module-row__dot.is-partial {
  border-color: var(--track-color, var(--accent));
  background: linear-gradient(to right, var(--track-color, var(--accent)) 50%, transparent 50%);
}

.module-row__dot.is-complete {
  border-color: var(--track-color, var(--accent));
  background: var(--track-color, var(--accent));
}

/* ---------- module + lesson pages ---------- */

.content {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.eyebrow {
  font-size: var(--text-xs);
  color: var(--track-color, var(--muted));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}

.content h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 20px;
}

.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  margin: 0 0 28px;
}

.progress-bar__fill {
  height: 100%;
  background: var(--track-color, var(--accent));
}

.objectives {
  margin: 0 0 32px;
  padding: 16px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.objectives h2 {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--faint);
  margin: 0 0 10px;
}

.objectives__list {
  margin: 0;
  padding-left: 18px;
  font-size: var(--text-base);
  color: var(--body);
}

.objectives__list li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.objectives__list li:last-child { margin-bottom: 0; }

.lesson-list {
  border-top: 1px solid var(--border);
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.lesson-row:hover .lesson-row__title { text-decoration: underline; }

.lesson-row__num {
  font-size: var(--text-xs);
  color: var(--faint-2);
  width: 20px;
  flex-shrink: 0;
}

.lesson-row__title { flex: 1; font-size: var(--text-md); color: var(--body); }

.lesson-row__kind {
  font-size: var(--text-2xs);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.check {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.5px solid var(--faint-2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check.is-done {
  background: var(--track-color, var(--accent));
  border-color: var(--track-color, var(--accent));
}

.check.is-done::after {
  content: "";
  width: 5px;
  height: 8px;
  border-right: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* lesson body */

.lesson-section {
  margin: 26px 0;
  font-size: var(--text-md);
}

.lesson-section h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}

.lesson-section p {
  margin: 0 0 14px;
  color: var(--body);
  line-height: 1.7;
}

.lesson-subhead {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  margin: 24px 0 10px;
}

.recap-list {
  margin: 0;
  padding-left: 20px;
  font-size: var(--text-md);
  color: var(--body);
}

.recap-list li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.placeholder-note {
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--faint);
  border: 1px dashed var(--faint-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: inline-block;
}

.video-slot {
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: var(--text-xs);
  margin: 14px 0;
}

.diagram-slot {
  min-height: 140px;
  background: var(--bg-alt);
  border: 1px dashed var(--faint-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: var(--text-xs);
  font-style: italic;
  text-align: center;
  padding: 16px;
  margin: 14px 0;
}

/* ---------- diagrams (real image) ---------- */

.diagram-figure { margin: 14px 0; }

.diagram-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.diagram-caption {
  font-size: var(--text-xs);
  color: var(--faint);
  font-style: italic;
  margin: 6px 0 0;
}

/* ---------- video (real embed) ---------- */

.video-embed {
  position: relative;
  padding-top: 56.25%;
  margin: 14px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-caption {
  font-size: var(--text-xs);
  color: var(--faint);
  margin: -6px 0 14px;
}

/* ---------- quiz ---------- */

.quiz { margin: 8px 0 32px; }

.quiz__question {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.quiz__question:first-child { padding-top: 0; }

.quiz__prompt {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
}

.quiz__media {
  display: block;
  max-width: 100%;
  margin: 0 0 12px;
  border-radius: var(--radius-sm);
}

.quiz__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz__option {
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--body);
  cursor: pointer;
}

.quiz__option:hover:not(:disabled) { border-color: var(--track-color, var(--accent)); }
.quiz__option:disabled { cursor: default; }

.quiz__option.is-correct {
  border-color: var(--correct);
  background: var(--correct-bg);
  color: var(--correct);
  font-weight: 600;
}

.quiz__option.is-incorrect {
  border-color: var(--incorrect);
  background: var(--incorrect-bg);
  color: var(--incorrect);
}

.quiz__feedback { font-size: var(--text-base); margin: 10px 0 0; }
.quiz__feedback.is-correct { color: var(--correct); }
.quiz__feedback.is-incorrect { color: var(--incorrect); }

.quiz__summary {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink);
  margin: 20px 0 0;
}

.lesson-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.btn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--body);
  cursor: pointer;
}

.btn:hover { border-color: var(--accent); color: var(--accent-hover); }

.btn--primary {
  background: var(--track-color, var(--accent));
  border-color: var(--track-color, var(--accent));
  color: #fff;
}

.btn--primary:hover { opacity: 0.92; color: #fff; }

.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-links {
  display: flex;
  gap: 10px;
}

.empty-state {
  max-width: 760px;
  margin: 60px auto;
  padding: 0 28px;
  text-align: center;
  color: var(--muted);
  font-size: var(--text-md);
}
