/* Verified local font files shared with the article. */
@font-face { font-family:"DM Sans"; font-style:normal; font-weight:400; font-display:swap; src:url("../../assets/fonts/dm-sans-400.ttf") format("truetype"); }
@font-face { font-family:"DM Sans"; font-style:normal; font-weight:600; font-display:swap; src:url("../../assets/fonts/dm-sans-600.ttf") format("truetype"); }
@font-face { font-family:"Newsreader"; font-style:normal; font-weight:400; font-display:swap; src:url("../../assets/fonts/newsreader-400.ttf") format("truetype"); }
:root {
  --cream: #f7f4ea;
  --ink: #24323a;
  --ink-soft: #5b6b70;
  --gray: #7d8a86;
  --teal: #2a9488;
  --mint: #e4f1e8;
  --line: #d9e2d8;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
}

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.motion { margin: 0; }

.stage {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--cream);
  outline: none;
  box-shadow: 0 0 0 1px var(--line);
}
.stage:focus-visible { box-shadow: 0 0 0 3px var(--teal); }

.stage svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--sans);
}

.motion[data-layout="narrow"] .stage { max-width: 440px; margin: 0 auto; }

/* SVG type */
.s-serif { font-family: var(--serif); font-style: italic; }
.s-sans  { font-family: var(--sans); }

/* Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  flex-wrap: wrap;
}
.motion[data-layout="narrow"] .controls,
.motion[data-layout="narrow"] .caption,
.motion[data-layout="narrow"] .transcript { max-width: 440px; margin-left: auto; margin-right: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px 0 11px;
  border: 1px solid #c9d3cc;
  border-radius: 17px;
  background: #fffdf7;
  color: var(--ink);
  font: 600 13px/1 var(--sans);
  cursor: pointer;
}
.btn:hover { background: var(--mint); }
.btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.icon { width: 14px; height: 14px; fill: currentColor; }
.btn .icon-pause { display: none; }
.btn[data-state="playing"] .icon-play { display: none; }
.btn[data-state="playing"] .icon-pause { display: inline; }

.scrub { flex: 1 1 160px; display: flex; align-items: center; }
.scrub input { width: 100%; accent-color: var(--teal); height: 28px; }
.scrub input:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.clock {
  min-width: 92px;
  text-align: right;
  font: 500 12px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--gray);
}

.caption {
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--gray);
}
.caption strong { color: var(--ink-soft); font-weight: 600; }

.transcript {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.transcript summary {
  cursor: pointer;
  color: var(--gray);
  font-weight: 600;
}
.transcript summary:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.transcript ol { padding-left: 1.3em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ?record: bare stage filling the viewport */
html.record, html.record body { width: 100%; height: 100%; overflow: hidden; }
html.record .page { max-width: none; padding: 0; margin: 0; }
html.record .controls,
html.record .caption,
html.record .transcript { display: none; }
html.record .stage { border-radius: 0; box-shadow: none; max-width: none; }
html.record .stage svg { width: 100vw; height: 100vh; }

/* The article supplies its own caption; the standalone page retains the transcript. */
html.embed .caption,html.embed .transcript { display:none; }
html.embed .page { padding:12px 20px 20px; }
