/* ===== VARIABLES ===== */
:root {
  --bg: #0a0a0b;
  --bg-card: #0d0d0f;
  --border: #1a2f1a;
  --text: #00ff41;
  --text-dim: #00aa2a;
  --accent: #00ff88;
  --accent2: #39ff14;
  --glitch: #ff0040;
  --glitch2: #00d4ff;
  --header-bg: rgba(10, 10, 11, 0.92);
  --font-mono: 'VT323', monospace;
  --font-display: 'Orbitron', sans-serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCANLINES & NOISE ===== */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 1000;
}
.noise {
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 1rem;
}
.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  transition: color 0.2s, text-shadow 0.2s;
}
.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}
.terminal-bar {
  font-size: 0.75rem;
  text-align: center;
  padding: 0.25rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.blink { animation: blink 1s step-end infinite; }
@keyframes blink {
  50% { opacity: 0; }
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 1rem 3rem;
  text-align: center;
}
.hero-inner { max-width: 42rem; }
.ascii-art {
  font-family: var(--font-mono);
  font-size: clamp(0.5rem, 2.5vw, 0.85rem);
  color: var(--text-dim);
  margin: 0 0 1.5rem;
  line-height: 1.2;
  letter-spacing: 0.05em;
}
.terminal-window {
  border: 1px solid var(--border);
  background: rgba(0, 20, 0, 0.4);
  text-align: left;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.08);
}
.term-header {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  background: rgba(0, 50, 0, 0.5);
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.term-body {
  padding: 1rem 1.25rem;
  font-size: 1.15rem;
}
.term-body p { margin: 0.5rem 0; }
.prompt { color: var(--accent); margin-right: 0.5rem; }
.output { color: var(--text); }
.cursor { color: var(--accent); animation: blink 0.8s step-end infinite; }
.cursor-blink { animation: blink 0.8s step-end infinite; }
.line-hidden { opacity: 0; }
.line-visible { opacity: 1; transition: opacity 0.3s; }
.tagline {
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  letter-spacing: 0.2em;
  color: var(--text-dim);
}
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--text-dim);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ===== SECTIONS COMMON ===== */
.section {
  padding: 4rem 1.5rem;
  max-width: 56rem;
  margin: 0 auto;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.bracket { color: var(--text-dim); }
.section-desc {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ===== CV ===== */
.section-cv .cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.cv-block {
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 1.25rem;
}
.cv-block h3 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.cv-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 1.05rem;
}
.cv-list li {
  padding: 0.25rem 0;
  color: var(--text-dim);
}
.cv-list .year {
  color: var(--accent);
  margin-right: 0.5rem;
}
.cv-list.skills li { color: var(--text); }
.btn-dl {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-dl:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

/* ===== WRITEUPS ===== */
.writeups-grid {
  display: grid;
  gap: 1.25rem;
}
.writeup-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.writeup-card:hover {
  border-color: var(--text-dim);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.06);
}
.writeup-date {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.5rem;
}
.writeup-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.writeup-card p {
  color: var(--text-dim);
  font-size: 1rem;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}
.writeup-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
}
.writeup-link:hover { text-decoration: underline; }

/* ===== CVE TABLE ===== */
.cve-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.cve-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.cve-table th,
.cve-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.cve-table th {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  background: rgba(0, 40, 0, 0.3);
}
.cve-table tbody tr:hover {
  background: rgba(0, 255, 65, 0.03);
}
.cve-table a {
  color: var(--accent);
  text-decoration: none;
}
.cve-table a:hover { text-decoration: underline; }
.sev {
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  display: inline-block;
}
.sev.critical { color: #ff4444; }
.sev.high { color: #ff8844; }
.sev.medium { color: #ffaa00; }
.sev.low { color: var(--text-dim); }

/* ===== CONTACT ===== */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.contact-link {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.15);
}
.pgp-hint {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-align: center;
}

/* ===== FOOTER ===== */
.footer {
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 1rem;
}
.footer .prompt { color: var(--accent); }

/* ===== GLITCH EFFECT (optional on title) ===== */
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}
.glitch::before {
  color: var(--glitch);
  animation: glitch-1 0.3s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  transform: translate(-2px, 2px);
}
.glitch::after {
  color: var(--glitch2);
  animation: glitch-2 0.3s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  transform: translate(2px, -2px);
}
@keyframes glitch-1 {
  0% { clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%); transform: translate(-2px, 2px); }
  20% { clip-path: polygon(0 20%, 100% 20%, 100% 55%, 0 55%); transform: translate(2px, -2px); }
  40% { clip-path: polygon(0 40%, 100% 40%, 100% 75%, 0 75%); transform: translate(-2px, 2px); }
  100% { clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%); transform: translate(-2px, 2px); }
}
@keyframes glitch-2 {
  0% { clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%); transform: translate(2px, -2px); }
  20% { clip-path: polygon(0 5%, 100% 5%, 100% 40%, 0 40%); transform: translate(-2px, 2px); }
  100% { clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%); transform: translate(2px, -2px); }
}
