:root {
  --proximate-os-bg: #000010;
  --proximate-os-ink: #f7f8ff;
  --proximate-os-muted: #8f91a6;
  --proximate-os-accent: #ffd700;
}

html.proximate-os-boot-pending body {
  opacity: 0;
}

.proximate-os-boot {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  color: var(--proximate-os-ink);
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 215, 0, 0.08), transparent 34%),
    var(--proximate-os-bg);
  opacity: 0;
  transition: opacity 180ms ease;
  isolation: isolate;
}

.proximate-os-boot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 100% 4px, 46px 100%;
  opacity: 0.65;
}

.proximate-os-boot.is-visible {
  opacity: 1;
}

.proximate-os-boot.is-leaving {
  opacity: 0;
}

.proximate-os-boot__terminal {
  width: min(1080px, 96vw);
  text-align: center;
}

.proximate-os-boot__command,
.proximate-os-boot__status {
  margin: 0;
  color: var(--proximate-os-muted);
  font: 700 10px/1.4 ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.proximate-os-boot__command {
  margin-bottom: clamp(22px, 4vh, 42px);
  text-align: left;
}

.proximate-os-boot__command::before {
  content: ">";
  margin-right: 8px;
  color: var(--proximate-os-accent);
}

.proximate-os-boot__ascii {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--proximate-os-ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: clamp(4px, 1.02vw, 12px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.055em;
  text-align: left;
  white-space: pre;
  clip-path: inset(0 100% 0 0);
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.12));
  animation: proximate-os-reveal 620ms cubic-bezier(.2,.8,.2,1) 100ms forwards;
}

.proximate-os-boot__edition {
  margin: clamp(24px, 4vh, 42px) 0 10px;
  color: var(--proximate-os-accent);
  font: 800 clamp(12px, 1.5vw, 18px)/1.2 ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: clamp(0.28em, 1vw, 0.62em);
  text-indent: clamp(0.28em, 1vw, 0.62em);
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  animation: proximate-os-edition 300ms ease 580ms forwards;
}

.proximate-os-boot__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  animation: proximate-os-edition 260ms ease 720ms forwards;
}

.proximate-os-boot__status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--proximate-os-accent);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.68);
  animation: proximate-os-pulse 900ms ease-in-out infinite;
}

.proximate-os-boot__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@keyframes proximate-os-reveal {
  to { clip-path: inset(0 0 0 0); }
}

@keyframes proximate-os-edition {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes proximate-os-pulse {
  50% { opacity: 0.38; transform: scale(0.72); }
}

@media (max-width: 520px) {
  .proximate-os-boot__terminal { width: 98vw; }
  .proximate-os-boot__command { margin-left: 4vw; }
  .proximate-os-boot__ascii {
    font-size: clamp(3.7px, 1.08vw, 5.3px);
    letter-spacing: -0.07em;
  }
  .proximate-os-boot__edition { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .proximate-os-boot,
  .proximate-os-boot__ascii,
  .proximate-os-boot__edition,
  .proximate-os-boot__status,
  .proximate-os-boot__status::before {
    animation: none !important;
    transition: none !important;
  }
  .proximate-os-boot__ascii { clip-path: none; }
  .proximate-os-boot__edition,
  .proximate-os-boot__status { opacity: 1; transform: none; }
}
