/* ========================================================================
   music-production: handout stylesheet
   Producer-facing reference handouts and tools.

   Aesthetic: retro geek, on paper. A light terminal/printout look: a clean
   white page, dark green-ink body text, a burnt-amber accent, and DM Mono
   carrying all the chrome (status bar, section markers, bracketed labels,
   captions, footer). Reads like a vintage software manual or a dot-matrix
   printout rather than a glowing screen.

   A deliberate departure from the warm cream/rust system in
   csuebmusic/mus381. It shares the same CUSTOM PROPERTY NAMES as 381
   (--bg, --ink, --accent, the meter / gain-reduction / cable families) so
   diagrams, meters, and widgets ported from 381 re-skin themselves with no
   edits to their SVG or inline CSS. Always reference colors by variable
   name; never hardcode hex in a component.
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,400;0,500;1,400&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

:root {
  /* Core surface + ink. White page, near-black ink carrying a faint green
     cast so the type nods to a monochrome-green terminal without costing
     legibility. */
  --bg:        #ffffff;   /* page background */
  --bg-alt:    #f2f3f0;   /* lifted panel: callouts, figures, widgets */
  --ink:       #1b211b;   /* near-black green ink, body text */
  --ink-soft:  #51604c;   /* medium green-grey, secondary text */
  --ink-faint: #7d8a77;   /* light green-grey, captions, footer, grid labels */
  --rule:      #cfd6c9;   /* panel borders, axes, dashed rules */
  --rule-soft: #e4e8df;   /* faint grid lines inside diagrams */

  /* Burnt amber: the one warm accent on the page. Darkened from the screen
     amber so it holds contrast on white for links, labels, and markers. */
  --accent:      #b5651d;
  --accent-soft: #8a4a12;   /* darker amber for emphasis text on white */

  /* Caution panel. */
  --warn-bg:  #fdf1df;
  --warn-ink: #8a4a12;

  /* Level-meter states: the audio-industry green / amber / red convention,
     tuned to read on the light canvas. "good" = below ceiling, "hot" =
     approaching it, "clip" = over. */
  --meter-good: #5c8c4e;
  --meter-hot:  #c08a2e;
  --meter-clip: #a83030;

  /* Gain-reduction gradient endpoints (compressor / dynamics meters):
     amber at low reduction deepening to rust at heavy reduction. */
  --gr-light: #d9b042;
  --gr-heavy: #b5552f;

  /* Cable colors for signal-flow diagrams. Each cable type keeps its own
     hue, distinct from --accent (devices) and from each other. */
  --cable-xlr: #3a6b7a;  /* mic-level, balanced; teal-slate */
  --cable-usb: #525a5e;  /* digital data; neutral graphite */
  --cable-ts:  #a8862e;  /* instrument-level, unbalanced; warm ochre */
  --cable-trs: #6b5e8c;  /* balanced line / stereo; muted plum */

  --serif: 'DM Sans', -apple-system, system-ui, sans-serif;
  --mono:  'DM Mono', 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ----- Layout ---------------------------------------------------------- */

/* The body itself is the centered content column. Constraining the width
   here (rather than element by element) means per-document widgets keep
   their own vertical margins without breaking out of the column
   horizontally, so audio players, tool panels, and figures all stay in
   the measure. */
body {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* ----- Terminal status bar (the old course header) --------------------- */

.handout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
  padding: 0.9rem 0 0.7rem;
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}
.handout-header .course { color: var(--accent); }
.handout-header .course::before { content: "$ "; color: var(--ink-faint); }
/* Blinking block cursor trailing the status line. */
.handout-header .meta::after {
  content: "\2588";
  margin-left: 0.5ch;
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ----- Title block ----------------------------------------------------- */

.title-block { margin-bottom: 2rem; }

.module-tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.module-tag::before { content: "// "; color: var(--ink-faint); }

h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.3rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.subtitle {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ----- Lede ------------------------------------------------------------ */

.lede {
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 1.5rem auto 2rem;
}
.lede strong { color: var(--accent-soft); font-weight: 500; }

/* ----- Body type ------------------------------------------------------- */

p { margin: 1.15rem auto; }

h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.005em;
  margin: 2.8rem auto 1rem;
  color: var(--ink);
}
h2::before {
  content: "\25B8 ";   /* small right triangle, terminal prompt feel */
  color: var(--accent);
}

h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2rem auto 0.8rem;
  color: var(--accent);
}

strong { color: var(--accent-soft); font-weight: 500; }
em { color: var(--ink); font-style: italic; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent-soft); }

ol, ul { margin: 1.15rem auto; padding-left: 1.5rem; }
li { margin: 0.5rem 0; }
li::marker { color: var(--accent); font-family: var(--mono); }

/* Numbered step list: mono leading-zero counters in a boxed chip. */
ol.steps {
  list-style: none;
  counter-reset: step;
  padding-left: 0;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1rem;
  min-height: 1.6rem;
}
ol.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.05rem;
  box-sizing: border-box;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  padding: 0.1em 0.45em;
  border-radius: 2px;
  min-width: 2rem;
  text-align: center;
}

/* ----- Rules ----------------------------------------------------------- */

hr {
  border: none;
  border-top: 1px dashed var(--rule);
  margin: 2.5rem auto;
}
hr.dotted {
  border-top: 1px dotted var(--rule);
  margin: 2rem auto;
}

/* ----- Callout: a bracketed terminal panel ----------------------------- */

.callout {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 1.1rem 1.3rem;
  margin: 1.9rem auto;
}
.callout-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.55rem;
}
.callout-label::before { content: "[ "; }
.callout-label::after  { content: " ]"; }
.callout p { margin: 0.5rem 0; }
.callout p:first-of-type { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ----- Caution panel --------------------------------------------------- */

.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-ink);
  border-left: 3px solid var(--warn-ink);
  color: var(--warn-ink);
  padding: 1.1rem 1.3rem;
  margin: 1.9rem auto;
}
.warn .callout-label,
.warn-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--warn-ink);
  margin-bottom: 0.55rem;
}
.warn .callout-label::before,
.warn-label::before { content: "[ ! "; }
.warn .callout-label::after,
.warn-label::after  { content: " ]"; }
.warn p { margin: 0.5rem 0; }
.warn p:last-child { margin-bottom: 0; }

/* ----- Vocab: terminal definition list --------------------------------- */

dl.vocab {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  padding: 1.3rem 1.4rem;
  margin: 2rem auto;
}
dl.vocab dt {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--accent);
  margin-top: 1.1rem;
  font-size: 0.95rem;
}
dl.vocab dt::before { content: "> "; color: var(--ink-faint); }
dl.vocab dt:first-child { margin-top: 0; }
dl.vocab dd {
  margin: 0.35rem 0 0;
  padding-left: 1.4rem;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.55;
}

/* ----- Figures and diagrams -------------------------------------------- */

figure {
  margin: 2.2rem auto;
  text-align: center;
}
figure svg {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--bg-alt);
}
figcaption {
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-top: 0.75rem;
}

/* ----- Walkthrough videos --------------------------------------------- */
/* Short screen-recording demos embedded inline. The figure caps the
   width so the native-resolution video scales down into the column;
   without this the raw MP4 renders at its encoded pixel width. Use the
   --narrow modifier for the smaller annotation-alongside demos. */

figure.vocab-video {
  margin: 0.75rem auto 1.25rem;
  max-width: 100%;
}
figure.vocab-video.vocab-video--narrow {
  max-width: 480px;
}
figure.vocab-video video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
}
figure.vocab-video figcaption {
  color: var(--ink-faint);
  margin-top: 0.6rem;
  line-height: 1.5;
}

/* Speed-control row beneath a walkthrough video: slowing playback makes
   the edit easier to see. */
.vocab-video-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.vocab-video-controls .speed-label {
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.25rem;
}
.vocab-video-controls .speed-btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.vocab-video-controls .speed-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.vocab-video-controls .speed-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ----- Signal-flow / form diagrams ------------------------------------- */
figure.form-diagram {
  margin: 1.75rem auto;
  text-align: center;
}
figure.form-diagram figcaption {
  color: var(--ink-faint);
  margin-top: 0.75rem;
  text-align: center;
  line-height: 1.5;
}

/* ----- Code ------------------------------------------------------------ */

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent-soft);
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.05em 0.35em;
}
pre {
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1.8rem auto;
}
pre code { border: none; background: none; padding: 0; color: inherit; }

kbd {
  font-family: var(--mono);
  display: inline-block;
  padding: 0.1em 0.5em;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 0.82em;
  color: var(--ink);
  white-space: nowrap;
}

/* Menu breadcrumb token, e.g. Effect -> EQ and Filters -> Filter Curve EQ */
.menu-path {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 0.2em 0.55em;
  border-radius: 0;
  color: var(--ink);
  white-space: nowrap;
}

/* ----- Tables ---------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem auto;
  font-size: 0.96rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
th {
  font-family: var(--mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  font-weight: 500;
  border-bottom: 1px solid var(--rule);
}

/* ----- Audio players --------------------------------------------------- */

audio { width: 100%; }

.audio-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 1rem auto 0;
  line-height: 1.5;
}

/* ----- Footer: end-of-file marker -------------------------------------- */

.handout-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
  margin-top: 3.5rem;
}
.handout-footer span:first-child::before { content: "// "; }

/* ----- Selection ------------------------------------------------------- */

::selection { background: var(--accent); color: var(--bg); }

/* ----- Responsive ------------------------------------------------------ */

@media (max-width: 600px) {
  html, body { font-size: 16px; }
  h1 { font-size: 1.9rem; }
  body { padding: 2rem 1.1rem 4rem; }
}
