/* A small, on-demand brass instrument exhibit. */
.trumpet-demo {
  --trumpet-gold: #dac39a;
  --trumpet-ink: #f1e9df;
  position: relative;
  z-index: 6;
  display: grid;
  min-width: 0;
  padding: clamp(18px, 3vw, 30px);
  color: var(--trumpet-ink);
  background: radial-gradient(ellipse at 58% 25%, #28241d 0, #161615 34%, #0c0c0c 74%);
  font-family: var(--font-sans, sans-serif);
  isolation: isolate;
}
.trumpet-demo *, .trumpet-demo *::before, .trumpet-demo *::after { box-sizing: border-box; }
.trumpet-demo__top, .trumpet-demo__bottom, .trumpet-demo__playbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.trumpet-demo__eyebrow {
  color: var(--trumpet-gold);
  font: 600 11px/1.5 var(--font-mono, monospace);
  letter-spacing: .08em;
}
.trumpet-demo__top > span:last-child {
  color: #a79b8c;
  font: 11px/1.5 var(--font-mono, monospace);
  white-space: nowrap;
}
.trumpet-demo__stage {
  position: relative;
  width: 100%;
  min-height: 280px;
  aspect-ratio: 1.95 / 1;
  margin: 10px 0 0;
  overflow: hidden;
  outline: none;
  touch-action: pan-y;
  cursor: grab;
  border-radius: 3px;
  background: radial-gradient(ellipse at 52% 87%, rgba(215, 205, 185, .06), transparent 58%);
}
.trumpet-demo__stage.is-dragging { cursor: grabbing; }
.trumpet-demo__stage::before {
  position: absolute;
  inset: 25% 8% 7%;
  z-index: -1;
  content: "";
  border-bottom: 1px solid rgba(229, 189, 119, .15);
  border-radius: 50%;
}
.trumpet-demo__stage canvas { display: block; width: 100%; height: 100%; }
.trumpet-demo__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 20px;
  color: #cabca9;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  pointer-events: none;
  gap: 14px;
}
.trumpet-demo .trumpet-demo__retry { justify-self: center; pointer-events: auto; }
.trumpet-demo button[hidden] { display: none; }
.trumpet-demo.is-ready .trumpet-demo__loading { display: none; }
.trumpet-demo__detail, .trumpet-demo__views, .trumpet-demo__zoom { display: flex; gap: 6px; }
.trumpet-demo__detail { align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 8px 0 12px; }
.trumpet-demo__views { flex-wrap: wrap; }
.trumpet-demo .trumpet-demo__views button[aria-pressed="true"] { color: #f6e6ca; border-color: #b69b70; background: #362d20; }
.trumpet-demo__zoom { margin-left: auto; }
.trumpet-demo .trumpet-demo__zoom button { font-size: 20px; padding: 5px 10px; }
.trumpet-demo__view {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(229, 189, 119, .18);
}
.trumpet-demo__hint { color: #c7bbaa; font-size: 13px; line-height: 1.6; }
.trumpet-demo__view-actions { display: flex; gap: 6px; }
.trumpet-demo button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid rgba(229, 189, 119, .3);
  border-radius: 2px;
  background: rgba(11, 10, 9, .7);
  color: var(--trumpet-ink);
  font: 500 13px/1.35 var(--font-sans, sans-serif);
  text-align: center;
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.trumpet-demo button:hover { border-color: var(--trumpet-gold); background: #292017; }
.trumpet-demo button:focus-visible, .trumpet-demo__stage:focus-visible {
  outline: 2px solid var(--trumpet-gold);
  outline-offset: 4px;
}
.trumpet-demo button:disabled { opacity: .45; cursor: default; }
.trumpet-demo__view button { padding: 7px 10px; }
.trumpet-demo__instrument {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 19px 0 15px;
}
.trumpet-demo__readout { display: grid; min-width: 65px; }
.trumpet-demo__note {
  color: var(--trumpet-gold);
  font: 500 clamp(23px, 3.1vw, 34px)/1.1 var(--font-mono, monospace);
  letter-spacing: -.05em;
}
.trumpet-demo__state { margin-top: 6px; color: #b1a596; font-size: 11px; line-height: 1.5; }
.trumpet-demo__wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 32px; overflow: hidden; }
.trumpet-demo__wave i {
  display: block;
  width: 2px;
  height: 3px;
  background: var(--trumpet-gold);
  opacity: .28;
  transition: height .15s, opacity .15s;
}
.trumpet-demo.is-playing .trumpet-demo__wave i { height: var(--bar); opacity: .85; }
.trumpet-demo__valves { display: flex; align-items: center; gap: 6px; }
.trumpet-demo__valve-label { color: #b1a596; font-size: 11px; margin-right: 2px; }
.trumpet-demo .trumpet-demo__valve { width: 44px; padding: 7px; border-radius: 50%; font-family: var(--font-mono, monospace); }
.trumpet-demo .trumpet-demo__valve[aria-pressed="true"] { border-color: #e5bd77; color: #17120d; background: #e5bd77; }
.trumpet-demo__notes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.trumpet-demo .trumpet-demo__note-key { display: grid; gap: 6px; min-width: 0; min-height: 62px; padding: 10px 4px; }
.trumpet-demo__note-key b { color: #f1e9df; font: 500 17px/1 var(--font-mono, monospace); }
.trumpet-demo__note-key span { color: #a89c8d; font: 11px/1.1 var(--font-mono, monospace); }
.trumpet-demo .trumpet-demo__note-key.is-active { border-color: #f40c3f; background: #41131b; }
.trumpet-demo .trumpet-demo__note-key.is-active b { color: #ffb8c7; }
.trumpet-demo__playbar { flex-wrap: wrap; margin-top: 13px; }
.trumpet-demo .trumpet-demo__blow { min-width: 116px; border-color: #bb1940; color: #ffccd6; background: #301019; }
.trumpet-demo .trumpet-demo__blow.is-active { border-color: #ff6b8b; background: #67172b; }
.trumpet-demo .trumpet-demo__sound[aria-pressed="true"] { border-color: var(--trumpet-gold); color: var(--trumpet-gold); }
.trumpet-demo__bottom { align-items: flex-start; margin-top: 15px; }
.trumpet-demo__footnote { max-width: 52ch; color: #a99d8e; font-size: 11px; line-height: 1.65; }
.trumpet-demo__feedback { flex: 0 0 auto; color: var(--trumpet-gold); font: 11px/1.65 var(--font-mono, monospace); }
.trumpet-demo.is-fallback .trumpet-demo__stage { min-height: 160px; aspect-ratio: 2 / 1; background: linear-gradient(#111a, #111d), url('/images/generated/human-signal-trumpet.webp') center / cover; }
.trumpet-demo.is-fallback .trumpet-demo__loading { color: white; text-shadow: 0 2px 8px #000; }
@media (min-width: 1400px) {
  .trumpet-demo button { font-size: 14px; }
  .trumpet-demo__hint { font-size: 14px; }
  .trumpet-demo__footnote, .trumpet-demo__state { font-size: 12px; }
}
@media (max-width: 540px) {
  .trumpet-demo { padding: 18px 14px 20px; }
  .trumpet-demo__stage { min-height: 220px; aspect-ratio: 1.55 / 1; }
  .trumpet-demo__detail { gap: 8px; }
  .trumpet-demo__views { gap: 4px; }
  .trumpet-demo .trumpet-demo__views button { padding-inline: 9px; }
  .trumpet-demo__instrument { grid-template-columns: auto 1fr; }
  .trumpet-demo__wave { justify-content: flex-end; }
  .trumpet-demo__valves { grid-column: 1 / -1; justify-content: flex-end; margin-top: -4px; }
  .trumpet-demo__notes { gap: 4px; }
  .trumpet-demo .trumpet-demo__note-key { padding-inline: 2px; }
  .trumpet-demo__note-key span { font-size: 10px; }
  .trumpet-demo__view { align-items: flex-start; }
  .trumpet-demo__view-actions { margin-left: auto; }
}
@media (max-width: 480px) {
  .trumpet-demo__notes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .trumpet-demo .trumpet-demo__note-key { min-height: 56px; }
  .trumpet-demo__footnote { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .trumpet-demo button, .trumpet-demo__wave i { transition: none; }
}
