:root {
  --bg: oklch(16% 0.02 270);
  --surface: oklch(20% 0.025 270);
  --ink: oklch(93% 0.01 90);
  --muted: oklch(62% 0.02 270);
  --accent: oklch(78% 0.14 75);       /* warm brass */
  --accent-dim: oklch(78% 0.14 75 / 0.35);
  --border: oklch(32% 0.02 270);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100%;
  background: radial-gradient(120% 90% at 50% 110%, oklch(22% 0.04 300 / 0.55), transparent 60%), var(--bg);
  color: var(--ink);
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  padding: 6vh 24px 10vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

nav {
  max-width: 680px;
  margin: 0 auto 4rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
nav .brand { color: var(--ink); }
nav .brand em { color: var(--accent); }
nav .links { display: flex; gap: 1.6rem; }
nav a { color: var(--muted); }
nav a[aria-current="page"] { color: var(--accent); }

main { max-width: 680px; margin: 0 auto; }
main.center { text-align: center; }

/* breathing staff */
.staff {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 64px;
  margin-bottom: 4.5rem;
}
.staff span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: .85;
  animation: breathe 3.6s ease-in-out infinite;
}
.staff span:nth-child(1)  { height: 18%; animation-delay: 0s;   }
.staff span:nth-child(2)  { height: 34%; animation-delay: .18s; }
.staff span:nth-child(3)  { height: 58%; animation-delay: .36s; }
.staff span:nth-child(4)  { height: 82%; animation-delay: .54s; }
.staff span:nth-child(5)  { height: 100%;animation-delay: .72s; }
.staff span:nth-child(6)  { height: 74%; animation-delay: .9s;  }
.staff span:nth-child(7)  { height: 46%; animation-delay: 1.08s;}
.staff span:nth-child(8)  { height: 62%; animation-delay: 1.26s;}
.staff span:nth-child(9)  { height: 30%; animation-delay: 1.44s;}
.staff span:nth-child(10) { height: 14%; animation-delay: 1.62s;}
@keyframes breathe {
  0%, 100% { transform: scaleY(.55); opacity: .45; }
  50%      { transform: scaleY(1);   opacity: .95; }
}
@media (prefers-reduced-motion: reduce) {
  .staff span { animation: none; }
}

h1 {
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.05;
}
h1 .deep { color: var(--accent); font-style: italic; }

h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin: 3.2rem 0 1rem;
  color: var(--ink);
}
h2 .n {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .8rem;
  color: var(--accent);
  letter-spacing: .2em;
  display: block;
  margin-bottom: .5rem;
  text-transform: uppercase;
}

p, li {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--muted);
  text-wrap: pretty;
}
p + p { margin-top: 1.1rem; }
p b, li b { color: var(--ink); font-weight: 400; }
p i, li i { color: var(--ink); }
ul { padding-left: 1.3rem; margin-top: .8rem; }
li + li { margin-top: .5rem; }

.rule {
  width: 72px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  margin: 2.2rem auto;
}
main:not(.center) .rule { margin-left: 0; }

.line {
  font-size: 1.14rem;
  line-height: 1.7;
  color: var(--muted);
  font-style: italic;
}
.line b { color: var(--ink); font-style: normal; font-weight: 400; }

.lede {
  font-size: 1.22rem;
  line-height: 1.7;
  color: var(--ink);
  font-style: italic;
  margin-top: 2.2rem;
}

.pipeline {
  margin: 1.6rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .82rem;
  line-height: 2;
  color: var(--muted);
  overflow-x: auto;
  white-space: nowrap;
}
.pipeline b { color: var(--accent); font-weight: 400; }

.cta {
  display: inline-block;
  margin-top: 2.6rem;
  padding: .9rem 2rem;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  color: var(--accent);
  font-size: 1.02rem;
  letter-spacing: .04em;
  transition: border-color .2s, background .2s;
}
.cta:hover { border-color: var(--accent); background: oklch(78% 0.14 75 / 0.08); text-decoration: none; }

footer {
  max-width: 680px;
  margin: 5.5rem auto 0;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: oklch(48% 0.02 270);
}
main.center + footer, footer.center { text-align: center; }
footer span { color: var(--accent); }

/* ============================================================
   Teaching pages — curriculum + interactive demo
   ============================================================ */

/* nav wraps gracefully now that there are more links */
nav .links { flex-wrap: wrap; }

/* --- curriculum: staged path --- */
.stage {
  position: relative;
  border-left: 1px solid var(--border);
  padding: .1rem 0 .3rem 1.5rem;
  margin: 2.4rem 0;
}
.stage::before {
  content: "";
  position: absolute;
  left: -4.5px; top: .5rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.stage .step {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); display: block; margin-bottom: .5rem;
}
.stage h3 { font-weight: 400; font-size: 1.28rem; color: var(--ink); margin-bottom: .5rem; }
.stage .drill {
  margin-top: 1rem; padding: .85rem 1.1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; font-size: .98rem; line-height: 1.65; color: var(--muted);
}
.stage .drill b { color: var(--accent); font-weight: 400; }

/* --- tags --- */
.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: .8rem 0 .2rem; }
.tag {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: .22rem .65rem;
}

/* --- interactive demo plot --- */
.demo { margin: 1.8rem 0 1rem; }
.note {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase;
  color: oklch(52% 0.02 270); margin-top: .8rem;
}
.plot {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 1.1rem 1.1rem .8rem;
}
.plot svg { width: 100%; height: auto; display: block; }
.plot .grid line { stroke: var(--border); stroke-width: 1; }
.plot .grid line.centre { stroke: var(--accent-dim); stroke-dasharray: 3 4; }
.plot .axis {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 8px; letter-spacing: .1em; text-transform: uppercase;
  fill: oklch(52% 0.02 270);
}
.plot .ref  { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.plot .take { fill: none; stroke: var(--muted);  stroke-width: 2;   stroke-linecap: round; stroke-linejoin: round; }
.plot .dev  { fill: oklch(78% 0.14 75 / 0.12); stroke: none; }
.plot .playhead { stroke: var(--ink); stroke-width: 1; opacity: .45; }
.plot .marker { fill: var(--accent); }

.controls { display: flex; align-items: center; gap: 1.2rem; margin-top: 1rem; flex-wrap: wrap; }
.legend {
  display: flex; gap: 1.3rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.legend i { display: inline-block; width: 16px; height: 2px; vertical-align: middle; margin-right: .45rem; }
.legend .r { background: var(--accent); }
.legend .t { background: var(--muted); }

.btn {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); background: transparent;
  border: 1px solid var(--accent-dim); border-radius: 999px;
  padding: .55rem 1.2rem; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.btn:hover { border-color: var(--accent); background: oklch(78% 0.14 75 / 0.08); }

/* --- coaching output --- */
.coach { margin-top: 1.3rem; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.coach .obs { padding: .95rem 1.15rem; border-bottom: 1px solid var(--border); transition: opacity .4s; }
.coach .obs:last-child { border-bottom: none; }
.coach .obs.hidden { display: none; }
.coach .k {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .64rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); display: block; margin-bottom: .35rem;
}
.coach .obs p { margin: 0; font-size: 1rem; line-height: 1.6; }
.coach .obs .metric { color: var(--ink); }

/* --- ear-training widget --- */
.ear { margin: 1.6rem 0; }
.ear .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.ear .opt { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .9rem; text-align: center; }
.ear .opt svg { width: 100%; height: auto; }
/* these SVGs sit outside .plot, so they need their own stroke rules —
   without them the paths take the default black fill and render as blobs */
.ear .opt svg .take, .take-card svg .take {
  fill: none; stroke: var(--muted); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.take-card svg .ref {
  fill: none; stroke: var(--accent); stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.ear .opt .lbl {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.ear .choices { display: flex; gap: .8rem; }
.ear .verdict { margin-top: 1rem; font-style: italic; color: var(--muted); min-height: 1.6rem; line-height: 1.6; }
.ear .verdict.right { color: var(--accent); }

/* --- progress over takes --- */
.takes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.4rem 0; }
.take-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .95rem; }
.take-card .wk {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.take-card svg { width: 100%; height: auto; margin: .5rem 0 .3rem; }
.take-card .d { font-size: .82rem; line-height: 1.5; color: var(--muted); }
.take-card .d b { color: var(--ink); font-weight: 400; }
@media (max-width: 560px) {
  .takes { grid-template-columns: 1fr; }
  .ear .pair { grid-template-columns: 1fr; }
}
