.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start center;
  padding: clamp(14px, 3vw, 34px);
  padding-top: clamp(10px, 2vw, 22px);
  padding-bottom: clamp(28px, 4vw, 54px);
  overflow: hidden;
  background:
    linear-gradient(rgba(5, 7, 5, 0.94), rgba(5, 7, 5, 0.94)),
    repeating-linear-gradient(90deg, rgba(132, 162, 67, 0.09) 0 1px, transparent 1px 5px);
  color: var(--ink);
  transition: opacity 700ms ease, visibility 700ms ease, transform 700ms ease;
}

.boot-loader.is-hidden {
  visibility: hidden;
  opacity: 0;
  transform: scale(1.018);
}

.boot-shell {
  width: min(1500px, 100%);
  min-height: min(900px, calc(100vh - 56px));
  max-height: calc(100vh - 56px);
  border: 2px solid rgba(239, 227, 175, 0.22);
  box-shadow: 0 0 0 1px rgba(132, 162, 67, 0.2), inset 0 0 52px rgba(132, 162, 67, 0.08);
  padding: clamp(18px, 3vw, 50px);
  background: rgba(1, 3, 2, 0.78);
}

.boot-topline,
.boot-rule,
.boot-status-row,
.boot-tip {
  color: var(--amber);
  letter-spacing: 0;
}

.boot-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: clamp(13px, 1.8vw, 27px);
  text-transform: uppercase;
}

.boot-rule {
  margin: 18px 0 26px;
  border-top: 2px dashed rgba(231, 194, 93, 0.62);
}

.boot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.72fr);
  gap: clamp(24px, 5vw, 72px);
}

.boot-title {
  margin: 0 0 16px;
  font-size: clamp(38px, 5vw, 76px);
  line-height: 0.96;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(231, 194, 93, 0.28);
}

.boot-copy {
  max-width: 780px;
  margin: 0 0 46px;
  color: var(--phosphor);
  font-size: clamp(16px, 2vw, 29px);
  line-height: 1.32;
  text-transform: uppercase;
}

.boot-status-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 12px;
  font-size: clamp(15px, 1.8vw, 27px);
  text-transform: uppercase;
}

.boot-progress-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px;
}

.boot-progress {
  height: clamp(34px, 4.4vw, 54px);
  padding: 6px;
  border: 2px solid rgba(231, 194, 93, 0.72);
  box-shadow: inset 0 0 20px rgba(231, 194, 93, 0.1);
}

.boot-progress-fill {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(28, minmax(0, 1fr));
  gap: 5px;
}

.boot-progress-block {
  display: block;
  min-width: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(179, 212, 95, 0.08);
}

.boot-progress-block.is-lit {
  background:
    linear-gradient(90deg, rgba(239, 227, 175, 0.28), transparent 42%),
    var(--phosphor-strong);
  box-shadow: 0 0 10px rgba(179, 212, 95, 0.32);
  animation: bootBlockPop 140ms steps(2, end);
}

.boot-percent {
  min-width: 70px;
  color: var(--phosphor-strong);
  font-size: clamp(16px, 2vw, 29px);
}

.boot-log {
  min-height: 300px;
  margin: 0;
  padding: clamp(16px, 2.5vw, 28px);
  border: 2px solid var(--line);
  color: var(--ink);
  list-style: none;
  font-size: clamp(13px, 1.55vw, 24px);
  line-height: 1.28;
  text-transform: uppercase;
}

.boot-log li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 1.28em;
  opacity: 0;
  transform: translateX(-14px);
  filter: blur(2px);
  transition: opacity 180ms ease, transform 220ms ease, filter 220ms ease;
}

.boot-log li.is-visible {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0);
}

.boot-log li.is-visible span:first-child::after {
  color: var(--amber);
  content: "_";
  animation: bootCursor 650ms steps(2, end) infinite;
}

.boot-log li.is-done span:first-child::after {
  content: "";
}

.boot-log .is-active {
  color: var(--amber);
  text-shadow: 0 0 12px rgba(231, 194, 93, 0.26);
}

.boot-log .is-done {
  color: var(--phosphor-strong);
}

.boot-visual {
  display: grid;
  align-content: center;
  gap: 28px;
}

.boot-cube-stage {
  position: relative;
  min-height: 340px;
  perspective: 800px;
}

.boot-wirebox {
  position: absolute;
  inset: 28px;
  border: 2px solid rgba(132, 162, 67, 0.58);
  transform: rotateX(62deg) rotateZ(-38deg);
  transform-style: preserve-3d;
  animation: bootOrbit 6s linear infinite;
}

.boot-wirebox::before,
.boot-wirebox::after {
  position: absolute;
  inset: 18%;
  border: 2px solid rgba(132, 162, 67, 0.34);
  content: "";
}

.boot-wirebox::after {
  inset: 36%;
}

.boot-cube {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 94px;
  height: 94px;
  background:
    linear-gradient(135deg, rgba(239, 227, 175, 0.5), rgba(132, 162, 67, 0.2)),
    repeating-linear-gradient(0deg, rgba(5, 7, 5, 0.28) 0 7px, transparent 7px 14px);
  border: 2px solid rgba(239, 227, 175, 0.34);
  box-shadow: 0 0 38px rgba(132, 162, 67, 0.2);
  transform: translate(-50%, -50%) rotateX(58deg) rotateZ(40deg);
  animation: bootCube 2.1s ease-in-out infinite alternate;
}

.boot-info {
  padding: 22px;
  border: 2px solid var(--line);
  color: var(--phosphor);
  font-size: clamp(14px, 1.55vw, 23px);
  line-height: 1.45;
  text-transform: uppercase;
}

.boot-info strong {
  display: block;
  margin-bottom: 18px;
  color: var(--phosphor-strong);
  font-weight: 400;
}

.boot-tip {
  margin-top: 34px;
  color: var(--phosphor);
  font-size: clamp(13px, 1.5vw, 22px);
  text-transform: uppercase;
}

@keyframes bootOrbit {
  to {
    transform: rotateX(62deg) rotateZ(322deg);
  }
}

@keyframes bootCube {
  from {
    filter: brightness(0.8);
    transform: translate(-50%, -50%) rotateX(58deg) rotateZ(40deg) scale(0.9);
  }

  to {
    filter: brightness(1.25);
    transform: translate(-50%, -50%) rotateX(58deg) rotateZ(40deg) scale(1.08);
  }
}

@keyframes bootCursor {
  50% {
    opacity: 0;
  }
}

@keyframes bootBlockPop {
  from {
    opacity: 0.25;
    transform: scaleY(0.45);
  }

  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (max-width: 900px) {
  .boot-grid {
    grid-template-columns: 1fr;
  }

  .boot-visual {
    display: none;
  }

  .boot-shell {
    min-height: calc(100vh - 28px);
  }
}

@media (max-height: 880px) and (min-width: 901px) {
  .boot-loader {
    padding: 12px;
    padding-top: 10px;
    padding-bottom: 32px;
  }

  .boot-shell {
    display: flex;
    flex-direction: column;
    padding: 28px;
    min-height: calc(100vh - 56px);
    max-height: calc(100vh - 56px);
  }

  .boot-rule {
    margin: 14px 0 20px;
  }

  .boot-grid {
    flex: 1;
    min-height: 0;
    gap: 40px;
  }

  .boot-title {
    margin-bottom: 12px;
    font-size: clamp(36px, 4.4vw, 62px);
  }

  .boot-copy {
    margin-bottom: 28px;
    font-size: clamp(16px, 1.7vw, 24px);
  }

  .boot-progress-wrap {
    margin-bottom: 24px;
  }

  .boot-log {
    min-height: 0;
    padding: 20px 24px;
    font-size: clamp(13px, 1.25vw, 19px);
    line-height: 1.22;
  }

  .boot-cube-stage {
    min-height: 260px;
  }

  .boot-info {
    padding: 18px;
    font-size: clamp(13px, 1.2vw, 18px);
  }

  .boot-tip {
    margin-top: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-loader,
  .boot-progress-fill,
  .boot-progress-block.is-lit,
  .boot-wirebox,
  .boot-cube,
  .boot-log li,
  .boot-log li.is-visible span:first-child::after {
    animation: none;
    transition: none;
  }
}
