/* SecurityTouch FX layer (v0.03). Loaded after enhance.css on every page.
 * Adds motion and colour on top of the day (Hum) and night (Dusk) themes, and styles the
 * new at-a-glance band and the four infographics. Motion runs only when fx.js sets .fx-on
 * and the visitor has not asked for reduced motion (.fx-still). */

/* ---------- tokens ---------- */
:root[data-mode="day"] {
  --fx-1: oklch(55% 0.19 255);           /* electric blue */
  --fx-2: oklch(66% 0.21 22);            /* coral */
  --fx-3: oklch(86% 0.17 96);            /* brand yellow */
  --fx-4: oklch(74% 0.16 160);           /* mint */
  --fx-5: oklch(60% 0.2 310);            /* violet */
  --fx-text-grad: linear-gradient(100deg, var(--color-ink) 0%, oklch(45% 0.19 255) 30%, oklch(46% 0.13 165) 52%, oklch(52% 0.2 22) 74%, var(--color-ink) 100%);
  --fx-panel: oklch(21% 0.03 262);
  --fx-panel-2: oklch(27% 0.04 262);
  --fx-on-panel: oklch(97% 0.012 95);
  --fx-on-panel-soft: oklch(84% 0.02 250);
  --fx-tile: var(--color-card);
  --fx-tile-edge: var(--color-rule);
  --fx-ink: var(--color-ink);
  --fx-ink-soft: var(--color-muted);
  --fx-grid-line: oklch(87% 0.016 95);
  /* validated categorical palette (light surface #fbfaf4) */
  --cat-1: #257de0; --cat-2: #f47230; --cat-3: #00b894; --cat-4: #f2a600;
  --st-critical: #d83a3b;
  --fx-quiet: oklch(91% 0.014 95);
  --fx-glow: 0 0 0 transparent;
}
:root[data-mode="night"] {
  --fx-1: oklch(77% 0.13 274);           /* periwinkle */
  --fx-2: oklch(80% 0.12 55);            /* apricot */
  --fx-3: oklch(72% 0.17 330);           /* dusk magenta */
  --fx-4: oklch(80% 0.13 170);           /* aqua mint */
  --fx-5: oklch(70% 0.16 300);
  --fx-text-grad: linear-gradient(100deg, var(--color-ink) 0%, oklch(82% 0.11 274) 30%, oklch(84% 0.1 62) 55%, oklch(76% 0.15 330) 78%, var(--color-ink) 100%);
  --fx-panel: oklch(21% 0.016 268);
  --fx-panel-2: oklch(26% 0.02 268);
  --fx-on-panel: var(--color-ink);
  --fx-on-panel-soft: var(--color-muted);
  --fx-tile: oklch(21% 0.016 268);       /* #1c1f27, the validated dark surface */
  --fx-tile-edge: var(--color-rule);
  --fx-ink: var(--color-ink);
  --fx-ink-soft: var(--color-muted);
  --fx-grid-line: oklch(31% 0.016 266);
  --cat-1: #338ced; --cat-2: #e76624; --cat-3: #00a888; --cat-4: #d28e05;
  --st-critical: #eb6263;
  --fx-quiet: oklch(27% 0.016 268);
  --fx-glow: 0 0 24px oklch(77% 0.13 274 / 0.35);
}

/* ---------- scroll progress ---------- */
.fx-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1000; pointer-events: none;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--fx-1), var(--fx-4), var(--fx-3), var(--fx-2));
  box-shadow: 0 0 12px color-mix(in oklab, var(--fx-1) 60%, transparent);
}
[dir="rtl"] .fx-progress { transform-origin: 100% 50%; }

/* ---------- hero: aurora + gradient headline ---------- */
.fx-on .hero { position: relative; isolation: isolate; overflow: clip; }
.fx-aurora { position: absolute; inset: -10% -5% 0; z-index: -3; pointer-events: none; overflow: hidden; }
.fx-aurora i {
  position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
  filter: blur(70px); opacity: 0.5; mix-blend-mode: multiply;
  animation: fx-drift 22s ease-in-out infinite alternate;
}
[data-mode="night"] .fx-aurora i { mix-blend-mode: screen; opacity: 0.26; }
.fx-aurora i:nth-child(1) { background: var(--fx-3); top: -18%; left: -10%; }
.fx-aurora i:nth-child(2) { background: var(--fx-4); top: 10%; right: -14%; animation-duration: 27s; animation-delay: -6s; }
.fx-aurora i:nth-child(3) { background: var(--fx-1); bottom: -30%; left: 30%; opacity: 0.32; animation-duration: 31s; animation-delay: -12s; }
[data-mode="night"] .fx-aurora i:nth-child(3) { opacity: 0.22; }
.fx-grid {
  position: absolute; inset: 0; opacity: 0.5;
  background-image: radial-gradient(color-mix(in oklab, var(--fx-ink) 18%, transparent) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}
@keyframes fx-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vw, 4vh, 0) scale(1.12); }
  100% { transform: translate3d(-4vw, -3vh, 0) scale(0.94); }
}

.fx-on .hero h1 {
  background: var(--fx-text-grad); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: fx-shine 9s ease-in-out infinite alternate;
}
@keyframes fx-shine { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (forced-colors: active) { .fx-on .hero h1 { -webkit-text-fill-color: CanvasText; background: none; } }

/* hero content arrives on load */
.fx-on:not(.fx-still) .hero .wrap > * { animation: fx-rise 0.9s var(--ease-out, cubic-bezier(.16,1,.3,1)) both; }
.fx-on:not(.fx-still) .hero .wrap > *:nth-child(2) { animation-delay: 0.15s; }
.fx-on:not(.fx-still) .hero .cta-row .btn { animation: fx-rise 0.8s var(--ease-out, ease-out) both; }
.fx-on:not(.fx-still) .hero .cta-row .btn:nth-child(2) { animation-delay: 0.1s; }
@keyframes fx-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* primary buttons: a light sweep and a glow */
.btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, oklch(100% 0 0 / 0.55) 48%, transparent 66%);
  transform: translateX(-120%);
}
.fx-on:not(.fx-still) .btn-primary::after { animation: fx-sweep 5.5s ease-in-out 1.5s infinite; }
.btn-primary:hover::after { animation-duration: 1.2s !important; }
@keyframes fx-sweep { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
[data-mode="night"] .btn-primary:hover { box-shadow: 0 0 0 1px color-mix(in oklab, var(--fx-1) 60%, transparent), 0 10px 40px -8px color-mix(in oklab, var(--fx-1) 70%, transparent); }

/* ---------- scroll reveals ---------- */
.fx-on .fx-reveal:not(.is-in) { opacity: 0; transform: translateY(34px) scale(0.985); filter: blur(6px); }
.fx-on .fx-reveal {
  transition: opacity 0.55s cubic-bezier(.16,1,.3,1), transform 0.65s cubic-bezier(.16,1,.3,1), filter 0.5s ease-out;
  transition-delay: calc(var(--fx-i, 0) * 60ms);
}
.fx-on .fx-reveal.is-in { transition-delay: calc(var(--fx-i, 0) * 70ms), calc(var(--fx-i, 0) * 70ms), calc(var(--fx-i, 0) * 70ms); }
/* section headings draw a gradient underline when they arrive */
.fx-on .section-head h2 { position: relative; }
.fx-on .section-head.fx-reveal h2::after {
  content: ""; display: block; height: 5px; width: 88px; margin-top: 18px; border-radius: 5px;
  background: linear-gradient(90deg, var(--fx-1), var(--fx-4), var(--fx-2));
  transform: scaleX(0); transform-origin: left; transition: transform 0.9s cubic-bezier(.16,1,.3,1) 0.25s;
}
[dir="rtl"] .fx-on .section-head.fx-reveal h2::after, .fx-on[dir="rtl"] .section-head.fx-reveal h2::after { transform-origin: right; }
.fx-on .section-head.fx-reveal.is-in h2::after { transform: scaleX(1); }
@media print { .fx-reveal { opacity: 1 !important; transform: none !important; filter: none !important; } .fx-progress, .fx-aurora { display: none; } }

/* ---------- tilt + spotlight ---------- */
.fx-tilt { position: relative; transform-style: preserve-3d; }
.fx-tilt.is-in, .fx-tilt:not(.fx-reveal) {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.35s cubic-bezier(.22,1,.36,1), box-shadow 0.35s ease, opacity 0.7s, filter 0.7s;
  transition-delay: 0s;
}
.fx-spot {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  opacity: 0; transition: opacity 0.3s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in oklab, var(--fx-1) 16%, transparent), transparent 45%);
}
[data-mode="night"] .fx-spot { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), oklch(85% 0.1 274 / 0.13), transparent 45%); }
.fx-tilt:hover .fx-spot, .fx-tile:hover .fx-spot { opacity: 1; }
.fx-tilt:hover { box-shadow: 0 24px 60px -30px color-mix(in oklab, var(--fx-1) 55%, transparent); }

/* steps and flow numbers glow in turn */
.fx-on:not(.fx-still) .flow-number { animation: fx-ping 4s ease-in-out infinite; }
.fx-on:not(.fx-still) .policy-flow > li:nth-child(2) .flow-number { animation-delay: 1s; }
.fx-on:not(.fx-still) .policy-flow > li:nth-child(3) .flow-number { animation-delay: 2s; }
.fx-on:not(.fx-still) .policy-flow > li:nth-child(4) .flow-number { animation-delay: 3s; }
@keyframes fx-ping {
  0%, 30%, 100% { box-shadow: 0 0 0 0 transparent; }
  10% { box-shadow: 0 0 0 10px color-mix(in oklab, var(--fx-1) 22%, transparent); }
}

/* feature icons wobble on hover */
.ruled .ic svg { transition: transform 0.4s cubic-bezier(.34,1.56,.64,1); }
.ruled article:hover .ic svg { transform: rotate(-8deg) scale(1.15); }

/* ---------- shared bits ---------- */
.fx-kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fx-ink-soft);
}
[dir="rtl"] .fx-kicker { letter-spacing: 0; font-size: 0.95rem; }
.fx-kicker::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--fx-4);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--fx-4) 60%, transparent);
}
.fx-on:not(.fx-still) .fx-kicker::before { animation: fx-beacon 2s ease-out infinite; }
@keyframes fx-beacon { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--fx-4) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }

/* ---------- at a glance: stat band ---------- */
.fx-pulse { padding-block: clamp(40px, 6vw, 72px); }
.fx-pulse-panel {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 32px; padding: clamp(28px, 4vw, 56px);
  background: radial-gradient(120% 140% at 0% 0%, var(--fx-panel-2), var(--fx-panel) 60%);
  color: var(--fx-on-panel);
  box-shadow: 0 40px 90px -40px oklch(20% 0.05 262 / 0.6), inset 0 1px 0 oklch(100% 0 0 / 0.08);
}
[data-mode="night"] .fx-pulse-panel { box-shadow: 0 0 0 1px var(--color-rule), 0 40px 90px -40px oklch(5% 0.02 268 / 0.9), inset 0 1px 0 oklch(100% 0 0 / 0.06); }
.fx-pulse-panel::before {
  content: ""; position: absolute; inset: -40%; z-index: -1; opacity: 0.55;
  background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, color-mix(in oklab, var(--fx-1) 50%, transparent) 60deg, transparent 120deg, color-mix(in oklab, var(--fx-4) 40%, transparent) 200deg, transparent 260deg, color-mix(in oklab, var(--fx-2) 40%, transparent) 320deg, transparent 360deg);
  filter: blur(60px);
}
.fx-on:not(.fx-still) .fx-pulse-panel::before { animation: fx-spin 26s linear infinite; }
@keyframes fx-spin { to { transform: rotate(1turn); } }
.fx-pulse-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 32px; margin-bottom: clamp(24px, 4vw, 44px); }
.fx-pulse-head h2 { color: var(--fx-on-panel); max-width: 18ch; }
.fx-pulse-head .fx-kicker { color: var(--fx-on-panel-soft); }
.fx-pulse-head p:not(.fx-kicker) { max-width: 40ch; margin: 0; color: var(--fx-on-panel-soft); }
.fx-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.fx-stat {
  position: relative; display: grid; justify-items: center; text-align: center; gap: 12px;
  padding: 22px 14px 24px; border-radius: 24px;
  background: oklch(100% 0 0 / 0.05); box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 0.09);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.fx-stat-fig { position: relative; display: grid; place-items: center; width: 116px; height: 116px; }
.fx-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.fx-ring-track { fill: none; stroke: oklch(100% 0 0 / 0.1); stroke-width: 7; }
.fx-ring-arc {
  fill: none; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.6s cubic-bezier(.16,1,.3,1);
  filter: drop-shadow(0 0 6px currentColor);
}
.fx-ring-tick { fill: oklch(100% 0 0 / 0.28); }
.fx-stat:nth-child(1) .fx-ring-arc { stroke: var(--fx-3); color: var(--fx-3); }
.fx-stat:nth-child(2) .fx-ring-arc { stroke: var(--fx-4); color: var(--fx-4); }
.fx-stat:nth-child(3) .fx-ring-arc { stroke: var(--fx-2); color: var(--fx-2); }
.fx-stat:nth-child(4) .fx-ring-arc { stroke: oklch(78% 0.12 255); color: oklch(78% 0.12 255); }
.fx-stat-num {
  position: relative; font-family: var(--font-display); font-weight: 600; line-height: 1;
  font-size: clamp(2.6rem, 3.4vw + 1rem, 3.4rem); font-variant-numeric: tabular-nums;
  color: var(--fx-on-panel);
}
.fx-on:not(.fx-still) .fx-stat.is-live .fx-stat-num { animation: fx-pop 0.7s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes fx-pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.fx-stat-label { font-size: 0.98rem; line-height: 1.35; color: var(--fx-on-panel-soft); max-width: 20ch; }
.fx-stat-label b { display: block; color: var(--fx-on-panel); font-weight: 600; font-size: 1.05rem; margin-bottom: 2px; }
.fx-stat.fx-tilt:hover { box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 0.18), 0 20px 50px -24px oklch(0% 0 0 / 0.6); }
@media (max-width: 860px) { .fx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .fx-stat-fig { width: 96px; height: 96px; } }

/* ---------- marquee ---------- */
.fx-marquee {
  margin-top: clamp(24px, 4vw, 40px); overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.fx-marquee-track { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 6px 0; list-style: none; margin: 0; }
.fx-marquee-track.is-looping { flex-wrap: nowrap; justify-content: flex-start; width: max-content; animation: fx-marquee 46s linear infinite; }
.fx-marquee:hover .fx-marquee-track { animation-play-state: paused !important; }
[dir="rtl"] .fx-marquee-track.is-looping { animation-name: fx-marquee-rtl; }
@keyframes fx-marquee { to { transform: translateX(calc(-50% - 6px)); } }
@keyframes fx-marquee-rtl { to { transform: translateX(calc(50% + 6px)); } }
.fx-marquee-track li {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  background: var(--fx-tile); color: var(--fx-ink); box-shadow: inset 0 0 0 1px var(--fx-tile-edge);
}
.fx-marquee-track li svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fx-marquee-track li:nth-child(4n+1) svg { color: var(--cat-1); }
.fx-marquee-track li:nth-child(4n+2) svg { color: var(--cat-2); }
.fx-marquee-track li:nth-child(4n+3) svg { color: var(--cat-3); }
.fx-marquee-track li:nth-child(4n+4) svg { color: var(--fx-5); }

/* ---------- insights: bento of infographics ---------- */
.fx-insights { position: relative; isolation: isolate; }
.fx-insights::before {
  content: ""; position: absolute; inset: 10% 0 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 15% 30%, color-mix(in oklab, var(--fx-1) 14%, transparent), transparent 70%),
    radial-gradient(40% 50% at 85% 70%, color-mix(in oklab, var(--fx-2) 12%, transparent), transparent 70%);
}
.fx-bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
.fx-tile {
  position: relative; overflow: hidden; min-width: 0;
  border-radius: 28px; padding: clamp(20px, 2.6vw, 32px);
  background: var(--fx-tile); color: var(--fx-ink);
  box-shadow: inset 0 0 0 1px var(--fx-tile-edge), 0 30px 70px -44px oklch(20% 0.03 262 / 0.55);
}
[data-mode="night"] .fx-tile { box-shadow: inset 0 1px 0 oklch(100% 0 0 / 0.06), 0 0 0 1px var(--color-rule), 0 40px 80px -40px oklch(5% 0.02 268 / 0.9); }
.fx-tile::before { /* animated gradient hairline on top */
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--fx-1), var(--fx-4), var(--fx-3), var(--fx-2), var(--fx-1)); background-size: 200% 100%;
}
.fx-on:not(.fx-still) .fx-tile::before { animation: fx-slide 6s linear infinite; }
@keyframes fx-slide { to { background-position: 200% 0; } }
.fx-tile h3 { font-size: 1.35rem; margin: 0 0 6px; }
.fx-tile-sub { margin: 0 0 18px; color: var(--fx-ink-soft); font-size: 0.98rem; max-width: 48ch; }
.fx-tile > * { position: relative; z-index: 1; }
.fx-tile > .fx-spot { position: absolute; z-index: 0; }
.fx-tile-map { grid-column: span 7; grid-row: span 2; }
.fx-tile-donut { grid-column: span 5; }
.fx-tile-heat { grid-column: span 5; }
.fx-tile-live { grid-column: span 12; }
@media (max-width: 1000px) {
  .fx-tile-map, .fx-tile-live { grid-column: span 12; grid-row: auto; }
  .fx-tile-donut, .fx-tile-heat { grid-column: span 6; }
}
@media (max-width: 720px) { .fx-tile-donut, .fx-tile-heat { grid-column: span 12; } }
.fx-fallback { margin: 0; padding-inline-start: 1.2em; color: var(--fx-ink-soft); }
.fx-note-tag {
  display: inline-block; margin-inline-start: 8px; padding: 2px 10px; border-radius: 999px; vertical-align: middle;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
  background: color-mix(in oklab, var(--fx-1) 14%, transparent); color: var(--fx-ink);
}

/* tooltip */
.fx-tip {
  position: absolute; z-index: 20; pointer-events: none; min-width: 120px; max-width: 240px;
  padding: 8px 12px; border-radius: 12px; font-size: 0.86rem; line-height: 1.35;
  background: var(--fx-panel); color: var(--fx-on-panel);
  box-shadow: 0 12px 30px -10px oklch(0% 0 0 / 0.45), inset 0 0 0 1px oklch(100% 0 0 / 0.1);
  opacity: 0; transform: translateY(4px); transition: opacity 0.15s ease, transform 0.15s ease;
}
.fx-tip.show { opacity: 1; transform: none; }
.fx-tip b { display: block; font-weight: 600; }
.fx-tip span { color: var(--fx-on-panel-soft); }

/* network map */
.fx-net-stage { position: relative; }
.fx-net-svg { width: 100%; height: auto; overflow: visible; }
.fx-net-glow-in { stop-color: var(--fx-1); stop-opacity: 0.18; }
.fx-net-glow-out { stop-color: var(--fx-1); stop-opacity: 0; }
.fx-net-orbit { fill: none; stroke: var(--fx-grid-line); stroke-width: 1; stroke-dasharray: 2 6; }
.fx-net-base { fill: none; stroke: var(--fx-grid-line); stroke-width: 6; stroke-linecap: round; }
.fx-net-flow { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 16; }
.fx-net-flow-back { stroke-width: 2.5; opacity: 0.55; stroke-dasharray: 1 22; }
.fx-on:not(.fx-still) .fx-net-flow { animation: fx-flow 1.4s linear infinite; }
.fx-on:not(.fx-still) .fx-net-flow-back { animation-duration: 2.2s; }
@keyframes fx-flow { to { stroke-dashoffset: -36; } }
.fx-net-link.c1 .fx-net-flow { stroke: var(--fx-1); }
.fx-net-link.c2 .fx-net-flow { stroke: var(--fx-2); }
.fx-net-link.c3 .fx-net-flow { stroke: var(--fx-4); }
.fx-net-link.is-blocked .fx-net-base { stroke-dasharray: 4 8; stroke-width: 3; }
.fx-net-flow-stop { stroke: var(--st-critical); }
.fx-net-gate-bg { fill: var(--st-critical); }
.fx-on:not(.fx-still) .fx-net-gate-bg { animation: fx-gate 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes fx-gate { 50% { transform: scale(1.15); } }
.fx-net-gate-x { stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.fx-net-gate-label { font-size: 15px; font-weight: 600; fill: var(--fx-ink); font-family: var(--font-body); }
.fx-net-node-orbit { fill: none; stroke: var(--fx-grid-line); stroke-width: 1.5; }
.fx-net-sats { transform-box: view-box; }
.fx-on:not(.fx-still) .fx-net-sats { animation: fx-spin 16s linear infinite; }
.fx-net-sat { stroke: var(--fx-tile); stroke-width: 3; }
.fx-net-av { stroke: var(--fx-tile); stroke-width: 4; }
.fx-net-pulse { fill: none; stroke-width: 2; opacity: 0; transform-box: view-box; }
.fx-on:not(.fx-still) .fx-net-pulse { animation: fx-node-pulse 2.6s ease-out infinite; }
@keyframes fx-node-pulse { 0% { opacity: 0.7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
.fx-net-node.c1 .fx-net-av, .fx-net-node.c1 .fx-net-sat { fill: var(--fx-1); } .fx-net-node.c1 .fx-net-pulse { stroke: var(--fx-1); }
.fx-net-node.c2 .fx-net-av, .fx-net-node.c2 .fx-net-sat { fill: var(--fx-2); } .fx-net-node.c2 .fx-net-pulse { stroke: var(--fx-2); }
.fx-net-node.c3 .fx-net-av, .fx-net-node.c3 .fx-net-sat { fill: var(--fx-4); } .fx-net-node.c3 .fx-net-pulse { stroke: var(--fx-4); }
.fx-net-node.c4 .fx-net-av, .fx-net-node.c4 .fx-net-sat { fill: var(--fx-quiet); stroke: var(--st-critical); stroke-dasharray: 4 4; }
.fx-net-node.c4 .fx-net-pulse { display: none; }
.fx-net-ini { font-size: 22px; font-weight: 700; fill: #fff; font-family: var(--font-display); pointer-events: none; }
[data-mode="day"] .fx-net-node.c3 .fx-net-ini { fill: oklch(22% 0.03 170); }
[data-mode="night"] .fx-net-node .fx-net-ini { fill: oklch(18% 0.03 268); }
.fx-net-node.c4 .fx-net-ini { fill: var(--st-critical); }
.fx-net-name { font-size: 20px; font-weight: 600; fill: var(--fx-ink); font-family: var(--font-body); }
.fx-net-wave { fill: none; stroke: var(--fx-1); stroke-width: 2; opacity: 0; transform-box: view-box; }
.fx-on:not(.fx-still) .fx-net-wave { animation: fx-wave 3s ease-out infinite; }
@keyframes fx-wave { 0% { opacity: 0.6; transform: scale(1); } 100% { opacity: 0; transform: scale(3.6); } }
.fx-net-rt-body { fill: var(--fx-panel); stroke: color-mix(in oklab, var(--fx-1) 60%, transparent); stroke-width: 2; }
[data-mode="night"] .fx-net-rt-body { fill: oklch(30% 0.03 270); }
.fx-net-rt-touch { fill: var(--fx-3); }
[data-mode="night"] .fx-net-rt-touch { fill: var(--fx-1); }
.fx-net-rt-glyph { fill: none; stroke: oklch(20% 0.03 262); stroke-width: 2.4; stroke-linecap: round; }
.fx-net-rt-label { font-size: 15px; font-weight: 600; fill: var(--fx-ink-soft); letter-spacing: 0.04em; font-family: var(--font-body); }
.fx-net-link, .fx-net-node { transition: opacity 0.35s ease; }
.fx-net-svg.has-focus .fx-net-link:not(.is-focus), .fx-net-svg.has-focus .fx-net-node:not(.is-focus) { opacity: 0.22; }
.fx-net-node.is-focus .fx-net-node-orbit { stroke: currentColor; stroke-dasharray: none; stroke-width: 2; }
.fx-net-node.c1 { color: var(--fx-1); } .fx-net-node.c2 { color: var(--fx-2); } .fx-net-node.c3 { color: var(--fx-4); } .fx-net-node.c4 { color: var(--st-critical); }
.fx-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.fx-chip {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; text-align: start;
  border: 0; border-radius: 16px; cursor: pointer; color: var(--fx-ink);
  background: color-mix(in oklab, var(--fx-ink) 4%, transparent); box-shadow: inset 0 0 0 1px var(--fx-tile-edge);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s cubic-bezier(.34,1.56,.64,1);
}
.fx-chip:hover { transform: translateY(-2px); }
.fx-chip:active { transform: scale(0.98); }
.fx-chip[aria-pressed="true"] { background: color-mix(in oklab, currentColor 0%, var(--fx-tile)); box-shadow: inset 0 0 0 2px var(--chip-c, var(--fx-1)), 0 10px 24px -14px var(--chip-c, var(--fx-1)); }
.fx-chip.c1 { --chip-c: var(--fx-1); } .fx-chip.c2 { --chip-c: var(--fx-2); } .fx-chip.c3 { --chip-c: var(--fx-4); } .fx-chip.c4 { --chip-c: var(--st-critical); }
.fx-chip-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--chip-c); box-shadow: 0 0 0 4px color-mix(in oklab, var(--chip-c) 22%, transparent); }
.fx-chip.c4 .fx-chip-dot { background: transparent; border: 2px dashed var(--st-critical); }
.fx-chip-text { display: grid; line-height: 1.25; min-width: 0; }
.fx-chip-text b { font-weight: 600; }
.fx-chip-text span { font-size: 0.85rem; color: var(--fx-ink-soft); }
.fx-net-caption { margin: 14px 0 0; min-height: 3em; font-size: 0.98rem; color: var(--fx-ink-soft); }
@media (max-width: 520px) { .fx-chips { grid-template-columns: minmax(0, 1fr); } }

/* donut */
.fx-donut { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); align-items: center; gap: clamp(16px, 3vw, 28px); }
@media (max-width: 420px) { .fx-donut { grid-template-columns: minmax(0, 1fr); justify-items: center; } .fx-legend { width: 100%; } }
.fx-donut-svg { width: 100%; max-width: 220px; height: auto; overflow: visible; }
.fx-donut-track { fill: none; stroke: var(--fx-quiet); stroke-width: 26; }
.fx-donut-seg {
  fill: none; stroke-width: 26; stroke-linecap: butt; cursor: pointer;
  transition: stroke-dasharray 1.3s cubic-bezier(.16,1,.3,1), stroke-width 0.25s ease, opacity 0.25s ease;
}
.fx-donut-seg.s1 { stroke: var(--cat-1); } .fx-donut-seg.s2 { stroke: var(--cat-2); } .fx-donut-seg.s3 { stroke: var(--cat-3); } .fx-donut-seg.s4 { stroke: var(--cat-4); }
.fx-donut-seg.is-hi { stroke-width: 34; }
.fx-donut-seg.is-dim { opacity: 0.3; }
.fx-donut-big { font-size: 34px; font-weight: 600; fill: var(--fx-ink); font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.fx-donut-small { font-size: 13px; fill: var(--fx-ink-soft); font-family: var(--font-body); }
.fx-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fx-legend-btn {
  width: 100%; display: grid; grid-template-columns: 14px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-height: 44px;
  padding: 8px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--fx-ink); cursor: pointer; text-align: start;
  transition: background 0.2s ease;
}
.fx-legend-btn:hover, .fx-legend-btn.is-hi { background: color-mix(in oklab, var(--fx-ink) 6%, transparent); }
.fx-sw { width: 14px; height: 14px; border-radius: 4px; }
.fx-sw.s1 { background: var(--cat-1); } .fx-sw.s2 { background: var(--cat-2); } .fx-sw.s3 { background: var(--cat-3); } .fx-sw.s4 { background: var(--cat-4); }
.fx-sw { grid-row: 1; }
.fx-legend-name { font-weight: 500; line-height: 1.2; }
.fx-legend-val { grid-column: 2; font-variant-numeric: tabular-nums; color: var(--fx-ink-soft); font-size: 0.88rem; line-height: 1.2; }
.fx-table { margin-top: 14px; font-size: 0.92rem; }
.fx-table summary { cursor: pointer; color: var(--fx-ink-soft); min-height: 32px; }
.fx-table table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.fx-table th, .fx-table td { padding: 6px 8px; text-align: start; border-bottom: 1px solid var(--fx-tile-edge); font-variant-numeric: tabular-nums; }

/* heatmap */
.fx-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; margin-bottom: 16px; background: color-mix(in oklab, var(--fx-ink) 6%, transparent); }
.fx-seg button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.92rem;
  background: transparent; color: var(--fx-ink-soft); transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.fx-seg button[aria-pressed="true"] { background: var(--fx-tile); color: var(--fx-ink); box-shadow: 0 2px 10px -4px oklch(0% 0 0 / 0.3), inset 0 0 0 1px var(--fx-tile-edge); }
.fx-heat { display: grid; grid-template-columns: 2.6em repeat(var(--cols), minmax(0, 1fr)); gap: 3px; align-items: center; }
.fx-heat-day { font-size: 0.78rem; color: var(--fx-ink-soft); white-space: nowrap; }
.fx-heat-hr { font-size: 0.72rem; color: var(--fx-ink-soft); text-align: center; font-variant-numeric: tabular-nums; }
.fx-heat-cell {
  aspect-ratio: 1; min-height: 12px; border-radius: 4px; background: var(--fx-quiet);
  transition: background-color 0.45s ease var(--w, 0ms), transform 0.45s cubic-bezier(.34,1.56,.64,1) var(--w, 0ms), opacity 0.45s ease var(--w, 0ms);
}
.fx-heat.is-waiting .fx-heat-cell { transform: scale(0.2); opacity: 0; }
.fx-heat-cell:hover { outline: 2px solid var(--fx-ink); outline-offset: 1px; }
.st-online { background: var(--cat-1); }
.st-school { background: var(--cat-3); }
.st-bonus { background: var(--cat-2); }
.st-quiet { background: var(--fx-quiet); }
.st-half { background: linear-gradient(90deg, var(--cat-1) 50%, var(--fx-quiet) 50%); }
[dir="rtl"] .st-half { background: linear-gradient(270deg, var(--cat-1) 50%, var(--fx-quiet) 50%); }
.fx-heat-cell.st-half { background-color: transparent; }
.fx-heat-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; margin: 14px 0 0; font-size: 0.86rem; color: var(--fx-ink-soft); }
.fx-heat-legend li { display: inline-flex; align-items: center; gap: 6px; }
.fx-heat-key { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.fx-heat-key.st-quiet { box-shadow: inset 0 0 0 1px var(--fx-tile-edge); }
.fx-heat-sum { margin: 12px 0 0; font-weight: 500; }

/* live chart */
.fx-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.fx-kpi { padding: 14px 16px; border-radius: 18px; background: color-mix(in oklab, var(--fx-ink) 4%, transparent); box-shadow: inset 0 0 0 1px var(--fx-tile-edge); }
.fx-kpi-num { display: block; font-family: var(--font-display); font-size: clamp(1.8rem, 2vw + 1rem, 2.4rem); line-height: 1.05; font-weight: 600; font-variant-numeric: tabular-nums; }
.fx-kpi span { font-size: 0.88rem; color: var(--fx-ink-soft); }
.fx-kpi.is-accent .fx-kpi-num { color: var(--cat-1); }
.fx-kpi.is-alert .fx-kpi-num::before { content: "\25B2"; font-size: 0.5em; vertical-align: 0.4em; margin-inline-end: 6px; color: var(--st-critical); }
.fx-kpi.flash { animation: fx-flash 0.9s ease-out; }
@keyframes fx-flash { 0% { box-shadow: inset 0 0 0 2px var(--st-critical), 0 0 0 0 color-mix(in oklab, var(--st-critical) 50%, transparent); } 100% { box-shadow: inset 0 0 0 1px var(--fx-tile-edge), 0 0 0 14px transparent; } }
.fx-live-plot { position: relative; }
.fx-live-svg { width: 100%; height: auto; display: block; overflow: visible; }
.fx-live-grid { stroke: var(--fx-grid-line); stroke-width: 1; }
.fx-live-grid.is-base { stroke: color-mix(in oklab, var(--fx-ink) 30%, transparent); }
.fx-live-tick { font-size: 12px; fill: var(--fx-ink-soft); font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.fx-live-stop-a { stop-color: var(--cat-1); stop-opacity: 0.35; }
.fx-live-stop-b { stop-color: var(--cat-1); stop-opacity: 0; }
.fx-live-line { fill: none; stroke: var(--cat-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
[data-mode="night"] .fx-live-line { filter: drop-shadow(0 0 6px color-mix(in oklab, var(--cat-1) 70%, transparent)); }
.fx-live-mark { fill: var(--st-critical); stroke: var(--fx-tile); stroke-width: 2; }
.fx-live-head { fill: var(--cat-1); stroke: var(--fx-tile); stroke-width: 2; }
.fx-live-head-ring { fill: none; stroke: var(--cat-1); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.fx-on:not(.fx-still) .fx-live-head-ring { animation: fx-node-pulse 1.6s ease-out infinite; }
.is-paused .fx-live-head-ring { animation: none !important; opacity: 0; }
.fx-live-cross, .fx-live-dot { opacity: 0; transition: opacity 0.15s ease; }
.fx-live-cross { stroke: color-mix(in oklab, var(--fx-ink) 45%, transparent); stroke-width: 1; stroke-dasharray: 3 3; }
.fx-live-dot { fill: var(--fx-tile); stroke: var(--cat-1); stroke-width: 3; }
.fx-live-svg.is-hover .fx-live-cross, .fx-live-svg.is-hover .fx-live-dot { opacity: 1; }
.fx-live-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 14px; }
.fx-live-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 600; background: var(--fx-panel); color: var(--fx-on-panel);
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1);
}
[data-mode="night"] .fx-live-btn { background: var(--color-accent); color: var(--color-accent-ink); }
.fx-live-btn:hover { transform: translateY(-2px); }
.fx-live-btn::before { content: ""; width: 10px; height: 12px; border-inline: 3px solid currentColor; box-sizing: border-box; }
.fx-live-btn[aria-pressed="true"]::before { width: 0; height: 0; border: 0; border-block: 6px solid transparent; border-inline-start: 10px solid currentColor; }
.fx-live-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; font-size: 0.88rem; color: var(--fx-ink-soft); }
.fx-live-legend li { display: inline-flex; align-items: center; gap: 8px; }
.fx-key-line { width: 20px; height: 3px; border-radius: 2px; background: var(--cat-1); }
.fx-key-tri { width: 0; height: 0; border-inline: 6px solid transparent; border-bottom: 10px solid var(--st-critical); }
@media (max-width: 560px) { .fx-kpis { grid-template-columns: minmax(0, 1fr); } .fx-kpi { display: flex; align-items: baseline; gap: 12px; } }

/* focus rings on new controls */
.fx-chip:focus-visible, .fx-legend-btn:focus-visible, .fx-seg button:focus-visible, .fx-live-btn:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.fx-chip, .fx-legend-btn, .fx-seg button, .fx-live-btn { touch-action: manipulation; font: inherit; }
.fx-seg button, .fx-live-btn { font-weight: 600; }

/* ---------- reduced motion: freeze everything decorative ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-aurora i, .fx-on .hero h1, .fx-pulse-panel::before, .fx-tile::before, .fx-marquee-track,
  .fx-net-flow, .fx-net-sats, .fx-net-pulse, .fx-net-wave, .fx-net-gate-bg, .fx-live-head-ring, .flow-number, .btn-primary::after { animation: none !important; }
  .fx-reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ---------- inner-page tile layouts ---------- */
.fx-tile-half { grid-column: span 6; }
.fx-tile-solo { grid-column: 1 / -1; }
.fx-tile-solo [data-fx="netmap"] { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px 32px; align-items: center; }
.fx-tile-solo .fx-net-stage { grid-row: span 2; }
.fx-tile-solo .fx-chips { grid-template-columns: minmax(0, 1fr); align-self: end; }
.fx-tile-solo .fx-net-caption { align-self: start; }
@media (max-width: 900px) {
  .fx-tile-half { grid-column: 1 / -1; }
  .fx-tile-solo [data-fx="netmap"] { grid-template-columns: minmax(0, 1fr); }
  .fx-tile-solo .fx-net-stage { grid-row: auto; }
}
