/* Sound page: the drone's controls, its ribbon, and the chart of the rule.
   Colour comes from the site's tokens; the pictures are drawn in code (canvas and SVG), never from files. */

.js-only { display: none; }
.js .js-only { display: block; }
.nojs-note { margin: 0; color: var(--muted); }
.js .nojs-note { display: none; }
.no-audio .js-only { display: none !important; }
.no-audio .nojs-note { display: block !important; }

/* ---------- the drone ---------- */
.split.drone-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); align-items: start; gap: clamp(20px, 3.5vw, 48px); }
@media (max-width: 860px) { .split.drone-split { grid-template-columns: minmax(0, 1fr); } }

.drone-panel {
  padding: clamp(1.1rem, 2.4vw, 1.7rem); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012)); min-width: 0;
}
#drone-ui { display: none; }
.js #drone-ui { display: grid; gap: 1.35rem; }
.no-audio #drone-ui { display: none; }

.drone-run { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.drone-run .btn { min-width: 9.5rem; }
.drone-status { margin: 0; flex: 1 1 200px; color: var(--muted); font-size: 0.95rem; line-height: 1.5; min-height: 2.9em; display: flex; align-items: center; }
#drone-go[disabled] { cursor: progress; }

.drone-vol { min-width: 0; flex: none; }
.drone-vol p { margin: 0; }

.mood-set { border: 0; margin: 0; padding: 0; min-width: 0; }
.mood-set legend { padding: 0; margin: 0 0 10px; font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.mood-set .controls { margin-top: 0; gap: 8px; }
.chip { display: inline-flex; align-items: center; }
.chip .sw { width: 0.72em; height: 0.72em; border-radius: 50%; margin-right: 0.55em; background: var(--sw, var(--teal)); box-shadow: 0 0 0 1px rgba(255,255,255,0.22); flex: none; }
.chip[aria-pressed="true"] .sw { box-shadow: 0 0 0 1.5px rgba(10,12,14,0.55); }
.palette-bar { height: 6px; border-radius: 3px; margin-top: 14px; background: rgba(255,255,255,0.06); }

.voice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.voice-row .btn { padding: 11px 20px; }
.voice-name { margin: 0; color: var(--muted); min-width: 0; flex: 1 1 180px; }
.voice-name output { font-family: var(--serif); font-size: 1.3rem; color: #eef2f5; line-height: 1.2; display: block; transition: opacity 0.5s var(--ease); }

.voice-facts-wrap { display: flex; flex-wrap: wrap; gap: 18px 22px; align-items: center; }
.voice-facts { margin: 0; display: grid; gap: 8px; flex: 1 1 210px; min-width: 0; }
.voice-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.voice-facts dt { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.voice-facts dd { margin: 0; text-align: right; min-width: 0; }
.voice-facts output { color: var(--text); font-size: 0.92rem; }

.wheel { width: 138px; height: 138px; flex: none; margin-inline: auto; }
.wheel path { transition: opacity 0.7s var(--ease); }
.wheel .mark { transition: transform 0.9s var(--ease); transform-origin: 80px 80px; }
.wheel text { font-family: var(--serif); font-size: 26px; fill: #f2f5f7; text-anchor: middle; dominant-baseline: central; }

.drone-left { min-width: 0; }
.drone-left .note { margin-top: 1rem; }
.drone-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.drone-stage { aspect-ratio: 16 / 10; }
.drone-stage .stage-caption { padding-top: 54px; }
.ribbon-note { margin: 0; }
.still-hint { margin: 0; color: var(--gold); }

.voice-rules { max-width: 800px; margin: clamp(2rem, 4vw, 3rem) auto 0; }
.voice-rules h3 { margin-bottom: 0.6em; }
.note + .note { margin-top: 0.8rem; }

/* ---------- the rule ---------- */
.limits { margin-top: 0; }
.limit { padding: 1.35rem 1.45rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,0.025); }
.limit b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.55rem; line-height: 1.15; color: #f2f5f7; margin-bottom: 0.35rem; }
.limit span { color: var(--muted); font-size: 0.97rem; }

.rule-figure { margin: clamp(1.6rem, 3vw, 2.4rem) 0 0; padding: clamp(0.8rem, 2vw, 1.4rem); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.012)); }
.rule-canvas-wrap { border-radius: 12px; background: #0f1215; overflow: hidden; }
#rule-canvas { width: 100%; height: auto; aspect-ratio: 16 / 7.4; }
@media (max-width: 720px) { #rule-canvas { aspect-ratio: 4 / 4.4; } }
.rule-controls { display: none; flex-wrap: wrap; align-items: end; gap: 12px 22px; margin-top: 14px; }
.js .rule-controls { display: flex; }
.rule-scrub { flex: 1 1 280px; }
.rule-scrub label { justify-content: flex-start; flex-wrap: wrap; gap: 4px 14px; }
.rule-scrub output { font-size: 0.82rem; color: #c9d1d8; }
.rule-figure figcaption { margin-top: 14px; color: var(--muted); font-size: 0.93rem; max-width: 80ch; }

@media (prefers-reduced-motion: reduce) {
  .wheel .mark, .wheel path, .voice-name output { transition: none; }
}
html.is-still .wheel .mark, html.is-still .wheel path { transition-duration: 0.01s; }

body.page-sound .page-hero h1 { text-wrap: balance; }
