/* Terminal Theme Enhancements */

/* Typewriter effect for header text */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

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

/* Subtle CRT screen effect */
@keyframes flicker {
  0% {
    opacity: 0.27861;
  }
  5% {
    opacity: 0.34769;
  }
  10% {
    opacity: 0.23604;
  }
  15% {
    opacity: 0.90626;
  }
  20% {
    opacity: 0.18128;
  }
  25% {
    opacity: 0.83891;
  }
  30% {
    opacity: 0.65583;
  }
  35% {
    opacity: 0.67807;
  }
  40% {
    opacity: 0.26559;
  }
  45% {
    opacity: 0.84693;
  }
  50% {
    opacity: 0.96019;
  }
  55% {
    opacity: 0.08594;
  }
  60% {
    opacity: 0.20313;
  }
  65% {
    opacity: 0.71988;
  }
  70% {
    opacity: 0.53455;
  }
  75% {
    opacity: 0.37288;
  }
  80% {
    opacity: 0.71428;
  }
  85% {
    opacity: 0.70419;
  }
  90% {
    opacity: 0.7003;
  }
  95% {
    opacity: 0.36108;
  }
  100% {
    opacity: 0.24387;
  }
}

/* CRT scanlines - very subtle */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    transparent 50%,
    rgba(0, 0, 0, 0.02) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 9999;
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 10px;
  }
}

/* Subtle phosphor glow effect */
body {
  text-shadow: 0 0 2px rgba(14, 165, 233, 0.1);
}

/*main section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2rem;
  background: linear-gradient(to bottom, rgba(30, 30, 30, 0.8), transparent);
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}*/

/*main section::after {
  content: '● ● ●';
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.3rem;
  color: var(--text-muted);
  opacity: 0.3;
}*/

/* Typewriter effect for header */
header h1 {
  overflow: hidden;
  white-space: nowrap;
  /*border-right: 2px solid var(--accent-primary);*/
  animation:
    typewriter 2s steps(14) 0.5s forwards,
    /*blink-cursor 1s step-end infinite 2.5s;*/
}

header p {
  /*opacity: 0;
  animation: fadeIn 0.5s ease-out 0.5s forwards;*/
}

/* Terminal prompt styling */
header p::before {
  content: '>';
  color: var(--accent-primary);
  font-weight: 600;
}

/* Command-style links */
a {
  position: relative;
}

a::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

a:hover::before {
  transform: scaleX(1);
}

a::after {
  content: '';
}

/* Typing indicator for loading */
@keyframes typing-dots {
  0%, 20% {
    content: '';
  }
  40% {
    content: '.';
  }
  60% {
    content: '..';
  }
  80%, 100% {
    content: '...';
  }
}

/* Monospace enhancement for certain elements */
.archive-list td.date,
.project-category > h2,
.project-card h2 {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* Terminal-style quotes */
.quote {
  position: relative;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.quote::before {
  content: '/*';
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  opacity: 0.5;
}

.quote::after {
  content: '*/';
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  opacity: 0.5;
}

/* Code blocks with terminal styling */
pre {
  position: relative;
  padding-top: 2.5rem;
  background: #0a0a0a;
  border: 1px solid rgba(14, 165, 233, 0.1);
}

pre::before {
  content: 'terminal';
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  opacity: 0.5;
}

pre::after {
  content: '●';
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  color: #4ade80;
  font-size: 0.8rem;
  animation: blink-cursor 2s infinite;
}

/* Subtle fade-in animation for content */
@keyframes terminal-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main section {
  animation: terminal-fade-in 0.6s ease-out;
}

main section:nth-child(2) {
  animation-delay: 0.1s;
}

main section:nth-child(3) {
  animation-delay: 0.2s;
}

main section:nth-child(4) {
  animation-delay: 0.3s;
}

/* Archive list with terminal styling */
.archive-list tr {
  position: relative;
}

.archive-list tr::before {
  content: '>';
  position: absolute;
  left: -1rem;
  color: var(--accent-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.archive-list tr:hover::before {
  opacity: 0.5;
}

/* Contact links with command style */
.contact-link {
  font-family: 'JetBrains Mono', monospace;
  position: relative;
}

.contact-link::before {
  content: '$ ';
  position: absolute;
  left: 0.5rem;
  color: var(--accent-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contact-link:hover::before {
  opacity: 1;
}

.contact-link:hover {
  /*padding-left: 2.5rem;*/
}

/* Subtle text glow on hover */
h1:hover,
h2:hover {
  text-shadow: 0 0 8px rgba(14, 165, 233, 0.3);
  transition: text-shadow 0.3s ease;
}

/* Terminal cursor for interactive elements */
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

/* Matrix-style number animation (very subtle) */
@keyframes matrix-rain {
  0% {
    opacity: 0;
    transform: translateY(-100%);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh);
  }
}

/* Optional: Add a subtle matrix rain effect */
.matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.02;
  overflow: hidden;
}

.matrix-bg::before {
  content: '010110100101001010110101';
  position: absolute;
  color: var(--accent-primary);
  font-family: 'Courier New', monospace;
  font-size: 10px;
  animation: matrix-rain 20s linear infinite;
  white-space: pre;
}
