:root {
  --black: #05070b;
  --cream: #eeeafb;
  --muted: #5b586d;
  --lavender: #9889ec;
  --sleepy: #ff76a8;
  --rule: rgba(143, 130, 221, 0.25);
  --online: #2ddc88;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--black);
  color: var(--cream);
  font-family: "Courier New", Courier, monospace;
}

.terminal-page {
  position: relative;
  isolation: isolate;
  width: 100vw;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 36% 45%, rgba(24, 26, 38, 0.42), transparent 48%),
    radial-gradient(ellipse at 100% 100%, rgba(55, 45, 99, 0.1), transparent 31%),
    var(--black);
}

.terminal-page::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.16;
  background-image: radial-gradient(rgba(255, 255, 255, 0.13) 0.35px, transparent 0.65px);
  background-size: 4px 4px;
  mask-image: radial-gradient(ellipse at 42% 48%, black, transparent 76%);
  pointer-events: none;
  content: "";
}

.terminal-page::after {
  position: absolute;
  inset: 0;
  z-index: 5;
  box-shadow: inset 0 0 9vw rgba(0, 0, 0, 0.5);
  pointer-events: none;
  content: "";
}

.terminal-stage {
  width: 76vw;
  min-height: 100svh;
  padding-top: 17vh;
  margin-left: 12vw;
}

.terminal-command,
.terminal-cursor-line {
  font-size: 1.05vw;
  letter-spacing: -0.035em;
}

.terminal-command {
  color: #d4d0e3;
  white-space: nowrap;
}

.prompt {
  color: var(--lavender);
}

.manifest {
  margin-top: 2.5vh;
  margin-left: 1vw;
}

.manifest-body {
  min-width: 0;
  padding-left: clamp(10px, 1.45vw, 30px);
}

.manifest-heading {
  position: relative;
}

.manifest-heading::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--rule);
  transform: translateX(clamp(-30px, -1.45vw, -10px));
  content: "";
}

.sleepy-line {
  margin: 1.7vh 0 1.4vh;
  color: var(--sleepy);
  text-shadow: 0 0 1.1em rgba(255, 118, 168, 0.2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 5.25vw;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.88;
  white-space: nowrap;
}

.manifest-divider {
  width: 55vw;
  height: 1px;
  background: linear-gradient(90deg, var(--rule), rgba(143, 130, 221, 0.015));
}

h1 {
  margin: 4.6vh 0 2.3vh;
  color: var(--cream);
  font-family: "Courier New", Courier, monospace;
  font-size: 5.25vw;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.96;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.manifest-notes {
  margin-left: calc(-1vw - clamp(10px, 1.45vw, 30px));
  color: var(--muted);
  font-size: 0.86vw;
  letter-spacing: -0.035em;
  line-height: 1.75;
}

.manifest-notes p {
  margin: 0;
  white-space: nowrap;
}

.manifest-notes em {
  color: var(--lavender);
  font-style: italic;
}

.terminal-cursor-line {
  display: flex;
  align-items: center;
  gap: 0.35em;
  margin-left: calc(-1vw - clamp(10px, 1.45vw, 30px));
  margin-top: 1.65vh;
  color: var(--lavender);
}

.terminal-cursor-line input {
  width: 1ch;
  min-width: 1ch;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--cream);
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  caret-color: var(--lavender);
}

.terminal-cursor-line input:focus-visible {
  outline: 1px solid rgba(152, 137, 236, 0.45);
  outline-offset: 4px;
}

.cursor {
  display: inline-block;
  width: 0.68em;
  height: 1.08em;
  background: var(--lavender);
  box-shadow: 0 0 0.8em rgba(152, 137, 236, 0.72);
  animation: cursor-blink 1.15s steps(2, jump-none) infinite;
}

.terminal-output {
  max-width: 62ch;
  margin-top: clamp(14px, 2vh, 24px);
  margin-left: calc(-1vw - clamp(10px, 1.45vw, 30px));
  color: var(--muted);
  font-size: 0.86vw;
  line-height: 1.6;
}

.terminal-output p {
  margin: 0.35em 0;
}

.terminal-output .command-history {
  color: var(--lavender);
}

.terminal-output .response {
  color: var(--cream);
}

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

.online-status {
  position: fixed;
  right: 2.5vw;
  bottom: 2.6vh;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.7vw;
  color: var(--muted);
  font-size: 0.6vw;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.online-dot {
  width: 0.45vw;
  height: 0.45vw;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 5px rgba(45, 220, 136, 0.07), 0 0 18px var(--online);
}

@media (max-width: 760px) {
  .terminal-page {
    width: 100%;
    min-height: 100svh;
    overflow: hidden;
  }

  .terminal-stage {
    width: 100%;
    min-height: 100svh;
    padding: clamp(48px, 10svh, 86px) 24px 96px;
    margin-left: 0;
  }

  .terminal-command,
  .terminal-cursor-line {
    font-size: clamp(12px, 2.65vw, 16px);
    letter-spacing: -0.04em;
  }

  .terminal-command {
    white-space: normal;
  }

  .manifest {
    margin-top: clamp(18px, 4svh, 32px);
    margin-left: 8px;
  }

  .manifest-body {
    padding-left: clamp(14px, 4vw, 24px);
  }

  .manifest-heading::before {
    transform: translateX(clamp(-24px, -4vw, -14px));
  }

  .sleepy-line {
    margin-top: 0;
    margin-bottom: clamp(16px, 3svh, 26px);
    font-size: clamp(2.15rem, 9.5vw, 4.25rem);
    letter-spacing: -0.08em;
  }

  .manifest-divider {
    width: 100%;
  }

  h1 {
    margin-top: clamp(28px, 5.5svh, 46px);
    margin-bottom: clamp(24px, 4svh, 34px);
    font-size: clamp(1.8rem, 7.6vw, 4.25rem);
    letter-spacing: -0.065em;
    line-height: 1;
  }

  .manifest-notes {
    display: grid;
    gap: 0.55em;
    margin-left: calc(-8px - clamp(14px, 4vw, 24px));
    font-size: clamp(10px, 2.25vw, 14px);
    line-height: 1.55;
  }

  .manifest-notes p {
    white-space: normal;
  }

  .terminal-cursor-line {
    margin-top: clamp(24px, 4svh, 36px);
    margin-left: calc(-8px - clamp(14px, 4vw, 24px));
  }

  .terminal-output {
    margin-left: calc(-8px - clamp(14px, 4vw, 24px));
    font-size: clamp(10px, 2.25vw, 14px);
  }

  .online-status {
    right: 18px;
    bottom: 18px;
    gap: 9px;
    font-size: clamp(9px, 2vw, 12px);
  }

  .online-dot {
    width: 7px;
    height: 7px;
  }
}

@media (max-width: 390px) {
  .terminal-stage {
    padding-right: 18px;
    padding-left: 18px;
  }

  .manifest {
    margin-left: 6px;
  }

  .manifest-body {
    padding-left: 14px;
  }

  .manifest-heading::before {
    transform: translateX(-14px);
  }

  .sleepy-line {
    font-size: clamp(2rem, 9.5vw, 2.35rem);
  }

  h1 {
    font-size: clamp(1.68rem, 7.6vw, 2rem);
  }

  .manifest-notes,
  .terminal-cursor-line {
    margin-left: -20px;
  }
}

@keyframes cursor-blink {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }
}
