/* ============================================================
   I-Fun Portfolio — Main Stylesheet
   Cyberpunk / Matrix Terminal Aesthetic
   ============================================================ */

/* --- Imports & Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Orbitron:wght@400;500;600;700;800;900&display=swap');
@import url('animations.css');

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --bg:           #050505;
  --bg-secondary: #0a0a0a;
  --bg-card:      #0d0d0d;
  --bg-glass:     rgba(0, 255, 65, 0.04);
  --bg-glass-blue:rgba(0, 180, 255, 0.04);

  /* Borders */
  --border:       rgba(0, 255, 65, 0.12);
  --border-hover: rgba(0, 255, 65, 0.45);
  --border-blue:  rgba(0, 180, 255, 0.25);
  --border-pink:  rgba(255, 0, 110, 0.25);

  /* Text */
  --text:         #c8ffc8;
  --text-muted:   #557755;
  --text-dim:     #2a3d2a;
  --text-bright:  #e8ffe8;

  /* Brand Colors */
  --green:        #00ff41;
  --green-dark:   #00cc33;
  --green-dim:    #005c16;
  --blue:         #00b4ff;
  --blue-dim:     #003d56;
  --pink:         #ff006e;
  --pink-dim:     #560025;
  --yellow:       #ffcc00;
  --orange:       #ff6b00;

  /* Glow Effects */
  --glow-green:  0 0 8px #00ff41, 0 0 16px rgba(0,255,65,0.5), 0 0 32px rgba(0,255,65,0.25);
  --glow-blue:   0 0 8px #00b4ff, 0 0 16px rgba(0,180,255,0.5);
  --glow-pink:   0 0 8px #ff006e, 0 0 16px rgba(255,0,110,0.5);
  --glow-text:   0 0 10px currentColor;

  /* Typography */
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-display: 'Orbitron', 'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   48px;
  --space-2xl:  96px;

  /* Layout */
  --nav-height:   64px;
  --max-width:    1200px;
  --radius:       4px;
  --radius-lg:    8px;
  --radius-xl:    16px;

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-base:   0.3s ease;
  --t-slow:   0.6s ease;
  --t-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--green-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* --- Background Canvas --- */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.12;
}

/* CRT scan lines overlay */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
}

/* --- Custom Cursor --- */
.cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s, width 0.2s, height 0.2s, opacity 0.2s;
  box-shadow: var(--glow-green);
}

.cursor-ring {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1px solid var(--green);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s, width 0.3s, height 0.3s, opacity 0.3s, border-color 0.3s;
  opacity: 0.5;
}

.cursor.clicking { transform: translate(-50%, -50%) scale(0.7); }
.cursor.hovering { width: 6px; height: 6px; opacity: 0.6; }
.cursor-ring.hovering { width: 48px; height: 48px; border-color: var(--blue); }

@media (hover: none) {
  .cursor, .cursor-ring { display: none; }
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(5, 5, 5, 0.85);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--t-base);
}

.navbar.scrolled {
  border-bottom-color: var(--border-hover);
  box-shadow: 0 1px 20px rgba(0, 255, 65, 0.08);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  letter-spacing: 3px;
  user-select: none;
  position: relative;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 1px;
  padding: var(--space-xs) var(--space-sm);
  position: relative;
  transition: color var(--t-base);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--green);
  transition: width var(--t-base);
  box-shadow: var(--glow-green);
}

.nav-link:hover,
.nav-link.active {
  color: var(--green);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 11px;
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text-muted);
  transition: var(--t-base);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + var(--space-xl)) var(--space-xl) var(--space-xl);
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 800px;
  width: 100%;
  z-index: 1;
}

/* Terminal Window */
.terminal-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.05), 0 20px 60px rgba(0, 0, 0, 0.5);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.8s ease both;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }

.terminal-title {
  margin-left: var(--space-sm);
  color: var(--text-muted);
  font-size: 12px;
}

.terminal-body {
  padding: var(--space-lg);
  min-height: 280px;
}

.terminal-line {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  animation: fadeIn 0.4s ease both;
}

.prompt {
  color: var(--green);
  user-select: none;
  flex-shrink: 0;
}

.command {
  color: var(--text-bright);
}

.terminal-output {
  padding: var(--space-xs) 0 var(--space-md) var(--space-lg);
  color: var(--text-muted);
  animation: fadeIn 0.4s ease both;
}

.name-output {
  color: var(--green);
  font-size: 24px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: var(--glow-green);
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-xs) 0 var(--space-md) var(--space-lg);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 12px;
  color: var(--green);
  letter-spacing: 0.5px;
  transition: var(--t-base);
}

.tag:hover {
  border-color: var(--border-hover);
  box-shadow: var(--glow-green);
  background: rgba(0, 255, 65, 0.08);
}

.tag.blue   { color: var(--blue);   border-color: rgba(0,180,255,0.2); }
.tag.pink   { color: var(--pink);   border-color: rgba(255,0,110,0.2); }
.tag.yellow { color: var(--yellow); border-color: rgba(255,204,0,0.2); }
.tag.orange { color: var(--orange); border-color: rgba(255,107,0,0.2); }

/* Blinking cursor */
.cursor-blink {
  display: inline-block;
  color: var(--green);
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}

/* Hero actions */
.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  animation: fadeInUp 0.8s 0.3s ease both;
}

/* Hero floating shapes */
.hero-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border: 1px solid rgba(0, 255, 65, 0.1);
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  width: 80px; height: 80px;
  top: 20%; right: 10%;
  border-color: rgba(0, 255, 65, 0.15);
  transform: rotate(45deg);
  animation-delay: 0s;
}
.shape-2 {
  width: 40px; height: 40px;
  top: 60%; right: 20%;
  border-color: rgba(0, 180, 255, 0.15);
  border-radius: 50%;
  animation-delay: 2s;
}
.shape-3 {
  width: 60px; height: 60px;
  top: 75%; right: 5%;
  border-color: rgba(255, 0, 110, 0.15);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  animation-delay: 4s;
}
.shape-4 {
  width: 120px; height: 120px;
  top: 10%; right: 25%;
  border-color: rgba(0, 255, 65, 0.06);
  border-radius: 50%;
  animation-delay: 1s;
  animation-duration: 8s;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: fadeIn 1s 1s ease both;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--green), transparent);
  animation: scrollLine 1.5s ease-in-out infinite;
}

/* --- Section Base --- */
.section {
  padding: var(--space-2xl) var(--space-xl);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: var(--space-sm);
  letter-spacing: 2px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.section-footer {
  text-align: center;
  margin-top: var(--space-xl);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-decoration: none;
  border: 1px solid;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--t-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--t-base);
}

.btn:hover::before { opacity: 0.08; }

.btn-primary {
  color: var(--bg);
  background: var(--green);
  border-color: var(--green);
}
.btn-primary:hover {
  box-shadow: var(--glow-green);
  transform: translateY(-2px);
}

.btn-secondary {
  color: var(--blue);
  background: transparent;
  border-color: var(--blue);
}
.btn-secondary:hover {
  box-shadow: var(--glow-blue);
  transform: translateY(-2px);
}

.btn-outline {
  color: var(--green);
  background: transparent;
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--border-hover);
  box-shadow: var(--glow-green);
  transform: translateY(-2px);
}

.btn-danger {
  color: var(--pink);
  background: transparent;
  border-color: var(--border-pink);
}
.btn-danger:hover {
  box-shadow: var(--glow-pink);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--t-base);
  position: relative;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  transition: left 0.6s ease;
}

.card:hover::after { left: 100%; }

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

/* Project Card */
.project-card .card-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 40px;
}

.project-card .card-body {
  padding: var(--space-lg);
}

.card-category {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.card-description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.card-links {
  display: flex;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  transition: color var(--t-base);
}

.card-link:hover { color: var(--green); }

.featured-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: var(--green);
  color: var(--bg);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 700;
}

/* --- Grid Layouts --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.wiki-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

/* Wiki Card */
.wiki-card .card-body {
  padding: var(--space-lg);
}

.wiki-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.wiki-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Stats Section --- */
.stats-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-xl) var(--space-xl);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
}

.stat-card {
  text-align: center;
  padding: var(--space-lg);
  position: relative;
}

.stat-card::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--border);
}

.stat-card:last-child::after { display: none; }

.stat-number {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  color: var(--green);
  text-shadow: var(--glow-green);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.stat-number::after { content: '+'; font-size: 24px; }

.stat-label {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* --- Contact Section --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-2xl);
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.contact-label {
  color: var(--text-muted);
  font-size: 12px;
}

.contact-value {
  color: var(--green);
  text-decoration: none;
  font-size: 14px;
  transition: text-shadow var(--t-base);
}

.contact-value:hover {
  text-shadow: var(--glow-green);
}

.social-links {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 16px;
  transition: var(--t-base);
}

.social-link:hover {
  border-color: var(--green);
  color: var(--green);
  box-shadow: var(--glow-green);
  transform: translateY(-2px);
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 1px;
}

.form-input,
.form-textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: var(--space-sm) var(--space-md);
  transition: var(--t-base);
  outline: none;
  resize: vertical;
  min-height: 40px;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 255, 65, 0.1);
}

.form-textarea { min-height: 120px; }

.form-message {
  font-size: 12px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(0, 255, 65, 0.08);
  border: 1px solid rgba(0, 255, 65, 0.3);
  color: var(--green);
}

.form-message.error {
  display: block;
  background: rgba(255, 0, 110, 0.08);
  border: 1px solid rgba(255, 0, 110, 0.3);
  color: var(--pink);
}

/* Turnstile */
.cf-turnstile {
  border-radius: var(--radius);
  overflow: hidden;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.filter-btn {
  padding: 4px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: var(--t-base);
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--bg-glass);
}

/* --- Search Bar --- */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  transition: border-color var(--t-base);
}

.search-bar:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(0, 255, 65, 0.08);
}

.search-icon { color: var(--text-muted); }

.search-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
}

.search-input::placeholder { color: var(--text-dim); }

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: var(--t-base);
  text-decoration: none;
}

.page-btn:hover,
.page-btn.active {
  border-color: var(--green);
  color: var(--green);
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    rgba(0, 255, 65, 0.04) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-card {
  height: 300px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* --- Wiki Article Page --- */
.article-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-xl);
  align-items: start;
  max-width: var(--max-width);
  margin: 0 auto;
}

.article-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-lg));
}

.toc-title {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.toc-link {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  padding: var(--space-xs) var(--space-sm);
  border-left: 2px solid transparent;
  transition: var(--t-base);
}

.toc-link:hover,
.toc-link.active {
  color: var(--green);
  border-left-color: var(--green);
}

/* Markdown Article Content */
.article-content {
  max-width: 720px;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  font-family: var(--font-display);
  color: var(--text-bright);
  margin: var(--space-xl) 0 var(--space-md);
  line-height: 1.3;
}

.article-content h1 { font-size: 28px; color: var(--green); }
.article-content h2 { font-size: 22px; border-bottom: 1px solid var(--border); padding-bottom: var(--space-sm); }
.article-content h3 { font-size: 18px; }
.article-content h4 { font-size: 15px; color: var(--text-muted); }

.article-content p {
  margin-bottom: var(--space-md);
  color: var(--text);
  line-height: 1.8;
}

.article-content a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 255, 65, 0.3);
  transition: var(--t-base);
}

.article-content a:hover {
  border-bottom-color: var(--green);
  text-shadow: var(--glow-green);
}

.article-content code {
  background: rgba(0, 255, 65, 0.06);
  border: 1px solid var(--border);
  color: var(--green);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
}

.article-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  overflow-x: auto;
  margin: var(--space-md) 0;
  position: relative;
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.article-content ul,
.article-content ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
  color: var(--text);
}

.article-content li { margin-bottom: var(--space-xs); }

.article-content blockquote {
  border-left: 3px solid var(--green);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-glass);
  margin: var(--space-md) 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: 13px;
}

.article-content th {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md);
  color: var(--green);
  text-align: left;
  font-weight: 600;
}

.article-content td {
  border: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-muted);
}

.article-content tr:hover td { background: var(--bg-glass); }

.article-content img {
  max-width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: var(--space-md) 0;
}

/* Copy button on code blocks */
.code-block-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--t-base);
}

.copy-btn:hover { color: var(--green); border-color: var(--green); }
.copy-btn.copied { color: var(--green); }

/* --- Footer --- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--space-xl);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 3px;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color var(--t-base);
}

.footer-links a:hover { color: var(--green); }

.footer-bottom {
  max-width: var(--max-width);
  margin: var(--space-lg) auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-bottom p {
  color: var(--text-dim);
  font-size: 12px;
}

.footer-tech { color: var(--text-muted) !important; font-style: italic; }

/* --- About Page --- */
.about-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2xl);
  align-items: center;
  margin-bottom: var(--space-2xl);
}

.profile-img-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 2px solid var(--green);
  display: block;
}

.profile-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  border: 2px solid var(--green);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--green);
  box-shadow: var(--glow-green);
}

.profile-img-wrapper::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) + 4px);
  animation: rotate 8s linear infinite;
  background: conic-gradient(transparent 30%, var(--green), transparent 35%);
  -webkit-mask: radial-gradient(circle at center, transparent calc(100% - 6px), black calc(100% - 6px));
  mask: radial-gradient(circle at center, transparent calc(100% - 6px), black calc(100% - 6px));
}

.about-text h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: var(--space-sm);
}

.about-role {
  color: var(--green);
  font-size: 16px;
  margin-bottom: var(--space-md);
}

.about-bio {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: var(--space-lg);
}

/* Skills section */
.skills-section {
  margin-bottom: var(--space-2xl);
}

.skills-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.skill-category {
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--t-base);
}

.skill-category:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.06);
}

.skill-category-title {
  font-size: 12px;
  color: var(--green);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 1px;
  background: linear-gradient(to bottom, var(--green), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) - 4px);
  top: 6px;
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: var(--glow-green);
}

.timeline-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-bright);
  margin-bottom: var(--space-xs);
}

.timeline-company {
  color: var(--green);
  font-size: 13px;
  margin-bottom: var(--space-sm);
}

.timeline-desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

/* --- 404 Page --- */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl);
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(80px, 15vw, 140px);
  font-weight: 900;
  color: var(--green);
  text-shadow: var(--glow-green);
  line-height: 1;
  margin-bottom: var(--space-md);
}

.error-message {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: var(--space-xl);
}

/* --- Toasts / Notifications --- */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  font-size: 13px;
  min-width: 280px;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3s forwards;
}

.toast.success { border-color: rgba(0, 255, 65, 0.4); color: var(--green); }
.toast.error   { border-color: rgba(255, 0, 110, 0.4); color: var(--pink); }
.toast.info    { border-color: rgba(0, 180, 255, 0.4); color: var(--blue); }

/* --- Utilities --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-green  { color: var(--green); }
.text-blue   { color: var(--blue);  }
.text-pink   { color: var(--pink);  }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-xl  { margin-bottom: var(--space-xl); }
.gap-sm { gap: var(--space-sm); }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --space-xl: 32px;
    --space-2xl: 60px;
  }

  .navbar { padding: 0 var(--space-md); }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(5, 5, 5, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
  }

  .nav-links.open { display: flex; }

  .nav-toggle { display: flex; }

  .nav-status { display: none; }

  .hero { padding: calc(var(--nav-height) + 32px) var(--space-md) var(--space-md); }

  .hero-shapes { display: none; }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card:nth-child(2)::after { display: none; }

  .contact-grid { grid-template-columns: 1fr; }

  .about-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }

  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }

  .footer-content { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; }

  .section { padding: var(--space-xl) var(--space-md); }

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

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .terminal-body { padding: var(--space-md); }
  .name-output { font-size: 20px; }
}
