/* ====================================================
   CSS VARIABLES & RESET
   ==================================================== */
:root {
  --green:        #00ff41;
  --cyan:         #00d4ff;
  --red-glitch:   #ff0040;
  --bg:           #0a0a0a;
  --bg-card:      #0f0f0f;
  --bg-terminal:  #050505;
  --border-dim:   rgba(0, 255, 65, 0.15);
  --border-glow:  rgba(0, 255, 65, 0.55);
  --cyan-glow:    rgba(0, 212, 255, 0.45);
  --text-dim:     #3a3a3a;
  --text-muted:   #888888;
  --font-mono:    'Courier New', 'Lucida Console', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--green);
  font-family: var(--font-mono);
  overflow-x: hidden;
}

/* ====================================================
   SCANLINE OVERLAY
   ==================================================== */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.07) 2px,
    rgba(0, 0, 0, 0.07) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ====================================================
   MATRIX RAIN CANVAS
   ==================================================== */
#matrix-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.18;
}

/* ====================================================
   SCROLL MARGIN (prevents navbar overlap on anchor)
   ==================================================== */
section {
  scroll-margin-top: 68px;
}

/* ====================================================
   NAVBAR
   ==================================================== */
#navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 58px;
  background: rgba(10, 10, 10, 0.97);
  border-bottom: 1px solid var(--border-dim);
  gap: 1rem;
}

.nav-logo {
  color: var(--green);
  font-size: 1.3rem;
  font-weight: bold;
  letter-spacing: 5px;
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.6);
  white-space: nowrap;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--green);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: blink-dot 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

.nav-uptime {
  color: var(--text-dim);
  font-size: 0.68rem;
  margin-left: 0.25rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.2s, text-shadow 0.2s;
}

.nav-links a:hover {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* ====================================================
   HERO SECTION
   ==================================================== */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
  padding: 2rem;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.ascii-art {
  color: rgba(0, 255, 65, 0.18);
  font-size: clamp(0.28rem, 0.6vw, 0.58rem);
  line-height: 1.2;
  letter-spacing: 0;
  white-space: pre;
  overflow: hidden;
  margin-bottom: 1.5rem;
  user-select: none;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6.5rem);
  color: var(--green);
  letter-spacing: 0.25em;
  font-weight: bold;
  position: relative;
  display: inline-block;
  text-shadow: 0 0 20px rgba(0, 255, 65, 0.7), 0 0 50px rgba(0, 255, 65, 0.3);
  margin-bottom: 2.5rem;
}

/* Glitch pseudo-elements */
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  color: var(--cyan);
  animation: glitch-before 3.5s infinite linear;
}

.glitch::after {
  color: var(--red-glitch);
  animation: glitch-after 3.5s infinite linear;
}

@keyframes glitch-before {
  0%, 88%, 100% { clip-path: inset(0 0 100% 0); transform: translate(0); }
  90%  { clip-path: inset(15% 0 65% 0); transform: translate(-4px, -2px); }
  92%  { clip-path: inset(55% 0 25% 0); transform: translate(4px, 2px); }
  94%  { clip-path: inset(5%  0 85% 0); transform: translate(-2px, 0); }
  96%  { clip-path: inset(75% 0 5%  0); transform: translate(3px, -1px); }
  98%  { clip-path: inset(35% 0 45% 0); transform: translate(-1px, 2px); }
}

@keyframes glitch-after {
  0%, 89%, 100% { clip-path: inset(0 0 100% 0); transform: translate(0); }
  91%  { clip-path: inset(45% 0 35% 0); transform: translate(4px, 1px); }
  93%  { clip-path: inset(80% 0 8%  0); transform: translate(-4px, 2px); }
  95%  { clip-path: inset(8%  0 72% 0); transform: translate(2px, -2px); }
  97%  { clip-path: inset(62% 0 22% 0); transform: translate(-3px, 0); }
  99%  { clip-path: inset(25% 0 55% 0); transform: translate(1px, -1px); }
}

.hero-terminal {
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: var(--text-muted);
  min-height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.term-prompt {
  color: var(--green);
  white-space: nowrap;
}

#hero-type-output {
  color: var(--cyan);
}

.term-cursor {
  color: var(--green);
  animation: blink-cursor 1s step-end infinite;
  margin-left: 1px;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  font-size: 0.7rem;
  letter-spacing: 3px;
  animation: fade-pulse 2.5s ease-in-out infinite;
}

/* ====================================================
   SHARED SECTION LAYOUT
   ==================================================== */
.section-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 5rem 2rem;
  position: relative;
  z-index: 1;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-tag {
  color: var(--text-dim);
  font-size: 0.72rem;
  white-space: nowrap;
}

.section-title {
  color: var(--green);
  font-size: 1.3rem;
  letter-spacing: 5px;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-dim);
  flex: 1;
}

/* ====================================================
   TERMINAL WINDOW CARD
   ==================================================== */
.terminal-window {
  background: var(--bg-terminal);
  border: 1px solid var(--border-dim);
  border-radius: 5px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.terminal-window:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.08), inset 0 0 50px rgba(0, 255, 65, 0.015);
}

.terminal-titlebar {
  background: #111111;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid var(--border-dim);
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.term-dot--red    { background: #ff5f57; }
.term-dot--yellow { background: #febc2e; }
.term-dot--green  { background: #28c840; }

.term-title {
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-left: 0.5rem;
}

.terminal-body {
  padding: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.9;
  color: var(--text-muted);
}

.term-comment { color: #2d5c2d; }
.term-var     { color: var(--cyan); }
.term-string  { color: #d4a96a; }
.term-bullet  { color: var(--green); margin-right: 0.5rem; }

.term-list {
  list-style: none;
  padding-left: 1rem;
}

.term-list li {
  display: flex;
  align-items: baseline;
}

.term-bio {
  color: #777;
  line-height: 1.8;
}

/* ====================================================
   CARD FADE-IN ANIMATION
   ==================================================== */
.card-fade {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.card-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====================================================
   ARSENAL SECTION
   ==================================================== */
.arsenal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
}

.arsenal-cat-title {
  color: var(--cyan);
  font-size: 0.82rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-dim);
  letter-spacing: 2px;
}

/* Skill bars */
.skill-bar-group {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skill-row {
  display: grid;
  grid-template-columns: 110px 1fr 38px;
  align-items: center;
  gap: 0.75rem;
}

.skill-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.skill-track {
  height: 3px;
  background: rgba(0, 255, 65, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  border-radius: 2px;
  width: 0%;
  transition: width 1.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Badges */
.badge-grid {
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hex-badge {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border-dim);
  color: var(--green);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  clip-path: polygon(8px 0%, calc(100% - 8px) 0%, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0% 50%);
  background: rgba(0, 255, 65, 0.03);
  transition: all 0.2s;
  cursor: default;
}

.hex-badge:hover {
  border-color: var(--green);
  background: rgba(0, 255, 65, 0.1);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.hex-badge--cyan {
  border-color: rgba(0, 212, 255, 0.2);
  color: var(--cyan);
}

.hex-badge--cyan:hover {
  border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.08);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

/* ====================================================
   PROJECTS SECTION
   ==================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.04), transparent);
  transition: left 0.55s ease;
  pointer-events: none;
}

.project-card:hover::before { left: 100%; }

.project-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.08);
  transform: translateY(-4px);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.project-icon {
  color: var(--green);
  font-size: 0.72rem;
  flex-shrink: 0;
}

.project-name {
  color: var(--green);
  font-size: 1rem;
  flex: 1;
}

.project-gh-link {
  color: var(--cyan);
  font-size: 0.72rem;
  text-decoration: none;
  transition: text-shadow 0.2s;
  white-space: nowrap;
}

.project-gh-link:hover {
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.7);
}

.project-desc {
  color: #666;
  font-size: 0.78rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.65rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--border-dim);
  color: #555;
  font-family: var(--font-mono);
}

.tag--python { border-color: rgba(0, 212, 255, 0.25);  color: rgba(0, 212, 255, 0.7); }
.tag--bash   { border-color: rgba(0, 255, 65, 0.25);   color: rgba(0, 255, 65, 0.7); }
.tag--ps1    { border-color: rgba(100, 149, 237, 0.35); color: rgba(100, 149, 237, 0.85); }
.tag--batch  { border-color: rgba(255, 165, 0, 0.3);    color: rgba(255, 165, 0, 0.75); }

/* ====================================================
   CERTIFICATIONS SECTION
   ==================================================== */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.cert-card {
  background: var(--bg-terminal);
  border: 1px solid var(--border-dim);
  border-radius: 5px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.cert-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.08), inset 0 0 50px rgba(0, 255, 65, 0.015);
}

.cert-body {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}

.cert-badge {
  font-size: 1.4rem;
  color: var(--green);
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 14px rgba(0, 255, 65, 0.6);
  font-family: var(--font-mono);
}

.cert-badge--cyan {
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(0, 212, 255, 0.6);
}

.cert-name {
  color: var(--green);
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.cert-issuer {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.cert-status {
  font-size: 0.65rem;
  letter-spacing: 2px;
  padding: 0.2rem 0.8rem;
  border: 1px solid;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
}

.cert-status--active {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
}

.cert-link {
  color: var(--cyan);
  font-size: 0.75rem;
  text-decoration: none;
  margin-top: 0.25rem;
  transition: text-shadow 0.2s;
}

.cert-link:hover {
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.7);
}

/* ====================================================
   CONNECT SECTION
   ==================================================== */
.connect-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.connect-tagline {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.88rem;
}

.connect-tagline .term-prompt {
  margin-right: 0.4rem;
}

.connect-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.connect-link {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 1.5rem;
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.3s, color 0.3s, box-shadow 0.3s, padding-left 0.3s;
}

.connect-link:hover {
  border-color: var(--cyan-glow);
  color: var(--cyan);
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.08);
  padding-left: 2.2rem;
}

.connect-icon {
  color: var(--green);
  min-width: 3.5rem;
  font-size: 0.82rem;
}

.connect-label {
  flex: 1;
  font-size: 0.88rem;
}

.connect-handle {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ====================================================
   FOOTER
   ==================================================== */
#site-footer {
  border-top: 1px solid var(--border-dim);
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-ascii {
  color: var(--text-dim);
  font-size: 0.7rem;
  line-height: 1.6;
  white-space: pre;
}

/* ====================================================
   KEYFRAME ANIMATIONS
   ==================================================== */
@keyframes blink-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
  50%       { opacity: 0.25; box-shadow: none; }
}

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

@keyframes fade-pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.7; }
}

/* ====================================================
   HAMBURGER MENU
   ==================================================== */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border-dim);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.nav-hamburger:hover {
  border-color: var(--green);
}

/* ====================================================
   ACTIVE NAV HIGHLIGHT
   ==================================================== */
.nav-links a.active {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* ====================================================
   BOOT SEQUENCE OVERLAY
   ==================================================== */
#boot-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #000;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

#boot-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

#boot-terminal {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green);
  width: min(600px, 90vw);
}

#boot-output .boot-line {
  margin-bottom: 0.3rem;
  line-height: 1.6;
}

#boot-output .boot-line.dim  { color: var(--text-dim); }
#boot-output .boot-line.ok   { color: #10b981; }
#boot-output .boot-line.cyan { color: var(--cyan); }

.boot-cursor {
  animation: blink-cursor 1s step-end infinite;
}

/* ====================================================
   RESPONSIVE / MOBILE
   ==================================================== */
@media (max-width: 768px) {
  .nav-hamburger { display: block; }
  .ascii-art     { display: none; }
  .nav-status    { font-size: 0.65rem; }
  .nav-uptime    { display: none; }

  /* Nav links become a dropdown when .open */
  .nav-links {
    display: none;
    position: absolute;
    top: 58px; left: 0;
    width: 100%;
    flex-direction: column;
    background: rgba(10, 10, 10, 0.98);
    border-bottom: 1px solid var(--border-dim);
    padding: 1rem 2rem;
    gap: 1.2rem;
    z-index: 999;
  }
  .nav-links.open { display: flex; }

  .arsenal-grid,
  .projects-grid,
  .certs-grid    { grid-template-columns: 1fr; }

  .section-container { padding: 3.5rem 1.25rem; }
  .connect-link      { padding: 0.75rem 1rem; }
  .footer-ascii      { font-size: 0.58rem; }
}

@media (max-width: 480px) {
  .nav-logo      { font-size: 1rem; letter-spacing: 3px; }
  .hero-terminal { font-size: 0.78rem; flex-wrap: wrap; justify-content: center; }
}
