/* ============ BOOT INTRO ============ */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  animation: bootFailsafe 3000ms ease-out 1 forwards;
}

.boot-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(232, 230, 222, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 50% 42%, rgba(94, 234, 212, 0.08), transparent 34%);
  background-size: 100% 5px, auto;
  opacity: 0.7;
}

.boot-overlay.is-hidden {
  animation: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-out;
}

.boot-rain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.86;
}

.boot-status {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(340px, calc(100vw - 40px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(16, 20, 31, 0.84);
  padding: 16px 18px;
  font-family: "JetBrains Mono", monospace;
}

.boot-kicker {
  margin-bottom: 8px;
  color: var(--warn);
  font-size: 11px;
  text-transform: uppercase;
}

.boot-status-line {
  color: var(--signal);
  font-size: 13px;
  line-height: 1.5;
}

@keyframes bootFailsafe {
  0%, 78% {
    opacity: 1;
    pointer-events: all;
  }
  100% {
    opacity: 0;
    pointer-events: none;
  }
}

/* ============ TERMINAL ============ */
.terminal-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(rgba(232, 230, 222, 0.025) 1px, transparent 1px),
    var(--panel);
  background-size: 100% 6px, auto;
  padding: 24px;
  font-family: "JetBrains Mono", monospace;
}

.terminal-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(94, 234, 212, 0.025), transparent);
  opacity: 0.45;
}

.terminal-code {
  position: relative;
  min-height: 280px;
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.75;
  color: var(--paper);
}

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

.terminal-line {
  display: block;
  min-height: 1.75em;
  white-space: pre;
}

.terminal-key {
  color: var(--warn);
}

.terminal-string {
  color: var(--signal);
}

.terminal-punc {
  color: rgba(232, 230, 222, 0.48);
}

.terminal-cursor {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  width: 2px;
  height: 1.55em;
  background: var(--signal);
  transform: translate(0, 0);
  transition: transform 35ms linear;
}

.terminal-cursor.is-blinking {
  animation: cursorBlink 900ms steps(2, start) infinite;
}

@keyframes cursorBlink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

.terminal-measure {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  font: inherit;
  left: -9999px;
  top: -9999px;
}

/* ============ REVEAL ANIMATIONS ============ */
.reveal-item {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(12px);
  transition:
    opacity 520ms var(--ease-out),
    filter 520ms var(--ease-out),
    transform 520ms var(--ease-out);
}

.reveal-item.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

@media (max-width: 640px) {
  .terminal-shell {
    padding: 16px;
  }

  .terminal-code {
    min-height: 250px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .boot-overlay {
    display: none !important;
  }

  .terminal-cursor.is-blinking {
    animation: none !important;
  }

  .reveal-item {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }

  .glass-card:hover,
  .skill-tag:hover,
  .proj-tag:hover,
  .contact-link:hover,
  .chat-fab:hover {
    transform: none !important;
  }
}
