@font-face { font-family: "DM Sans"; src: url("../../assets/fonts/dm-sans-400.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../../assets/fonts/dm-sans-600.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../../assets/fonts/newsreader-400.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --cream: #fdf6e3; --paper: #fffaf0; --ink: #073642; --teal: #23867e;
  --blue: #779db7; --gold: #c39a3e; --rust: #b94f31; --muted: #586e75; --rule: #e1d8bd;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font: 400 15px/1.45 "DM Sans", system-ui, sans-serif; }

/* Natural-height wrapper: the parent iframe measures this element. */
.motion-page { max-width: 992px; margin: 0 auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; }

.tabs { display: flex; flex-wrap: wrap; gap: 2px 20px; border-bottom: 1px solid var(--rule); }
.tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 9px 2px 8px; font: 600 15px/1.2 "DM Sans", system-ui, sans-serif; color: var(--muted); cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

.figure { margin: 0; }
#art { display: block; width: 100%; height: auto; }
#art text { font-family: "DM Sans", system-ui, sans-serif; }
#art .serif { font-family: "Newsreader", Georgia, serif; }
.is-narrow #art { max-width: 460px; margin: 0 auto; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--rule); border-radius: 18px; background: var(--paper); color: var(--ink);
  font: 600 14px/1 "DM Sans", system-ui, sans-serif; cursor: pointer;
}
.btn:hover { border-color: var(--teal); }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.btn .i-pause, .btn[data-playing="true"] .i-play { display: none; }
.btn[data-playing="true"] .i-pause { display: inline; }
.scrub { flex: 1 1 200px; min-width: 160px; }
.scrub input { display: block; width: 100%; margin: 0; accent-color: var(--teal); cursor: pointer; }
.ticks { position: relative; height: 16px; margin: 0 8px; }
.tick { position: absolute; top: 0; transform: translateX(-50%); font: 600 13px/16px "DM Sans", system-ui, sans-serif; color: var(--muted); }
.time { min-width: 84px; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }
.status { margin: 0; font-size: 14px; color: var(--muted); }

.caption { margin: 0; max-width: 62ch; font: 400 17px/1.45 "Newsreader", Georgia, serif; }
.text-eq { border-top: 1px solid var(--rule); padding-top: 8px; font-size: 14px; color: var(--muted); }
.text-eq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.text-eq ul { margin: 8px 0 0; padding-left: 18px; }
.text-eq li { margin: 0 0 6px; }
.text-eq li[aria-current] { color: var(--ink); }
.text-eq strong { color: var(--ink); font-weight: 600; }

.is-narrow .scrub { flex-basis: 100%; order: 9; }
.is-narrow .time { margin-left: auto; }

/* ?record: art only. ?embed: keep tabs and playback, drop standalone text. */
.is-record .tabs, .is-record .controls, .is-record .status, .is-record .caption, .is-record .text-eq { display: none; }
.is-record .motion-page { padding: 0; max-width: none; }
.is-embed .caption, .is-embed .text-eq { display: none; }
