/* ═══════════════════════════════════════════
   TERMINAL PORTFOLIO — STYLES
   ═══════════════════════════════════════════ */

:root {
  --green: #00ff41;
  --green-dim: #00cc33;
  --green-dark: #003b00;
  --green-glow: rgba(0, 255, 65, 0.4);
  --bg: #0a0a0a;
  --bg-light: #111111;
  --bg-terminal: #0d0d0d;
  --red: #ff0040;
  --cyan: #00ffff;
  --yellow: #ffff00;
  --magenta: #ff00ff;
  --text: #00ff41;
  --font-mono: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Scanline overlay */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
}

.scanlines::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

/* Glitch overlay */
.glitch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  background: var(--green);
  mix-blend-mode: overlay;
  transition: opacity 0.05s;
}

/* Particle canvas */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Terminal window */
.terminal {
  width: 100%;
  background: var(--bg-terminal);
  border: 1px solid var(--green-dark);
  border-radius: 8px;
  box-shadow:
    0 0 20px rgba(0, 255, 65, 0.1),
    0 0 60px rgba(0, 255, 65, 0.05),
    inset 0 0 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

.terminal::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 9px;
  background: linear-gradient(45deg, var(--green-dark), transparent, var(--green-dark));
  z-index: -1;
  animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Terminal header */
.terminal-header {
  background: #1a1a1a;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--green-dark);
  position: relative;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
  margin-right: 16px;
}

.terminal-buttons span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.btn-close { background: var(--red); }
.btn-minimize { background: var(--yellow); }
.btn-maximize { background: #00cc33; }

.terminal-title {
  color: #666;
  font-size: 0.85rem;
}

/* Terminal body */
.terminal-body {
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--green-dark) var(--bg);
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
  background: var(--bg);
}

.terminal-body::-webkit-scrollbar-thumb {
  background: var(--green-dark);
  border-radius: 3px;
}

/* Sections */
.section {
  margin-bottom: 40px;
  animation: fadeIn 0.5s ease-out;
}

.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Lines */
.line {
  margin-bottom: 6px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.prompt {
  color: var(--cyan);
  margin-right: 8px;
}

.command {
  color: var(--green);
}

.output {
  color: #888;
  padding-left: 20px;
}

/* Cursor blink */
.cursor-blink {
  display: inline-block;
  color: var(--green);
  animation: blink 1s step-end infinite;
  font-weight: bold;
}

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

/* Hero section */
.hero-section {
  text-align: center;
  padding: 20px 0;
}

.ascii-art {
  font-size: 0.55rem;
  line-height: 1.1;
  color: var(--green);
  text-shadow: 0 0 10px var(--green-glow);
  margin-bottom: 30px;
  overflow: hidden;
}

.ascii-art pre {
  font-family: var(--font-mono);
  white-space: pre;
}

.hero-info h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--green);
  text-shadow:
    0 0 10px var(--green-glow),
    0 0 40px rgba(0, 255, 65, 0.2),
    0 0 80px rgba(0, 255, 65, 0.1);
  margin-bottom: 16px;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--green-dim);
  min-height: 1.5em;
}

/* Section titles */
.section-title {
  font-size: 1.1rem;
  color: var(--green);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--green-dark);
  text-shadow: 0 0 8px var(--green-glow);
}

/* Content box */
.content-box {
  background: rgba(0, 255, 65, 0.03);
  border: 1px solid var(--green-dark);
  border-radius: 4px;
  padding: 20px;
  margin-top: 10px;
}

.content-box p {
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.highlight {
  color: var(--cyan);
  text-shadow: 0 0 6px rgba(0, 255, 255, 0.3);
}

.status-online {
  color: #00ff41;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Skills */
.skills-grid {
  display: grid;
  gap: 16px;
  margin-top: 10px;
}

.skill-item {
  display: grid;
  grid-template-columns: 160px 1fr 50px;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.skill-name {
  color: var(--green-dim);
}

.skill-bar {
  height: 8px;
  background: rgba(0, 255, 65, 0.1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--green-dark);
}

.skill-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  border-radius: 4px;
  box-shadow: 0 0 10px var(--green-glow);
  transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.skill-pct {
  text-align: right;
  color: var(--green);
  font-size: 0.85rem;
}

/* Timeline */
.timeline {
  margin-top: 10px;
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--green), var(--green-dark));
  box-shadow: 0 0 8px var(--green-glow);
}

.timeline-item {
  margin-bottom: 24px;
  padding-left: 20px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--green-glow);
}

.timeline-date {
  color: var(--cyan);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.timeline-content h3 {
  color: var(--green);
  font-size: 1rem;
  margin-bottom: 4px;
}

.timeline-content p {
  color: #888;
  font-size: 0.9rem;
}

/* JSON box */
.json-box pre {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.8;
}

.json-key { color: var(--cyan); }
.json-val { color: var(--green); }

/* Contact links */
.contact-links {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.contact-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
  transition: left 0.5s ease;
}

.contact-btn:hover {
  background: rgba(0, 255, 65, 0.1);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
  transform: translateY(-2px);
}

.contact-btn:hover::before {
  left: 100%;
}

.btn-icon {
  font-size: 1.1rem;
}

/* Footer */
.footer-section {
  text-align: left;
  padding-top: 20px;
  border-top: 1px solid var(--green-dark);
}

/* ═══════════════════════════════════════════
   GLITCH EFFECTS
   ═══════════════════════════════════════════ */

.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.glitch::before {
  color: var(--cyan);
  z-index: -1;
  animation: glitch-1 3s infinite linear alternate-reverse;
}

.glitch::after {
  color: var(--red);
  z-index: -2;
  animation: glitch-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
  0%, 95% { clip-path: inset(0 0 0 0); transform: translate(0); }
  96% { clip-path: inset(20% 0 40% 0); transform: translate(-3px, 1px); }
  97% { clip-path: inset(60% 0 10% 0); transform: translate(3px, -1px); }
  98% { clip-path: inset(10% 0 70% 0); transform: translate(-2px, 2px); }
  99% { clip-path: inset(40% 0 30% 0); transform: translate(2px, -2px); }
  100% { clip-path: inset(0 0 0 0); transform: translate(0); }
}

@keyframes glitch-2 {
  0%, 93% { clip-path: inset(0 0 0 0); transform: translate(0); }
  94% { clip-path: inset(50% 0 20% 0); transform: translate(4px, -1px); }
  95% { clip-path: inset(10% 0 60% 0); transform: translate(-4px, 2px); }
  96% { clip-path: inset(70% 0 5% 0); transform: translate(2px, 1px); }
  97% { clip-path: inset(30% 0 40% 0); transform: translate(-2px, -1px); }
  100% { clip-path: inset(0 0 0 0); transform: translate(0); }
}

/* Random glitch flash on elements */
.glitch-flash {
  animation: flashGlitch 0.1s ease;
}

@keyframes flashGlitch {
  0% { opacity: 1; transform: translate(0); }
  25% { opacity: 0.8; transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
  50% { opacity: 0.6; transform: translate(2px, -1px); filter: hue-rotate(180deg); }
  75% { opacity: 0.9; transform: translate(-1px, -1px); filter: hue-rotate(270deg); }
  100% { opacity: 1; transform: translate(0); filter: none; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .container {
    padding: 20px 10px;
  }

  .terminal-body {
    padding: 16px;
  }

  .hero-info h1 {
    font-size: 1.8rem;
    letter-spacing: 4px;
  }

  .ascii-art {
    font-size: 0.35rem;
  }

  .skill-item {
    grid-template-columns: 120px 1fr 40px;
    gap: 8px;
    font-size: 0.8rem;
  }

  .contact-links {
    flex-direction: column;
  }

  .contact-btn {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-info h1 {
    font-size: 1.4rem;
    letter-spacing: 2px;
  }

  .ascii-art {
    display: none;
  }

  .skill-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .skill-pct {
    text-align: left;
  }
}

/* Selection color */
::selection {
  background: var(--green);
  color: var(--bg);
}

/* Flicker animation for boot text */
.flicker {
  animation: flicker 0.1s linear;
}

@keyframes flicker {
  0% { opacity: 0.2; }
  10% { opacity: 0.8; }
  20% { opacity: 0.1; }
  30% { opacity: 0.9; }
  40% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 1; }
}