:root {
  --bg: #030303;
  --text: rgba(221, 219, 213, 0.8);
  --text-strong: rgba(232, 230, 223, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --glow: rgba(255, 255, 255, 0.16);
  --dark-shell-width: min(490px, calc(100vw - 3rem));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Lucida Console", "Courier New", Courier, monospace;
  overflow: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.025), transparent 42%),
    radial-gradient(circle at center, transparent 0, transparent 58%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
  z-index: 3;
}

.hero-video,
.crt-noise,
.crt-scanlines,
.crt-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 0;
}

.video-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.video-overlay-dark {
  background: rgba(0, 0, 0, 0.3);
}

.background-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.background-texture-dark {
  background: url("../../images/background2.png") center/cover no-repeat;
  opacity: 0.22;
  mix-blend-mode: screen;
}

.crt-noise {
  z-index: 1;
  opacity: 0.18;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
  animation: noise-drift 0.1s steps(4) infinite;
}

.crt-scanlines {
  z-index: 2;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0) 2px,
      rgba(0, 0, 0, 0.24) 3px,
      rgba(0, 0, 0, 0.02) 4px
    );
  background-size: 100% 4px;
  opacity: 0.62;
}

.crt-flash {
  z-index: 5;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 24%, transparent 76%, rgba(255, 255, 255, 0.04));
  opacity: 0;
  animation: random-flash 4.7s linear infinite;
}

.screen {
  min-height: 100vh;
  position: relative;
  z-index: 4;
  display: grid;
  align-items: center;
}

.gateway-stage {
  display: grid;
  place-items: center;
  padding: 2rem;
}

.gateway-line {
  width: min(32rem, calc(100vw - 2rem));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
}

.statement {
  margin: 0;
  font-size: clamp(0.52rem, 0.88vw, 0.82rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0;
  text-shadow:
    0 0 0.24rem rgba(255, 255, 255, 0.05),
    0 0 0.8rem var(--glow);
  filter: blur(0.2px);
  animation: text-jitter 2.8s steps(1) infinite;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  flex-wrap: nowrap;
  width: auto;
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
}

body.is-revealed .statement {
  opacity: 0.8;
}

body.is-question-visible .statement {
  opacity: 0.8;
}

.cursor {
  display: inline-block;
}

.cursor-inline {
  margin-left: 0.05em;
  color: var(--text);
  animation: blink 1s steps(1) infinite;
}

.prompt-input-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 1.35rem;
  min-width: 1.35rem;
  height: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  transition: opacity 500ms ease;
  pointer-events: none;
  flex: 0 0 auto;
  gap: 0;
  margin-left: 0.18rem;
}

body.is-question-visible .prompt-input-wrap {
  opacity: 1;
  pointer-events: auto;
}

.prompt-input {
  width: 1ch;
  min-width: 1ch;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-strong);
  caret-color: transparent;
  font: inherit;
  font-size: inherit;
  text-transform: uppercase;
  text-align: left;
  outline: none;
  opacity: 1;
}

.cursor-prompt {
  color: var(--text-strong);
  animation: blink 1s steps(1) infinite;
  position: static;
  transform: translateY(-0.08em);
  margin-left: 0.04em;
  z-index: 2;
  pointer-events: none;
}

.terminal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1rem;
  padding: min(8vh, 4rem) min(7vw, 4.5rem);
}

.oracle-frame {
  width: min(100%, 700px);
  margin: 0 auto;
  display: grid;
  gap: 1.2rem;
  padding: 0;
}

.question-form {
  display: block;
}

.output-panel {
  border: 1px solid rgba(247, 246, 242, 0.72);
  background: rgba(51, 51, 51, 0.7);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
  position: relative;
}

.dark-command-form,
.dark-output-panel {
  border: 1px solid rgba(247, 246, 242, 0.72);
  background: rgba(51, 51, 51, 0.7);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
  position: relative;
}

.dark-command-form {
  min-height: 4.5rem;
  display: grid;
  align-items: center;
  padding: 0.5rem 0.8rem;
}

.dark-side-stage {
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.dark-side-output-shell {
  width: var(--dark-shell-width);
  position: absolute;
  top: 28vh;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(clamp(4.5rem, 14vh, 8rem) + 5.75rem);
  overflow: hidden;
}

.dark-side-output {
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: auto;
  scrollbar-width: none;
}

.dark-side-output::-webkit-scrollbar {
  display: none;
}

.dark-command-form-bottom {
  position: absolute;
  left: 50%;
  bottom: clamp(4.5rem, 14vh, 8rem);
  transform: translateX(-50%);
  width: var(--dark-shell-width);
  min-height: 4.25rem;
  border: 1px solid rgba(247, 246, 242, 0.72);
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

body.dark-input-enabled .dark-command-form-bottom {
  opacity: 1;
  pointer-events: auto;
}

.dark-input-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.dark-output-panel {
  min-height: 17rem;
  padding: 0.8rem 1rem;
}

.terminal-output {
  overflow: auto;
  padding-right: 0.5rem;
}

.dark-output-panel .terminal-output {
  overflow: visible;
  padding-right: 0;
}

.terminal-line {
  margin: 0;
  width: 100%;
  font-size: clamp(0.52rem, 0.88vw, 0.82rem);
  line-height: 1.12;
  letter-spacing: 0.05em;
  white-space: pre-wrap;
  text-align: left;
  color: var(--text);
  text-shadow: 0 0 0.7rem rgba(255, 255, 255, 0.09);
  text-transform: uppercase;
}

.terminal-line.boot {
  margin: 0;
  color: rgba(221, 219, 213, 0.68);
}
.terminal-line + .terminal-line {
  margin-top: 0.08rem;
}

.terminal-line.user {
  color: rgba(245, 243, 237, 0.95);
}

.terminal-line.machine-final {
  margin-top: 1.2rem;
  color: rgba(255, 255, 255, 0.95);
}

.terminal-input-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.35rem 0;
}

.terminal-input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-strong);
  caret-color: var(--text-strong);
  font: inherit;
  font-size: clamp(0.52rem, 0.88vw, 0.82rem);
  text-transform: uppercase;
  outline: none;
  font-family: inherit;
  text-align: left;
}

.cursor-prompt-horizontal {
  font-size: clamp(0.52rem, 0.88vw, 0.82rem);
  flex: 0 0 auto;
}

.output-cursor {
  display: inline-block;
  margin-left: 0.08em;
  animation: blink 1s steps(1) infinite;
}

.output-cursor-underline {
  transform: translateY(-0.02em);
}

.output-cursor-idle {
  display: inline-block;
  margin-left: 0.08em;
  animation: blink 1s steps(1) infinite;
}

.terminal-output,
.terminal-input {
  position: relative;
  z-index: 1;
}

.dark-output-panel::before,
.dark-command-form::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../../images/background1.png") center/cover;
  opacity: 0.2;
  pointer-events: none;
}

.dark-command-form-bottom::before {
  background: url("../../images/background2.png") center/cover;
  opacity: 0.16;
}

.force-stage {
  min-height: 100vh;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 0.8rem;
  padding: 18vh 2rem 2rem;
  text-align: center;
}

.force-manifest {
  max-width: 36rem;
  margin: 0;
  font-size: clamp(0.64rem, 0.96vw, 0.88rem);
  line-height: 1.25;
  letter-spacing: 0.12em;
  color: rgba(221, 219, 213, 0.72);
  text-transform: uppercase;
  text-shadow:
    0 0 0.24rem rgba(255, 255, 255, 0.05),
    0 0 0.8rem var(--glow);
}

.force-line {
  display: inline;
}

.force-line-break {
  display: inline;
}

.force-center-link {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(5rem, 10vw, 7.5rem);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  z-index: 6;
}

.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;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes screen-flicker {
  0%,
  7%,
  11%,
  19%,
  24%,
  36%,
  42%,
  58%,
  63%,
  76%,
  82%,
  100% {
    opacity: 1;
  }

  8% {
    opacity: 0.965;
  }

  10% {
    opacity: 0.92;
  }

  20% {
    opacity: 0.95;
  }

  23% {
    opacity: 0.9;
  }

  37% {
    opacity: 0.95;
  }

  41% {
    opacity: 0.91;
  }

  59% {
    opacity: 0.95;
  }

  62% {
    opacity: 0.89;
  }

  77% {
    opacity: 0.95;
  }

  81% {
    opacity: 0.9;
  }
}

@keyframes noise-drift {
  0% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-0.55%, 0.32%);
  }

  50% {
    transform: translate(0.48%, -0.34%);
  }

  75% {
    transform: translate(-0.32%, 0.22%);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes random-flash {
  0%,
  8%,
  10%,
  24%,
  27%,
  41%,
  45%,
  63%,
  66%,
  84%,
  88%,
  100% {
    opacity: 0;
  }

  8.4% {
    opacity: 0.16;
  }

  9.1% {
    opacity: 0.04;
  }

  24.6% {
    opacity: 0.11;
  }

  41.6% {
    opacity: 0.13;
  }

  44.3% {
    opacity: 0.04;
  }

  63.4% {
    opacity: 0.17;
  }

  65.1% {
    opacity: 0.05;
  }

  84.7% {
    opacity: 0.13;
  }
}

@keyframes text-jitter {
  0%,
  15%,
  17%,
  39%,
  42%,
  57%,
  60%,
  100% {
    transform: translate(0, 0);
  }

  16% {
    transform: translate(0.4px, -0.08px);
  }

  40% {
    transform: translate(-0.5px, 0.12px);
  }

  58% {
    transform: translate(0.33px, 0.09px);
  }
}

@media (max-width: 720px) {
  .gateway-line {
    width: min(320px, calc(100vw - 2rem));
    gap: 0.2rem;
  }

  .statement {
    font-size: 14px;
    flex: 0 1 auto;
    width: auto;
  }

  .prompt-input,
  .terminal-line,
  .terminal-input,
  .cursor-prompt-horizontal,
  .force-manifest {
    font-size: max(16px, clamp(0.88rem, 2.2vw, 1.4rem));
  }

  .prompt-input-wrap {
    width: 1.1rem;
    min-width: 1.1rem;
    height: 1rem;
    padding: 0;
    margin-left: 0.12rem;
  }

  .cursor-prompt {
    margin-left: 0;
  }

  .oracle-frame {
    padding: 1.2rem;
  }

  .dark-command-form {
    min-height: 3.5rem;
  }

  .dark-output-panel {
    min-height: 13rem;
  }

  .terminal-shell {
    padding: 2.2rem 1.2rem 1.4rem;
  }

  .force-stage {
    padding: 12vh 1.5rem 1.5rem;
  }

  .force-line {
    display: block;
  }

  .force-line-break {
    display: block;
  }

  .dark-side-output-shell {
    width: min(32rem, calc(100vw - 2rem));
    top: 24vh;
    bottom: calc(clamp(3rem, 12vh, 6rem) + 5.25rem);
  }

  .dark-command-form-bottom {
    width: min(32rem, calc(100vw - 2rem));
    bottom: clamp(3rem, 12vh, 6rem);
    min-height: 3.75rem;
  }

  .dark-input-line,
  .dark-command-form-bottom {
    touch-action: manipulation;
  }
}
