/* ===== Matrix theme — mr-anderson.org (OLED-optimized, pure black) ===== */
:root {
  --matrix-green: #00ff41;
  --matrix-green-dim: #009929;
  --matrix-green-glow: rgba(0, 255, 65, 0.45);
  --matrix-bg: #000000;
  --matrix-text: #b8e8b8;
  --font-display: 'Orbitron', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: #000000;
}

/* Body transparent so matrix canvas shows through; html stays pure black (OLED) */
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-mono);
  color: var(--matrix-text);
  background: transparent;
  overflow-x: hidden;
  position: relative;
}

#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.48;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Subtle scanlines */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
}

/* Light vignette only at very edges so rain stays visible */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(
    ellipse 100% 100% at 50% 50%,
    transparent 70%,
    rgba(0, 0, 0, 0.25) 90%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

/* ===== Hero (single placeholder) ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.hero-tagline {
  font-size: 1rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--matrix-green-dim);
  margin-bottom: 0.5rem;
  animation: fadeInDown 1s ease-out, pulse 3s ease-in-out 1s infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: 0.2em;
  margin: 0;
  color: var(--matrix-green);
  text-shadow: 0 0 12px var(--matrix-green-glow);
  animation: fadeIn 1.2s ease-out 0.3s both;
}

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 #ff0040;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  animation: glitchTop 2s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: 2px 0 #00ffff;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  animation: glitchBottom 2.5s infinite linear alternate-reverse;
}

@keyframes glitchTop {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(2px, -2px); }
  60% { transform: translate(-2px, -2px); }
  80% { transform: translate(2px, 2px); }
  100% { transform: translate(0); }
}

@keyframes glitchBottom {
  0% { transform: translate(0); }
  20% { transform: translate(2px, -2px); }
  40% { transform: translate(-2px, 2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(-2px, -2px); }
  100% { transform: translate(0); }
}

.hero-sub {
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  margin-top: 1rem;
  color: var(--matrix-text);
  opacity: 0.9;
  animation: fadeIn 1s ease-out 0.6s both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* ===== White rabbit easter egg — fullscreen terminal + iconic chat ===== */
.easter-egg-overlay {
  position: fixed;
  inset: 0;
  background: #000000;
  display: flex;
  flex-direction: column;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.easter-egg-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.terminal-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #050505;
  overflow: hidden;
  animation: terminal-appear 0.5s ease;
}

@keyframes terminal-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

.terminal-screen {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.terminal-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 2rem 2.5rem 4rem;
  max-width: 52rem;
  width: 100%;
}

.terminal-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.14) 2px,
    rgba(0, 0, 0, 0.14) 4px
  );
}

.terminal-output,
.terminal-line {
  position: relative;
  font-family: 'Consolas', 'Monaco', 'Courier New', Courier, monospace;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  line-height: 1.85;
  color: var(--matrix-green);
  text-shadow: 0 0 12px var(--matrix-green-glow);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-output {
  min-height: 0.5em;
  margin-bottom: 0.5rem;
}

.terminal-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
}

.terminal-prompt {
  color: var(--matrix-green);
  margin-right: 0.25rem;
}

.terminal-typed {
  color: var(--matrix-green);
}

.terminal-cursor {
  display: inline-block;
  color: var(--matrix-green);
  animation: terminal-blink 1s step-end infinite;
  margin-left: 1px;
}

@keyframes terminal-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.terminal-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--matrix-green-dim);
  opacity: 0.6;
  margin: 0;
}

@media (max-width: 600px) {
  .hero-title {
    letter-spacing: 0.1em;
  }
  .glitch::before,
  .glitch::after {
    display: none;
  }
}
