:root {
  --h: 28;
  --bg: hsla(var(--h), 34%, 96%, 1);
  --bg-deep: hsla(var(--h), 28%, 90%, 1);
  --bg-wash: hsla(var(--h), 36%, 93%, 0.9);
  --panel: hsla(var(--h), 38%, 98%, 0.78);
  --ink: hsla(var(--h), 18%, 14%, 1);
  --muted: hsla(var(--h), 14%, 34%, 1);
  --soft: hsla(var(--h), 16%, 50%, 1);
  --line: hsla(var(--h), 18%, 72%, 0.74);
  --line-strong: hsla(var(--h), 20%, 44%, 0.58);
  --sn: hsla(calc(var(--h) - 8), 71%, 54%, 1);
  --fpn: hsla(calc(var(--h) + 156), 40%, 36%, 1);
  --dmn: hsla(calc(var(--h) + 304), 26%, 35%, 1);
  --state-0: hsla(calc(var(--h) + 304), 30%, 42%, 0.82);
  --state-1: hsla(var(--h), 18%, 54%, 0.88);
  --state-2: hsla(calc(var(--h) + 156), 42%, 40%, 0.84);
  --plot-axis: hsla(var(--h), 18%, 74%, 0.74);
  --plot-grid: hsla(var(--h), 18%, 78%, 0.5);
  --plot-band: hsla(var(--h), 26%, 94%, 0.58);
  --plot-line: hsla(calc(var(--h) + 156), 34%, 37%, 1);
  --plot-fill: hsla(calc(var(--h) + 156), 44%, 52%, 0.16);
  --plot-cursor: hsla(calc(var(--h) - 8), 66%, 49%, 0.9);
  --plot-mean: hsla(calc(var(--h) + 156), 14%, 42%, 0.74);
  --plot-control: hsla(calc(var(--h) + 156), 34%, 37%, 1);
  --plot-patient: hsla(calc(var(--h) - 8), 68%, 52%, 1);
  --plot-patient-fill: hsla(calc(var(--h) - 8), 72%, 62%, 0.16);
  --shadow: 0 28px 64px hsla(var(--h), 18%, 15%, 0.08);
  --ease: 360ms cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Instrument Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, hsla(calc(var(--h) - 8), 72%, 58%, 0.12), transparent 24%),
    radial-gradient(circle at 84% 18%, hsla(calc(var(--h) + 156), 44%, 44%, 0.1), transparent 22%),
    radial-gradient(circle at 70% 84%, hsla(calc(var(--h) + 304), 28%, 42%, 0.09), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(hsla(var(--h), 18%, 50%, 0.04) 1px, transparent 1px);
  background-size: 100% 22px;
  mask-image: linear-gradient(180deg, hsla(0, 0%, 0%, 0.24), transparent 78%);
}

button,
input {
  font: inherit;
}

.viz {
  min-height: 100vh;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(1rem, 2.8vw, 1.45rem) clamp(1rem, 2.8vw, 1.4rem) 1.25rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: clamp(0.85rem, 2vw, 1.15rem);
}

.topline,
.controls,
.playbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topline {
  justify-content: flex-start;
}

.stepline,
.source,
.eyebrow,
.what,
.mini-kicker,
.lane-label,
.lane-subject,
.triangle-note,
.node-short,
.node-role {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stepline,
.source,
.eyebrow,
.mini-kicker,
.lane-label,
.lane-subject,
.triangle-note,
.node-short,
.node-role {
  font-size: 0.72rem;
}

.stepline,
.source,
.eyebrow,
.mini-kicker,
.lane-subject,
.triangle-note,
.node-role {
  color: var(--muted);
}

.copy {
  width: min(100%, 34rem);
  display: grid;
  gap: 0.7rem;
  padding-top: 0.35rem;
}

.copy > * {
  transform: translate3d(0, 0, 0);
  transition:
    opacity 360ms var(--ease-out-quart),
    transform 360ms var(--ease-out-quart);
}

.copy.is-refreshing .eyebrow {
  animation: copy-rise 360ms var(--ease-out-quart) both;
}

.copy.is-refreshing #headline {
  animation: copy-rise 520ms var(--ease-out-expo) 50ms both;
}

.copy.is-refreshing .body {
  animation: copy-rise 520ms var(--ease-out-expo) 110ms both;
}

.copy.is-refreshing .what {
  animation: copy-rise 520ms var(--ease-out-expo) 180ms both;
}

.copy.is-resting .eyebrow,
.copy.is-resting .what {
  opacity: 0.28;
}

.copy.is-resting .body {
  opacity: 0.72;
}

.copy:hover > *,
.copy:focus-within > * {
  opacity: 1 !important;
}

.viz[data-mode="compare"] .copy,
.viz[data-mode="summary"] .copy,
.viz[data-mode="explore"] .copy {
  width: min(100%, 30rem);
  gap: 0.55rem;
}

.viz[data-mode="compare"] .copy h1,
.viz[data-mode="summary"] .copy h1,
.viz[data-mode="explore"] .copy h1 {
  font-size: clamp(2.5rem, 5.7vw, 4.45rem);
  max-width: 5.8ch;
}

.copy h1 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 0.9;
  font-weight: 500;
  letter-spacing: -0.045em;
  max-width: 7ch;
}

.body {
  margin: 0;
  max-width: 28rem;
  font-size: clamp(1rem, 1.85vw, 1.2rem);
  line-height: 1.5;
  color: color-mix(in srgb, var(--ink) 86%, var(--muted));
}

.what {
  margin-top: 0.1rem;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: hsla(var(--h), 34%, 98%, 0.7);
  font-size: 0.78rem;
  color: var(--ink);
  width: fit-content;
  max-width: min(100%, 29rem);
  line-height: 1.35;
  text-wrap: pretty;
}

.source {
  display: none;
}

.scene {
  min-height: 0;
  display: grid;
  align-items: stretch;
}

.mode {
  min-height: 0;
}

.scene.is-step-entering .mode:not([hidden]) {
  animation: scene-fade 280ms ease;
}

.scene.is-step-entering .mode:not([hidden]) .node,
.scene.is-step-entering .mode:not([hidden]) .panel,
.scene.is-step-entering .mode:not([hidden]) .triangle-note,
.scene.is-step-entering .mode:not([hidden]) .lane-head,
.scene.is-step-entering .mode:not([hidden]) .mini-strip,
.scene.is-step-entering .mode:not([hidden]) .compare-board-svg,
.scene.is-step-entering .mode:not([hidden]) .plot-svg,
.scene.is-step-entering .mode:not([hidden]) .subject-pill {
  animation: fade-lift 320ms var(--ease-out-quart);
}

.focus-main {
  min-height: clamp(360px, 44vw, 520px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: clamp(1rem, 2.8vw, 2.5rem);
  align-items: center;
}

.focus-side {
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 0.65rem;
}

.panel {
  min-height: 220px;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}

.summary-panel {
  min-height: 320px;
}

.network-triangle {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1;
  margin: 0 auto;
  isolation: isolate;
}

.network-triangle::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 999px;
  background: radial-gradient(circle, var(--bg-wash), transparent 72%);
  filter: blur(14px);
}

.triangle-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.triangle-edges line {
  stroke-linecap: round;
  opacity: 0.12;
  transition:
    stroke-width var(--ease),
    opacity var(--ease),
    stroke-dasharray var(--ease),
    stroke-dashoffset var(--ease);
  will-change: transform, opacity, stroke-dashoffset;
}

.triangle-edges [data-edge="sn_fpn"] {
  stroke: color-mix(in srgb, var(--sn) 60%, var(--fpn));
}

.triangle-edges [data-edge="sn_dmn"] {
  stroke: color-mix(in srgb, var(--sn) 64%, var(--dmn));
}

.triangle-edges [data-edge="fpn_dmn"] {
  stroke: color-mix(in srgb, var(--fpn) 52%, var(--dmn));
}

.node {
  position: absolute;
  left: calc(var(--x, 50) * 1%);
  top: calc(var(--y, 50) * 1%);
  width: clamp(8rem, 17vw, 10.5rem);
  aspect-ratio: 1;
  border-radius: 999px;
  padding: clamp(0.72rem, 1.7vw, 0.96rem);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.12rem;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transform: translate(-50%, -50%) scale(var(--node-scale, 1));
  transition:
    opacity var(--ease),
    border-color var(--ease),
    background var(--ease),
    box-shadow var(--ease),
    transform 280ms var(--ease-out-quart);
}

.node::before {
  content: "";
  position: absolute;
  inset: -7%;
  border-radius: inherit;
  border: 1px solid currentColor;
  opacity: 0.14;
  transform: scale(var(--ring-scale, 1));
  transition:
    transform var(--ease),
    opacity var(--ease);
}

.node-label {
  display: block;
  font-family: "Newsreader", serif;
  max-width: 8.4ch;
  font-size: clamp(0.96rem, 1.55vw, 1.3rem);
  line-height: 0.92;
  font-weight: 500;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.node-short {
  color: currentColor;
  max-width: 100%;
  line-height: 1;
}

.node-role {
  max-width: 9ch;
  font-size: 0.64rem;
  line-height: 1.08;
  letter-spacing: 0.04em;
  text-transform: none;
  overflow-wrap: anywhere;
}

.node-sn {
  --x: 22;
  --y: 74;
  color: var(--sn);
}

.node-fpn {
  --x: 50;
  --y: 18;
  color: var(--fpn);
}

.node-dmn {
  --x: 78;
  --y: 74;
  color: var(--dmn);
}

.node.active {
  background: hsla(var(--h), 40%, 99%, 0.94);
  border-color: color-mix(in srgb, currentColor 34%, var(--line));
}

.node:hover,
.node:focus-visible {
  --node-scale: 1.03;
  box-shadow: 0 32px 72px hsla(var(--h), 18%, 15%, 0.13);
}

.node.is-grabbed {
  --node-scale: 1.07;
  cursor: grabbing;
  box-shadow: 0 36px 86px hsla(var(--h), 18%, 15%, 0.17);
}

.network-triangle.is-dragging .node:not(.is-grabbed) {
  opacity: 0.7;
}

.node.live::before {
  animation: ring-breathe 1.5s var(--ease-out-quart) infinite alternate;
}

.node.is-hot {
  box-shadow: 0 30px 72px hsla(var(--h), 18%, 15%, 0.12);
}

.triangle-edges line.positive {
  filter: saturate(1.05);
}

.triangle-edges line.negative {
  stroke-linecap: butt;
  stroke-dashoffset: 0;
}

.viz.is-playing .triangle-edges line.negative {
  animation: dash-travel 1.25s linear infinite;
}

.viz.is-playing .triangle-edges line.positive {
  animation: edge-breathe 1.4s var(--ease-out-quart) infinite alternate;
}

.triangle-edges line.dominant {
  opacity: 0.88 !important;
}

.node.compact .node-label,
.compact .node-label,
.compact .node-role {
  display: none;
}

.compact .node {
  width: clamp(5.2rem, 8.6vw, 6rem);
  padding: 0.45rem;
  background: hsla(var(--h), 40%, 99%, 0.96);
  border-color: color-mix(in srgb, currentColor 58%, var(--line));
  box-shadow: 0 22px 44px hsla(var(--h), 18%, 15%, 0.1);
}

.compact .node-short {
  font-size: 0.82rem;
  font-weight: 600;
}

.compact .node-sn {
  --x: 20;
  --y: 72;
}

.compact .node-fpn {
  --x: 50;
  --y: 20;
}

.compact .node-dmn {
  --x: 80;
  --y: 72;
}

.triangle-note {
  position: absolute;
  left: 2%;
  bottom: 3%;
  max-width: 15rem;
  padding: 0.55rem 0.8rem;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  background: hsla(var(--h), 36%, 98%, 0.72);
  letter-spacing: 0.04em;
  text-transform: none;
  pointer-events: none;
}

.state-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: hsla(var(--h), 34%, 98%, 0.72);
  font-size: 0.8rem;
  color: var(--ink);
  transition:
    border-color 220ms ease,
    transform 220ms var(--ease-out-quart);
}

.state-chip:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.state-chip span {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
}

.state-chip[data-state="0"] span {
  background: var(--state-0);
}

.state-chip[data-state="1"] span {
  background: var(--state-1);
}

.state-chip[data-state="2"] span {
  background: var(--state-2);
}

.mode-compare {
  min-height: clamp(420px, 46vw, 560px);
  display: grid;
  align-content: start;
}

.compare-stage {
  display: grid;
  min-width: 0;
}

.compare-board {
  display: grid;
  gap: 0.8rem;
  width: 100%;
  min-width: 0;
}

.compare-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.9rem, 2vw, 1.6rem);
  align-items: start;
  width: min(100%, 820px);
  min-width: 0;
  margin-inline: auto;
}

.compare-head {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.compare-board-viz {
  width: min(100%, 820px);
  min-width: 0;
  margin-inline: auto;
}

.compare-board-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: hidden;
}

.compare-strip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.9rem, 2vw, 1.6rem);
  width: min(100%, 820px);
  min-width: 0;
  margin-inline: auto;
}

.lane-label {
  color: var(--ink);
}

.lane-subject {
  min-width: 0;
  max-width: 18rem;
  font-size: 0.74rem;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: none;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.mini-strip,
.state-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  width: 100%;
  min-width: 0;
  height: 1rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.strip-segment {
  min-width: 0;
  border-radius: 999px;
  opacity: 0.28;
  border: 0;
  cursor: pointer;
  transform: translateY(0) scaleY(1);
  transition:
    opacity 180ms ease,
    filter 180ms ease,
    transform 180ms var(--ease-out-quart);
}

.strip-segment[data-state="0"] {
  background: var(--state-0);
}

.strip-segment[data-state="1"] {
  background: var(--state-1);
}

.strip-segment[data-state="2"] {
  background: var(--state-2);
}

.strip-segment.current {
  opacity: 1;
  filter: saturate(1.1) brightness(1.02);
  transform: translateY(-1px) scaleY(1.12);
}

.strip-segment:hover {
  opacity: 0.78;
  transform: translateY(-1px);
}

.mode-summary {
  min-height: clamp(360px, 42vw, 460px);
  display: grid;
  align-content: center;
  gap: 0.75rem;
}

.plot-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.plot-axis,
.plot-baseline {
  stroke: var(--plot-axis);
  stroke-width: 1;
}

.plot-baseline {
  stroke-dasharray: 4 6;
}

.plot-line {
  fill: none;
  stroke: var(--plot-line);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plot-fill {
  fill: var(--plot-fill);
}

.plot-cursor {
  stroke: var(--plot-cursor);
  stroke-width: 1.2;
  animation: cursor-breathe 1.25s ease-in-out infinite alternate;
}

.plot-label,
.plot-value {
  fill: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.plot-value {
  fill: var(--plot-cursor);
}

.plot-point {
  fill: hsla(var(--h), 34%, 98%, 1);
  stroke-width: 2;
  transition:
    opacity 180ms ease,
    stroke-width 180ms ease;
}

.plot-point.control {
  stroke: var(--plot-control);
}

.plot-point.schizophrenia {
  stroke: var(--plot-patient);
}

.plot-point.patient {
  fill: var(--plot-patient-fill);
  stroke: var(--plot-patient);
}

.plot-point.selected {
  stroke-width: 3;
}

.current-point {
  fill: var(--plot-cursor);
  stroke: hsla(var(--h), 34%, 98%, 1);
  stroke-width: 2;
}

.plot-mean {
  stroke: var(--plot-mean);
  stroke-width: 2;
}

.fit-line {
  stroke: var(--plot-patient);
  stroke-width: 2;
  stroke-dasharray: 7 6;
}

.plot-hitarea,
.plot-hit {
  cursor: crosshair;
}

.summary-plot .plot-hit {
  cursor: pointer;
}

.plot-gridline {
  stroke: var(--plot-grid);
  stroke-width: 1;
}

.plot-band {
  fill: hsla(var(--h), 26%, 94%, 0.58);
}

.mode-explore {
  min-height: clamp(440px, 55vw, 650px);
  display: grid;
  align-content: center;
}

.explore-main {
  display: grid;
  gap: 1rem;
}

.explore-side {
  display: grid;
  gap: 0.65rem;
}

.subject-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subject-pill {
  min-height: 2rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: hsla(var(--h), 34%, 98%, 0.72);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms var(--ease-out-quart),
    box-shadow 180ms var(--ease-out-quart);
}

.subject-pill.active {
  border-color: currentColor;
  background: hsla(var(--h), 36%, 99%, 0.94);
}

.subject-pill:hover,
.subject-pill:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px hsla(var(--h), 18%, 15%, 0.08);
}

.subject-pill.control {
  color: var(--fpn);
}

.subject-pill.schizophrenia {
  color: var(--sn);
}

.explore-note {
  margin: 0;
  max-width: 26rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ink) 74%, var(--muted));
}

.explore-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  gap: clamp(1rem, 2.4vw, 2rem);
  align-items: center;
}

.explore-panel-wrap .panel {
  min-height: 260px;
}

.pair-bars {
  display: grid;
  gap: 0.75rem;
}

.pair-row {
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  align-items: center;
  gap: 0.7rem;
}

.pair-row label,
.pair-row span {
  font-size: 0.84rem;
}

.pair-row label {
  color: var(--ink);
}

.pair-row span {
  color: var(--muted);
}

.pair-track {
  position: relative;
  height: 0.95rem;
  border-radius: 999px;
  background: hsla(var(--h), 20%, 82%, 0.42);
  overflow: hidden;
}

.pair-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: inherit;
}

.pair-fill.positive {
  background: color-mix(in srgb, var(--ink) 16%, var(--fpn));
}

.pair-fill.negative {
  background:
    repeating-linear-gradient(
      -55deg,
      color-mix(in srgb, var(--ink) 12%, var(--dmn)),
      color-mix(in srgb, var(--ink) 12%, var(--dmn)) 8px,
      hsla(var(--h), 36%, 98%, 0.4) 8px,
      hsla(var(--h), 36%, 98%, 0.4) 14px
    );
}

.pair-center {
  position: absolute;
  top: -0.12rem;
  bottom: -0.12rem;
  left: 50%;
  width: 1px;
  background: hsla(var(--h), 20%, 45%, 0.32);
}

.panel-note {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ink) 76%, var(--muted));
}

.viz-tooltip {
  position: fixed;
  z-index: 40;
  min-width: 10.5rem;
  max-width: 14rem;
  padding: 0.75rem 0.85rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: hsla(var(--h), 38%, 98%, 0.95);
  box-shadow: 0 18px 40px hsla(var(--h), 18%, 14%, 0.12);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.viz-tooltip strong,
.viz-tooltip p {
  margin: 0;
}

.viz-tooltip p + p,
.viz-tooltip strong + p {
  margin-top: 0.18rem;
}

.tooltip-kicker {
  margin-bottom: 0.28rem !important;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.glossary {
  display: grid;
  gap: 0.75rem;
}

.glossary-row {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.8rem;
  align-items: start;
}

.glossary-name {
  font-family: "Newsreader", serif;
  font-size: 1.08rem;
  line-height: 1;
}

.glossary-note {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ink) 78%, var(--muted));
}

.playbar {
  justify-content: center;
}

.playback,
.ghost,
.primary {
  height: 2.85rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: hsla(var(--h), 34%, 98%, 0.72);
  color: var(--ink);
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease,
    transform 180ms var(--ease-out-quart),
    box-shadow 180ms var(--ease-out-quart);
}

.primary {
  background: hsla(var(--h), 24%, 18%, 1);
  color: hsla(var(--h), 18%, 98%, 1);
}

.ghost:hover,
.primary:hover,
.playback:hover,
.ghost:focus-visible,
.primary:focus-visible,
.playback:focus-visible {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px hsla(var(--h), 18%, 15%, 0.08);
}

.ghost:disabled,
.primary:disabled {
  opacity: 0.42;
  cursor: default;
}

#scrubber {
  width: min(52vw, 460px);
  accent-color: color-mix(in srgb, var(--ink) 74%, var(--line-strong));
}

.time-readout {
  min-width: 3.3rem;
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.controls {
  justify-content: center;
}

.dots {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dot {
  width: 0.48rem;
  height: 0.48rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: hsla(var(--h), 14%, 62%, 1);
  cursor: pointer;
  transition: background var(--ease);
}

.dot.active {
  background: hsla(var(--h), 22%, 18%, 1);
}

@keyframes scene-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-lift {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes copy-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ring-breathe {
  from {
    opacity: 0.12;
    transform: scale(var(--ring-scale, 1));
  }

  to {
    opacity: 0.24;
    transform: scale(calc(var(--ring-scale, 1) + 0.05));
  }
}

@keyframes dash-travel {
  to {
    stroke-dashoffset: -28;
  }
}

@keyframes edge-breathe {
  from {
    opacity: 0.4;
  }

  to {
    opacity: 0.86;
  }
}

@keyframes cursor-breathe {
  from {
    opacity: 0.45;
  }

  to {
    opacity: 0.9;
  }
}

@media (max-width: 860px) {
  .viz {
    padding-inline: 0.9rem;
  }

  .focus-main,
  .compare-meta,
  .compare-strip-grid,
  .explore-stage {
    grid-template-columns: 1fr;
  }

  .focus-main {
    align-items: start;
  }

  .network-triangle {
    width: min(100%, 500px);
  }

  .node {
    width: clamp(7rem, 24vw, 8.7rem);
  }

  .copy h1 {
    max-width: 7.5ch;
  }
}

@media (max-width: 620px) {
  .viz {
    grid-template-rows: auto auto auto 1fr auto auto;
    gap: 0.85rem;
  }

  .topline,
  .controls,
  .playbar {
    flex-wrap: wrap;
  }

  .what {
    font-size: 0.76rem;
  }

  .node {
    width: clamp(6.5rem, 29vw, 7.8rem);
  }

  .node-label {
    max-width: 6.3ch;
    font-size: clamp(0.92rem, 4vw, 1.16rem);
  }

  .node-role {
    max-width: 7ch;
    font-size: 0.58rem;
  }

  .pair-row {
    grid-template-columns: 1fr;
  }

  .subject-picker {
    gap: 0.4rem;
  }

  .subject-pill {
    font-size: 0.8rem;
  }

  #scrubber {
    width: 100%;
  }

  .playbar {
    justify-content: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
