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

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


/* Sources and presets */
.ec-sourcebar { margin-top: 1rem; }
.ec-sources { display: flex; flex-wrap: wrap; gap: .45rem; }
.ec-sources button, .ec-speed button { padding: .5rem .95rem; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: .88rem; cursor: pointer; }
.ec-sources button[aria-pressed="true"], .ec-speed button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ec-sources button:disabled { opacity: .45; cursor: not-allowed; }
.ec-sources .ec-rec { border-color: #a3202f; background: #a3202f; color: #fff; font-weight: 600; }
.ec-sources .ec-rec.is-recording { background: var(--ink); border-color: var(--ink); }
/* the microphone's level while a take is being recorded */
.ec-level { height: 8px; max-width: 320px; margin: .5rem 0 0; border-radius: 999px; background: #e6dcc8; overflow: hidden; }
.ec-level i { display: block; width: 0; height: 100%; background: #a3202f; transition: width .08s linear; }
.ec-src-status { margin: .5rem 0 0; color: var(--muted); font-size: .8rem; }
.ec-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: 1rem 0; }
.ec-presets button { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; padding: .7rem .9rem; border: 1.5px solid var(--paper-line); border-radius: 12px; background: #fffaf0; color: var(--ink); text-align: left; cursor: pointer; }
.ec-presets strong { font-family: var(--mono); font-size: .95rem; }
.ec-presets span { color: var(--muted); font-size: .8rem; }
.ec-presets button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.ec-presets button[aria-pressed="true"] span { color: var(--gold); }

/* The map: desk, tape machine and a cutaway of the tiled chamber */
.ec-stage { padding: .8rem; border-radius: 12px; background: radial-gradient(ellipse at 60% 20%, #3a2d46, #1a1422 75%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 10px 30px rgba(0,0,0,.35); }
.ec-map { display: block; width: 100%; height: auto; }
.ec-lbl { font-family: var(--mono); font-size: 11px; text-anchor: middle; fill: #f3e9c8; }
.ec-lbl-room { font-size: 13px; font-weight: 600; fill: #5a4a3a; letter-spacing: .02em; }
.ec-lbl-room .ec-lbl-minor { font-weight: 400; }
.ec-lbl-dark { fill: #6b5a48; }
.ec-lbl-start { text-anchor: start; }
.ec-lbl-tape { font-size: 11px; fill: #3d2614; font-weight: 600; letter-spacing: .06em; }
.ec-lbl-desk { font-size: 12px; fill: #3d2614; font-weight: 600; letter-spacing: .12em; }

/* the room */
.ec-ceiling { fill: #e4dccb; }
.ec-sidewall { fill: #e6dfcd; }
.ec-sidewall-r { fill: #ddd4c0; }
.ec-floor { fill: #cfc5b0; }
.ec-grout { fill: none; stroke: #b3a88f; stroke-width: 1; }
.ec-floorgrout { stroke: #a69a80; }
.ec-sideglaze { fill: #fff; opacity: .45; }
.ec-edge { fill: none; stroke: #a89d86; stroke-width: 1.5; }
.ec-cut { fill: url(#ec-hatch); stroke: #1f1830; stroke-width: 1.5; transition: stroke .3s, filter .3s; }
.ec-room.is-on ~ .ec-cut { stroke: #f2c14e; stroke-width: 2.5; filter: drop-shadow(0 0 5px rgba(242,193,78,.6)); }
.ec-shadow { fill: #3a2a3e; opacity: .22; }

/* loudspeaker */
.ec-cab { fill: url(#ec-wood); stroke: #3d2614; stroke-width: 1.5; }
.ec-baffle { fill: #3a2c22; }
.ec-surround { fill: #1a1512; stroke: #8e6338; stroke-width: 1.2; }
.ec-dustcap { fill: #2a2420; stroke: #9c9086; stroke-width: .8; }
.ec-foot { fill: #2a180b; }
.ec-conegroup { transform-box: fill-box; transform-origin: center; }
.ec-conegroup.is-thump { animation: ec-thump .22s ease-out; }
@keyframes ec-thump { 40% { transform: scale(1.12); } }

/* singer */
.ec-singer circle, .ec-singer path { fill: #6b2fa0; }
.ec-singer .ec-shadow { fill: #3a2a3e; }
.ec-singer .ec-arm { fill: none; stroke: #6b2fa0; stroke-width: 7; stroke-linecap: round; }
.ec-speaker, .ec-singer { transition: opacity .25s; }
.ec-speaker.is-off, .ec-singer.is-off { opacity: 0; }

/* microphones */
.ec-stand { fill: none; stroke: #3b3740; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ec-micbody { fill: #b9bec6; stroke: #2b2731; stroke-width: 1.5; }
.ec-grille { fill: none; stroke: #4b4f57; stroke-width: 1; }
.ec-micpair { transition: transform .25s ease-out; }
.ec-miccable { fill: none; stroke: #2b2731; stroke-width: 2; stroke-linecap: round; opacity: .8; }
.ec-plate { fill: #8a8f99; stroke: #2b2731; stroke-width: 1.2; }

/* tape machine */
.ec-tapecab { fill: url(#ec-metal); stroke: #5a4d3a; stroke-width: 2; transition: stroke .3s, filter .3s; }
.ec-tapebox.is-on .ec-tapecab { stroke: #f2c14e; filter: drop-shadow(0 0 6px rgba(242,193,78,.55)); }
.ec-tapedeck { fill: #4a4150; stroke: #2b2331; stroke-width: 1; }
.ec-flange { fill: #8f97a3; fill-opacity: .55; stroke: #d7dbe0; stroke-width: 1.5; }
.ec-pack { fill: #6b4524; stroke: #3d2614; stroke-width: 1; }
.ec-spokes { stroke: #d7dbe0; stroke-width: 3; stroke-linecap: round; }
.ec-hub { fill: #e8e1d1; stroke: #5a4d3a; stroke-width: 1.2; }
.ec-window { fill: #2b2331; stroke: #d7dbe0; stroke-width: 1; }
.ec-reel { transform-box: fill-box; transform-origin: center; }
.ec-map.is-playing .ec-tapebox.is-on .ec-reel { animation: ec-spin 1.6s linear infinite; }
.ec-map.is-playing .ec-tapebox.is-on.is-slow .ec-reel { animation-duration: 3.2s; }
@keyframes ec-spin { to { transform: rotate(360deg); } }
.ec-tapepath { fill: none; stroke: #8a5a2e; stroke-width: 2.2; }
.ec-guide { fill: #d7dbe0; stroke: #2b2331; stroke-width: 1; }
.ec-pinch { fill: #222; stroke: #8f97a3; stroke-width: 1; }
.ec-headblock { fill: #8f97a3; stroke: #2b2331; stroke-width: 1; }
.ec-head { fill: #2b2731; }
.ec-tapebox.is-on .ec-head-rec, .ec-tapebox.is-on .ec-head-play { fill: #f2c14e; }

/* desk */
.ec-desktop { fill: url(#ec-deskface); stroke: #2b2731; stroke-width: 1.5; }
.ec-bridge { fill: #3d2614; }
.ec-vuscale { fill: none; stroke: #5a381d; stroke-width: 1; }
.ec-vured { fill: none; stroke: #c23b4b; stroke-width: 2; }
.ec-needle { stroke: #1f1830; stroke-width: 1.3; stroke-linecap: round; transition: transform .08s linear; }
.ec-knobs circle { fill: #2b2731; stroke: #c9ced6; stroke-width: 1; }
.ec-knobs .ec-knob-red { fill: #8a1f2c; }
.ec-slots { stroke: #1f1830; stroke-width: 2.4; stroke-linecap: round; }
.ec-caps rect { fill: #e8e1d1; stroke: #1f1830; stroke-width: 1; }
.ec-caps .ec-cap-send { fill: #f2c14e; }
.ec-caps .ec-cap-tape { fill: #c96ad8; }
.ec-caps .ec-cap-send, .ec-caps .ec-cap-tape { transition: transform .2s; }
.ec-nameplate { fill: #f3e9c8; stroke: #3d2614; stroke-width: 1; }

/* cables and sound pulses */
.ec-wire { fill: none; stroke: #120d18; stroke-width: 6; opacity: .7; stroke-linecap: round; stroke-linejoin: round; marker-end: url(#ec-arrow); transition: stroke .25s, filter .25s; }
.ec-wire.is-on { opacity: 1; stroke: #f2c14e; marker-end: url(#ec-arrow-on); filter: drop-shadow(0 0 4px rgba(242,193,78,.75)); }
.ec-pulse { fill: none; stroke: #fff8e0; stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 0 14; opacity: 0; pointer-events: none; }
.ec-map.is-playing .ec-wire.is-on + .ec-pulse { opacity: 1; animation: ec-flow .7s linear infinite; }
@keyframes ec-flow { to { stroke-dashoffset: -14; } }

/* sound in the room: a wavefront from the loudspeaker and its reflections off the four walls */
.ec-wave { fill: none; stroke: #6b2fa0; stroke-width: 3; vector-effect: non-scaling-stroke; opacity: 0; transform-box: fill-box; transform-origin: center; animation: ec-wave 1.6s linear forwards; }
.ec-wave.is-echo { stroke: #a774d1; stroke-width: 2; animation-name: ec-echo; }
@keyframes ec-wave { 0% { transform: scale(.04); opacity: .9; } 65% { opacity: .55; } 100% { transform: scale(1); opacity: 0; } }
@keyframes ec-echo { 0% { transform: scale(.04); opacity: .6; } 65% { opacity: .4; } 100% { transform: scale(1); opacity: 0; } }
.ec-still { display: none; }
.ec-still path { fill: none; stroke: #6b2fa0; stroke-width: 3; stroke-linecap: round; opacity: .55; }

@media (prefers-reduced-motion: reduce) {
  .ec-map.is-playing .ec-tapebox.is-on .ec-reel, .ec-map.is-playing .ec-wire.is-on + .ec-pulse, .ec-wave, .ec-conegroup.is-thump { animation: none; }
  .ec-micpair, .ec-needle, .ec-caps rect { transition: none; }
  .ec-map.is-playing .ec-room.is-on .ec-still { display: inline; }
}
@media (max-width: 560px) {
  .ec-stage { margin: 0 -.6rem; padding: .35rem; }
  .ec-lbl-minor { display: none; }
  .ec-lbl-room { font-size: 24px; }
  .ec-lbl-tape { font-size: 17px; letter-spacing: 0; }
  .ec-lbl-desk { font-size: 17px; letter-spacing: .04em; }
}

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

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

@media (max-width: 1000px) { .ec-steps, .ec-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ec-desk { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .ec-steps, .ec-presets { grid-template-columns: minmax(0, 1fr); } }

/* Grab the drawing: the microphones slide down the room, the two coloured faders slide up and down */
.ec-mic-hit, .ec-caps .ec-fd-hit { fill: transparent; stroke: none; }
.ec-micpair.is-grabbing, .ec-caps .is-grabbing rect { transition: none; }
.ec-drag { fill: #6b2fa0; }
