/* fx-core.css - the sitewide motion layer (lane C, 2026-11-11). js/fx-core.js sets html.fx-core, then one class per piece
   (fxc-type · fxc-radar · fxc-foot · fxc-btn · fxc-form), so ?fx=0, fx.core:false or a piece's key:false gives back the plain
   page. Hidden waiting states also sit under html.m (site.js's motion flag; any script error drops it and shows everything).
   Order: tokens (the only raw values here) -> type -> radar -> footer -> buttons -> form -> reduced motion. */

/* ---------- tokens ---------- */
html.fx-core {
  --fx-round: 50%;                 /* radar rings and pings are circles: the one round thing on the page */
  --fx-ring-a: .24;                /* range-ring hairlines */
  --fx-arm-a: .9;                  /* the sweep arm, then its four trail hairlines */
  --fx-trail-1: .42;
  --fx-trail-2: .24;
  --fx-trail-3: .12;
  --fx-trail-4: .05;
  --fx-ping: clamp(2.5rem, 4.5vw, 4rem);   /* a ping ring's diameter at full size (smaller on a phone's smaller map) */
  --fx-lock: 1.75rem;              /* the ring that holds a hovered city */
  --fx-foot-line-a: .3;            /* the footer L's outline, white at low contrast */
  --fx-foot-fill-a: .055;          /* ...and the faint fill it resolves to */
  --fx-press-scale: .965;          /* a pressed button */
  --fx-press-y: 2px;
  --fx-e-spring: cubic-bezier(.34, 1.56, .64, 1);
  --fx-d-press: .08s;
  --fx-d-release: .36s;
  --fx-d-ul: .42s;                 /* the focus underline drawing from the left */
  --fx-d-lock: .3s;
}

/* ---------- 1 · kinetic headlines ---------- */
/* The heading itself never changes: its text goes transparent while an aria-hidden overlay of measured words plays over
   it, and the overlay is removed when the last word lands. The split replaces site.js's .rv fade on these headings. */
html.fx-core.fxc-type h2.fxk { position: relative; }
html.fx-core.fxc-type h2.fxk.rv,
html.fx-core.fxc-type h2.fxk.rv.is-in { opacity: 1; animation: none; }
html.fx-core.fxc-type.m h2.fxk--wait,
html.fx-core.fxc-type.m h2.fxk--wait .hl { color: transparent; }
html.fx-core .fxk-ov { position: absolute; inset: 0; pointer-events: none; user-select: none; }
html.fx-core .fxk-m { position: absolute; overflow: hidden; }
/* no will-change here: each word is promoted by its own tween and only for its length (a held layer per word cost the
   whole page ~0.5 ms a frame in layer-tree updates on the phone trace) */
html.fx-core .fxk-w { position: absolute; display: block; white-space: pre; color: var(--c-white); transform-origin: 0 80%; }
html.fx-core .fxk-w--hl { color: var(--c-yellow); }
html.fx-core .fxk-bar { position: absolute; display: block; background: var(--c-yellow); }

/* ---------- shared: a compositor hairline segment (js Hair: rotated into place, scaled along its length) ---------- */
html.fx-core .fxh { position: absolute; left: 0; top: 0; height: var(--hair); margin-top: calc(var(--hair) / -2); background: currentColor; transform-origin: 0 50%; transform: scaleX(0); }
/* layers only while a piece is near or live: every composited layer costs the whole page a little on every frame */
html.fx-core .fxf.is-live .fxh,
html.fx-core .fxq-edge.is-on .fxh,
html.fx-core .map.fxr-near .fxh { will-change: transform; }

/* ---------- 2 · the area map: rings, the sweep, pings, the chip line ---------- */
/* The layer rides above the map's drawing (under it, the grid lines cut the hairlines into dashes). Everything in it
   moves by transform or opacity; waiting layers sit at .001 so they are rastered before the sweep needs them. */
html.fx-core.fxc-radar .map { isolation: isolate; }
html.fx-core .fxr { position: absolute; z-index: 1; overflow: hidden; pointer-events: none; }
html.fx-core .map:not(.fxr-near) .fxr { display: none; }   /* out of the tree when far: the page re-commits every node every frame */
html.fx-core .fxr i { font-style: normal; }   /* the layer's pieces are <i>: the label copies must not turn italic */
html.fx-core .fxr-q { position: absolute; overflow: hidden; opacity: .001; }
html.fx-core .map.fxr-near :is(.fxr-q, .fxr-g) { will-change: opacity; }
html.fx-core .map.fxr-near :is(.fxr-arm, .fxr-p) { will-change: transform, opacity; }
html.fx-core .fxr.is-ringed .fxr-q { opacity: 1; }
html.fx-core .fxr-q svg { position: absolute; overflow: visible; max-width: none; }   /* each quarter holds the whole drawing */
html.fx-core .fxr-ring { fill: none; stroke: var(--c-white); opacity: var(--fx-ring-a); }
html.fx-core .fxr-lnh { position: absolute; inset: 0; color: var(--c-white); opacity: 0; }
html.fx-core .fxr-lnh.is-on { opacity: 1; }
html.fx-core .fxr-arm { position: absolute; opacity: .001; }
html.fx-core .fxr-arm svg { display: block; width: 100%; height: 100%; overflow: visible; }
html.fx-core .fxr-g { position: absolute; opacity: .001; }
html.fx-core .fxr-g svg { display: block; width: 100%; height: 100%; overflow: visible; }
html.fx-core .fxr-g .map__city text,
html.fx-core .fxr-g .map__city circle { fill: var(--c-white); }
html.fx-core .fxr-arm line { stroke: var(--c-white); stroke-width: var(--hair); vector-effect: non-scaling-stroke; }
html.fx-core .fxr-arm .t0 { opacity: var(--fx-arm-a); }
html.fx-core .fxr-arm .t1 { opacity: var(--fx-trail-1); }
html.fx-core .fxr-arm .t2 { opacity: var(--fx-trail-2); }
html.fx-core .fxr-arm .t3 { opacity: var(--fx-trail-3); }
html.fx-core .fxr-arm .t4 { opacity: var(--fx-trail-4); }
html.fx-core .fxr-p,
html.fx-core .fxr-lock { position: absolute; left: 0; top: 0; border-radius: var(--fx-round); box-shadow: inset 0 0 0 var(--hair) var(--c-white); opacity: 0; }
html.fx-core .fxr-p { width: var(--fx-ping); height: var(--fx-ping); margin: calc(var(--fx-ping) / -2) 0 0 calc(var(--fx-ping) / -2); }
html.fx-core .fxr-lock { width: var(--fx-lock); height: var(--fx-lock); margin: calc(var(--fx-lock) / -2) 0 0 calc(var(--fx-lock) / -2); scale: 1.6; transition: opacity var(--fx-d-lock) linear, scale var(--fx-d-lock) var(--e-out); }
html.fx-core .fxr-lock.is-on { opacity: 1; scale: 1; }
/* while the sweep runs, lit cities rest one step down so the arm can brighten them */
html.fx-core.fxc-radar .map.fxr-live .map__city.is-on:not(.map__hq) text,
html.fx-core.fxc-radar .map.fxr-live .map__city.is-on:not(.map__hq) circle { fill: var(--c-body); }
/* the step down and back happen in one frame (the map's own fill transition would repaint the whole map for 15) */
html.fx-core.fxc-radar .map.fxr-snap .map__city text,
html.fx-core.fxc-radar .map.fxr-snap .map__city circle { transition: none; }
html.fx-core.fxc-radar .map .map__city.fxr-hold text,
html.fx-core.fxc-radar .map .map__city.fxr-hold circle { fill: var(--c-white); }
html.fx-core.fxc-radar [data-cities] li { cursor: default; transition: box-shadow var(--d-ui) linear; }
html.fx-core.fxc-radar [data-cities] li.fxr-hold { box-shadow: inset 0 0 0 var(--hair) var(--c-white); }

/* ---------- 3 · the footer mark ---------- */
html.fx-core.fxc-foot .footer > .wrap { position: relative; z-index: 1; }
html.fx-core .fxf { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* the L hangs from the footer's top rule and its foot runs off the bottom edge; on phones it fills the lower footer */
html.fx-core .fxf__L { position: absolute; right: 2%; bottom: -12%; height: 112%; }
html.fx-core .fxf__L svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
html.fx-core .fxf__line { position: absolute; inset: 0; color: var(--c-white); opacity: var(--fx-foot-line-a); }
html.fx-core .fxf:not(.is-near) .fxf__line { display: none; }
html.fx-core .fxf__fill { opacity: 0; }
html.fx-core .fxf.is-live .fxf__line { will-change: transform; }
html.fx-core .fxf.is-live .fxf__fill { will-change: opacity, transform; }
html.fx-core .fxf__fill path { fill: var(--c-white); fill-opacity: var(--fx-foot-fill-a); }
html.fx-core.fxf-still .fxf__fill { opacity: 1; }
@media (max-width: 899px) {
  html.fx-core .fxf__L { height: auto; width: 104%; right: -10%; bottom: calc(var(--dock-h) + var(--safe-b)); }
}

/* ---------- 4 · buttons with weight ---------- */
html.fx-core.fxc-btn .btn { transition: scale var(--fx-d-release) var(--fx-e-spring), translate var(--fx-d-release) var(--fx-e-spring); }
/* !important only while pressed: the lean writes an inline scale/translate of "none" (the library's own reset) */
html.fx-core.fxc-btn .btn:active { scale: var(--fx-press-scale) !important; translate: 0 var(--fx-press-y) !important; transition-duration: var(--fx-d-press); transition-timing-function: var(--e-out); }
html.fx-core.fxc-btn .btn:active::before { scale: 1; }

/* ---------- 5 · the quote form arrives ---------- */
html.fx-core.fxc-form .form .field { position: relative; }
html.fx-core .fxq-edge { position: absolute; inset: 0; z-index: 2; pointer-events: none; color: var(--c-white); display: none; }
html.fx-core .fxq-edge.is-on { display: block; }
/* the fields are never hidden or held back (2026-11-17, the older-reader pass): only the edge hairline plays on arrival */
html.fx-core .fxq-ul { position: absolute; left: 0; top: 0; width: 0; height: var(--rule); margin-top: calc(var(--rule) * -1); background: var(--c-yellow); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; display: none; }
html.fx-core.fxc-form .input:focus + .fxq-ul { display: block; animation: fxq-draw var(--fx-d-ul) var(--e-out) both; }
html.fx-core.fxc-form .input[aria-invalid="true"] + .fxq-ul { visibility: hidden; }
@keyframes fxq-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- reduced motion: every finished state, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  html.fx-core.fxc-btn .btn { transition: none; }
  html.fx-core .fxr-lock { transition: none; }
  html.fx-core.fxc-form .input:focus + .fxq-ul { animation: none; transform: none; }
  html.fx-core .fxf__fill { opacity: 1; }
}
