/* ══════════════════════════════════════════════════════════════════════
   ORBIT CONSTELLATION v14 — "Living Console"
   LyDian enterprise hero constellation. Replaces .orbit-system (v13).

   Design intent
   ─────────────
   · Rings genuinely rotate (fine-pointer only) — nodes counter-rotate so
     every label stays upright and readable at all times.
   · Hover / keyboard focus anywhere on the stage FREEZES the rotation, so a
     moving target is never a click target.
   · Coarse pointers (touch) get a static constellation — tapping a drifting
     tile is hostile UX. All other motion (sweep, flux, pulses) stays on.
   · Nodes are HUD tiles, not generic pills: corner bracket, glyph cell,
     name + monospace kicker, status LED, accent edge-light.
   · Each node is tethered to the core by a radial hairline that lives in the
     rotating frame, so the tether always points home.
   · Every size is expressed in cqmin against a square container, so the whole
     system scales as one object from 320px phones to 4K desktops.

   Structure (index.html)
   ──────────────────────
   section.cst[data-orbit-parallax]
     └ div.cst-stage                     ← container-type: size
         ├ div.cst-grid                  ← coordinate plane
         ├ div.cst-sweep                 ← lidar sweep
         ├ div.cst-ring.cst-ring--{1,2,3}
         ├ svg.cst-flux                  ← data packets core→edge
         ├ div.cst-core                  ← logo + spin collar
         ├ div.cst-live.orbit-core-live  ← LIVE chip (JS updates textContent)
         └ div.cst-track.cst-track--{1,2,3}   ← rotating frames
             └ div.cst-slot[--a,--r,--i]      ← polar placement + tether
                 └ a.cst-node[--accent]       ← counter-rotating tile
   ══════════════════════════════════════════════════════════════════════ */

/* ── Tokens ────────────────────────────────────────────────────────── */
.cst {
  /* Radial gaps (19cqmin) are wider than a tile (≈17.9cqmin measured), so no
     two tiles on adjacent rings can ever overlap — at any rotation phase, at
     any angle. This is what makes the rotation safe rather than lucky. */
  --cst-r1: 20cqmin;
  --cst-r2: 39cqmin;
  --cst-r3: 58cqmin;

  --cst-spin-1: 132s;
  --cst-spin-2: 168s;
  --cst-spin-3: 210s;

  --cst-node-font: clamp(0.7rem, 1.95cqmin, 0.82rem);
  --cst-kicker-font: clamp(0.44rem, 1.15cqmin, 0.52rem);
  --cst-glyph: 1.9cqmin;
  --cst-pad-y: 0.55cqmin;
  --cst-pad-x: 1.05cqmin;

  --cst-surface-a: rgba(41, 41, 39, 0.94);
  --cst-surface-b: rgba(22, 22, 21, 0.96);
  --cst-text: #fdfaf8;
  --cst-kicker: rgba(255, 255, 255, 0.46);
  --cst-hairline: rgba(255, 255, 255, 0.1);
  /* Per-node accent; each .cst-slot overrides it inline and the node inherits. */
  --accent: #e97451;

  position: relative;
  display: block;
  margin: 2.2rem auto 2.6rem;
  /* Height is a real constraint, not just width: the constellation's vertical
     extent is ~1.21x the stage, and the hero is only 100vh - 68px tall. On a
     wide-but-short viewport (1280x800) a width-only cap pushed the top tiles
     under the site header. Measured with a header-overlap check at every
     rotation phase. */
  width: min(88vw, 720px, 72vh);
  max-width: 100%;
  perspective: 1100px;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── Stage: the square coordinate space everything is measured against ── */
.cst-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  container-type: size;
  isolation: isolate;
  overflow: visible;
  opacity: 0;
  animation: cst-stage-in 0.6s ease-out 0.05s forwards;
}
@keyframes cst-stage-in {
  to {
    opacity: 1;
  }
}

/* Ambient vignette — tight, corporate, never a "glow blob" */
.cst-stage::before {
  content: '';
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(233, 116, 81, 0.13) 0%,
    rgba(233, 116, 81, 0.07) 26%,
    rgba(143, 61, 33, 0.035) 52%,
    transparent 78%
  );
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

/* ── Coordinate plane ──────────────────────────────────────────────── */
.cst-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  animation: cst-fade-in 1.1s ease-out 0.3s forwards;
  -webkit-mask-image: radial-gradient(
    circle at 50% 50%,
    #000 0%,
    #000 44%,
    rgba(0, 0, 0, 0.5) 70%,
    transparent 95%
  );
  mask-image: radial-gradient(
    circle at 50% 50%,
    #000 0%,
    #000 44%,
    rgba(0, 0, 0, 0.5) 70%,
    transparent 95%
  );
}
.cst-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(255, 255, 255, 0.085) 1px,
    transparent 1.4px
  );
  background-size: 22px 22px;
  background-position: center center;
}
.cst-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.86%, rgba(255, 255, 255, 0.05) 50%, transparent 50.14%),
    linear-gradient(0deg, transparent 49.86%, rgba(255, 255, 255, 0.05) 50%, transparent 50.14%);
  mix-blend-mode: screen;
}
@keyframes cst-fade-in {
  to {
    opacity: 1;
  }
}

/* ── Lidar sweep ───────────────────────────────────────────────────── */
.cst-sweep {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    rgba(233, 116, 81, 0) 0%,
    rgba(233, 116, 81, 0) 84%,
    rgba(233, 116, 81, 0.05) 91%,
    rgba(233, 116, 81, 0.13) 97%,
    rgba(255, 245, 240, 0.16) 99.6%,
    rgba(233, 116, 81, 0) 100%
  );
  -webkit-mask-image: radial-gradient(
    circle at 50% 50%,
    transparent 12%,
    #000 34%,
    #000 62%,
    transparent 96%
  );
  mask-image: radial-gradient(
    circle at 50% 50%,
    transparent 12%,
    #000 34%,
    #000 62%,
    transparent 96%
  );
  opacity: 0;
  animation: cst-sweep-rotate 9s linear 1.2s infinite;
}
@keyframes cst-sweep-rotate {
  0% {
    transform: rotate(0deg);
    opacity: 0;
  }
  6% {
    opacity: 0.6;
  }
  94% {
    opacity: 0.6;
  }
  100% {
    transform: rotate(360deg);
    opacity: 0;
  }
}

/* ── Rings ─────────────────────────────────────────────────────────── */
.cst-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  scale: 0.4;
  animation: cst-ring-in 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes cst-ring-in {
  to {
    opacity: 1;
    scale: 1;
  }
}
.cst-ring--1 {
  width: calc(var(--cst-r1) * 2);
  height: calc(var(--cst-r1) * 2);
  border: 1px solid rgba(245, 164, 124, 0.3);
  box-shadow:
    inset 0 0 30px rgba(245, 164, 124, 0.07),
    0 0 20px rgba(233, 116, 81, 0.08);
  animation-delay: 0.3s;
}
.cst-ring--2 {
  width: calc(var(--cst-r2) * 2);
  height: calc(var(--cst-r2) * 2);
  border: 0.75px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 0 0 40px rgba(233, 116, 81, 0.05),
    0 0 22px rgba(233, 116, 81, 0.05);
  animation-delay: 0.42s;
}
.cst-ring--3 {
  width: calc(var(--cst-r3) * 2);
  height: calc(var(--cst-r3) * 2);
  border: 0.5px solid rgba(255, 255, 255, 0.085);
  box-shadow:
    inset 0 0 50px rgba(143, 61, 33, 0.04),
    0 0 26px rgba(143, 61, 33, 0.05);
  animation-delay: 0.54s;
}

/* Live arc travelling each ring — reads as "this ring is transmitting" */
.cst-ring::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--cst-arc, rgba(245, 164, 124, 0.75));
  border-right-color: color-mix(in srgb, var(--cst-arc, #f5a47c) 30%, transparent);
  animation: cst-arc-run var(--cst-arc-dur, 14s) linear infinite;
  opacity: 0.7;
}
.cst-ring--1::after {
  --cst-arc: rgba(245, 164, 124, 0.8);
  --cst-arc-dur: 11s;
}
.cst-ring--2::after {
  --cst-arc: rgba(233, 116, 81, 0.7);
  --cst-arc-dur: 15s;
  animation-direction: reverse;
}
.cst-ring--3::after {
  --cst-arc: rgba(201, 90, 55, 0.62);
  --cst-arc-dur: 19s;
}
@keyframes cst-arc-run {
  to {
    transform: rotate(360deg);
  }
}

/* ── Data flux packets (static radial paths, non-rotating layer) ───── */
.cst-flux {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  animation: cst-fade-in 0.9s ease-out 1.5s forwards;
}
.cst-flux .cst-packet {
  r: 1.2;
  fill: #f5a47c;
  opacity: 0.75;
  filter: drop-shadow(0 0 2px rgba(233, 116, 81, 0.65));
  animation: cst-packet-flow 4.4s linear infinite;
}
.cst-flux .cst-packet.p2 {
  animation-duration: 5.6s;
  animation-delay: 1.2s;
  fill: #e97451;
}
.cst-flux .cst-packet.p3 {
  animation-duration: 6.9s;
  animation-delay: 2.4s;
  fill: #c95a37;
}
.cst-flux .cst-packet.p4 {
  animation-duration: 5.2s;
  animation-delay: 0.7s;
}
.cst-flux .cst-packet.p5 {
  animation-duration: 6.2s;
  animation-delay: 3.1s;
  fill: #f08a5d;
}
.cst-flux .cst-packet.p6 {
  animation-duration: 7.4s;
  animation-delay: 1.9s;
  fill: #c95a37;
}
.cst-flux .cst-packet.d0 {
  offset-path: path('M 50 50 L 50 6');
}
.cst-flux .cst-packet.d1 {
  offset-path: path('M 50 50 L 88 28');
}
.cst-flux .cst-packet.d2 {
  offset-path: path('M 50 50 L 88 72');
}
.cst-flux .cst-packet.d3 {
  offset-path: path('M 50 50 L 50 94');
}
.cst-flux .cst-packet.d4 {
  offset-path: path('M 50 50 L 12 72');
}
.cst-flux .cst-packet.d5 {
  offset-path: path('M 50 50 L 12 28');
}
@keyframes cst-packet-flow {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

/* ── Core ──────────────────────────────────────────────────────────── */
.cst-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16cqmin;
  height: 16cqmin;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  z-index: 5;
  opacity: 0;
  scale: 0.55;
  animation: cst-core-in 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}
@keyframes cst-core-in {
  to {
    opacity: 1;
    scale: 1;
  }
}
.cst-core::before {
  content: '';
  position: absolute;
  inset: -26%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(233, 116, 81, 0.3) 0%,
    rgba(233, 116, 81, 0.1) 42%,
    transparent 72%
  );
  filter: blur(15px);
  z-index: -1;
  animation: cst-core-breathe 3.6s ease-in-out 1.4s infinite;
}
@keyframes cst-core-breathe {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.09);
  }
}

/* Dashed collar — the only element that visibly spins at the centre */
.cst-core-collar {
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  border: 1px dashed rgba(245, 164, 124, 0.4);
  animation: cst-collar-spin 26s linear infinite;
  pointer-events: none;
}
.cst-core-collar::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #f5a47c;
  box-shadow: 0 0 8px rgba(245, 164, 124, 0.9);
}
@keyframes cst-collar-spin {
  to {
    transform: rotate(360deg);
  }
}

.cst-core-disc {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.cst-core-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

/* LIVE chip — kept on .orbit-core-live so existing /api/health JS still binds */
.cst-live {
  position: absolute;
  top: calc(50% + 11cqmin);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.8);
  border: 1px solid rgba(245, 164, 124, 0.45);
  font-family: ui-monospace, 'Geist Mono', 'JetBrains Mono', Menlo, monospace;
  font-size: clamp(8px, 1.55cqmin, 10px);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #f5a47c;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 6;
  opacity: 0;
  animation: cst-fade-in 0.55s ease-out 2s forwards;
}
.cst-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: cst-led 1.7s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes cst-led {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.7);
  }
}

/* ── Rotating tracks ───────────────────────────────────────────────── */
.cst-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  transform-origin: 50% 50%;
  will-change: rotate;
}
/* Rotation is enabled further down, only for >=1024px + fine pointer. */
@keyframes cst-orbit {
  to {
    rotate: 360deg;
  }
}

/* Slot = polar placement + tether. Zero interaction surface of its own. */
.cst-slot {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transform: translate(calc(cos(var(--a)) * var(--r)), calc(sin(var(--a)) * var(--r)));
  opacity: 0;
  scale: 0.35;
  animation: cst-slot-in 0.8s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
  animation-delay: calc(0.75s + var(--i, 0) * 0.055s);
}
@keyframes cst-slot-in {
  to {
    opacity: 1;
    scale: 1;
  }
}
/* Per-ring radius, applied to the slot so the tether length matches the orbit */
.cst-track--1 .cst-slot {
  --r: var(--cst-r1);
}
.cst-track--2 .cst-slot {
  --r: var(--cst-r2);
}
.cst-track--3 .cst-slot {
  --r: var(--cst-r3);
}

/* A finished `forwards` animation outranks declarative styles, which would
   make the sibling-dim below a no-op. The stage gets `.is-settled` once the
   entrance choreography ends (see the v14 script in index.html), releasing the
   slots back to normal cascade control. */
.cst-stage.is-settled .cst-slot {
  animation: none;
  opacity: 1;
  scale: 1;
}

/* Tether: hairline from the node back to the core, inside the rotating frame */
.cst-slot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--r);
  height: 1px;
  transform-origin: 0 50%;
  transform: rotate(calc(var(--a) + 180deg));
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent, #e97451) 85%, transparent) 0%,
    color-mix(in srgb, var(--accent, #e97451) 22%, transparent) 45%,
    transparent 100%
  );
  opacity: 0.24;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

/* ── Node: the HUD tile ────────────────────────────────────────────── */
.cst-node {
  position: relative;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.75cqmin;
  padding: var(--cst-pad-y) calc(var(--cst-pad-x) + 0.35cqmin) var(--cst-pad-y) var(--cst-pad-x);
  border-radius: 11px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--cst-text);
  background: linear-gradient(158deg, var(--cst-surface-a) 0%, var(--cst-surface-b) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--cst-hairline));
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.5),
    0 0 0 3px rgba(31, 31, 30, 0.5),
    0 0 18px color-mix(in srgb, var(--accent) 26%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transition:
    scale 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}
@keyframes cst-counter-orbit {
  to {
    rotate: -360deg;
  }
}

/* ── Orbital rotation ───────────────────────────────────────────────────
   Gated on two conditions, both of which must hold:
     · >=1024px  — below that the tiles are too wide relative to the rings
     · pointer: fine — a drifting tap target on touch is a defect
   Track 2 runs in reverse for differential motion; its nodes therefore
   counter-spin forward, which is the same keyframe with the direction
   flipped. ─────────────────────────────────────────────────────────── */
@media (min-width: 1024px) and (pointer: fine) {
  .cst-track--1 {
    animation: cst-orbit var(--cst-spin-1) linear infinite;
  }
  .cst-track--2 {
    animation: cst-orbit var(--cst-spin-2) linear infinite reverse;
  }
  .cst-track--3 {
    animation: cst-orbit var(--cst-spin-3) linear infinite;
  }
  .cst-node {
    animation: cst-counter-orbit var(--cst-spin, 132s) linear infinite;
  }
  .cst-track--1 .cst-node {
    --cst-spin: var(--cst-spin-1);
  }
  .cst-track--2 .cst-node {
    --cst-spin: var(--cst-spin-2);
    animation-direction: reverse;
  }
  .cst-track--3 .cst-node {
    --cst-spin: var(--cst-spin-3);
  }
}

/* Corner bracket — the HUD signature */
.cst-node::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 9px;
  height: 9px;
  border-top: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
  border-top-left-radius: 11px;
  opacity: 0.75;
  transition:
    opacity 0.25s ease,
    width 0.25s ease,
    height 0.25s ease;
  pointer-events: none;
}
/* Bottom-right mirror bracket */
.cst-node::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-bottom: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
  border-bottom-right-radius: 11px;
  opacity: 0.45;
  transition:
    opacity 0.25s ease,
    width 0.25s ease,
    height 0.25s ease;
  pointer-events: none;
}

.cst-node-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--cst-glyph) + 1.15cqmin);
  height: calc(var(--cst-glyph) + 1.15cqmin);
  border-radius: 7px;
  flex-shrink: 0;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}
.cst-node-glyph svg {
  width: var(--cst-glyph);
  height: var(--cst-glyph);
  display: block;
}

.cst-node-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1cqmin;
  min-width: 0;
}
.cst-node-name {
  font-size: var(--cst-node-font);
  font-weight: 650;
  letter-spacing: 0.005em;
  line-height: 1.15;
  color: var(--cst-text);
}
.cst-node-kicker {
  font-family: ui-monospace, 'Geist Mono', 'JetBrains Mono', Menlo, monospace;
  font-size: var(--cst-kicker-font);
  font-weight: 600;
  letter-spacing: 0.14em;
  /* NOT text-transform: uppercase. The page is lang="tr", so CSS uppercasing
     applies Turkish casing rules to these English technical words and renders
     AVİATİON / CLİNİCAL / MEDİCAL with a dotted capital I. The markup carries
     the uppercase form instead, which is locale-independent. */
  line-height: 1.1;
  color: var(--cst-kicker);
  transition: color 0.25s ease;
}

.cst-node-led {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 0.25cqmin;
  background: var(--accent);
  box-shadow:
    0 0 7px var(--accent),
    0 0 0 2px rgba(0, 0, 0, 0.35);
  animation: cst-led 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.14s);
}

/* ── Interaction ───────────────────────────────────────────────────── */
.cst-node:hover,
.cst-node:focus-visible {
  scale: 1.09;
  border-color: var(--accent);
  background: linear-gradient(158deg, rgba(52, 51, 48, 0.97) 0%, rgba(27, 27, 25, 0.97) 100%);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.6),
    0 0 0 3px rgba(31, 31, 30, 0.55),
    0 0 34px color-mix(in srgb, var(--accent) 62%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  outline: none;
}
.cst-node:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.cst-node:hover::before,
.cst-node:focus-visible::before,
.cst-node:hover::after,
.cst-node:focus-visible::after {
  opacity: 1;
  width: 14px;
  height: 14px;
}
.cst-node:hover .cst-node-glyph,
.cst-node:focus-visible .cst-node-glyph {
  background: var(--accent);
  border-color: var(--accent);
  color: #17110d;
}
.cst-node:hover .cst-node-kicker,
.cst-node:focus-visible .cst-node-kicker {
  color: color-mix(in srgb, var(--accent) 78%, #ffffff);
}
.cst-slot:has(.cst-node:hover)::after,
.cst-slot:has(.cst-node:focus-visible)::after {
  opacity: 0.95;
}

/* Freeze the whole constellation while a node is being aimed at or focused,
   and dim the siblings so the target is unmistakable. */
.cst-stage:hover .cst-track,
.cst-stage:hover .cst-node,
.cst-stage:focus-within .cst-track,
.cst-stage:focus-within .cst-node {
  animation-play-state: paused;
}
.cst-stage:has(.cst-node:hover) .cst-slot:not(:has(.cst-node:hover)),
.cst-stage:has(.cst-node:focus-visible) .cst-slot:not(:has(.cst-node:focus-visible)) {
  opacity: 0.34;
  transition: opacity 0.28s ease;
}

/* ── Light theme ───────────────────────────────────────────────────── */
[data-theme='light'] .cst {
  --cst-surface-a: rgba(255, 253, 251, 0.96);
  --cst-surface-b: rgba(252, 246, 242, 0.96);
  --cst-text: #3a1a0a;
  --cst-kicker: rgba(92, 37, 19, 0.55);
  --cst-hairline: rgba(143, 61, 33, 0.16);
}
[data-theme='light'] .cst-stage::before {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(233, 116, 81, 0.2) 0%,
    rgba(233, 116, 81, 0.12) 24%,
    rgba(143, 61, 33, 0.06) 55%,
    transparent 80%
  );
}
[data-theme='light'] .cst-grid::before {
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(31, 31, 30, 0.12) 1px,
    transparent 1.4px
  );
}
[data-theme='light'] .cst-grid::after {
  background:
    linear-gradient(90deg, transparent 49.86%, rgba(31, 31, 30, 0.08) 50%, transparent 50.14%),
    linear-gradient(0deg, transparent 49.86%, rgba(31, 31, 30, 0.08) 50%, transparent 50.14%);
  mix-blend-mode: multiply;
}
/* Light theme: the same alphas that read as a soft glow on charcoal read as a
   solid grey wedge on white. Narrower, warmer, and roughly a third as strong. */
[data-theme='light'] .cst-sweep {
  background: conic-gradient(
    from 0deg,
    rgba(233, 116, 81, 0) 0%,
    rgba(233, 116, 81, 0) 88%,
    rgba(233, 116, 81, 0.05) 94%,
    rgba(233, 116, 81, 0.11) 98.5%,
    rgba(201, 90, 55, 0.16) 99.6%,
    rgba(233, 116, 81, 0) 100%
  );
  mix-blend-mode: multiply;
}
[data-theme='light'] .cst-ring--1 {
  border-color: rgba(233, 116, 81, 0.42);
}
[data-theme='light'] .cst-ring--2 {
  border-color: rgba(201, 90, 55, 0.3);
}
[data-theme='light'] .cst-ring--3 {
  border-color: rgba(143, 61, 33, 0.26);
}
[data-theme='light'] .cst-core-collar {
  border-color: rgba(201, 90, 55, 0.45);
}
[data-theme='light'] .cst-live {
  background: rgba(255, 252, 250, 0.94);
  border-color: rgba(201, 90, 55, 0.5);
  color: #8f3d21;
}
[data-theme='light'] .cst-node {
  box-shadow:
    0 8px 22px rgba(143, 61, 33, 0.13),
    0 0 0 3px rgba(255, 255, 255, 0.7),
    0 0 18px color-mix(in srgb, var(--accent) 24%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
[data-theme='light'] .cst-node:hover,
[data-theme='light'] .cst-node:focus-visible {
  background: linear-gradient(158deg, rgba(255, 255, 254, 0.99) 0%, rgba(254, 247, 243, 0.99) 100%);
  box-shadow:
    0 16px 34px rgba(143, 61, 33, 0.2),
    0 0 0 3px rgba(255, 255, 255, 0.85),
    0 0 34px color-mix(in srgb, var(--accent) 52%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}
[data-theme='light'] .cst-node:hover .cst-node-glyph,
[data-theme='light'] .cst-node:focus-visible .cst-node-glyph {
  color: #fffaf7;
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE

   Measured constraint (Chrome, real DOM): a tile is ~17.9cqmin wide and its
   width barely shrinks with the viewport, because the font bottoms out around
   8px while the stage keeps shrinking. Below ~768px, 15 labelled tiles simply
   do not fit on three rings — no choice of radii or angles avoids collisions.
   (The v13 orbit this replaces overlapped Cyber×Velora and Medi×Veris on every
   phone width; that is the defect this breakpoint removes.)

   So: orbit above 768px, constellation index below it. Same tiles, same
   accents, same core — different geometry.
   ══════════════════════════════════════════════════════════════════════ */

/* Desktop sizes. The rails are narrower since v15, so the constellation gets
   the room back. Ceilings are set by measurement (tile-vs-rail and
   tile-vs-header overlap at every rotation phase), not by eye. */
@media (max-width: 1599px) {
  .cst {
    width: min(90vw, 660px, 72vh);
  }
}
@media (max-width: 1439px) {
  .cst {
    width: min(92vw, 620px, 72vh);
  }
}

/* Tablet — the monospace kicker goes, tiles get narrower, radii tighten */
@media (max-width: 1023px) {
  .cst {
    width: min(94vw, 560px, 72vh);
    --cst-r1: 18cqmin;
    --cst-r2: 36cqmin;
    --cst-r3: 54cqmin;
    --cst-node-font: clamp(0.64rem, 2.15cqmin, 0.78rem);
    --cst-glyph: 2.15cqmin;
  }
  .cst-node-kicker {
    display: none;
  }
  .cst-core {
    width: 14cqmin;
    height: 14cqmin;
  }
  .cst-live {
    top: calc(50% + 10cqmin);
  }
  .cst-grid {
    opacity: 0.6;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   CONSTELLATION INDEX (<768px)
   The stage stops being a polar plane and becomes a grid. Tracks and slots
   collapse via `display: contents` so the tiles become direct grid items —
   no markup change, no duplicated DOM, no JS.
   cqmin is unavailable here (container-type must go back to `normal` or the
   auto-height grid would collapse to zero), so every size is restated.
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px), (max-height: 790px) {
  .cst {
    width: min(94vw, 520px);
    margin: 1.6rem auto 1.8rem;
    perspective: none;
  }
  .cst-stage {
    container-type: normal;
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    align-content: start;
  }

  /* Polar-only furniture has no meaning in a grid */
  .cst-grid,
  .cst-sweep,
  .cst-ring,
  .cst-flux {
    display: none !important;
  }
  .cst-stage::before {
    inset: -14% -8%;
    filter: blur(28px);
  }

  .cst-track,
  .cst-slot {
    display: contents;
  }

  /* Core + LIVE chip become the index header, spanning the full grid */
  .cst-core {
    position: static;
    grid-column: 1 / -1;
    justify-self: center;
    width: 58px;
    height: 58px;
    transform: none;
    margin-bottom: 2px;
  }
  .cst-core-collar {
    inset: -18%;
  }
  .cst-live {
    position: static;
    grid-column: 1 / -1;
    justify-self: center;
    transform: none;
    font-size: 9.5px;
    margin-bottom: 10px;
  }

  .cst-node {
    width: 100%;
    justify-content: flex-start;
    min-height: 44px;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 0;
    rotate: none !important;
    animation: none !important;
  }
  .cst-node-glyph {
    display: inline-flex;
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }
  .cst-node-glyph svg {
    width: 15px;
    height: 15px;
  }
  .cst-node-text {
    gap: 1px;
    flex: 1 1 auto;
    overflow: hidden;
  }
  .cst-node-name {
    font-size: 0.82rem;
  }
  .cst-node-kicker {
    display: block;
    font-size: 0.5rem;
    letter-spacing: 0.12em;
  }
  .cst-node-led {
    margin-left: auto;
  }
  .cst-node:hover,
  .cst-node:focus-visible {
    scale: 1;
  }
  .cst-node:active {
    scale: 0.98;
  }
  /* No sibling-dim in the index: every row must stay readable */
  .cst-stage:has(.cst-node:hover) .cst-slot:not(:has(.cst-node:hover)),
  .cst-stage:has(.cst-node:focus-visible) .cst-slot:not(:has(.cst-node:focus-visible)) {
    opacity: 1;
  }
}

/* Two columns are the floor; below ~330px a single column keeps names intact */
@media (max-width: 400px) {
  .cst-stage {
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 7px;
  }
  .cst-node {
    padding: 8px 9px;
    gap: 7px;
  }
  .cst-node-glyph {
    width: 23px;
    height: 23px;
  }
  .cst-node-name {
    font-size: 0.76rem;
  }
}
/* A single column was the obvious choice at 320px, but 15 rows are taller than
   the hero (100vh - 68px = ~500px on a 568px-tall phone) and the top rows slid
   under the site header. Two columns keep the index inside the hero; measured,
   the names still fit. */
@media (max-width: 330px) {
  .cst-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .cst-node {
    padding: 7px 7px;
    gap: 6px;
    min-height: 40px;
  }
  .cst-node-glyph {
    display: none;
  }
  .cst-node-name {
    font-size: 0.72rem;
  }
  .cst-node-kicker {
    font-size: 0.45rem;
  }
  .cst-core {
    width: 46px;
    height: 46px;
  }
}

/* ── Touch devices: freeze the orbit. A drifting tap target is a defect, not
      a feature. Everything else (sweep, flux, LEDs, entrance) still runs. ── */
@media (pointer: coarse) {
  .cst-node {
    min-height: 34px;
    touch-action: manipulation;
  }
  .cst-node:active {
    scale: 0.96;
  }
}

/* Grid-mode entrance: the tiles rise in sequence instead of bursting out of
   the core. Same stagger variable (--i), different vector. */
@media (max-width: 767px), (max-height: 850px) and (prefers-reduced-motion: no-preference) {
  .cst-node {
    opacity: 0;
    translate: 0 8px;
    animation: cst-row-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    animation-delay: calc(0.35s + var(--i, 0) * 0.04s) !important;
  }
  @keyframes cst-row-in {
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
}

/* ── Reduced motion: nothing moves. Full contrast, full information. ── */
@media (prefers-reduced-motion: reduce) {
  .cst-stage,
  .cst-grid,
  .cst-ring,
  .cst-ring::after,
  .cst-core,
  .cst-core::before,
  .cst-core-collar,
  .cst-track,
  .cst-slot,
  .cst-node,
  .cst-node-led,
  .cst-live,
  .cst-live::before {
    animation: none !important;
    opacity: 1 !important;
    scale: 1 !important;
    rotate: none !important;
  }
  .cst-sweep,
  .cst-flux {
    display: none !important;
  }
  .cst-node {
    transition: none !important;
  }
}

/* WebKit / iOS compositing hygiene */
@supports (-webkit-touch-callout: none) {
  .cst-node,
  .cst-ring,
  .cst-core {
    -webkit-backface-visibility: hidden;
  }
}
