/* ============================================================
   TDNT · HISTORY 01 · FIRE TO FIBRE
   A scroll-driven race: one sticky clock, thirteen eras, one demo each.
   Every class is prefixed hxa-. Brand colors only, via the tokens in
   ../styles.css, plus alpha mixes of the six brand colors.
   ============================================================ */

/* ───────── banner (the one dark section) ───────── */
.hxa-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 251, 250, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 251, 250, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, transparent, #0a081c 30%, #0a081c 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #0a081c 30%, #0a081c 70%, transparent);
}
.hxa-banner .pg-h1 { max-width: 12ch; }

.hxa-scope {
  margin-top: clamp(40px, 6vw, 72px);
  padding: 18px clamp(14px, 2.4vw, 28px) 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 251, 250, 0.02);
}
.hxa-scope-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.hxa-scope-head b { color: var(--accent2); font-weight: 500; }
.hxa-scope-note { margin: 12px 0 0; font-size: 12px; color: var(--fg-mute); }

.hxa-chart {
  --lab: 52px;
  --gut: 58px;
  position: relative;
  height: clamp(250px, 26vw, 340px);
  margin-top: 18px;
}
.hxa-chart-grid { position: absolute; inset: 0 0 var(--lab) 0; pointer-events: none; }
.hxa-gl {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--y) * 100%);
  border-top: 1px dashed rgba(255, 251, 250, 0.1);
}
.hxa-gl span {
  position: absolute;
  left: 0;
  bottom: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.hxa-chart-line { position: absolute; left: var(--gut); top: 0; width: calc(100% - var(--gut)); height: calc(100% - var(--lab)); overflow: visible; }
/* the line inks itself on from 9 days to 22 ms; the shaded area follows once it is drawn */
.hxa-chart-line .base { fill: none; stroke: rgba(151, 226, 232, 0.7); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.hxa-chart.is-on .hxa-chart-line .base { animation: hxaInk 2.1s cubic-bezier(.55, .05, .25, 1) 0.2s forwards; }
@keyframes hxaInk { to { stroke-dashoffset: 0; } }
.hxa-chart-line .area { opacity: 0; transition: opacity 1.2s ease 1.6s; }
.hxa-chart.is-on .hxa-chart-line .area { opacity: 1; }
/* the racer: a point of light with a comet tail, running the whole history again and again */
.hxa-chart-line .racer { opacity: 0; }
.hxa-chart-line .racer .tail { fill: none; stroke: #97e2e8; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }
.hxa-chart-line .racer .halo { fill: rgba(151, 226, 232, 0.18); }
.hxa-chart-line .racer .head { fill: var(--cloud); stroke: #97e2e8; stroke-width: 2; filter: drop-shadow(0 0 6px rgba(151, 226, 232, 0.9)); }
/* each era point rings as the racer passes it */
.hxa-chart-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid #97e2e8;
  opacity: 0;
  pointer-events: none;
}
.hxa-chart-dot.is-ping::after { animation: hxaPing 0.9s cubic-bezier(.2, .7, .2, 1); }
@keyframes hxaPing { from { opacity: 0.95; transform: scale(1); } to { opacity: 0; transform: scale(3.4); } }

.hxa-chart-cols {
  position: absolute;
  inset: 0 0 0 var(--gut);
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
}
.hxa-chart-cols li { position: relative; }
.hxa-chart-cols a { position: absolute; inset: 0; display: block; border-radius: 8px; transition: background 0.25s; }
.hxa-chart-cols a:hover, .hxa-chart-cols a:focus-visible { background: rgba(255, 251, 250, 0.04); outline: none; }
.hxa-chart-dot {
  position: absolute;
  left: 50%;
  top: calc((100% - var(--lab)) * var(--y));
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 5px rgba(229, 88, 44, 0.16);
  transform: scale(0);
  transition: transform 0.55s cubic-bezier(.3, 1.6, .5, 1) calc(var(--i) * 150ms + 260ms);
}
.hxa-chart-dot.is-under { background: var(--midnight); border: 2px solid var(--cyan); box-shadow: none; }
.hxa-chart-dot.is-end { background: var(--cyan); box-shadow: 0 0 0 6px rgba(151, 226, 232, 0.18), 0 0 18px rgba(151, 226, 232, 0.5); }
.hxa-chart.is-on .hxa-chart-dot { transform: scale(1); }
.hxa-chart-cols a:hover .hxa-chart-dot { transform: scale(1.35); transition-delay: 0s; }
.hxa-chart-lab {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--lab);
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 3px;
  padding-bottom: 2px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.2;
  color: var(--fg-mute);
}
.hxa-chart-lab b { font-weight: 500; color: var(--fg); white-space: nowrap; }
.hxa-chart-lab em { font-style: normal; white-space: nowrap; }
.hxa-chart-cols li.is-setback .hxa-chart-lab em { color: var(--ember); }

/* ───────── the race layout ───────── */
.hxa-race {
  display: grid;
  grid-template-columns: minmax(270px, 360px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 96px);
  align-items: start;
}

/* sticky race clock */
.hxa-dash {
  position: sticky;
  top: 92px;
  z-index: 4;
  display: grid;
  gap: 16px;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: 0 24px 60px -40px rgba(10, 8, 28, 0.35);
}
.hxa-dash-top { display: grid; gap: 8px; }
.hxa-dash-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-mute); }
.hxa-dash-era { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-family: var(--mono); font-size: 12px; color: var(--fg-dim); }
.hxa-dash-era i { font-style: normal; font-size: 11px; color: var(--accent); }
.hxa-dash-era b { font-family: var(--display); font-weight: 400; font-size: 15px; letter-spacing: -0.02em; color: var(--fg); }

.hxa-count { position: relative; display: grid; gap: 2px; }
.hxa-count-pre { min-height: 1.3em; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); }
.hxa-count-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.hxa-count-val {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(60px, 6.4vw, 108px);
  line-height: 1;
  padding-top: 0.24em;  /* Boldonse glyphs rise above a 1.0 line box; keep clear of the "about" label */
  letter-spacing: -0.04em;
  color: var(--fg);
  transition: color 0.35s;
}
/* at this size fixed cells look gappy (Boldonse "0" is far wider than the other digits),
   so the big counter uses natural widths; it only moves briefly while it morphs */
.hxa-count-val .fig { width: auto; margin-inline: 0; }
.hxa-count-unit { font-family: var(--display); font-weight: 400; font-size: clamp(18px, 1.7vw, 26px); letter-spacing: -0.02em; color: var(--fg-mute); }
.hxa-count-flag {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--ember);
  color: var(--cloud);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s, transform 0.3s;
}
.hxa-dash.is-setback .hxa-count-val { color: var(--ember); }
.hxa-dash.is-setback .hxa-count-flag { opacity: 1; transform: none; }
.hxa-dash.is-end .hxa-count-val { color: var(--cobalt); }
/* the counter rolls: the old reading is a ghost laid over the new one while it lifts away */
.hxa-count-val.is-ghost { position: absolute; margin: 0; pointer-events: none; white-space: nowrap; }
.hxa-dash-cap { margin: 0; min-height: 2.9em; font-size: 13.5px; line-height: 1.45; color: var(--fg-dim); }

/* log scale: slow on the left, fast on the right */
.hxa-scale { overflow: hidden; padding: 2px 0 0; }
.hxa-scale-bar { position: relative; height: 26px; margin: 0 10px; }
.hxa-scale-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--line); border-radius: 2px; }
.hxa-scale-dots i {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.3s;
}
.hxa-scale-dots i.is-under { background: var(--bg-card); border: 1.5px solid var(--line); }
.hxa-scale-dots i.is-past { background: var(--cobalt); border-color: var(--cobalt); }
/* the ground covered so far, from 9 days toward 10 ms; it follows the needle on its spring */
.hxa-scale-fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 51, 153, 0.35), var(--cobalt));
  transform-origin: 0 50%;
  transform: scaleX(0);
  will-change: transform;
}
.hxa-dash.is-setback .hxa-scale-fill { background: linear-gradient(90deg, rgba(229, 88, 44, 0.35), var(--ember)); }
.hxa-scale-mark { position: absolute; inset: 0; will-change: transform; }
.hxa-scale-mark i {
  position: absolute;
  left: 0;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 6px rgba(229, 88, 44, 0.16);
}
.hxa-scale-ticks { position: relative; height: 16px; margin: 4px 10px 0; }
.hxa-scale-ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--fg-mute);
}
.hxa-scale-ticks span.is-first { transform: none; margin-left: -10px; }
.hxa-scale-ticks span.is-last { transform: translateX(-100%); margin-left: 10px; }

/* era rail */
.hxa-rail { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line-soft); display: grid; gap: 1px; }
.hxa-rail button {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  text-align: left;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg-mute);
  transition: background 0.2s, color 0.2s;
}
.hxa-rail button i { font-style: normal; font-size: 10.5px; }
.hxa-rail button em { font-style: normal; font-size: 11px; }
.hxa-rail button:hover { background: var(--bg-elev); color: var(--fg); }
.hxa-rail button.is-past { color: var(--fg-dim); }
.hxa-rail button.is-past i { color: var(--accent); }
.hxa-rail button.is-active { background: var(--accent-soft); color: var(--fg); }
.hxa-rail button.is-active i, .hxa-rail button.is-active em { color: var(--accent); }
.hxa-rail button[data-go="4"] em { color: var(--ember); }

/* focus rings for every control on the page */
.hxa-race button:focus-visible,
.hxa-race input:focus-visible,
.hxa-race a:focus-visible,
.hxa-chart-cols a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ───────── one era ───────── */
.hxa-eras { display: grid; min-width: 0; }
.hxa-era {
  display: grid;
  gap: 26px;
  padding: clamp(64px, 11vh, 130px) 0;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 90px;
}
.hxa-era:first-child { padding-top: 0; border-top: 0; }
.hxa-era:last-child { padding-bottom: 0; }
.hxa-era-head { display: grid; gap: 14px; max-width: 66ch; }
.hxa-era-head .hx-era b { margin-right: 4px; }
.hxa-era-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 54px);
  line-height: 1.2;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.hxa-era-title:focus { outline: none; }
.hxa-era-title em { font-style: oblique -10deg; color: var(--accent); }
.hxa-era-copy { margin: 0; font-size: 16px; line-height: 1.65; color: var(--fg-dim); }

/* demo frame */
.hxa-demo { box-shadow: 0 30px 70px -50px rgba(10, 8, 28, 0.4); }
.hxa-demo-body {
  position: relative;
  padding: 18px 18px 14px;
  background-color: var(--bg-card);
  background-image:
    linear-gradient(to right, rgba(0, 51, 153, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 51, 153, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}
.hxa-svg { display: block; width: 100%; height: auto; overflow: visible; }
/* layers around a plate: backdrops behind it slide as their own layers (parallax, dusk), and the
   beacon fires burn on a canvas laid exactly over it */
.hxa-fx { position: relative; }
.hxa-fx.is-clip { overflow: hidden; }
.hxa-fx > .hxa-svg { position: relative; }
.hxa-fx > .hxa-back { position: absolute; top: 0; height: 100%; max-width: none; display: block; pointer-events: none; will-change: transform, opacity; }
.hxa-fx > canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.hxa-ends {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 8px;
}
.hxa-ends > span:first-child, .hxa-ends > span:last-child {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.hxa-ends > span:last-child { text-align: right; }
.hxa-legend {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
}
.hxa-legend b { font-weight: 500; color: var(--fg); }
.hxa-legend i { display: inline-block; width: 8px; height: 8px; margin: 0 5px 0 10px; border-radius: 50%; vertical-align: 0; }
.hxa-legend i:first-child { margin-left: 0; }
.k-ember { background: var(--ember); }
.k-cobalt { background: var(--cobalt); }
.k-mute { background: rgba(10, 8, 28, 0.3); }

.hxa-ctrl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}
.hxa-clock { margin-left: auto; display: grid; justify-items: end; gap: 2px; min-width: 120px; }
.hxa-clock span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); }
.hxa-clock b { font-family: var(--display); font-weight: 400; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; color: var(--fg); }
.hxa-demo.is-running .hxa-clock b { color: var(--accent); }
.hxa-demo.is-done .hxa-clock b { color: var(--ember); }

.hxa-toggle { display: inline-flex; flex-wrap: wrap; padding: 3px; border: 1px solid var(--line); border-radius: 100px; background: var(--bg-card); }
.hxa-toggle button { padding: 7px 13px; border-radius: 100px; font-family: var(--mono); font-size: 12px; color: var(--fg-dim); transition: background 0.2s, color 0.2s; }
.hxa-toggle button:hover { color: var(--fg); }
.hxa-toggle button[aria-pressed="true"] { background: var(--cobalt); color: var(--cloud); }

.hxa-stepper { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 100px; background: var(--bg-card); }
.hxa-stepper button { width: 32px; height: 32px; border-radius: 50%; font-size: 17px; line-height: 1; color: var(--fg); transition: background 0.2s; }
.hxa-stepper button:hover { background: var(--accent-soft); }
.hxa-stepper output { min-width: 66px; text-align: center; font-family: var(--mono); font-size: 12.5px; color: var(--fg); }
/* the beacon demo: a line on what the hour means, then the labelled hour picker */
.hxa-hint { flex: 1 1 100%; margin: 0; max-width: 70ch; font-size: 13.5px; line-height: 1.5; color: var(--fg-dim); }
.hxa-hour { display: inline-flex; align-items: center; gap: 10px; }
.hxa-hour > span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); }

.hxa-field { display: flex; align-items: center; gap: 10px; flex: 1 1 240px; min-width: 0; }
.hxa-field span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); }
.hxa-field input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* svg parts shared by the demos */
.hxa-svg .stn { fill: var(--cloud); stroke: var(--midnight); stroke-width: 1.8; stroke-linejoin: round; transition: fill 0.35s; }
.hxa-svg .stn.is-hit, .hxa-svg .stn-g.is-hit .stn { fill: var(--sage); }
.hxa-svg .flag { fill: rgba(10, 8, 28, 0.22); transform-box: fill-box; transform-origin: 0% 50%; transform: scaleX(0.45); transition: fill 0.3s, transform 0.45s cubic-bezier(.3, 1.6, .5, 1); }
.hxa-svg .stn-g.is-hit .flag { fill: var(--ember); transform: scaleX(1); }
.hxa-svg .tower .win { fill: rgba(10, 8, 28, 0.18); transition: fill 0.3s; }
.hxa-svg .tower.is-hot .win { fill: var(--ember); }
.hxa-svg .tower.is-set .win { fill: var(--cobalt); }
.hxa-panel-lab { fill: rgba(255, 251, 250, 0.5); font-family: var(--mono); font-size: 8.5px; letter-spacing: 1.6px; }
.hxa-demo[data-demo="phone"] .jack { fill: rgba(255, 251, 250, 0.12); stroke: rgba(255, 251, 250, 0.28); stroke-width: 1; }
.hxa-demo[data-demo="phone"] .jack.is-on { fill: var(--ember); stroke: var(--ember); filter: drop-shadow(0 0 3px rgba(229, 88, 44, 0.8)); }

/* the arrival moment: when a message lands, the stage flashes once and the clock settles */
.hxa-demo-body::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 0 rgba(229, 88, 44, 0);
  opacity: 0;
}
.hxa-demo.is-arrived .hxa-demo-body::after { animation: hxaArrive 1.1s cubic-bezier(.2, .7, .2, 1); }
.hxa-demo.is-arrived .hxa-clock b { animation: hxaSettle 0.7s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes hxaArrive {
  0% { opacity: 0; box-shadow: inset 0 0 0 0 rgba(229, 88, 44, 0); }
  18% { opacity: 1; box-shadow: inset 0 0 0 3px rgba(229, 88, 44, 0.55), inset 0 0 60px rgba(229, 88, 44, 0.16); }
  100% { opacity: 0; box-shadow: inset 0 0 0 1px rgba(229, 88, 44, 0), inset 0 0 0 rgba(229, 88, 44, 0); }
}
@keyframes hxaSettle { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 100% { transform: scale(1); } }
.hxa-clock b { display: inline-block; transform-origin: 100% 60%; }
.hxa-chart-line .area { stroke: none; }
@media (prefers-reduced-motion: reduce) {
  .hxa-demo.is-arrived .hxa-demo-body::after, .hxa-demo.is-arrived .hxa-clock b { animation: none; }
  .hxa-svg .flag { transition: none; }
}
.hxa-svg .tower .reg { transition: none; }
.hxa-svg .tower.is-hot .mast { stroke: var(--ember); }
.hxa-svg .jack { fill: var(--cloud); stroke: rgba(10, 8, 28, 0.35); stroke-width: 1.5; transition: fill 0.4s, stroke 0.4s; }
.hxa-svg .jack.is-on { fill: var(--ember); stroke: var(--ember); }
/* TAT-1: the channel dial in the cable section, and the calls running inside the cutaway (a dark surface, so cyan) */
.hxa-svg .chan { stroke: rgba(255, 251, 250, 0.16); stroke-width: 2.2; stroke-linecap: round; transition: stroke 0.3s; }
.hxa-svg .chan.is-on { stroke: var(--cyan); filter: drop-shadow(0 0 2px rgba(151, 226, 232, 0.8)); }
.hxa-svg .lane { stroke: rgba(255, 251, 250, 0.08); stroke-width: 1.2; transition: stroke 0.3s; }
.hxa-svg .lane.is-on { stroke: var(--cyan); stroke-dasharray: 12 22; }
/* TDNT: a hexagonal gate for every stage, ringing once as the call clears it */
.hxa-svg .node { fill: var(--cloud); stroke: var(--cobalt); stroke-width: 2.2; stroke-linejoin: round; transition: fill 0.25s; }
.hxa-svg .node.is-on { fill: var(--cobalt); }
.hxa-svg .ripple { fill: none; stroke: var(--cobalt); stroke-width: 1.5; opacity: 0; }
.hxa-svg .ripple.is-on { animation: hxaRipple 0.9s cubic-bezier(.2, .7, .2, 1); }
@keyframes hxaRipple { from { opacity: 0.8; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
/* the relay post's gate glows once a rider has changed horses there, and a ring marks the hand-off */
.hxa-svg .arch { fill: rgba(10, 8, 28, 0.6); transition: fill 0.35s; }
.hxa-svg .stn-g.is-hit .arch { fill: var(--ember); }
.hxa-svg .burst { fill: none; stroke: var(--ember); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
.hxa-svg .stn-g.is-hit .burst { animation: hxaBurst 0.8s cubic-bezier(.2, .7, .2, 1); }
@keyframes hxaBurst { from { opacity: 0.9; transform: scale(0.4); } to { opacity: 0; transform: scale(1.7); } }
/* small engraved captions inside the dioramas */
.hxa-lab { fill: rgba(10, 8, 28, 0.5); font-family: var(--mono); font-size: 8.5px; letter-spacing: 1.4px; }
.hxa-demo[data-demo="tat1"] .hxa-lab { fill: rgba(10, 8, 28, 0.62); font-size: 7.5px; }
.hxa-loupe { filter: drop-shadow(0 6px 10px rgba(10, 8, 28, 0.22)); }
@media (prefers-reduced-motion: reduce) {
  .hxa-svg .burst, .hxa-svg .ripple { animation: none !important; opacity: 0; }
  .hxa-chart-dot.is-ping::after { animation: none; }
}

/* telegraph paper tape */
.hxa-tape {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 58px;
  margin-top: 12px;
  padding: 10px 14px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--sage);
  scrollbar-width: thin;
}
.hxa-tape-l { display: grid; justify-items: center; gap: 5px; flex: none; }
.hxa-tape-m { display: flex; align-items: center; gap: 3px; height: 10px; }
.hxa-tape-m i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--cobalt); opacity: 0.12; transition: opacity 0.12s; }
.hxa-tape-m i.h { width: 18px; border-radius: 3px; }
.hxa-tape-m i.on { opacity: 1; }
.hxa-tape-l small { font-family: var(--mono); font-size: 11px; color: var(--fg-mute); opacity: 0.35; transition: opacity 0.2s; }
.hxa-tape-l.on small { opacity: 1; color: var(--fg); }
.hxa-tape-sp { flex: none; width: 8px; }

/* 98-word grid for the 1858 cable */
.hxa-words { display: grid; grid-template-columns: repeat(49, minmax(0, 1fr)); gap: 3px; margin-top: 12px; }
.hxa-words i { display: block; aspect-ratio: 1; border-radius: 2px; background: rgba(0, 51, 153, 0.1); transition: background 0.2s; }
.hxa-words i.on { background: var(--ember); }

/* telephone caption */
.hxa-caption { margin: 10px 0 0; min-height: 1.6em; text-align: center; font-family: var(--display); font-size: clamp(13px, 1.3vw, 16px); letter-spacing: -0.01em; }
.hxa-caption span { opacity: 0.12; transition: opacity 0.25s; }
.hxa-caption span.on { opacity: 1; }

.hxa-dots { letter-spacing: 0.2em; transition: opacity 0.1s; }

/* TDNT stage pins over the svg */
.hxa-pins { position: absolute; left: 18px; right: 18px; top: 18px; aspect-ratio: 800 / 180; pointer-events: none; }
.hxa-pin {
  position: absolute;
  left: calc(var(--x) * 100%);
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 1px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--fg-mute);
  transition: color 0.25s;
}
.hxa-pin b { font-family: var(--display); font-weight: 400; font-size: 13px; color: var(--fg); }
.hxa-pin small { font-size: 10px; color: var(--ember); }
.hxa-pin.is-up { top: 4%; }
.hxa-pin.is-down { top: 66%; }
.hxa-pin.is-on { color: var(--accent); }
.hxa-pin.is-on b { color: var(--accent); }
.hxa-pin:first-child { transform: none; justify-items: start; }
.hxa-pin:last-child { transform: translateX(-100%); justify-items: end; }

/* era footer: ticket, aside, photo */
.hxa-era-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; align-items: start; }
.hxa-aside { display: grid; gap: 10px; padding: 4px 0 4px 18px; border-left: 2px solid var(--accent2); }
.hxa-aside-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent2); }
.hxa-aside p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--fg-dim); }
.hxa-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }
.hxa-link:hover { text-decoration-color: var(--accent); }
.hxa-photo-tall .hx-photo-frame { aspect-ratio: 3 / 4; }
.hxa-photo-tall .hx-photo-frame img { object-position: 50% 0; }
.hxa-photo-square .hx-photo-frame { aspect-ratio: 1; }

/* ───────── today: the handoff ───────── */
.hxa-end {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 110px);
  align-items: start;
  margin-bottom: clamp(64px, 9vw, 130px);
}
.hxa-end-race { display: grid; gap: 14px; }
.hxa-end-row { display: grid; gap: 6px; }
.hxa-end-row span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-mute); }
.hxa-end-row b { font-family: var(--display); font-weight: 400; font-size: clamp(52px, 7.6vw, 124px); line-height: 1; padding: 0.24em 0 0.22em; letter-spacing: -0.05em; color: var(--fg-mute); }
.hxa-end-row.is-now b { color: var(--accent); }
.hxa-end-row small { font-size: 14px; color: var(--fg-dim); }
.hxa-end-arrow { position: relative; height: 54px; margin-left: 18px; }
.hxa-end-arrow i { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--ember); }
.hxa-end-arrow i::after { content: ""; position: absolute; left: -5px; bottom: 0; border: 6px solid transparent; border-top: 8px solid var(--ember); border-bottom: 0; }
.hxa-end-x { margin: 10px 0 0; font-size: 16px; line-height: 1.55; color: var(--fg-dim); }
.hxa-end-x strong { color: var(--fg); font-weight: 600; }
.hxa-end-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid var(--fg); }
.hxa-end-stats li { display: grid; gap: 6px; padding: 20px 16px 20px 0; border-bottom: 1px solid var(--line); }
.hxa-end-stats li:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
.hxa-end-stats b { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 2.4vw, 36px); letter-spacing: -0.03em; color: var(--accent); }
.hxa-end-stats span { font-size: 13.5px; line-height: 1.45; color: var(--fg-dim); }

/* closing call to action (mirrors .pg-cta without touching the section heading) */
.hxa-cta h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 104px);
  line-height: 1.2;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hxa-cta h2 em { font-style: oblique -10deg; color: var(--accent); }
.hxa-cta p { margin: 0 0 22px; max-width: 40ch; font-size: 16px; line-height: 1.6; color: var(--fg-dim); }

/* sources notes */
.hxa-notes { display: grid; gap: 10px; }
.hxa-notes .hx-note { margin: 0; line-height: 1.55; }

/* ───────── responsive ───────── */
@media (max-height: 860px) and (min-width: 981px) {
  .hxa-dash { gap: 12px; padding: 18px 18px 14px; top: 84px; }
  .hxa-dash-cap { min-height: 0; }
  .hxa-rail button { padding: 3px 8px; font-size: 12px; }
}
@media (max-height: 740px) and (min-width: 981px) {
  .hxa-rail { display: none; }
}

@media (max-width: 980px) {
  .hxa-race { grid-template-columns: 1fr; gap: 28px; }
  .hxa-dash {
    top: 68px;
    margin: 0 calc(-1 * var(--pad-x));
    padding: 10px var(--pad-x) 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 16px;
    align-items: center;
    border-radius: 0;
    border-width: 1px 0;
    background: color-mix(in srgb, var(--cloud) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: none;
  }
  .hxa-dash-k, .hxa-dash-cap, .hxa-rail, .hxa-count-flag { display: none; }
  .hxa-dash-top { gap: 0; }
  .hxa-dash-era { font-size: 11px; }
  .hxa-dash-era b { font-size: 13px; }
  /* a fixed slot, so a wider reading never nudges the era name beside it */
  .hxa-count { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; width: 152px; }
  .hxa-count-pre { min-height: 0; font-size: 10px; }
  .hxa-count-num { flex-wrap: nowrap; gap: 6px; }
  .hxa-count-val { font-size: 34px; }
  .hxa-count-unit { font-size: 14px; }
  .hxa-scale { grid-column: 1 / -1; }
  .hxa-scale-bar { height: 18px; }
  .hxa-scale-mark i { width: 12px; height: 12px; margin: -6px 0 0 -6px; box-shadow: 0 0 0 4px rgba(229, 88, 44, 0.16); }
  .hxa-scale-ticks { height: 13px; margin-top: 0; }
  .hxa-scale-ticks span { font-size: 9px; }
  .hxa-era { scroll-margin-top: 170px; }
  .hxa-end { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .hxa-chart { --lab: 46px; --gut: 46px; height: 230px; }
  .hxa-chart-lab { font-size: 9.5px; }
  .hxa-chart-lab em { display: none; }
  .hxa-chart-lab b { transform: rotate(-60deg); transform-origin: 50% 50%; margin-bottom: 12px; font-weight: 400; }
  .hxa-gl span { font-size: 9px; }
  .hxa-demo-body { padding: 14px 12px 12px; }
  .hxa-pins { left: 12px; right: 12px; top: 14px; }
  .hxa-pin { font-size: 9px; }
  .hxa-pin b { font-size: 10.5px; }
  .hxa-pin small { display: none; }
  .hxa-ends { flex-wrap: wrap; }
  .hxa-legend { order: 3; flex-basis: 100%; }
  .hxa-ctrl { padding: 12px; }
  .hxa-clock { min-width: 0; }
  .hxa-words { grid-template-columns: repeat(14, minmax(0, 1fr)); }
  .hxa-end-stats { grid-template-columns: 1fr; }
  .hxa-end-stats li:nth-child(even) { padding-left: 0; border-left: 0; }
}

@media (max-width: 420px) {
  .hxa-toggle button { padding: 6px 10px; font-size: 11.5px; }
  .hxa-ctrl .hxa-send { flex: 1 1 auto; justify-content: center; }
  .hxa-clock { margin-left: 0; justify-items: start; flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .hxa-chart-dot { transform: scale(1); transition: none; }
  .hxa-chart-line .base { stroke-dasharray: none; animation: none !important; }
  .hxa-chart-line .area { opacity: 1; transition: none; }
  .hxa-count-val, .hxa-count-flag, .hxa-scale-dots i { transition: none; }
}
