/* Fibonacci Loop: the title on the electric hero band, then the live picture and its controls.
   Colors: the theme.css tokens. The picture keeps its own amber inks, like the Thomas attractor drawing. */
.chapter-fib {
  --ink: var(--ex-n3);
  --muted: var(--chapter-muted);
  --line: var(--chapter-line);
  --panel: var(--ex-n2);
  --serif: Georgia, "Times New Roman", serif;
}
.chapter-fib .chapter-hero > .heading { width: min(1150px, calc(100% - clamp(40px, 9vw, 160px))); }
.chapter-fib .heading h1 {
  margin: 18px 0;
  font: 400 clamp(54px, 6.4vw, 104px)/.98 var(--serif);
  letter-spacing: -.07em;
  text-wrap: balance;
}
.chapter-fib .lead { max-width: 46ch; color: var(--muted); font-size: clamp(16px, 1.26vw, 20px); line-height: 1.55; }
.fib { max-width: 1150px; padding-block: clamp(20px, 3vw, 40px) clamp(40px, 6vw, 96px); }
.fib-bench {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
.fib-stage {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #050302;
}
.fib-stage canvas, .fib-still { display: block; width: 100%; height: 100%; object-fit: cover; }
.fib-stage [hidden] { display: none; }
.fib-read {
  position: absolute;
  inset: 16px auto auto 18px;
  display: grid;
  gap: 2px;
  color: #ffe0ae;
  text-shadow: 0 1px 10px #000, 0 0 3px #000;
  pointer-events: none;
}
.fib-stage-name { font: 600 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.fib-width { font: 400 15px/1.2 var(--serif); }
.fib-width b { margin-right: .14em; font: 400 clamp(34px, 4.6vw, 58px)/1 var(--serif); letter-spacing: -.045em; }
.fib-bar {
  position: absolute;
  inset: auto auto 16px 18px;
  display: grid;
  gap: 6px;
  color: #ffe0ae;
  font: 12px/1 var(--mono);
  text-shadow: 0 1px 8px #000, 0 0 3px #000;
  pointer-events: none;
}
.fib-bar i { display: block; height: 3px; min-width: 2px; background: currentColor; box-shadow: 0 0 6px #000; }
.fib-line { min-height: 4.2em; font: 400 clamp(21px, 2vw, 27px)/1.3 var(--serif); letter-spacing: -.02em; text-wrap: pretty; }
.fib-note { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.fib-controls { display: grid; gap: 22px; margin-top: 22px; }
.fib-controls[hidden] { display: none; }
.fib-controls button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: 650 15px/1 var(--chapter-font);
}
.fib-controls button:hover { border-color: var(--ex-pop); }
.fib-controls .fib-main { min-height: 52px; border-color: var(--ex-pop); background: var(--ex-pop); color: var(--ex-n1); font-size: 16px; }
.fib-controls .fib-main:hover { background: color-mix(in oklab, var(--ex-pop) 86%, var(--ex-n3)); }
.fib-buttons { display: flex; gap: 10px; }
.fib-buttons button { flex: 1; }
.control-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.control-head label { font-size: 15px; font-weight: 700; }
.control-head output { color: var(--ex-pop); font: 13px/1.2 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.fib-control input[type="range"] { display: block; width: 100%; min-height: 36px; margin: 4px 0 0; accent-color: var(--ex-pop); cursor: pointer; }
.endpoints { display: flex; justify-content: space-between; color: var(--muted); font: 11px/1.2 var(--mono); }
.fib-ladder {
  display: grid;
  gap: 0;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}
.fib-ladder li { display: grid; grid-template-columns: 82px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.fib-ladder b { color: var(--ink); font: 500 13px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.fib-notes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 44px);
  margin-top: clamp(36px, 5vw, 72px);
  padding-top: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--line);
}
.fib-notes h2 { margin-bottom: 10px; font: 400 26px/1.05 var(--serif); letter-spacing: -.04em; }
.fib-notes p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.fib-notes a, .fib-film a { color: var(--ink); text-decoration: underline var(--ex-pop); text-underline-offset: 3px; }
.fib-notes a:hover, .fib-film a:hover { color: var(--ex-pop); }
.fib-film { margin-top: clamp(28px, 4vw, 48px); font-size: 16px; font-weight: 650; }
.fib-film a { display: inline-flex; align-items: center; gap: .3em; min-height: 44px; }
@media (max-width: 980px) {
  .fib-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .fib-bench { grid-template-columns: minmax(0, 1fr); }
  .fib-stage { aspect-ratio: 4 / 5; }
  .fib-line { min-height: 3.9em; }
}
@media (max-width: 520px) {
  .fib-notes { grid-template-columns: minmax(0, 1fr); }
}
