/* Restore the authored viewport-edge strips and staggered corners without
   changing the refined, independently centered percentage counter. */
html[data-initial-load] #initial-loader {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  --loader-bar-size: 20px;
  /* Keep the authored 1600ms clockwise orbit independent of the reference
     number cadence; direction, masks and nav easing stay intact. */
  --loader-wipe-duration: 200ms;
  --loader-easing: cubic-bezier(.25, .1, .25, 1);
}
.initial-loader-frame {
  /* Fill the overlay again: the 20px strips follow the screen perimeter,
     while the existing percentage group stays at the same viewport center. */
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.initial-loader-progress {
  display: inline-grid;
  /* Center the usual two-digit value plus %. The number's clipping window
     extends one extra digit to the left for 100, without moving the suffix. */
  grid-template-columns: 2ch max-content;
  align-items: center;
  gap: 0;
  margin: 0;
  font: normal 400 48px/62px "Instrument Serif", serif;
  letter-spacing: 0;
  white-space: nowrap;
}
.initial-loader-number {
  display: flex;
  justify-content: flex-end;
  width: 3ch;
  justify-self: end;
  height: 62px;
  overflow: hidden;
  text-align: right;
  /* A crisp 42px aperture hugs the glyphs without moving their baseline or
     changing the 62px reel pitch. Keep the fixed % outside this clip. */
  clip-path: inset(9px 0 11px);
}
.initial-loader-digit {
  position: relative;
  flex: 0 0 auto;
  width: 0;
  height: 62px;
}
.initial-loader-digit-value {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  width: max-content;
  height: 62px;
  line-height: 62px;
  text-align: right;
  will-change: transform;
}
.initial-loader-percent {
  display: block;
  line-height: 62px;
}
.initial-loader-bar {
  position: absolute;
  background: var(--blue);
  /* One entrance + one forward exit per side. Each side owns one quarter
     of the loop; the next never starts by extending through its neighbour. */
  animation: initial-loader-wipe calc(8 * var(--loader-wipe-duration))
    var(--loader-easing) calc(2 * var(--loader-step) * var(--loader-wipe-duration)) infinite both;
}
.initial-loader-bar[data-loader-side="top"] {
  top: 0;
  left: var(--loader-bar-size);
  right: 0;
  height: var(--loader-bar-size);
  --loader-step: 0;
  --loader-start: inset(0 100% 0 0);
  --loader-end: inset(0 0 0 100%);
}
.initial-loader-bar[data-loader-side="right"] {
  top: var(--loader-bar-size);
  right: 0;
  bottom: 0;
  width: var(--loader-bar-size);
  --loader-step: 1;
  --loader-start: inset(0 0 100% 0);
  --loader-end: inset(100% 0 0 0);
}
.initial-loader-bar[data-loader-side="bottom"] {
  bottom: 0;
  left: 0;
  right: var(--loader-bar-size);
  height: var(--loader-bar-size);
  --loader-step: 2;
  --loader-start: inset(0 0 0 100%);
  --loader-end: inset(0 100% 0 0);
}
.initial-loader-bar[data-loader-side="left"] {
  top: 0;
  left: 0;
  bottom: var(--loader-bar-size);
  width: var(--loader-bar-size);
  --loader-step: 3;
  --loader-start: inset(100% 0 0 0);
  --loader-end: inset(0 0 100% 0);
}
@keyframes initial-loader-wipe {
  0% { clip-path: var(--loader-start); }
  12.5% { clip-path: inset(0 0 0 0); }
  25%, 100% { clip-path: var(--loader-end); }
}
@media (prefers-reduced-motion: reduce) {
  .initial-loader-bar { animation: none; clip-path: none; }
}
@media print {
  html[data-initial-load] #initial-loader { display: none; }
  html[data-initial-load="loading"] .portfolio { visibility: visible; }
}
