* { box-sizing: border-box; }

/* Vintage CRT-style cursor — pixel-art arrow SVG in project colors */
:root {
  /* Default arrow (used globally). Hotspot at top-left of the SVG. */
  --cursor-default: url("/mainframe/imgs/mainframe-cursor-arrow.svg") 0 0, auto;
  /* Pointer state can share the same arrow for now. */
  --cursor-pointer: url("/mainframe/imgs/mainframe-cursor-arrow.svg") 0 0, pointer;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0a0a0a;
  color: #ff9f1c;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.25rem;
  line-height: 1.4;
  overflow: hidden;
  cursor: var(--cursor-default);
}

/* CRT effect */
.crt {
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,0.15),
      rgba(0,0,0,0.15) 1px,
      transparent 1px,
      transparent 2px
    );
  pointer-events: none;
  z-index: 10;
}
.crt::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

.screen {
  position: fixed;
  inset: 0;
  padding: 2rem 3rem;
  overflow: hidden;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  animation: crtFlicker 0.08s ease-in-out infinite;
}

/* Scrollable viewport — text rolls up and off like old teletype/CRT */
.boot-output-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.boot-output {
  white-space: pre-wrap;
  word-break: break-all;
  padding-bottom: 1rem;
  animation: crtTextFlickerJitter 0.06s ease-in-out infinite;
}

/* All boot text: same size and display, drawn line by line like CRT */
.boot-output .line {
  font-size: 1.25rem;
  line-height: 1.5;
  color: #ff9f1c;
  margin: 0;
  opacity: 0;
  animation: crtLineDraw 0.2s ease-out forwards;
}

/* DONNER ENCRYPTION line — extra emphasis, ACTIVE gets encryption-style reveal */
.boot-output .line.line-donner {
  margin: 0.25rem 0;
}
.boot-output .line .encrypt-active {
  display: inline-block;
  animation: encryptReveal 2s ease-out forwards;
  letter-spacing: 0.15em;
}
@keyframes encryptReveal {
  0% { opacity: 0; filter: blur(3px); letter-spacing: 0.4em; }
  15% { opacity: 0.3; filter: blur(2px); letter-spacing: 0.35em; }
  30% { opacity: 0.6; filter: blur(1px); letter-spacing: 0.25em; }
  50% { opacity: 0.2; filter: blur(2px); letter-spacing: 0.3em; }
  70% { opacity: 0.9; filter: blur(0); letter-spacing: 0.2em; }
  85% { opacity: 0.7; filter: blur(0); letter-spacing: 0.18em; }
  100% { opacity: 1; filter: blur(0); letter-spacing: 0.15em; }
}

/* [ENC] lines — decoding / cipher stream animation */
.boot-output .line.line-enc {
  animation: encLineReveal 0.5s ease-out forwards;
}
@keyframes encLineReveal {
  0% { opacity: 0; filter: brightness(0.2); }
  30% { opacity: 0.5; filter: brightness(0.6); }
  60% { opacity: 0.3; filter: brightness(0.4); }
  100% { opacity: 1; filter: brightness(1); }
}

.prompt-line {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.prompt-input {
  flex: 1;
  min-width: 8rem;
  background: transparent;
  border: none;
  color: #ff9f1c;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.25rem;
  outline: none;
  caret-color: #ff9f1c;
}
.prompt-input::placeholder {
  color: rgba(255, 159, 28, 0.3);
}

/* Menu screen — same CRT look, compact list */
.menu-screen .menu-output-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.menu-output {
  white-space: pre-wrap;
  padding-bottom: 0.5rem;
  animation: crtTextFlickerJitter 0.06s ease-in-out infinite;
}
.menu-header {
  font-size: 1.25rem;
  color: #ff9f1c;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: crtLineDraw 0.2s ease-out forwards;
}
.menu-divider {
  height: 0;
  border-bottom: 1px solid rgba(255, 159, 28, 0.3);
  margin: 0.5rem 0;
}
.menu-options {
  display: block;
}
.menu-options .menu-option {
  display: block;
  font-size: 1.25rem;
  line-height: 1.35;
  margin: 0;
  padding: 0;
  color: #ff9f1c;
  opacity: 0;
  animation: crtLineDraw 0.2s ease-out forwards;
}
.menu-options .menu-option:nth-child(1) { animation-delay: 0.05s; }
.menu-options .menu-option:nth-child(2) { animation-delay: 0.1s; }
.menu-options .menu-option:nth-child(3) { animation-delay: 0.15s; }
.menu-options .menu-option:nth-child(4) { animation-delay: 0.2s; }
.menu-options .menu-option:nth-child(5) { animation-delay: 0.25s; }
.menu-options .menu-option:nth-child(6) { animation-delay: 0.3s; }
.menu-options .menu-option:nth-child(7) { animation-delay: 0.35s; }
.menu-options .menu-option:nth-child(8) { animation-delay: 0.4s; }
.menu-options .menu-option.menu-option-unavailable {
  position: relative;
  opacity: 0.5;
}
.menu-options .menu-option-unavailable .menu-option-text {
  position: relative;
  display: inline-block;
}
.menu-options .menu-option-unavailable .menu-option-text::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0;
  border-bottom: 2px solid #e00;
  transform: translateY(-50%);
  pointer-events: none;
}
.menu-options .menu-option-unavailable .menu-option-unavailable-label {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.65rem;
  color: #e00;
  letter-spacing: 0.05em;
  background: #000;
  padding: 0.1em 0.25em;
  margin-left: 0.35em;
  pointer-events: none;
}
.menu-response {
  font-size: 1.25rem;
  color: #ff9f1c;
  line-height: 1.5;
}

@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes crtLineDraw {
  0% { opacity: 0; filter: brightness(0.4); }
  100% { opacity: 1; filter: brightness(1); }
}

/* Whole-screen CRT flicker — stronger */
@keyframes crtFlicker {
  0%, 100% { opacity: 1; }
  20% { opacity: 0.82; }
  40% { opacity: 0.95; }
  60% { opacity: 0.78; }
  80% { opacity: 0.9; }
}

/* Text: stronger CRT flicker + horizontal + vertical jitter */
@keyframes crtTextFlickerJitter {
  0%, 100% { opacity: 1; transform: translate(0, 0); }
  20% { opacity: 0.85; transform: translate(1.2px, 0.4px); }
  40% { opacity: 0.92; transform: translate(-1px, -0.5px); }
  60% { opacity: 0.78; transform: translate(0.8px, 0.6px); }
  80% { opacity: 0.88; transform: translate(-0.6px, -0.3px); }
}


/* CVH MAINFRAME logo image — entrance then flicker */
.mainframe-logo-wrap {
  text-align: left;
  margin: 1.5rem 0 2rem 0;
}
.mainframe-logo-wrap img {
  max-width: 45%;
  width: auto;
  height: auto;
  display: block;
  /* Recolor black/white image to orange/amber on dark */
  filter: invert(1) sepia(0.65) saturate(6) hue-rotate(15deg) brightness(1.1) contrast(1.1);
  animation: logoEntrance 1s ease-out 0.2s forwards, logoFlicker 0.08s ease-in-out 1.2s infinite;
}

@keyframes logoEntrance {
  0% {
    opacity: 0;
    filter: invert(1) sepia(0.65) saturate(6) hue-rotate(15deg) brightness(0.2) contrast(1.1);
    transform: translateY(-8px);
  }
  100% {
    opacity: 1;
    filter: invert(1) sepia(0.65) saturate(6) hue-rotate(15deg) brightness(1.1) contrast(1.1);
    transform: translateY(0);
  }
}

@keyframes logoFlicker {
  0%, 100% { opacity: 1; }
  20% { opacity: 0.68; }
  50% { opacity: 0.88; }
  80% { opacity: 0.62; }
}

/* Centered pulsing ACCESS link — entrance then pulse */
.access-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  animation: accessEntrance 0.7s ease-out 0.9s forwards;
}
.access-overlay a {
  pointer-events: auto;
  color: #ffb84d;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 2rem;
  letter-spacing: 0.2em;
  text-decoration: none;
  animation: pulse 1.5s ease-in-out 1.6s infinite;
  cursor: var(--cursor-pointer);
}
.access-overlay a:hover {
  color: #ffc970;
}

@keyframes accessEntrance {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
