/* Loading the body (loader-ring.js): the fourteen channels light up in their flow order while 0 → 100 % counts up.
   Only transform and opacity animate, so the browser keeps them running while the page is busy starting up.
   The ring covers the stage with the stage's own backdrop; the body under it shows only when the ring is gone. */
.lring { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: inherit; pointer-events: auto;
  --l-ink: #1b1f27; --l-muted: #6b7180; --dur: 4500ms; transition: opacity .25s ease .05s; }
[data-bg="dark"] .lring { --l-ink: #eef0f7; --l-muted: #9aa1b5; }
.lring .ring { position: relative; width: 230px; height: 230px; transition: opacity .15s ease; }
.lring.out .ring { opacity: 0; }
.lring.out { opacity: 0; }

.lring i { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px;
  transform: rotate(calc(var(--k) * 360deg / 14 - 90deg)) translate(100px) rotate(calc(var(--k) * -360deg / 14 + 90deg)); }
.lring i::before, .lring i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--c); }
.lring i::before { opacity: .16; }
.lring i::after { opacity: 0; box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 18%, transparent), 0 0 18px color-mix(in srgb, var(--c) 60%, transparent); }
.lring i b { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); font: 700 9.5px "JetBrains Mono", ui-monospace, monospace; color: var(--l-muted); opacity: 0; }
/* Dot k lights when the count passes (k + 1) / 14 of the way. */
.lring i::after, .lring i b { animation: lring-on .3s ease forwards; animation-delay: calc(var(--dur) * (var(--k) + 1) / 14 - .3s); }

.lring .mid { position: absolute; inset: 0; display: grid; place-content: center; color: var(--l-ink); }
.lring .num { display: flex; align-items: flex-start; direction: ltr; font: 800 46px/1 "Plus Jakarta Sans", system-ui, sans-serif; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.lring .num > .col { display: flex; flex-direction: column; height: 1em; overflow: hidden; text-align: end; }
.lring .num > .col > span { display: block; height: 1em; line-height: 1; animation: lring-count var(--dur) steps(99, end) forwards; }
.lring.ready .num > .col > span { animation: none; transform: translateY(-10000%); }
.lring .num small { font-size: 20px; color: var(--l-muted); font-weight: 700; align-self: flex-end; margin-bottom: 4px; }
:lang(ar) .lring .num { letter-spacing: 0; }

/* The count: a column 0 … 100 slides up one number per step, 0 → 99 over --dur; 100 only once the body is ready (.ready). */
@keyframes lring-count { to { transform: translateY(-9900%); } }
@keyframes lring-on { to { opacity: 1; } }
@media (max-width: 860px) { .lring .ring { transform: scale(.82); } }
