/* Opening signature. Only visible while html[data-boot="play"]; the whole
   timeline is CSS so it always ends, even without JavaScript.
   0.1s  the bezel and the three arcs draw around the logo
   1.3s  the orbit lifts, the name rises letter by letter
   2.1s  the rule draws, school and discipline, then the three fields
   3.7s  the camera pushes through; the overlay is gone at 4.5s
   Only transform and opacity move, except one-time line drawing. No filters. */
.boot {
  display: none;
}
:root[data-boot="play"] .boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  overflow: hidden;
  contain: strict;
  background: #0e0f0e;
  color: #f4f5f1;
  animation: boot-exit 0.8s 3.7s cubic-bezier(0.76, 0, 0.24, 1) forwards;
  --b-cyan: #45bfcd;
  --b-green: #93b885;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --mono: 600 10px/1.5 Consolas, ui-monospace, monospace;
}
/* The scroll lock expires with the overlay, so a page whose boot.js failed to
   load still scrolls once the film has ended. */
:root[data-boot="play"] body {
  overflow: hidden;
  animation: boot-unlock 4.5s step-end forwards;
}
@keyframes boot-unlock {
  to {
    overflow: visible;
  }
}
/* The page under the overlay holds still, so it costs nothing while hidden. */
:root[data-boot="play"] main > :not(.boot),
:root[data-boot="play"] main > :not(.boot) *,
:root[data-boot="play"] :is(.site-header, .site-footer) * {
  animation-play-state: paused !important;
}
:root[data-boot="play"] .grid-panel {
  backdrop-filter: none;
}
.boot-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(40% 46% at 50% 44%, #45bfcd1f, transparent 70%),
    radial-gradient(34% 40% at 62% 60%, #93b88517, transparent 70%);
  animation: boot-fade 1.4s 0.2s ease-out both;
}
.boot-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  text-align: center;
  will-change: transform, opacity;
  animation: boot-push 0.8s 3.7s cubic-bezier(0.6, 0, 0.9, 0.4) forwards;
}

/* Orbit: bezel, arcs and logo move as one layer. */
.boot-orbit {
  position: relative;
  width: min(42vh, 320px, 68vw);
  aspect-ratio: 1;
  will-change: transform;
  animation: boot-lift 1s 1.25s var(--ease-out) both;
}
.boot-arcs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ba-bezel {
  stroke: #ffffff2e;
  stroke-width: 1.5;
  animation: boot-fade 0.9s 0.1s ease-out both;
}
.ba-ring {
  fill: none;
  stroke: #ffffff1c;
  stroke-width: 1;
  stroke-dasharray: 2 9;
  transform-origin: 300px 300px;
  animation:
    boot-fade 0.9s 0.2s ease-out both,
    boot-turn 30s linear infinite;
}
.ba-spin {
  transform-origin: 300px 300px;
  animation: boot-settle 1.7s 0.1s var(--ease-out) both;
}
.ba-arc {
  fill: none;
  stroke-width: 15;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: boot-draw 1.15s var(--ease-out) forwards;
}
.ba-white {
  stroke: #f4f5f1;
  animation-delay: 0.15s;
}
.ba-cyan {
  stroke: var(--b-cyan);
  animation-delay: 0.32s;
}
.ba-green {
  stroke: var(--b-green);
  animation-delay: 0.49s;
}
.ba-node {
  fill: #0e0f0e;
  stroke-width: 5;
  transform-box: fill-box;
  transform-origin: center;
  animation: boot-pop 0.5s var(--ease-out) both;
}
.ba-node-c {
  stroke: var(--b-cyan);
  animation-delay: 1.25s;
}
.ba-node-g {
  stroke: var(--b-green);
  animation-delay: 1.4s;
}
.boot-logo {
  position: absolute;
  inset: 22%;
  width: 56%;
  height: 56%;
  border-radius: 50%;
  object-fit: cover;
  animation: boot-logo 0.9s 0.35s var(--ease-out) both;
}
.boot-pulse {
  position: absolute;
  inset: 20%;
  border: 1.5px solid var(--b-cyan);
  border-radius: 50%;
  opacity: 0;
  animation: boot-pulse 1.1s 0.75s ease-out forwards;
}

/* Name: each letter rises out of its own mask. */
.boot-name {
  margin: clamp(10px, 2vh, 22px) 0 0;
  font:
    500 clamp(40px, 9.2vw, 124px) / 1 Manrope,
    system-ui,
    sans-serif;
  letter-spacing: -0.055em;
  white-space: nowrap;
  animation: boot-lift-name 1s 1.25s var(--ease-out) both;
}
.boot-last {
  color: var(--b-cyan);
}
.bn-ch {
  display: inline-block;
  overflow: clip;
  padding: 0.12em 0.02em 0.16em;
  margin: -0.12em 0 -0.16em;
}
.bn-ch > span {
  display: inline-block;
  transform: translateY(115%);
  animation: boot-rise 0.85s calc(1.35s + var(--i) * 0.035s) var(--ease-out)
    forwards;
}
.boot-rule {
  width: min(560px, 74vw);
  height: 2px;
  margin-top: clamp(14px, 2.4vh, 26px);
  background: linear-gradient(90deg, var(--b-cyan), var(--b-green));
  transform: scaleX(0);
  transform-origin: 0 50%;
  animation: boot-scale-x 0.9s 2.05s var(--ease-out) forwards;
}
.boot-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: clamp(14px, 2.4vh, 24px) 0 0;
  font-size: clamp(13px, 1.5vw, 19px);
  letter-spacing: 0.16em;
  color: #d9dcd5;
  animation: boot-track 0.9s 2.2s var(--ease-out) both;
}
.boot-line b {
  font-weight: 600;
  color: var(--b-cyan);
}
.boot-line i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.boot-fields {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  list-style: none;
  padding: 0;
  margin: clamp(16px, 3vh, 30px) 0 0;
}
.boot-fields li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border: 1px solid #ffffff26;
  border-radius: 99px;
  font-size: 12.5px;
  color: #c9cec6;
  animation: boot-chip 0.6s calc(2.55s + var(--i) * 0.14s) var(--ease-out) both;
}
.boot-fields small {
  font: var(--mono);
  color: var(--b-green);
}

/* Corner readouts. */
.boot-hud span {
  position: absolute;
  font: var(--mono);
  letter-spacing: 0.14em;
  color: #9aa39b;
  animation: boot-fade 0.8s 0.4s ease-out both;
}
.boot-hud em {
  font-style: normal;
  color: #5f6861;
}
.boot-hud strong {
  color: #f4f5f1;
  font-weight: 600;
}
.bh-tl {
  top: 26px;
  left: 30px;
}
.bh-tr {
  top: 26px;
  right: 30px;
  text-align: right;
}
.boot-hud .bh-bl {
  bottom: 30px;
  left: 30px;
  color: var(--b-cyan);
}
.bh-br {
  bottom: 30px;
  right: 30px;
}
.boot-hud .boot-progress {
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #ffffff12;
}
.boot-progress b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--b-cyan), var(--b-green));
  transform: scaleX(0);
  transform-origin: 0 50%;
  animation: boot-scale-x 3.7s linear forwards;
}

@keyframes boot-fade {
  from {
    opacity: 0;
  }
}
@keyframes boot-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes boot-settle {
  from {
    transform: rotate(-120deg) scale(0.86);
  }
}
@keyframes boot-turn {
  to {
    transform: rotate(360deg);
  }
}
@keyframes boot-pop {
  from {
    transform: scale(0);
  }
}
@keyframes boot-logo {
  from {
    opacity: 0;
    transform: scale(0.55) rotate(-40deg);
  }
}
@keyframes boot-pulse {
  from {
    opacity: 0.9;
    transform: scale(0.8);
  }
  to {
    opacity: 0;
    transform: scale(2.3);
  }
}
@keyframes boot-lift {
  from {
    transform: translateY(34%) scale(1.25);
  }
}
@keyframes boot-lift-name {
  from {
    transform: translateY(-40%);
  }
}
@keyframes boot-rise {
  to {
    transform: none;
  }
}
@keyframes boot-scale-x {
  to {
    transform: none;
  }
}
@keyframes boot-track {
  from {
    opacity: 0;
    letter-spacing: 0.5em;
  }
}
@keyframes boot-chip {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
/* The camera pushes through the mark while the overlay clears. */
@keyframes boot-push {
  to {
    transform: scale(1.7);
    opacity: 0;
  }
}
@keyframes boot-exit {
  30% {
    opacity: 1;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}
@media (max-width: 640px) {
  .bh-tr,
  .bh-br {
    display: none;
  }
  .boot-line {
    flex-wrap: wrap;
    gap: 6px 12px;
    letter-spacing: 0.1em;
  }
  .bh-tl {
    top: 18px;
    left: 18px;
  }
  .boot-hud .bh-bl {
    bottom: 20px;
    left: 18px;
  }
}
@media (max-height: 560px) {
  .boot-fields {
    display: none;
  }
  .boot-orbit {
    width: min(34vh, 200px);
  }
}
@media (prefers-reduced-motion: reduce) {
  :root[data-boot="play"] .boot {
    display: none;
  }
}
