/* Boot gate - the first-visit loading screen.

   Own sheet on purpose: `assets/css/style.css` is a shared surface under
   parallel work, and nothing in the page reads these rules. The sheet is
   linked before `style.css` so the overlay is painted with the first frame,
   never one frame after it.

   The overlay is authored hidden and is shown only by `html.is-booting`,
   which the inline head script adds. A page without JavaScript, a second
   visit inside the same session, or a dead `loader.js` therefore never shows
   a covered page: the class is the single switch, and the head script always
   removes it. */

.boot {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  /* A touch drag on the overlay must not scroll the page behind it. */
  touch-action: none;
  overscroll-behavior: contain;
}

html.is-booting .boot {
  display: flex;
}

/* Two panels rather than one ground: the exit parts them along the carrier
   line, and the opening entrance of the page rises through the gap. The seam
   is placed on the middle of the mark by `loader.js`; the 50% fallback keeps
   the split sane if that read never happens. */
.boot__panel {
  position: absolute;
  right: 0;
  left: 0;
  background: var(--graphite-deep);
  will-change: transform;
}

/* The warm light around the mark is one glow cut in two: each panel carries
   its half against the seam, so the two halves meet without a visible step
   while the ground can still part along that line. */
.boot__panel--top {
  top: 0;
  height: var(--boot-seam, 50%);
  background-image: radial-gradient(
    110% 150% at 50% 100%,
    rgba(240, 89, 31, 0.16),
    rgba(240, 89, 31, 0) 70%
  );
}

.boot__panel--bottom {
  top: var(--boot-seam, 50%);
  bottom: 0;
  background-image: radial-gradient(
    110% 150% at 50% 0%,
    rgba(240, 89, 31, 0.16),
    rgba(240, 89, 31, 0) 70%
  );
}

/* The grain the rest of the page carries, so the loading ground is the same
   material as the graphite side of the stage. */
.boot__panel::after {
  position: absolute;
  content: "";
  inset: 0;
  background-image: var(--grain);
  background-size: 220px 220px;
  opacity: 0.055;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* The carrier: the line the signal travels before the cloud condenses out of
   it. It sits exactly on the seam, so it also reads as the cut the two panels
   open along. */
.boot__carrier {
  position: absolute;
  top: var(--boot-seam, 50%);
  right: 0;
  left: 0;
  z-index: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(240, 89, 31, 0),
    var(--signal-orange-invert) 22%,
    var(--signal-orange-invert) 78%,
    rgba(240, 89, 31, 0)
  );
  transform: scaleX(0);
  opacity: 0.7;
}

/* The exit with no library and no motion: the overlay leaves on opacity
   alone. GSAP parts the panels instead when motion is allowed. */
.boot.is-leaving {
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}

.boot__core {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(88vw, 420px);
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3.4vh, 34px);
}

.boot__mark {
  display: block;
  width: clamp(148px, 21vw, 252px);
  height: auto;
  overflow: visible;
}

.boot__cloud path {
  fill: var(--signal-orange);
}

.boot__arcs path {
  fill: var(--orange-line);
}

/* The silhouette drawn ahead of the fill. DrawSVGPlugin travels it, and it
   stays behind afterwards at a low opacity as the edge light of the mark. */
.boot__trace {
  fill: none;
  stroke: var(--signal-orange-invert);
  stroke-width: 3.4;
  stroke-linejoin: round;
  opacity: 0;
}

.boot__packet {
  fill: var(--paper-bright);
  opacity: 0;
}

.boot__readout {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.boot__caption {
  margin: 0;
  color: var(--muted-invert);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.boot__meter {
  position: relative;
  width: min(100%, 320px);
  height: 1px;
  background: rgba(250, 247, 240, 0.16);
  overflow: hidden;
}

.boot__meter span {
  position: absolute;
  inset: 0;
  background: var(--signal-orange-invert);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* The four things the gate actually waits for. Naming them keeps the wait
   honest: the meter cannot run ahead of the step that is still open. */
.boot__steps {
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  list-style: none;
}

.boot__steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(250, 247, 240, 0.34);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 260ms ease;
}

.boot__steps li::before {
  display: block;
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  content: "";
  transition:
    background-color 260ms ease,
    border-color 260ms ease;
}

.boot__steps li.is-done {
  color: var(--paper-bright);
}

.boot__steps li.is-done::before {
  background: var(--signal-orange-invert);
  border-color: var(--signal-orange-invert);
}

@media (max-width: 420px) {
  .boot__steps {
    gap: 6px 12px;
  }

  .boot__steps li {
    font-size: 9.5px;
    letter-spacing: 0.1em;
  }
}

/* The stage curtain was removed on 2026-08-03, at the operator's request.
   It covered the copy the scroll scene takes out of the first view with a
   window-wide 58px backdrop blur and swept it open. `html.is-opening` holds
   that copy now, at no compositing cost. Gone with it: `.stage-veil`, the
   `stage-veil-clear` keyframes, the registered `--veil-cut` property, the
   `is-stage-curtain` decision in the head script of `index.html`, and the
   curtain block of `assets/js/loader.js`. */

/* Reduced motion: the gate still holds the page until the scene is warm -
   that is a load state, not decoration - but nothing travels. The mark is
   whole from the first frame and the overlay leaves on opacity alone. */
@media (prefers-reduced-motion: reduce) {
  .boot__carrier {
    transform: scaleX(1);
  }

  .boot__trace,
  .boot__packet {
    display: none;
  }
}
