/* ===== VARIABLES ===== */
:root {
  --bg: #030712;
  --bg2: #0d1117;
  --bg3: #161b22;
  --card: #0f1923;
  --border: rgba(0,255,128,0.12);
  --green: #00ff80;
  --green2: #00cc66;
  --purple: #a855f7;
  --purple2: #7c3aed;
  --cyan: #22d3ee;
  --text: #e2e8f0;
  --muted: #64748b;
  --radius: 12px;
  --radius-lg: 20px;
  --mono: 'Share Tech Mono', monospace;
  --sans: 'Outfit', sans-serif;
  --grotesk: 'Space Grotesk', sans-serif;
  --glow: 0 0 20px rgba(0,255,128,0.3);
  --glow-purple: 0 0 20px rgba(168,85,247,0.3);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--green2); border-radius: 3px; }

/* ===== UTILITIES ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.gradient-text {
  background: linear-gradient(135deg, var(--green), var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.highlight { color: var(--green); font-family: var(--mono); }
.section { padding: 100px 0; }
.section-tag { font-family: var(--mono); font-size: 0.8rem; color: var(--green); letter-spacing: 2px; display: block; margin-bottom: 12px; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.15; margin-bottom: 16px; }
.section-desc { color: var(--muted); max-width: 560px; margin: 0 auto; line-height: 1.7; }
.tag-dot { display: inline-block; width: 8px; height: 8px; background: var(--green); border-radius: 50%; margin-right: 8px; animation: pulse 2s infinite; }
.hide-mobile { display: inline; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 8px; font-weight: 600;
  font-size: 0.95rem; transition: all 0.3s ease; position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.05); opacity: 0; transition: opacity 0.3s;
}
.btn:hover::before { opacity: 1; }
.btn-primary {
  background: linear-gradient(135deg, var(--green2), var(--cyan));
  color: #000; box-shadow: var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 35px rgba(0,255,128,0.5); }
.btn-ghost {
  border: 1px solid var(--border); color: var(--text);
  background: rgba(255,255,255,0.03);
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); transform: translateY(-2px); }
.full-width { width: 100%; justify-content: center; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 16px 0; transition: all 0.4s ease;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(3,7,18,0.92); backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono); font-size: 1.2rem; color: var(--green);
  display: flex; align-items: center; gap: 2px;
}
.logo-bracket { opacity: 0.5; }
.logo-cursor { animation: blink 1s infinite; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link { font-size: 0.9rem; color: var(--muted); transition: color 0.3s; position: relative; }
.nav-link::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px;
  background: var(--green); transition: width 0.3s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.cta-nav {
  border: 1px solid var(--green) !important; color: var(--green) !important;
  padding: 8px 18px; border-radius: 6px;
}
.cta-nav::after { display: none !important; }
.cta-nav:hover { background: rgba(0,255,128,0.08) !important; }
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text); transition: all 0.3s; border-radius: 2px; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  position: relative; overflow: hidden; padding: 100px 24px 60px;
  gap: 40px; max-width: 1200px; margin: 0 auto;
}
.hero-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
#matrixCanvas { position: absolute; inset: 0; opacity: 0.07; }
.hero-grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,255,128,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,128,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-content { flex: 1; min-width: 0; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,255,128,0.06); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 20px; font-size: 0.82rem;
  color: var(--green); margin-bottom: 28px;
}
.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 900;
  line-height: 1.1; margin-bottom: 20px; font-family: var(--grotesk);
}
.hero-sub { color: var(--muted); font-size: 1.1rem; line-height: 1.7; margin-bottom: 36px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 52px; }
.hero-stats { display: flex; align-items: center; gap: 32px; }
.stat-num {
  font-size: 2rem; font-weight: 900; color: var(--green);
  font-family: var(--grotesk); line-height: 1;
}
.stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* Terminal card */
.hero-side { flex: 0 0 380px; }
.terminal-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--glow), 0 40px 80px rgba(0,0,0,0.5);
}
.terminal-header {
  background: var(--bg3); padding: 12px 16px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.t-dot { width: 12px; height: 12px; border-radius: 50%; }
.t-dot.red { background: #ff5f57; }
.t-dot.yellow { background: #febc2e; }
.t-dot.green { background: #28c840; }
.t-title { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-left: auto; }
.terminal-body { padding: 20px; font-family: var(--mono); font-size: 0.82rem; min-height: 260px; line-height: 1.8; }
.t-line { color: var(--text); }
.t-line .prompt { color: var(--green); }
.t-line .cmd { color: var(--cyan); }
.t-line .out { color: var(--muted); }
.t-line .val { color: var(--purple); }
.t-cursor { display: inline-block; width: 8px; height: 14px; background: var(--green); animation: blink 1s infinite; vertical-align: middle; margin-left: 2px; }

/* Scroll indicator */
.scroll-indicator {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 0.7rem; color: var(--muted); font-family: var(--mono); letter-spacing: 2px;
}
.scroll-line { width: 1px; height: 40px; background: linear-gradient(var(--green), transparent); animation: scrollAnim 2s ease-in-out infinite; }

/* ===== WORK SECTION ===== */
.work-section { background: var(--bg2); }
.filter-bar { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.filter-btn {
  padding: 8px 20px; border-radius: 20px; font-size: 0.85rem;
  border: 1px solid var(--border); color: var(--muted);
  background: transparent; transition: all 0.3s;
}
.filter-btn.active, .filter-btn:hover {
  border-color: var(--green); color: var(--green);
  background: rgba(0,255,128,0.06);
}
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px,1fr)); gap: 24px;
}
.project-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: all 0.4s ease; cursor: pointer; position: relative;
}
.project-card:hover { transform: translateY(-6px); border-color: var(--green); box-shadow: var(--glow); }
.project-card-top {
  height: 200px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
/* Cover image fills the card top completely */
.project-card-top img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.project-card-top img ~ .project-badge { z-index: 2; }
.project-icon { font-size: 3.5rem; opacity: 0.8; }
.project-badge {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 10px; font-size: 0.72rem; color: var(--green); font-family: var(--mono);
}
.project-card-body { padding: 20px; }
.project-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; font-family: var(--grotesk); }
.project-desc { color: var(--muted); font-size: 0.88rem; line-height: 1.6; margin-bottom: 16px; }
.project-stack { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.stack-tag {
  font-family: var(--mono); font-size: 0.72rem; padding: 3px 10px;
  border-radius: 4px; background: rgba(0,255,128,0.07);
  border: 1px solid rgba(0,255,128,0.15); color: var(--green);
}
.project-link { font-size: 0.83rem; color: var(--cyan); font-family: var(--mono); transition: color 0.3s; }
.project-link:hover { color: var(--green); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); max-width: 680px; width: 100%;
  max-height: 90vh; overflow-y: auto; position: relative;
  transform: scale(0.9); transition: transform 0.3s;
}
.modal-overlay.open .modal-card { transform: scale(1); }
.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  color: var(--muted); font-size: 1.2rem; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bg3); transition: all 0.3s;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.modal-content { padding: 36px; }
.modal-hero { height: 200px; border-radius: var(--radius); margin-bottom: 24px; display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.modal-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; font-family: var(--grotesk); }
.modal-desc { color: var(--muted); line-height: 1.7; margin-bottom: 24px; }
.modal-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.meta-item { background: var(--bg3); border-radius: 8px; padding: 14px; }
.meta-label { font-size: 0.72rem; color: var(--muted); font-family: var(--mono); margin-bottom: 4px; }
.meta-value { font-size: 0.92rem; font-weight: 600; }
.impact-box { background: rgba(0,255,128,0.05); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.impact-box h4 { color: var(--green); font-family: var(--mono); font-size: 0.8rem; margin-bottom: 8px; }
.impact-box p { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }
