:root {
  color-scheme: dark;
  --white: #f4f8ff;
  --bios-blue: #0000aa;
  --dark: #05070c;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
}

button,
a {
  font: inherit;
}

.site-shell,
.scene {
  width: 100vw;
  height: 100vh;
}

.scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 360ms ease, visibility 360ms ease;
}

.scene.is-active {
  opacity: 1;
  visibility: visible;
}

.scene-boot {
  background:
    radial-gradient(circle at 50% 42%, rgba(51, 113, 205, 0.26), transparent 32%),
    linear-gradient(180deg, #07111f, #000 72%);
  text-align: center;
}

.windows-mark {
  display: grid;
  grid-template-columns: repeat(2, 54px);
  gap: 8px;
  transform: perspective(180px) rotateY(-12deg);
  filter: drop-shadow(0 0 24px rgba(79, 151, 255, 0.85));
}

.windows-mark span {
  display: block;
  width: 54px;
  height: 42px;
  background: linear-gradient(135deg, #23a6ff, #0b58c5);
}

.scene-boot h1 {
  margin: 22px 0 28px;
  font-size: clamp(42px, 7vw, 84px);
  font-weight: 400;
  letter-spacing: 0;
}

.loader {
  display: flex;
  justify-content: center;
  gap: 9px;
  height: 18px;
}

.loader i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #78b7ff;
  animation: pulse 1.1s infinite ease-in-out;
}

.loader i:nth-child(2) {
  animation-delay: 120ms;
}

.loader i:nth-child(3) {
  animation-delay: 240ms;
}

.loader i:nth-child(4) {
  animation-delay: 360ms;
}

.loader i:nth-child(5) {
  animation-delay: 480ms;
}

.boot-status {
  min-height: 22px;
  margin: 24px 0 0;
  color: #a9c9f7;
  font-size: 16px;
}

.scene-error {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px),
    #05070c;
}

.error-window {
  width: min(540px, calc(100vw - 36px));
  border: 2px solid #dedede;
  background: #d8d8d8;
  color: #050505;
  box-shadow: 18px 18px 0 rgba(0, 0, 0, 0.4);
  transform: translateY(-18px);
  animation: windowPop 340ms steps(3, end) both;
}

.error-window header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 4px 6px 4px 10px;
  background: linear-gradient(90deg, #001489, #0b7bdc);
  color: #fff;
  font-weight: 700;
}

.error-window header button {
  width: 24px;
  height: 22px;
  border: 1px solid #777;
  background: #c9c9c9;
  color: #000;
  line-height: 18px;
}

.error-body {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  padding: 28px 24px;
}

.error-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #d71920;
  color: #fff;
  font-size: 34px;
  font-weight: 700;
}

.error-body h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.25;
}

.error-body p {
  margin: 0;
  line-height: 1.45;
}

.error-window footer {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 18px;
}

.error-window footer button {
  min-width: 86px;
  min-height: 30px;
  border: 2px outset #fff;
  background: #d8d8d8;
}

.scanline-crash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(transparent 42%, rgba(255, 255, 255, 0.95) 48%, transparent 54%),
    repeating-linear-gradient(90deg, rgba(0, 97, 255, 0.36) 0 8px, rgba(255, 0, 60, 0.25) 8px 14px);
}

.scene-error.is-glitching .scanline-crash {
  animation: crash 720ms steps(7, end) both;
}

.scene-bios {
  align-items: stretch;
  justify-items: stretch;
  background: var(--bios-blue);
  font-family: "Lucida Console", "Courier New", Courier, monospace;
}

.bios-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 34vw);
  gap: clamp(20px, 5vw, 76px);
  width: 100%;
  min-height: 100vh;
  padding: clamp(20px, 4vw, 52px);
  background: var(--bios-blue);
  overflow: hidden;
}

.bios-screen::before {
  content: "";
  position: absolute;
  inset: clamp(10px, 2vw, 24px);
  pointer-events: none;
  border: 2px solid #fff;
  opacity: 0.92;
}

.bios-screen::after {
  content: "BIOS SETUP UTILITY";
  position: absolute;
  top: clamp(10px, 2vw, 24px);
  left: 50%;
  padding: 0 16px;
  background: var(--bios-blue);
  color: #fff;
  font-size: clamp(13px, 1.6vw, 20px);
  line-height: 1;
  transform: translate(-50%, -1px);
}

.bios-copy {
  align-self: start;
  position: relative;
  z-index: 1;
  max-width: 860px;
  color: #fff;
  font-size: clamp(14px, 1.85vw, 24px);
  line-height: 1.33;
  padding-top: clamp(28px, 4vw, 42px);
  text-shadow: none;
}

.bios-copy p {
  width: max-content;
  max-width: 100%;
  min-height: 1.33em;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
}

.bios-copy p:last-child {
  margin-top: 1.2em;
  color: #fff;
  font-size: clamp(22px, 3.9vw, 56px);
  font-weight: 700;
  white-space: normal;
  text-transform: uppercase;
}

.bios-copy p.is-typing::after {
  content: "_";
  animation: cursorBlink 740ms steps(1, end) infinite;
}

.bios-card {
  align-self: center;
  justify-self: end;
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  color: #fff;
  text-align: center;
  text-shadow: none;
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transform: translateY(0);
}

.bios-card img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid #fff;
  image-rendering: auto;
  filter: none;
}

.bios-card.is-drawing {
  animation: drawCard 2.1s steps(18, end) forwards;
}

.bios-card.is-drawing img {
  animation: imageScan 2.1s steps(18, end) forwards;
}

.token-line {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.token-line strong {
  font-size: clamp(22px, 3vw, 36px);
}

.token-line span {
  color: #fff;
  font-size: clamp(30px, 5vw, 68px);
  font-weight: 700;
}

.bios-card a {
  display: inline-block;
  margin-top: 14px;
  color: #fff;
  font-size: clamp(15px, 2vw, 24px);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.bios-footer {
  position: absolute;
  z-index: 1;
  right: clamp(16px, 4vw, 48px);
  bottom: clamp(14px, 3vw, 34px);
  left: clamp(16px, 4vw, 48px);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #fff;
  font-size: clamp(12px, 1.6vw, 18px);
  text-shadow: none;
  opacity: 0;
}

.bios-footer.is-visible {
  opacity: 1;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-7px);
  }
}

@keyframes windowPop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(-18px) scale(1);
  }
}

@keyframes crash {
  0% {
    opacity: 0;
    transform: translateY(-100%);
  }

  20%,
  68% {
    opacity: 0.95;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(100%);
  }
}

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

@keyframes drawCard {
  0% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
  }

  6% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    clip-path: inset(0);
  }
}

@keyframes imageScan {
  0% {
    filter: contrast(1.8) grayscale(1);
  }

  100% {
    filter: contrast(1) grayscale(0);
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .site-shell,
  .scene {
    min-height: 100vh;
    height: auto;
  }

  .bios-screen {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 18px;
    padding-bottom: 96px;
  }

  .bios-copy {
    font-size: 14px;
  }

  .bios-copy p {
    white-space: normal;
  }

  .bios-card {
    justify-self: center;
    width: min(340px, 86vw);
  }

  .bios-footer {
    flex-direction: column;
    gap: 6px;
  }
}
