.sp-section {
  --sp-ink: #163e44;
  --sp-muted: #395c60;
  --sp-rule: #8daea799;
  color: var(--sp-ink);
  background: radial-gradient(ellipse at 71% 64%, #dce8e1 0, transparent 63%), #f1f3ec;
}
.sp-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr);
  gap: clamp(2rem, 6vw, 6.8rem);
  align-items: end;
}
.sp-intro h2 {
  max-width: 20ch;
  font-size: clamp(2.6rem, 4.3vw, 4.46rem);
  line-height: 1.02;
  text-wrap: balance;
}
.sp-intro h2 em { color: #3b716b; }
.sp-intro .body-copy {
  margin: 0;
  max-width: 48ch;
  font-size: clamp(1rem, 1.28vw, 1.16rem);
  line-height: 1.55;
  color: var(--sp-muted);
}
.sp-plate {
  --sp-cycle: 12s;
  margin: clamp(2rem, 3.3vw, 3.4rem) 0 0;
  border: 1px solid #284a52;
  border-radius: 3px;
  color: #edf7f2;
  background: radial-gradient(ellipse at 60% 48%, #23535c 0%, #163c47 38%, #102e3a 68%, #0b222f 100%);
  box-shadow: inset 0 1px 0 #a9d8ce40, 0 12px 27px -21px #123a41aa;
  position: relative;
  isolation: isolate;
}
.sp-bench {
  --sp-grid-spacing: 19px 19px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(0, .35fr) minmax(0, 1.0fr) minmax(0, .20fr) minmax(0, .81fr);
  min-height: clamp(360px, 29.3vw, 425px);
  padding: 1rem clamp(.62rem, 1.65vw, 1.65rem);
}
.sp-bench::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-radial-gradient(ellipse at 61% 48%, transparent 0 65px, #a2d6d00e 66px, transparent 67px 105px),
    radial-gradient(circle at 1px 1px, #91c3bc38 .75px, transparent 1px);
  background-size: auto, var(--sp-grid-spacing);
  mask-image: linear-gradient(100deg, #0008, #000 64%, #0009);
}
.sp-grid-light { display: none; }
.sp-bench::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 10px;
  --sp-tick: #abdad174;
  background:
    linear-gradient(to right,var(--sp-tick) 13px,transparent 13px) left top / 13px 1px,
    linear-gradient(var(--sp-tick) 11px,transparent 11px) left top / 1px 11px,
    linear-gradient(to left,var(--sp-tick) 13px,transparent 13px) right bottom / 13px 1px,
    linear-gradient(to top,var(--sp-tick) 11px,transparent 11px) right bottom / 1px 11px;
  background-repeat: no-repeat;
}
.sp-inputs { display: grid; grid-template-rows: 1fr 1fr; min-width: 0; }
.sp-family {
  display: grid;
  grid-template-columns: minmax(75px, 1fr) minmax(145px, 1.24fr);
  gap: clamp(.6rem, 1.3vw, 1.25rem);
  align-items: center;
  position: relative;
  min-width: 0;
  padding: .48rem 1.1rem .48rem 0;
}
.sp-specimen { min-width: 0; }
.sp-specimen > svg { display: block; width: 100%; height: auto; }
.sp-family--context::before {
  content: ""; position: absolute; inset: 0 .8rem auto .25rem; height: 1px;
  background: linear-gradient(90deg,transparent,#96cdc637 17%,#96cdc624 82%,transparent);
}
.sp-family h3 {
  font: 580 clamp(1.04rem, 1.4vw, 1.34rem)/1.13 var(--display);
  letter-spacing: -.04em;
  margin: 0 0 .45rem;
}
.sp-family ul { list-style: none; padding: 0; margin: 0; }
.sp-family li {
  font: 460 clamp(.88rem, 1.07vw, 1rem)/1.42 var(--body);
  color: #c2d8d5;
}
.sp-family li + li { margin-top: .1rem; }
.sp-jack {
  position: absolute;
  right: -1px; top: 50%;
  width: 7px; height: 14px;
  transform: translateY(-50%);
  background: linear-gradient(90deg,#568591,#b3e1d5 61%,#5c9097);
  border: 1px solid #82aca9;
  border-radius: 2px;
}
.sp-collector { min-width: 0; position: relative; }
.sp-collector > svg { position: absolute; inset: 0; height: 100%; width: 100%; }
.sp-collector-down, .sp-downlink, .sp-stack-port, .sp-top-inlet { display: none; }
.sp-inlet-light, .sp-prism-ray { opacity: 0; stroke-dasharray: 17 120; }
.sp-record-light { opacity: 0; stroke-dasharray: 19 115; }
.sp-context-light { opacity: 0; }
.sp-wire { stroke: #78a7a8; stroke-width: .95; vector-effect: non-scaling-stroke; }
.sp-in-pulse, .sp-out-pulse {
  stroke: #c3fff0; stroke-width: 1.85;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 9 117;
  stroke-dashoffset: 12;
  opacity: 0;
}
.sp-station { position: relative; align-self: center; min-width: 0; }
.sp-focus-frame { display: none; }
.sp-station > svg { display: block; width: 100%; height: auto; }
.sp-station h3 {
  position: absolute;
  inset: calc(100% + .12rem) 0 auto;
  max-width: 17ch;
  margin: 0 auto;
  text-align: center;
  font: 560 clamp(1.09rem, 1.6vw, 1.58rem)/1.08 var(--display);
  letter-spacing: -.043em;
  text-wrap: balance;
}
.sp-transmission { position: relative; align-self: center; height: 24px; }
.sp-transmission svg { position: absolute; width: 100%; height: 100%; }
.sp-output-line { stroke: #8cb7b2; stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.sp-transmission i {
  position: absolute; top: 8.5px; left: 58%;
  width: 7px; height: 7px;
  transform: rotate(-45deg);
  border: solid #b5d9c7; border-width: 0 1.5px 1.5px 0;
}
.sp-legend {
  min-height: 2.9rem;
  padding-inline: clamp(.8rem, 1.8vw, 1.7rem);
  border-top: 1px solid #93c6c12c;
  background: #051b2763;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #b4cdca;
  font: 490 .77rem/1.3 var(--body);
}
.sp-legend button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: .45rem .1rem .45rem .75rem;
  border: 0;
  color: #c5e6de;
  background: transparent;
  font: inherit;
}
.sp-legend button::before { content: ""; width: 7px; height: 9px; border-inline: 2px solid currentColor; box-sizing: border-box; }
.sp-legend button[aria-pressed=true]::before {
  width: 0; height: 0; border: solid transparent; border-width: 4.5px 0 4.5px 7px; border-left-color: currentColor;
}
@keyframes sp-collect {
  0% { stroke-dashoffset: 11; opacity: 0; }
  2%, 12% { opacity: 1; }
  15%, 100% { stroke-dashoffset: -104; opacity: 0; }
}
@keyframes sp-source-mark {
  0% { stroke-dashoffset: 19; opacity: 0; }
  5%, 15% { opacity: 1; }
  22%, 100% { stroke-dashoffset: -103; opacity: 0; }
}
@keyframes sp-window-glint {
  0%, 22%, 45%, 100% { opacity: 0; }
  27%, 36% { opacity: .95; }
}
.sp-deck-signal, .sp-report-glint {
  opacity: 0;
  stroke-dasharray: 13 114;
}
.sp-crystal-reflection { opacity: .22; }
@keyframes sp-chip-route {
  0%, 46% { stroke-dashoffset: 15; opacity: 0; }
  49%, 60% { opacity: .9; }
  65%, 100% { stroke-dashoffset: -101; opacity: 0; }
}
@keyframes sp-rim-read {
  0%, 72% { stroke-dashoffset: 15; opacity: 0; }
  75%, 87% { opacity: .9; }
  90%, 100% { stroke-dashoffset: -101; opacity: 0; }
}
@keyframes sp-turn-facet {
  0%, 45%, 72%, 100% { opacity: .18; }
  51%, 64% { opacity: .85; }
}
@keyframes sp-refract {
  0%, 45%, 72%, 100% { opacity: .38; }
  52%, 65% { opacity: 1; }
}
@keyframes sp-couple {
  0%, 46% { stroke-dashoffset: 18; opacity: 0; }
  48%, 52% { opacity: 1; }
  55%, 100% { stroke-dashoffset: -103; opacity: 0; }
}
@keyframes sp-through-glass {
  0%, 52% { stroke-dashoffset: 18; opacity: 0; }
  54%, 63% { opacity: 1; }
  66%, 100% { stroke-dashoffset: -106; opacity: 0; }
}
@keyframes sp-deliver {
  0%, 64% { stroke-dashoffset: 10; opacity: 0; }
  66%, 73% { opacity: 1; }
  76%, 100% { stroke-dashoffset: -108; opacity: 0; }
}
@keyframes sp-inscribe {
  0%, 74% { stroke-dashoffset: 101; opacity: 0; }
  77% { opacity: 1; }
  85%, 98% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@media (prefers-reduced-motion:no-preference) {
  html.js .sp-plate.motion-ready .sp-grid-light {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    opacity: .55;
    /* Fix the lit points to the same coordinates as the printed grid. */
    mask: radial-gradient(circle at 1px 1px, #000 1px, #0005 1.55px, transparent 2.4px) 0 0 / var(--sp-grid-spacing) repeat;
  }
  .sp-grid-light::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, #88e0d628 28%, #b6f5df99 61%, #83e6d838 76%, transparent);
    animation: sp-grid-pass var(--sp-cycle) linear infinite;
  }
  @keyframes sp-grid-pass {
    0% { transform: translateX(-100%); }
    90%, 100% { transform: translateX(250%); }
  }
  html.js .sp-plate.motion-ready .sp-deck-signal { animation: sp-chip-route var(--sp-cycle) ease-in-out infinite; }
  html.js .sp-plate.motion-ready [data-optic-layer="1"] .sp-deck-signal { animation-delay: .16s; }
  html.js .sp-plate.motion-ready [data-optic-layer="0"] .sp-deck-signal { animation-delay: .32s; }
  html.js .sp-plate.motion-ready .sp-crystal-reflection { animation: sp-turn-facet var(--sp-cycle) ease-in-out infinite; }
  html.js .sp-plate.motion-ready .sp-report-glint { animation: sp-rim-read var(--sp-cycle) ease-in-out infinite; }
  html.js .sp-plate.motion-ready .sp-record-light { animation: sp-source-mark var(--sp-cycle) ease-in-out infinite; }
  html.js .sp-plate.motion-ready .sp-context-light { animation: sp-window-glint var(--sp-cycle) ease-in-out infinite; }
  html.js .sp-plate.motion-ready .sp-in-pulse { animation: sp-collect var(--sp-cycle) linear var(--signal-delay) infinite; }
  html.js .sp-plate.motion-ready .sp-core-live { animation: sp-refract var(--sp-cycle) ease-in-out infinite; }
  html.js .sp-plate.motion-ready .sp-inlet-light { animation: sp-couple var(--sp-cycle) linear infinite; }
  html.js .sp-plate.motion-ready .sp-prism-ray { animation: sp-through-glass var(--sp-cycle) linear infinite; }
  html.js .sp-plate.motion-ready .sp-out-pulse { animation: sp-deliver var(--sp-cycle) linear infinite; }
  html.js .sp-plate.motion-ready .sp-report-trace { stroke-dasharray: 100 104; animation: sp-inscribe var(--sp-cycle) ease-out infinite; }
}
@media (max-width: 960px) {
  .sp-family { grid-template-columns: minmax(62px,.7fr) minmax(128px,1.1fr); gap: .55rem; }
  .sp-intro { gap: 2rem; grid-template-columns: 1fr .94fr; }
  .sp-bench { padding-inline: .45rem; }
}
/* The narrow plate reads down the page. The engine, its output lead, and
   the report share an optical axis at the center of the illustration column. */
@media (max-width: 900px) {
  .sp-intro { grid-template-columns: 1fr; gap: 1.05rem; }
  .sp-intro h2 { font-size: clamp(2.2rem, 6.8vw, 3.45rem); }
  .sp-intro .body-copy { max-width: 62ch; }
  .sp-bench {
    --sp-art-column: 46%;
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: auto 40px auto 28px auto;
    width: min(100%, 630px);
    min-height: 0;
    margin-inline: auto;
    padding: clamp(.85rem,3vw,1.5rem) clamp(.75rem,3vw,1.35rem) .8rem;
  }
  .sp-inputs {
    position: relative;
    grid-template: auto auto / minmax(0,1fr);
    isolation: isolate;
    --rail-space: 15px;
  }
  .sp-inputs::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 var(--rail-space) 0 0;
    border: 1px solid #8cbcb64d;
    border-radius: 5px;
    background: linear-gradient(125deg,#244852dd,#102e38e8);
  }
  .sp-family {
    grid-template-columns: minmax(0,.68fr) minmax(0,1.32fr);
    gap: clamp(.4rem,2vw,.8rem);
    align-items: center;
    padding: .72rem calc(var(--rail-space) + .58rem) .72rem .42rem;
  }
  .sp-specimen { width: min(100%,122px); justify-self: center; }
  .sp-family h3 { font-size: clamp(1.04rem,4.6vw,1.24rem); margin-bottom: .28rem; }
  .sp-family li { font-size: clamp(.91rem,3.7vw,.99rem); line-height: 1.4; }
  .sp-family li + li { margin-top: .04rem; }
  .sp-family--context::before { inset: 0 calc(var(--rail-space) + .65rem) auto .65rem; }
  /* Each source has a separate tap off the common collection rail. */
  .sp-jack {
    right: 1px; width: var(--rail-space); height: 1px;
    background: #8cbdb8; border: 0; border-radius: 0;
  }
  .sp-jack::before {
    content: ""; position: absolute; left: -2px; top: -2px; width: 5px; height: 5px;
    border-radius: 50%; background: #b2ded0; box-shadow: 0 0 0 2px #214650;
  }
  .sp-family::after {
    content: ""; position: absolute; inset: 50% 1px 0 auto; border-right: 1px solid #84aaa9;
  }
  .sp-family--context::after { top: 0; }
  .sp-collector-horizontal, .sp-side-port, .sp-side-inlet, .sp-paired-return { display: none; }
  .sp-collector-down { display: block; }
  .sp-top-inlet, .sp-stack-port { display: inline; }
  .sp-station {
    display: grid;
    grid-template-columns: var(--sp-art-column) minmax(0,1fr);
    column-gap: clamp(.45rem,1.8vw,.95rem);
    align-items: center;
  }
  .sp-station h3 {
    position: static; margin: 0; max-width: 14ch;
    text-align: left; font-size: clamp(1.1rem,5.1vw,1.85rem); line-height: 1.12;
    hyphens: auto; overflow-wrap: anywhere;
  }
  .sp-result h3 { --sp-rest-ink: #c0efdf; color: var(--sp-rest-ink); }
  .sp-transmission { align-self: stretch; width: var(--sp-art-column); height: auto; }
  .sp-transmission > svg:first-child, .sp-transmission i { display: none; }
  .sp-transmission .sp-downlink { display: block; left: calc(50% - 12px); width: 24px; }
  .sp-legend { padding-inline: 1rem; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .sp-inputs { grid-template: auto / repeat(2,minmax(0,1fr)); --rail-space: 0px; }
  .sp-family { padding: .8rem .7rem; grid-template-columns: minmax(0,.55fr) minmax(0,1.45fr); }
  .sp-family--context::before { inset: .65rem auto .65rem 0; width: 1px; height: auto; background: #8cbcb645; }
  .sp-family::after { display: none; }
  .sp-jack { right: auto; left: 50%; top: auto; bottom: 0; }
  .sp-paired-return { display: inline; }
  .sp-rail-return { display: none; }
}
@media (max-width:900px) and (prefers-reduced-motion:no-preference) {
  html.js .sp-plate.motion-ready .sp-jack::before {
    animation: sp-tap-light var(--sp-cycle) ease-out infinite;
  }
  html.js .sp-plate.motion-ready .sp-family--context .sp-jack::before { animation-delay: 2.88s; }
  html.js .sp-plate.motion-ready .sp-collector-down .sp-in-pulse { animation: sp-link-travel var(--sp-cycle) linear var(--signal-delay) infinite; }
  html.js .sp-plate.motion-ready .sp-stack-port .sp-out-pulse { animation: sp-link-travel var(--sp-cycle) linear 7.8s infinite; }
  html.js .sp-plate.motion-ready .sp-downlink .sp-out-pulse { animation: sp-link-travel var(--sp-cycle) linear 8.55s infinite; }
  @keyframes sp-tap-light {
    0%, 18%, 100% { box-shadow: 0 0 0 2px #214650; }
    7% { background: #e2fff1; box-shadow: 0 0 0 2px #336965, 0 0 7px 1px #a1f7dc; }
  }
  @keyframes sp-link-travel {
    0% { stroke-dashoffset: 12; opacity: 0; }
    1%, 7% { opacity: .95; }
    9%, 100% { stroke-dashoffset: -106; opacity: 0; }
  }
  .sp-grid-light::before {
    inset: 0 0 auto;
    width: 100%; height: 40%;
    background: linear-gradient(180deg,transparent,#88e0d628 28%,#b6f5df99 61%,#83e6d838 76%,transparent);
    animation-name: sp-grid-descend;
  }
  @keyframes sp-grid-descend {
    0% { transform: translateY(-100%); }
    90%, 100% { transform: translateY(250%); }
  }
}
@media (max-width:600px) and (prefers-reduced-motion:no-preference) {
  html.js .sp-plate.motion-ready .sp-family::after {
    width: 1px; border: 0;
    background: linear-gradient(transparent,#c6ffee,transparent) no-repeat, #84aaa9;
    background-size: 100% 19px;
    animation: sp-rail-travel var(--sp-cycle) linear .96s infinite backwards;
  }
  /* The first pulse arrives at the second source tap midway down this rail. */
  html.js .sp-plate.motion-ready .sp-family--context::after {
    animation-name: sp-rail-merge;
    animation-delay: 2.4s;
  }
  @keyframes sp-rail-merge {
    0% { background-position: 0 -20px; }
    20%, 100% { background-position: 0 calc(100% + 20px); }
  }
  @keyframes sp-rail-travel {
    0% { background-position: 0 -20px; }
    12%, 100% { background-position: 0 calc(100% + 20px); }
  }
}

/* A single lit panel identifies the current stage. Its artwork and label
   use the same clock as the signal paths, without shifting the diagram. */
@media (prefers-reduced-motion:no-preference) {
  .sp-family, .sp-station { isolation: isolate; }
  .sp-family--clinical { --sp-stage-start: 0s; }
  .sp-family--context { --sp-stage-start: calc(var(--sp-cycle) * .22); }
  .sp-engine { --sp-stage-start: calc(var(--sp-cycle) * .46); }
  .sp-result {
    --sp-stage-start: calc(var(--sp-cycle) * .70);
    --sp-stage-animation: sp-finish-focus;
  }
  .sp-focus-frame {
    position: absolute; z-index: -1; pointer-events: none;
    inset: .18rem 0; border: 1px solid #96e7d3c7; border-radius: 5px;
    border-inline-start: 3px solid #bbffe7;
    background: linear-gradient(108deg,#317165e6,#25545acd 54%,#193d44db);
    box-shadow: inset 0 0 12px #80efc91a;
    opacity: 0;
  }
  .sp-family .sp-focus-frame { inset-inline-end: calc(var(--rail-space,0px) + 2px); }
  html.js .sp-plate.motion-ready .sp-focus-frame { display: block; }
  .sp-specimen, .sp-station > svg {
    --sp-rest-alpha: 1;
    --sp-lit-filter: brightness(1.25) saturate(1.16);
  }
  .sp-plate h3 {
    --sp-rest-alpha: 1;
    --sp-lit-ink: #c8ffea;
    --sp-lit-shadow: 0 0 .45em #7cffe645;
  }
  html.js .sp-plate.motion-ready :is(.sp-focus-frame,.sp-specimen,.sp-station > svg,h3) {
    animation: var(--sp-stage-animation,sp-stage-focus) var(--sp-cycle) ease-in-out var(--sp-stage-start) infinite;
  }
  @keyframes sp-stage-focus {
    0%, 24%, 100% { opacity: var(--sp-rest-alpha,0); filter: none; color: var(--sp-rest-ink,inherit); text-shadow: none; }
    2%, 21% { opacity: 1; filter: var(--sp-lit-filter,none); color: var(--sp-lit-ink,inherit); text-shadow: var(--sp-lit-shadow,none); }
  }
  @keyframes sp-finish-focus {
    0%, 30%, 100% { opacity: var(--sp-rest-alpha,0); filter: none; color: var(--sp-rest-ink,inherit); text-shadow: none; }
    2%, 28% { opacity: 1; filter: var(--sp-lit-filter,none); color: var(--sp-lit-ink,inherit); text-shadow: var(--sp-lit-shadow,none); }
  }
}
