.dr-page { width: var(--page); margin: 0 auto; }
.dr-page [hidden] { display: none !important; }
.dr-page.page-columns, .dr-page .page-columns, #dr-explorer.page-columns { display: block !important; }
.dr-page .page-columns > * { grid-column: auto !important; }
.dr-heading { max-width: 820px; margin: 3rem 0 1.5rem; }
.dr-heading .eyebrow { color: var(--gold); margin-bottom: .7rem; }
.dr-heading h1 { color: var(--paper); font-size: clamp(2.2rem, 7vw, 4.6rem); line-height: 1.06; margin: 0 0 1rem; }
.dr-heading h1 em { color: var(--gold); }
.dr-heading > p:last-child { color: var(--soft); font-size: 1.05rem; max-width: 64ch; }
.dr-loading { color: var(--soft); }
.dr-page button { font-family: var(--sans); }
.dr-page button:focus-visible, .dr-page input:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

.dr-panel { position: relative; margin-bottom: 1.5rem; padding: clamp(1.25rem, 3vw, 1.9rem); border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.dr-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; border-radius: var(--radius) var(--radius) 0 0; background: var(--rainbow); }
.dr-panel .eyebrow { margin-bottom: .3rem; }
.dr-panel h2 { margin: 0 0 .5rem; padding: 0; border: 0; color: var(--ink); font-size: clamp(1.7rem, 3vw, 2.3rem); }
.dr-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .8rem 1.5rem; }
.dr-transport { display: flex; flex-wrap: wrap; gap: .5rem; }
.dr-play { padding: .6rem 1.4rem; border: 0; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 1rem; font-weight: 600; cursor: pointer; }
.dr-btn { padding: .55rem 1rem; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: .88rem; cursor: pointer; }
.dr-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.dr-btn[aria-pressed="true"]::before { content: "✓ "; }

/* The three years */
.dr-years { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: 1rem 0; }
.dr-years button { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .7rem 1rem; border: 1.5px solid var(--paper-line); border-radius: 12px; background: #fffaf0; color: var(--ink); text-align: left; cursor: pointer; }
.dr-years strong { font-family: var(--mono); font-size: 1.25rem; }
.dr-years span { color: var(--muted); font-size: .85rem; }
.dr-years button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.dr-years button[aria-pressed="true"] span { color: var(--gold); }

/* The kit and the Fairchild */
.dr-stage { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 1rem; align-items: stretch; padding: .8rem; border-radius: 14px; background: linear-gradient(180deg, #2a2236, #1a1422); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.dr-kit { display: block; width: 100%; height: auto; border-radius: 9px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35); }
.dr-head { fill: url(#dr-g-head); stroke: #b9a98a; stroke-width: .6; }
.dr-drum[data-d="kick"] .dr-head { fill: url(#dr-g-kickhead); stroke: none; }
.dr-kit.has-sweater .dr-drum[data-d="kick"] .dr-head { filter: brightness(.93); }
.dr-hoop { fill: none; stroke: url(#dr-g-chrome); }
.dr-leg { fill: none; stroke: #aeb4bc; stroke-linecap: round; }
.dr-lathe { fill: none; stroke: #5e3a08; stroke-opacity: .28; stroke-width: .55; }
.dr-gleam { fill: none; stroke: url(#dr-g-gleam); stroke-width: 2.2; stroke-linecap: round; opacity: .85; }
.dr-gleam.is-soft { stroke-width: 1.2; opacity: .45; }
.dr-spark { fill: #fffbe8; opacity: 0; }
.dr-ripple { fill: none; stroke: #fff; stroke-width: 2; opacity: 0; }
.dr-cable { fill: none; stroke: #121014; stroke-width: 2; stroke-linecap: round; }
.dr-mic { transition: opacity .3s; }
.dr-mic text { fill: #fdf3dc; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-anchor: middle; paint-order: stroke; stroke: #1a1422; stroke-width: 4px; stroke-linejoin: round; }
.dr-mic text.is-end { text-anchor: end; }

/* the sweater slides out of the port, the towels drop onto the toms */
.dr-towel, .dr-sweater { opacity: 0; transition: opacity .3s, transform .4s cubic-bezier(.3, 1.4, .5, 1); }
.dr-towel { transform: translateY(-10px); }
.dr-sweater { transform-box: view-box; transform-origin: 332px 272px; transform: scale(.4); }
.dr-kit.has-towels .dr-towel, .dr-kit.has-sweater .dr-sweater { opacity: 1; transform: none; }

/* hits: the head gives, a ripple spreads, the cymbals wobble and flash */
.dr-drum, .dr-cym, .dr-head, .dr-ripple { transform-box: fill-box; transform-origin: center; }
.dr-drum.is-hit { animation: dr-bump .2s ease-out; }
.dr-drum.is-hit .dr-head { animation: dr-flex .22s ease-out; }
.dr-drum[data-d="kick"].is-hit .dr-head { animation-name: dr-flex-kick; }
.dr-drum.is-hit .dr-ripple { animation: dr-ripple .35s ease-out; }
.dr-cym.is-hit { animation: dr-wobble 1.1s cubic-bezier(.2, .6, .3, 1); }
.dr-cym[data-d="hat"].is-hit { animation: dr-chick .16s ease-out; }
.dr-cym.is-hit .dr-gleam { animation: dr-gleam .6s ease-out; }
.dr-cym.is-hit .dr-spark { animation: dr-spark .5s ease-out; }
@keyframes dr-bump { 0% { transform: translateY(1.5px); } 100% { transform: none; } }
@keyframes dr-flex { 0% { transform: scale(.96, .72); filter: brightness(1.12); } 60% { transform: scale(1.01, 1.06); } 100% { transform: none; filter: none; } }
@keyframes dr-flex-kick { 0% { transform: scale(.95); filter: brightness(1.1); } 60% { transform: scale(1.012); } 100% { transform: none; filter: none; } }
@keyframes dr-ripple { 0% { transform: scale(.25); opacity: .9; } 100% { transform: scale(1.04); opacity: 0; } }
@keyframes dr-wobble { 0% { transform: rotate(-5deg); filter: brightness(1.35); } 18% { transform: rotate(3.5deg); } 36% { transform: rotate(-2.2deg); filter: brightness(1.08); } 56% { transform: rotate(1.2deg); } 76% { transform: rotate(-.5deg); } 100% { transform: none; filter: none; } }
@keyframes dr-chick { 0% { transform: translateY(2.5px); filter: brightness(1.3); } 100% { transform: none; filter: none; } }
@keyframes dr-gleam { 0% { opacity: 1; stroke-width: 3.4; } 100% { opacity: .85; } }
@keyframes dr-spark { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.6) rotate(45deg); } }
.dr-spark { transform-box: fill-box; transform-origin: center; }

/* the Fairchild 660: a grey rack panel, a lit meter and two big knobs */
.dr-fairchild { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .1rem; padding: 1rem .8rem; border-radius: 10px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px), linear-gradient(180deg, #6b7480, #4a525c 60%, #3f464f);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 0 0 3px #2c2f35, 0 6px 16px rgba(0,0,0,.35); }
.dr-fairchild::before, .dr-fairchild::after { content: ""; position: absolute; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e6e9ed, #7c838c 60%, #3a3f46); box-shadow: inset 0 0 0 1px rgba(0,0,0,.3); }
.dr-fairchild::before { left: 9px; } .dr-fairchild::after { right: 9px; }
.dr-fairchild svg { width: 100%; max-width: 168px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.dr-unit { margin: 0 0 .5rem; color: #f3e9c8; font-family: var(--mono); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 -1px 0 rgba(0,0,0,.5); }
.dr-unit-sub { margin: .45rem 0 0; color: #e2e5e9; font-size: .72rem; text-align: center; }
.dr-dial { fill: none; stroke: #2a2018; stroke-width: 1.4; }
.dr-scale text { fill: #2a2018; font-family: var(--mono); font-size: 10px; font-weight: 600; text-anchor: middle; }
.dr-vu-db { fill: #2a2018; font-family: var(--serif); font-size: 11px; font-style: italic; text-anchor: middle; }
.dr-needle path { fill: none; }
.dr-pivot { fill: #6a5d50; stroke: #1b1714; stroke-width: 1; }
.dr-knobs { display: flex; gap: 1.2rem; margin-top: .7rem; }
.dr-knob { position: relative; display: block; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 38% 30%, #5b5652, #1d1a18 62%, #0c0b0a); box-shadow: 0 0 0 3px #2c2f35, 0 0 0 4px #7d858f, 0 3px 6px rgba(0,0,0,.5); transform: rotate(var(--turn, -120deg)); transition: transform .3s; }
.dr-knob::after { content: ""; position: absolute; left: 50%; top: 3px; width: 2px; height: 11px; margin-left: -1px; border-radius: 1px; background: #f3e9c8; }
.dr-knob + .dr-knob { transform: rotate(30deg); }

@media (prefers-reduced-motion: reduce) {
  .dr-drum.is-hit, .dr-drum.is-hit .dr-head, .dr-drum.is-hit .dr-ripple, .dr-cym.is-hit, .dr-cym.is-hit .dr-gleam, .dr-cym.is-hit .dr-spark { animation: none; }
  .dr-towel, .dr-sweater, .dr-mic, .dr-knob { transition: opacity .2s; }
  .dr-towel, .dr-sweater { transform: none; }
}

/* The desk */
.dr-desk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin-top: 1rem; }
.dr-slider { display: flex; flex-direction: column; gap: .3rem; font-size: .92rem; font-weight: 600; }
.dr-slider output { margin-left: .4rem; color: var(--pink-ink); font-weight: 400; }
.dr-slider input { width: 100%; accent-color: var(--purple); }
.dr-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; font-weight: 400; }
.dr-toggles { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }
.dr-status { margin: 1rem 0 0; padding: .55rem .8rem; border-radius: 8px; background: #fdf0cf; font-size: .88rem; }

/* The pads */
.dr-pads-wrap { margin-top: 1.2rem; }
.dr-pads-title { margin: 0 0 .5rem; font-weight: 600; }
.dr-pads-title small { color: var(--muted); font-weight: 400; }
.dr-pads { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .45rem; }
.dr-pads button { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .8rem .3rem; border: 1.5px solid var(--ink); border-radius: 10px; background: #fffaf0; color: var(--ink); font-size: .82rem; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.dr-pads button:active, .dr-pads button.is-down { background: var(--ink); color: var(--paper); }
.dr-pads kbd { padding: 0 .4rem; border: 1px solid currentColor; border-radius: 4px; font-family: var(--mono); font-size: .72rem; }
.dr-fine { margin: .8rem 0 0; color: var(--muted); font-size: .78rem; }

/* The story */
.dr-story > p:not(.eyebrow) { max-width: 80ch; }
.dr-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 1.2rem; }
.dr-step { padding: 1rem 1.1rem; border: 1px solid var(--paper-line); border-radius: 10px; background: #fffaf0; font-size: .9rem; }
.dr-step h3 { margin: .4rem 0 .3rem; color: var(--ink); font-size: 1.15rem; }
.dr-step p { margin: 0; }
.dr-n { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--ink); color: var(--gold); font-family: var(--mono); font-size: .72rem; }
.dr-story a { color: var(--pink-ink); }
.dr-method { max-width: 90ch; margin: 1.75rem 0; color: var(--soft); font-size: .82rem; }
.dr-method a { color: var(--gold); }
.dr-signoff { margin: 2rem 0; text-align: center; font-family: var(--serif); font-size: 1.2rem; }

@media (max-width: 1000px) { .dr-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .dr-stage { grid-template-columns: minmax(0, 1fr); }
  .dr-fairchild { display: grid; grid-template-columns: auto minmax(0, 150px) auto; justify-content: center; align-items: center; gap: .4rem 1rem; padding: .9rem 1.6rem; }
  .dr-fairchild svg { max-width: 150px; grid-row: 1 / span 2; grid-column: 2; }
  .dr-unit { grid-column: 1; margin: 0; text-align: right; }
  .dr-unit-sub { grid-column: 1; grid-row: 2; margin: 0; text-align: right; align-self: start; }
  .dr-knobs { grid-column: 3; grid-row: 1 / span 2; flex-direction: column; gap: .7rem; margin: 0; }
  .dr-desk { grid-template-columns: minmax(0, 1fr); }
  .dr-pads { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .dr-mic text { font-size: 24px; stroke-width: 6px; }
  .dr-fairchild { grid-template-columns: minmax(0, 1fr) auto; padding: .9rem 1.2rem; }
  .dr-unit, .dr-unit-sub { grid-column: 1 / -1; text-align: center; }
  .dr-unit { grid-row: 1; } .dr-unit-sub { grid-row: 3; }
  .dr-fairchild svg { grid-column: 1; grid-row: 2; justify-self: end; max-width: 170px; width: 100%; }
  .dr-knobs { grid-column: 2; grid-row: 2; }
}
@media (max-width: 560px) { .dr-steps, .dr-years { grid-template-columns: minmax(0, 1fr); } .dr-years button { flex-direction: row; align-items: baseline; gap: .6rem; } }

/* Grab the drawing: the room mic walks in or out, the Fairchild's knob turns */
.dr-mic text.dr-drag { fill: #ffd76a; font-size: 11px; font-weight: 400; opacity: .85; }
.dr-knob.is-grabbing { transition: none; }
@media (max-width: 560px) { .dr-mic text.dr-drag { display: none; } }
