/*
 * TAPES · the VVV-5 Stereo Cassette Deck + its J-card.
 * Everything is prefixed tape- and scoped to the tapes mount.
 */

.tape-root {
  --tape-ink: var(--ink);
  --tape-rust-ink: var(--rust-ink); /* rust for small text on paper */
  /* floor for small-but-meaningful labels: ~11.5px desktop, 12px phones */
  --tape-fs-label: 0.72rem;
  --tape-champ-1: #efe4c9;
  --tape-champ-2: #d9caa6;
  --tape-champ-3: #c4b18a;
  --tape-bezel: #18111b;
  --tape-amber: #ffc25a;
  position: relative;
}

/* =========================================================
   Banner: "The band's own recordings are on the way"
   ========================================================= */
.tape-banner {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.6rem;
  width: fit-content;
  max-width: calc(100% - 12px);
  margin: 0 0 -0.55rem clamp(6px, 4%, 56px);
  padding: 0.7rem 1.4rem 0.75rem;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  line-height: 1.2;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 8%, transparent 92%, rgba(0, 0, 0, 0.06)),
    #ecdcb0;
  transform: rotate(-1.6deg);
  box-shadow: 0 10px 18px -10px rgba(0, 0, 0, 0.7);
  /* torn masking-tape ends */
  clip-path: polygon(
    0 6%, 2% 0, 4% 9%, 6% 1%, 94% 0, 96% 8%, 98% 0, 100% 7%, 99% 30%, 100% 52%, 98.5% 75%, 100% 100%,
    97% 93%, 95% 100%, 93% 92%, 6% 100%, 4% 92%, 2% 100%, 0 94%, 1% 70%, 0 48%, 1.2% 26%
  );
}
.tape-banner__sub {
  font-family: var(--font-script);
  font-size: 1.15em;
  font-weight: 700;
  color: var(--tape-rust-ink);
}

/* =========================================================
   Layout
   ========================================================= */
.tape-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.25rem, 5vw, 3.5rem);
  align-items: start;
}

/* =========================================================
   The deck housing: walnut sides, champagne faceplate
   ========================================================= */
.tape-deck {
  --tape-wood-w: clamp(9px, 2.3vw, 30px);
  position: relative;
  display: grid;
  grid-template-columns: var(--tape-wood-w) minmax(0, 1fr) var(--tape-wood-w);
  min-width: 0;
  border-radius: 16px;
  box-shadow:
    0 2px 0 rgba(255, 240, 194, 0.12) inset,
    9px 9px 0 var(--orange),
    18px 18px 0 var(--rust),
    0 40px 70px -26px rgba(0, 0, 0, 0.9);
  margin-right: 18px;
  margin-bottom: 18px;
}
.tape-wood {
  position: relative;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='520'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.22 0.0045' numOctaves='3' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.05 0 0 0 0 0.02 2.2 0 0 0 -0.82'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E"),
    linear-gradient(90deg, var(--wood-dark), var(--wood) 26%, #8a4c27 54%, var(--wood) 78%, var(--wood-dark));
  background-size: 80px 520px, auto;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 210, 160, 0.18);
}
.tape-wood--l {
  border-radius: 16px 0 0 16px;
}
.tape-wood--r {
  border-radius: 0 16px 16px 0;
}
.tape-face {
  --focus: var(--ink); /* champagne faceplate: dark ring */
  min-width: 0;
  container: tape-face / inline-size;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.09) 0 1px, rgba(0, 0, 0, 0.035) 1px 2px, transparent 2px 3px),
    repeating-linear-gradient(0deg, transparent 0 11px, rgba(0, 0, 0, 0.03) 11px 12px, transparent 12px 27px),
    linear-gradient(100deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.32) 42%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, var(--tape-champ-1), var(--tape-champ-2) 55%, var(--tape-champ-3));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -3px 0 rgba(0, 0, 0, 0.25),
    inset 2px 0 0 rgba(0, 0, 0, 0.25),
    inset -2px 0 0 rgba(0, 0, 0, 0.25);
}
.tape-panel {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "brand"
    "well"
    "meters"
    "readout"
    "error"
    "seek"
    "keys";
  padding: 12px 8px 14px;
}
@container tape-face (min-width: 420px) {
  .tape-panel {
    gap: 16px;
    padding: 16px 16px 18px;
  }
}
@container tape-face (min-width: 560px) {
  .tape-panel {
    column-gap: 16px;
    row-gap: 16px;
    padding: 18px 20px 22px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.95fr);
    grid-template-areas:
      "brand  brand  brand"
      "well   well   well"
      "meters meters readout"
      "error  error  error"
      "seek   seek   seek"
      "keys   keys   keys";
  }
}
@container tape-face (min-width: 800px) {
  .tape-panel {
    column-gap: 24px;
    row-gap: 18px;
    padding: 22px 28px 26px;
    grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
    grid-template-areas:
      "brand  brand"
      "well   meters"
      "seek   seek"
      "keys   readout"
      "error  error";
  }
  .tape-panel .tape-well {
    align-self: stretch;
    display: grid;
    align-content: center;
    padding-inline: 7%;
  }
  .tape-readout {
    align-items: stretch;
  }
  .tape-readout .tape-counter {
    justify-content: center;
  }
}

/* ---------- brand strip ---------- */
.tape-brand {
  grid-area: brand;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(30, 20, 36, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.tape-brand__logo {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 900;
  font-size: clamp(1.5rem, 4.6cqw, 2.1rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--mustard), 4px 4px 0 var(--orange), 6px 6px 0 var(--rust);
  padding: 0 6px 4px 0;
}
.tape-brand__model {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--tape-fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.3;
  min-width: 0;
}
.tape-brand__v5 {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 4px;
  color: var(--cream);
  background: var(--ink);
  border-radius: 3px;
}
.tape-lamps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.tape-lamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1.5px solid rgba(30, 20, 36, 0.6);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}
.tape-lamp::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5b3a2c;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6);
  transition: background-color 0.25s, box-shadow 0.25s;
}
.tape-lamp.is-on::before {
  background: #ffb347;
  box-shadow: 0 0 0 2px rgba(255, 179, 71, 0.25), 0 0 10px 2px rgba(255, 160, 60, 0.85);
}
.tape-lamp--nr.is-on::before {
  background: #7fe0d2;
  box-shadow: 0 0 0 2px rgba(63, 184, 168, 0.25), 0 0 10px 2px rgba(63, 184, 168, 0.8);
}

/* ---------- cassette well ---------- */
.tape-well {
  grid-area: well;
  position: relative;
  align-self: start;
  padding: 4.5% 6% 6.5%;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(120% 90% at 50% 0%, #2a1f2b, #120c13 70%),
    #120c13;
  box-shadow:
    inset 0 0 0 3px #0a070b,
    inset 0 10px 24px rgba(0, 0, 0, 0.75),
    0 1px 0 rgba(255, 255, 255, 0.55),
    0 -1px 0 rgba(0, 0, 0, 0.25);
}
.tape-well::before {
  /* the door's chrome frame */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 2px solid rgba(255, 240, 194, 0.12);
  pointer-events: none;
  z-index: 2;
}
.tape-well__glass {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.13) 0 14%, rgba(255, 255, 255, 0) 14.2% 52%, rgba(255, 255, 255, 0.06) 52.2% 60%, rgba(255, 255, 255, 0) 60.2%),
    linear-gradient(180deg, rgba(120, 60, 120, 0.12), rgba(0, 0, 0, 0.18));
  mix-blend-mode: screen;
}
.tape-well__tag {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 2.2%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(246, 230, 196, 0.55);
  white-space: nowrap;
}
.tape-cassette {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1000 / 640;
  container: tape-cassette / inline-size;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6));
}
.tape-cassette.tape-is-swapping {
  animation: tape-swap 0.76s var(--ease-out);
}
@keyframes tape-swap {
  0% { transform: translateY(0); }
  30% { transform: translateY(-118%) rotate(-2.5deg); }
  36% { transform: translateY(-118%) rotate(1.5deg); }
  72% { transform: translateY(3%) rotate(0); }
  84% { transform: translateY(-1.6%); }
  100% { transform: translateY(0); }
}
.tape-shell {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.tape-shell__edge {
  fill: none;
  stroke: rgba(0, 0, 0, 0.45);
  stroke-width: 2;
}
.tape-shell__grip rect {
  fill: rgba(0, 0, 0, 0.35);
}
.tape-shell__label {
  fill: var(--cream);
  stroke: rgba(0, 0, 0, 0.18);
  stroke-width: 2;
}
.tape-shell__rule {
  stroke: var(--rust);
  stroke-opacity: 0.45;
  stroke-width: 2.5;
}
.tape-shell__small {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: var(--tape-rust-ink);
}
.tape-shell__well {
  fill: #160d10;
}
.tape-shell__path {
  stroke: #6e3d23;
  stroke-width: 6;
  opacity: 0.5;
}
.tape-hub__ring {
  fill: #efe3c8;
}
.tape-hub__lip {
  fill: none;
  stroke: #c7b089;
  stroke-width: 3;
}
.tape-hub__slots circle {
  fill: #1a1013;
}
.tape-hub__hole {
  fill: #120a0d;
}
.tape-hub__teeth rect {
  fill: #efe3c8;
}
.tape-hub__mark {
  fill: var(--orange);
}
.tape-shell__ticks rect {
  fill: rgba(246, 230, 196, 0.35);
}
.tape-shell__frame {
  fill: none;
  stroke: #1e1424;
  stroke-width: 7;
}
.tape-shell__sidering {
  fill: var(--ink);
}
.tape-shell__side {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 900;
  font-size: 52px;
  fill: var(--mustard);
}
.tape-shell__nr {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.1em;
  fill: var(--ink);
}
.tape-shell__nr--sub {
  font-size: 17px;
  fill: var(--tape-rust-ink);
}
.tape-shell__head {
  fill: #2c1f28;
  stroke: rgba(0, 0, 0, 0.4);
  stroke-width: 2;
}
.tape-shell__holes > * {
  fill: #0b0708;
}
.tape-shell__tape {
  fill: #6e3d23;
}
.tape-shell__screw circle {
  fill: #8d8173;
  stroke: #2b2027;
  stroke-width: 3;
}
.tape-shell__screw path {
  stroke: #2b2027;
  stroke-width: 3.5;
  stroke-linecap: round;
}

/* label writing (HTML so long titles can wrap) */
.tape-label {
  position: absolute;
  left: 9.6%;
  right: 9.6%;
  top: 15.4%;
  height: 10.6%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.tape-label__title {
  display: block;
  max-width: 100%;
  font-family: var(--font-hand);
  font-size: var(--tape-title, 6cqw);
  line-height: 1.02;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: rotate(-1.2deg);
  padding-bottom: 0.04em;
}
.tape-label__title.is-two {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 0.98;
}
.tape-label__stamp {
  position: absolute;
  right: 4.5%;
  top: 30.5%;
  padding: 0.12em 0.5em 0.08em;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.9cqw;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tape-rust-ink);
  background: rgba(246, 230, 196, 0.92);
  border: 0.45cqw solid currentColor;
  border-radius: 0.8cqw;
  transform: rotate(-7deg);
  pointer-events: none;
}

/* ---------- VU meters ---------- */
.tape-meters {
  grid-area: meters;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}
@container tape-face (min-width: 800px) {
  .tape-meters {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}
.tape-vu {
  position: relative;
  padding: 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a1e28, var(--tape-bezel));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.6),
    0 -1px 0 rgba(0, 0, 0, 0.25);
}
.tape-vu::after {
  /* glass */
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 9px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.28) 0 18%, rgba(255, 255, 255, 0) 18.5%);
  pointer-events: none;
}
.tape-vu__svg {
  display: block;
  width: 100%;
  height: auto;
}
.tape-vu__face {
  fill: #ead8b0;
}
.tape-vu__lamp {
  opacity: 0.35;
  transition: opacity 0.9s ease;
}
.tape-is-playing .tape-vu__lamp {
  opacity: 1;
}
.tape-vu__arc {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}
.tape-vu__red {
  fill: none;
  stroke: var(--rust);
  stroke-width: 9;
}
.tape-vu__ticks line {
  stroke: var(--ink);
  stroke-width: 2.4;
}
.tape-vu__ticks line.is-red {
  stroke: var(--rust);
}
.tape-vu__nums text,
.tape-vu__sign {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  fill: var(--ink);
}
.tape-vu__nums text.is-red,
.tape-vu__sign.is-red {
  fill: #b23a1f;
}
.tape-vu__sign {
  font-size: 22px;
}
.tape-vu__vu {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 900;
  font-size: 30px;
  fill: var(--ink-soft);
}
.tape-vu__needle {
  stroke: #1a0f14;
  stroke-width: 2.6;
  stroke-linecap: round;
}
.tape-vu__cover {
  fill: var(--tape-bezel);
}
.tape-vu__ch {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 900;
  font-size: 17px;
  fill: var(--mustard);
}
.tape-vu__brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2em;
  fill: rgba(246, 230, 196, 0.55);
}
.tape-vu__peak {
  fill: #5a2a22;
  stroke: rgba(0, 0, 0, 0.5);
  stroke-width: 1.5;
  transition: fill 0.12s;
}
.tape-vu__peak.is-on {
  fill: #ff5a36;
  filter: drop-shadow(0 0 4px #ff5a36);
}

/* ---------- counter + display ---------- */
.tape-readout {
  grid-area: readout;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}
@container tape-face (min-width: 560px) and (max-width: 799px) {
  .tape-readout {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
  }
  .tape-readout .tape-counter {
    align-self: flex-start;
  }
  .tape-readout .tape-display {
    flex: none;
    padding-block: 10px 11px;
  }
}
.tape-counter {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.tape-counter__win {
  display: inline-flex;
  gap: 3px;
  padding: 5px;
  background: var(--tape-bezel);
  border-radius: 7px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.6);
}
.tape-digit {
  position: relative;
  display: block;
  width: 1.45rem;
  height: 1.9rem;
  overflow: hidden;
  border-radius: 3px;
  background: #f3e6c8;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.9rem;
  text-align: center;
  color: var(--ink);
}
.tape-digit:last-child {
  background: #fbe3c4;
  color: var(--tape-rust-ink);
}
.tape-digit::after {
  /* the drum curves away top and bottom */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0) 68%, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.tape-digit__strip {
  display: block;
  will-change: transform;
}
.tape-digit__strip > span {
  display: block;
  height: 1.9rem;
}
.tape-counter__cap,
.tape-seek__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.62rem; /* "Counter" is decorative (aria-hidden) */
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}
.tape-seek__label {
  font-size: var(--tape-fs-label);
  letter-spacing: 0.18em;
}
.tape-display {
  flex: 1 1 8rem;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 12px 7px;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    #1d1210;
  border-radius: 7px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.6);
}
.tape-time {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--tape-amber);
  text-shadow: 0 0 8px rgba(255, 170, 60, 0.55);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tape-time__sep {
  opacity: 0.5;
}
.tape-status {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--tape-fs-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 194, 90, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tape-deck[data-status="play"] .tape-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #7fe0d2;
  box-shadow: 0 0 8px #7fe0d2;
  vertical-align: 1px;
}
.tape-deck[data-status="error"] .tape-status {
  color: #ff8a5c;
}

/* ---------- error note (masking tape stuck to the deck) ---------- */
.tape-error {
  grid-area: error;
  justify-self: start;
  display: grid;
  gap: 2px;
  max-width: 100%;
  padding: 8px 14px 9px;
  color: var(--ink);
  background: #f3e3b6;
  border-left: 6px solid var(--rust);
  transform: rotate(-0.8deg);
  box-shadow: 0 6px 12px -6px rgba(0, 0, 0, 0.6);
}
.tape-error__msg {
  font-family: var(--font-hand);
  font-size: 1rem;
  line-height: 1.25;
}

/* ---------- seek: tape position meter ---------- */
.tape-seek {
  grid-area: seek;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.tape-seek__track {
  position: relative;
}
.tape-seek__scale {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 7px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.tape-seek__scale i {
  width: 2px;
  height: 100%;
  background: rgba(30, 20, 36, 0.55);
}
.tape-seek__scale i:nth-child(odd) {
  height: 140%;
  margin-top: -2px;
}
.tape-seek__input {
  --tape-p: 0%;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.tape-seek__input:disabled {
  cursor: default;
}
.tape-seek__input::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: 7px;
  background:
    linear-gradient(180deg, var(--mustard) 0 25%, var(--orange) 25% 50%, var(--rust) 50% 75%, var(--brown) 75%) 0 0 / var(--tape-p) 100% no-repeat,
    linear-gradient(180deg, #120b0e, #2a1c22);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.65);
}
.tape-seek__input::-moz-range-track {
  height: 14px;
  border-radius: 7px;
  background:
    linear-gradient(180deg, var(--mustard) 0 25%, var(--orange) 25% 50%, var(--rust) 50% 75%, var(--brown) 75%) 0 0 / var(--tape-p) 100% no-repeat,
    linear-gradient(180deg, #120b0e, #2a1c22);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.65);
}
.tape-seek__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 34px;
  margin-top: -10px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background:
    linear-gradient(90deg, transparent 45%, var(--ink) 45% 55%, transparent 55%),
    linear-gradient(180deg, #fbf3df, #d9c69c);
  box-shadow: 0 3px 0 rgba(30, 20, 36, 0.55);
  transition: transform 0.15s var(--ease-bounce);
}
.tape-seek__input::-moz-range-thumb {
  width: 18px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background:
    linear-gradient(90deg, transparent 45%, var(--ink) 45% 55%, transparent 55%),
    linear-gradient(180deg, #fbf3df, #d9c69c);
  box-shadow: 0 3px 0 rgba(30, 20, 36, 0.55);
}
@media (hover: hover) {
  .tape-seek__input:hover:not(:disabled)::-webkit-slider-thumb {
    transform: scale(1.08);
  }
}
.tape-seek__input:disabled::-webkit-slider-thumb {
  background: linear-gradient(180deg, #e6dccb, #c8bba3);
  border-color: rgba(30, 20, 36, 0.5);
}
.tape-seek__input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- piano keys ---------- */
.tape-keys {
  --focus: var(--mustard); /* dark key tray: mustard ring */
  grid-area: keys;
  display: flex;
  gap: 6px;
  padding: 8px 8px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #120b10, #24171f);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.6);
}
@container tape-face (min-width: 420px) {
  .tape-keys {
    gap: 8px;
    padding: 10px 12px 16px;
  }
}
.tape-key {
  position: relative;
  flex: 1 1 0;
  min-width: 44px;
  min-height: 62px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.tape-key:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.tape-key__cap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  min-height: 56px;
  border-radius: 5px 5px 9px 9px;
  background: linear-gradient(180deg, #fbf3df 0%, #efe0bc 70%, #e2cfa4 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    0 6px 0 #a88f63,
    0 7px 0 #2a1c22,
    0 12px 14px -4px rgba(0, 0, 0, 0.7);
  transform: translateY(0);
  transition: transform 0.12s var(--ease-out), box-shadow 0.12s var(--ease-out), background-color 0.2s;
}
/* hover: the key sinks a little and lights up, inviting a press
   (mouse only, so a tapped key doesn't stay half-down on a phone) */
@media (hover: hover) {
  .tape-key:hover {
    color: var(--rust-ink);
  }
  .tape-key:hover .tape-key__cap {
    transform: translateY(2px);
    background: linear-gradient(180deg, #fffaf0 0%, #f6e6c4 70%, #e8d6ad 100%);
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.9),
      0 4px 0 #a88f63,
      0 5px 0 #2a1c22,
      0 8px 10px -4px rgba(0, 0, 0, 0.65),
      0 0 0 2px rgba(244, 179, 60, 0.55);
  }
  .tape-key--play:hover .tape-key__cap {
    background: linear-gradient(180deg, #ffe3a3 0%, #f8c254 70%, #e8a730 100%);
  }
}
.tape-key:active .tape-key__cap,
.tape-key[aria-pressed="true"] .tape-key__cap {
  transform: translateY(5px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 1px 0 #a88f63,
    0 2px 0 #2a1c22,
    0 4px 6px -2px rgba(0, 0, 0, 0.6);
}
.tape-key.is-thunk .tape-key__cap {
  animation: tape-thunk 0.26s var(--ease-bounce);
}
@keyframes tape-thunk {
  0% { transform: translateY(5px); }
  60% { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}
.tape-key[aria-pressed="true"].is-thunk .tape-key__cap {
  animation: none;
}
.tape-key .tape-ico {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.tape-key__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--tape-fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}
.tape-key--play .tape-key__cap {
  background: linear-gradient(180deg, #ffd27a 0%, var(--mustard) 70%, #e09a22 100%);
}
.tape-key--rec {
  color: var(--rust-ink);
}
.tape-key--rec .tape-ico {
  width: 16px;
  height: 16px;
}
/* latch lamp on the play + pause keys */
.tape-key--play .tape-key__cap::before,
.tape-key--pause .tape-key__cap::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(30, 20, 36, 0.25);
  transition: background-color 0.2s, box-shadow 0.2s;
}
.tape-key--play[aria-pressed="true"] .tape-key__cap::before {
  background: #1f8f7f;
  box-shadow: 0 0 8px 1px rgba(63, 184, 168, 0.9);
}
.tape-key--pause[aria-pressed="true"] .tape-key__cap::before {
  background: var(--rust);
  box-shadow: 0 0 8px 1px rgba(236, 122, 44, 0.9);
}
.tape-key[aria-disabled="true"] .tape-key__cap {
  opacity: 0.55;
}
@container tape-face (max-width: 379px) {
  .tape-key--rec {
    display: none;
  }
  .tape-keys {
    gap: 4px;
    padding: 7px 6px 13px;
  }
  .tape-key__label {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
  }
}

/* =========================================================
   The J-card (tracklist insert)
   ========================================================= */
.tape-jcard {
  --focus: var(--ink); /* paper insert: dark ring */
  position: relative;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  min-width: 0;
  color: var(--ink);
  background:
    radial-gradient(rgba(78, 38, 23, 0.07) 1px, transparent 1.4px) 0 0 / 6px 6px,
    linear-gradient(90deg, rgba(0, 0, 0, 0.07), transparent 3%, transparent 97%, rgba(0, 0, 0, 0.05)),
    var(--paper);
  border-radius: 4px;
  box-shadow: 8px 8px 0 rgba(10, 8, 32, 0.55), 0 30px 50px -24px rgba(0, 0, 0, 0.8);
  transform: rotate(0.35deg);
}
.tape-jcard::before,
.tape-jcard::after {
  /* masking tape holding it to the sky */
  content: "";
  position: absolute;
  top: -12px;
  width: 92px;
  height: 26px;
  background: rgba(236, 220, 176, 0.82);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  z-index: 2;
}
.tape-jcard::before {
  left: 18%;
  transform: rotate(-4deg);
}
.tape-jcard::after {
  right: 8%;
  transform: rotate(5deg);
}
.tape-jcard__spine {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(90deg, var(--mustard) 0 25%, var(--orange) 25% 50%, var(--rust) 50% 75%, var(--brown) 75%);
  border-radius: 4px 0 0 4px;
  box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.12);
}
.tape-jcard__spine span {
  writing-mode: vertical-rl;
  /* every glyph turns with the line, so "C-∞" doesn't stand the ∞ up as an 8 */
  text-orientation: sideways;
  transform: rotate(180deg);
  padding: 1rem 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  background: rgba(246, 230, 196, 0.88);
  padding-inline: 3px;
  border-radius: 2px;
}
.tape-jcard__inner {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.6rem) clamp(0.9rem, 2.6vw, 1.5rem) clamp(1.1rem, 3vw, 1.6rem);
  container: tape-jcard / inline-size;
}
.tape-jcard__head {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 1.1rem;
}
.tape-jcard__kicker {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--tape-fs-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tape-rust-ink);
}
.tape-jcard__title {
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 900;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--mustard), 4px 4px 0 var(--orange);
  padding-bottom: 0.1em;
}
.tape-sides {
  display: grid;
  gap: 1.6rem;
}
@container tape-jcard (min-width: 620px) {
  .tape-sides {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.8rem;
  }
  /* lopsided sides: one above the other, tracks in two columns */
  .tape-sides--stacked {
    grid-template-columns: minmax(0, 1fr);
  }
  .tape-sides--stacked .tape-list {
    columns: 2;
    column-gap: 1.8rem;
  }
  .tape-sides--stacked .tape-item {
    break-inside: avoid;
  }
}
.tape-side {
  min-width: 0;
}
.tape-side__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1.1;
}
.tape-side__letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  font-size: 1.35rem;
  color: var(--mustard);
  background: var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--orange);
}
.tape-side--b .tape-side__letter {
  color: var(--ink);
  background: var(--teal);
  box-shadow: 2px 2px 0 var(--ink);
}
.tape-side__dot {
  color: var(--tape-rust-ink);
}
.tape-side__comma {
  /* read aloud ("Side A, The Five"), never seen; stays inline so no stray space */
  font-size: 0;
}
.tape-side__sub {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--tape-rust-ink);
}
.tape-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}
.tape-item {
  border-bottom: 1.5px dashed rgba(30, 20, 36, 0.32);
}
.tape-track {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.15rem 0.55rem;
  align-items: start;
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.4rem 0.7rem;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 6px;
  font: inherit;
  transition: background-color 0.2s, transform 0.2s var(--ease-bounce);
}
@media (hover: hover) {
  button.tape-track:hover {
    background: rgba(244, 179, 60, 0.28);
  }
}
button.tape-track:active {
  transform: scale(0.99);
}
button.tape-track:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}
.tape-track__num {
  padding-top: 0.2rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--tape-rust-ink);
}
.tape-track__main {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}
.tape-track__title {
  max-width: 100%;
  font-family: var(--font-hand);
  font-size: 1.12rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
@container tape-jcard (max-width: 340px) {
  .tape-track__title {
    font-size: 1.02rem;
  }
}
.tape-track__hl {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.tape-track__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
  font-family: var(--font-mono);
  font-size: var(--tape-fs-label);
  line-height: 1.3;
}
.tape-track__lead {
  color: var(--ink-soft);
  text-wrap: balance;
}
.tape-track__note {
  font-family: var(--font-script);
  font-weight: 500;
  font-size: 1.12rem;
  line-height: 1.15;
  color: var(--ink-soft);
}
.tape-track__end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  padding-top: 0.15rem;
}
.tape-track__dur {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: max(var(--tape-fs-label), 0.78rem);
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tape-item--soon .tape-track__dur {
  font-size: var(--tape-fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* current track: highlighter + EQ bars */
.tape-item.is-current .tape-track__hl {
  background: linear-gradient(transparent 52%, rgba(244, 179, 60, 0.85) 52% 94%, transparent 94%);
  padding-inline: 0.15em;
  margin-inline: -0.15em;
}
.tape-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}
.tape-item.is-current .tape-eq {
  display: inline-flex;
}
.tape-eq i {
  width: 4px;
  height: 30%;
  background: var(--rust);
  border-radius: 1px;
  transform-origin: 50% 100%;
}
.tape-eq i:nth-child(2) { height: 70%; }
.tape-eq i:nth-child(3) { height: 45%; }
.tape-eq i:nth-child(4) { height: 85%; }
.tape-item.is-playing .tape-eq i {
  animation: tape-eq 0.9s ease-in-out infinite alternate;
}
.tape-item.is-playing .tape-eq i:nth-child(2) { animation-duration: 0.7s; animation-delay: -0.3s; }
.tape-item.is-playing .tape-eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -0.5s; }
.tape-item.is-playing .tape-eq i:nth-child(4) { animation-duration: 0.8s; animation-delay: -0.1s; }
@keyframes tape-eq {
  0% { transform: scaleY(0.25); }
  100% { transform: scaleY(1.15); }
}

/* coming soon */
.tape-item--soon .tape-track {
  color: var(--ink-soft);
}
.tape-item--soon .tape-track__hl {
  opacity: 0.85;
  text-decoration: underline dashed rgba(90, 69, 72, 0.6);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
}

/* badges */
.tape-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem 0.1rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--tape-fs-label);
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
}
.tape-badge--tape {
  color: var(--cream);
  background: var(--ink);
}
.tape-badge--soon {
  color: var(--tape-rust-ink);
  border-style: dashed;
  border-color: var(--tape-rust-ink);
}
.tape-badge--demo,
.tape-badge--missing {
  color: var(--cream);
  background: var(--tape-rust-ink);
  border-color: var(--tape-rust-ink);
  transform: rotate(-3deg);
}
.tape-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.45rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--tape-fs-label);
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--chip, var(--mustard));
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px rgba(30, 20, 36, 0.7);
}
/* "More from Adam on Spotify ↗": a link-out scribbled on the insert,
   underlined in that member's highlighter. A link, not a player. */
.tape-outs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.2rem;
  margin: 0.55rem 0 0;
  padding: 0 0 0 2.75rem; /* lines up with the song titles */
  list-style: none;
}
.tape-out {
  --chip: var(--mustard);
  display: inline-block;
  min-height: 44px;
  padding: 0.45rem 0.2rem;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
  border-radius: 4px;
}
/* a fat underline in the member's colour, painted under the letters,
   so it works like a highlighter and follows the text when it wraps */
.tape-out__text {
  text-decoration-line: underline;
  text-decoration-color: var(--chip);
  text-decoration-thickness: 0.4em;
  text-underline-offset: -0.2em;
  text-decoration-skip-ink: none;
  transition: text-decoration-thickness 0.2s var(--ease-out), text-underline-offset 0.2s var(--ease-out);
}
.tape-out__nb {
  white-space: nowrap; /* the arrow never wraps away from "Spotify" */
}
.tape-out__arrow {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-left: 0.28em;
  vertical-align: -0.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s var(--ease-bounce);
}
@media (hover: hover) {
  .tape-out:hover .tape-out__text {
    text-decoration-thickness: 0.75em;
    text-underline-offset: -0.55em;
  }
  .tape-out:hover .tape-out__arrow {
    transform: translate(2px, -2px);
  }
}
.tape-out:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.tape-jcard__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin-top: 1.3rem;
  padding-top: 0.8rem;
  border-top: 2px solid var(--ink);
  font-family: var(--font-script);
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--ink-soft);
}
.tape-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.6rem;
  white-space: nowrap;
}
.tape-jcard__empty {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--ink-soft);
}

/* =========================================================
   Now-playing strip (phones, while the deck is off-screen).
   Appended to <body> by tapes.js, so it carries its own tokens.
   ========================================================= */
.tape-mini {
  --focus: var(--mustard);
  position: fixed;
  z-index: 85; /* under the toast (90) */
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: min(25rem, calc(100% - 28px));
  padding: 6px;
  color: var(--cream);
  background: linear-gradient(180deg, #2f2130, #18111b);
  border-radius: 14px;
  box-shadow:
    0 0 0 2px var(--ink),
    4px 4px 0 var(--orange),
    7px 7px 0 var(--rust),
    0 16px 30px -10px rgba(0, 0, 0, 0.85);
  transform: translateX(calc(-50% - 3px));
  animation: tape-mini-in 0.4s var(--ease-bounce);
}
.tape-mini[hidden] {
  display: none;
}
@keyframes tape-mini-in {
  from {
    transform: translate(calc(-50% - 3px), 140%);
  }
}
.tape-mini__toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 50px;
  min-height: 50px;
  padding: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #ffd27a 0%, var(--mustard) 70%, #e09a22 100%);
  border: 0;
  border-radius: 9px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 3px 0 #a87a2c;
  -webkit-tap-highlight-color: transparent;
}
.tape-mini__toggle:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 1px 0 #a87a2c;
}
.tape-mini__toggle .tape-ico {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.tape-mini__back {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  padding: 5px 8px 6px 12px;
  text-align: left;
  color: inherit;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px), #1d1210;
  border: 0;
  border-radius: 9px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85);
  -webkit-tap-highlight-color: transparent;
}
.tape-mini__kicker {
  grid-column: 1;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 194, 90, 0.85);
}
.tape-mini.is-playing .tape-mini__kicker::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #7fe0d2;
  box-shadow: 0 0 8px #7fe0d2;
  vertical-align: 1px;
}
.tape-mini__title {
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--cream);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tape-mini__tag {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding: 5px 9px 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  background: var(--cream);
  border-radius: 999px;
}

/* =========================================================
   Small screens
   ========================================================= */
/* Short landscape phones: cassette and meters side by side, like the wide
   deck, so the whole thing is about a screen and a half instead of 2.5. */
@media (orientation: landscape) and (max-height: 500px) {
  @container tape-face (min-width: 560px) {
    .tape-panel {
      column-gap: 18px;
      row-gap: 12px;
      padding: 14px 18px 18px;
      grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
      grid-template-areas:
        "brand  brand"
        "well   meters"
        "seek   seek"
        "keys   readout"
        "error  error";
    }
    .tape-panel .tape-well {
      align-self: stretch;
      display: grid;
      align-content: center;
      padding-inline: 5%;
    }
    .tape-meters {
      grid-template-columns: minmax(0, 1fr);
      gap: 10px;
    }
    .tape-readout {
      flex-direction: row;
      align-items: stretch;
    }
    .tape-readout .tape-counter {
      align-self: auto;
      justify-content: center;
    }
    .tape-brand {
      padding-bottom: 8px;
    }
    .tape-keys {
      align-self: center; /* don't stretch when the readout wraps */
    }
  }
}

@media (max-width: 520px) {
  .tape-root {
    --tape-fs-label: 0.75rem; /* 12px on phones */
  }
  .tape-deck {
    --tape-wood-w: 8px;
    margin-right: 8px;
    margin-bottom: 8px;
    box-shadow:
      0 2px 0 rgba(255, 240, 194, 0.12) inset,
      4px 4px 0 var(--orange),
      8px 8px 0 var(--rust),
      0 30px 50px -20px rgba(0, 0, 0, 0.9);
  }
  .tape-jcard {
    grid-template-columns: 1.8rem minmax(0, 1fr);
    transform: none;
    box-shadow: 5px 5px 0 rgba(10, 8, 32, 0.55), 0 30px 50px -24px rgba(0, 0, 0, 0.8);
  }
  .tape-banner {
    margin-right: 6px;
  }
}

/* =========================================================
   Off-screen, or under a dialog: CSS loops hold still
   ========================================================= */
.tape-root.tape-is-offscreen .tape-item .tape-eq i,
html.has-dialog .tape-root .tape-item .tape-eq i {
  animation-play-state: paused;
}

/* =========================================================
   Reduced motion: state, not spectacle
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .tape-cassette.tape-is-swapping,
  .tape-key.is-thunk .tape-key__cap,
  .tape-mini,
  .tape-item.is-playing .tape-eq i {
    animation: none !important;
  }
}
.tape-is-reduced .tape-cassette.tape-is-swapping,
.tape-is-reduced .tape-item.is-playing .tape-eq i {
  animation: none;
}
