/* ═══════════════════════════════════════════════════════════════════════════
   FSL loading ticker (web port of the mobile handoff-loading-ticker, option 1d)
   ───────────────────────────────────────────────────────────────────────────
   Two moments, both driven by static/fsl-loading.js:

   1. Click → the current page's <main> is hidden and a loading layout for the
      destination (.fsl-skel) is shown at once: static chrome, placeholder bars
      (.fsl-bar), spinning digit reels (.fsl-reel) and the chart dot (.fsl-chartload).
   2. The next page paints with html.fsl-landing: sections marked [data-rise]
      rise in top to bottom, numbers marked [data-roll] land from spinning reels,
      chart lines marked [data-draw] draw themselves in.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reels ──────────────────────────────────────────────────────────────── */
/* The dim colour lives on the inner wrapper the reels sit in, never on the
   page's own element, so handing the plain text back leaves nothing behind. */
.fsl-roll { white-space: nowrap; }
.fsl-roll-in { display: inline-block; white-space: nowrap; color: inherit; transition: color .35s ease; }
.fsl-roll.is-spinning .fsl-roll-in { color: #3b414f; }
/* Each column is sized by the script to its target digit (see metrics()); the
   clip is vertical only, so a wider digit passing through is not cut at the sides. */
.fsl-reel {
  display: inline-block; vertical-align: top; overflow: visible;
  clip-path: inset(0 -0.6em); width: 1ch; height: var(--cell, 1em); text-align: center;
}
.fsl-reel-ch { display: inline-block; vertical-align: top; text-align: center; height: var(--cell, 1em); line-height: var(--cell, 1em); }
.fsl-reel-stack { display: block; will-change: transform; }
.fsl-reel-stack i { display: block; height: var(--cell, 1em); line-height: var(--cell, 1em); font-style: normal; }
.fsl-reel.is-spinning .fsl-reel-stack {
  animation: fslReelSpin .6s linear infinite;
  animation-delay: var(--phase, 0ms);
}
@keyframes fslReelSpin { from { transform: translateY(0); } to { transform: translateY(calc(var(--cell, 1em) * -10)); } }
.fsl-reel.is-landing .fsl-reel-stack { transition: transform var(--land, 750ms) cubic-bezier(.12, .8, .2, 1); }
.fsl-reel.is-rolling .fsl-reel-stack { transition: transform .4s cubic-bezier(.2, .8, .2, 1); }

/* ── Placeholder bars (static — the reels and the chart dot carry the motion) ─ */
.fsl-bar { display: inline-block; height: 12px; border-radius: 4px; background: #171a22; vertical-align: middle; }
.fsl-bar--block { display: block; }
.fsl-bar--round { border-radius: 99px; }

/* ── Chart loading box ──────────────────────────────────────────────────── */
.fsl-chartload { position: relative; width: 100%; height: var(--h, 160px); }
.fsl-chartload::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed #262b36; }
.fsl-chartload-dot {
  position: absolute; top: 50%; left: 0; width: 8px; height: 8px; margin-top: -4px; border-radius: 99px;
  background: var(--c, var(--blue)); box-shadow: 0 0 7px 2px var(--c, var(--blue));
  animation: fslChartScan 1.2s ease-in-out infinite alternate;
}
@keyframes fslChartScan { from { transform: translateX(0); } to { transform: translateX(calc(var(--w, 300px) - 8px)); } }

/* ── Line draw-in (JS sets the dasharray from getTotalLength) ───────────── */
[data-draw].is-drawing { transition: stroke-dashoffset 1.2s cubic-bezier(.3, .7, .2, 1) .1s; }
[data-fade] { transition: opacity .3s ease 1.3s; }
html.fsl-landing [data-fade]:not(.is-faded-in) { opacity: 0; }

/* ── Section rise-in ────────────────────────────────────────────────────── */
/* Hidden until the script assigns each section its delay (the head hook sets
   html.fsl-landing before first paint, and clears it after 4s as a safety). */
html.fsl-landing [data-rise]:not(.fsl-rise) { opacity: 0; }
.fsl-rise { animation: fslRise .45s cubic-bezier(.2, .8, .2, 1) var(--rise-d, 0ms) both; }
@keyframes fslRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── Loading layouts (what the click swaps in) ──────────────────────────── */
.fsl-skel { color: var(--text-2); }
.fsl-skel .fsl-roll { display: inline-block; }
.fsl-skel-block { padding: 24px 32px; border-bottom: 1px solid var(--rule-2); }
.fsl-skel-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--rule-1); }
.fsl-skel-row > .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fsl-skel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.fsl-skel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 12px; }
.fsl-skel-stat .v { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1; color: var(--text-1); }
.fsl-skel-stat .l { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.fsl-skel-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; flex-wrap: wrap; }
.fsl-skel-val { font-family: var(--font-display); font-weight: 700; font-size: clamp(48px, 5vw, 66px); line-height: .88; color: var(--text-1); margin-top: 12px; }
.fsl-skel-kpi { text-align: right; }
.fsl-skel-kpi .v { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--text-1); margin-top: 6px; }
.fsl-skel-pct { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1; }
.fsl-skel-num { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1; color: var(--text-1); }
.fsl-skel-table { width: 100%; }
.fsl-skel-cols { display: grid; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule-1); }
.fsl-skel-cols .r { text-align: right; }
.fsl-skel-page { max-width: var(--page-max, 1200px); margin: 0 auto; padding: 28px var(--gutter, 32px) 48px; }
.fsl-skel-two { display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.fsl-skel-two > * { min-width: 0; }
.fsl-skel-two > :first-child { border-right: 1px solid var(--rule-2); }
@media (max-width: 1200px) { .fsl-skel-two { grid-template-columns: minmax(0, 1fr); } .fsl-skel-two > :first-child { border-right: none; } }
@media (max-width: 760px) { .fsl-skel-block { padding: 22px 18px; } .fsl-skel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fsl-skel-stat .v { font-size: 32px; } }

@media (prefers-reduced-motion: reduce) {
  .fsl-reel.is-spinning .fsl-reel-stack, .fsl-chartload-dot { animation: none; }
  .fsl-reel.is-landing .fsl-reel-stack, .fsl-reel.is-rolling .fsl-reel-stack, [data-draw].is-drawing { transition: none; }
  .fsl-rise { animation-duration: .2s; }
}
