:root {
  --bg: #0a0a0f;
  --bg-alt: #12121a;
  --bg-card: #1a1a24;
  --border: #2a2a3a;
  --text: #e8e8ed;
  --text-muted: #9898a8;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --green: #34d399;
  --radius: 12px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--accent-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: #a5b4fc; }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 700; font-size: 1.25rem; color: var(--text);
}
.logo span { color: var(--accent); }

.nav-links {
  display: flex; align-items: center; gap: 2rem;
  list-style: none;
}

.nav-links a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

.btn-nav {
  background: var(--accent) !important;
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--text); transition: 0.3s;
}

/* Hero */
.hero {
  padding: 8rem 0 5rem;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem; font-weight: 500;
  color: var(--green);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero h1 .accent { color: var(--accent-light); }

.hero-title {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin-bottom: 2rem;
}

.hero-desc strong { color: var(--text); }

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }

.btn {
  display: inline-flex; align-items: center;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  font-weight: 600; font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-light); color: white; transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--text); }

.hero-stats {
  display: flex; gap: 2.5rem;
}
.hero-stats strong { display: block; font-size: 1.1rem; }
.hero-stats span { font-size: 0.8rem; color: var(--text-muted); }

/* Terminal */
.hero-terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.terminal-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 0.75rem 1rem;
  background: #0d0d14;
  border-bottom: 1px solid var(--border);
}
.terminal-bar span {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--border);
}
.terminal-bar span:nth-child(1) { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }
.terminal-bar code { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); font-family: var(--mono); }

.terminal-body {
  padding: 1.25rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-x: auto;
}

.t-prompt { color: var(--accent-light); }
.t-out { color: var(--green); }
.t-json { color: var(--text-muted); }
.t-cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Sections */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}
.section-title::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 48px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.about-text p { color: var(--text-muted); margin-bottom: 1rem; }
.about-text strong { color: var(--text); }

.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--accent); }
.card-icon { font-size: 1.5rem; display: block; margin-bottom: 0.5rem; }
.card h3 { font-size: 0.95rem; margin-bottom: 0.35rem; }
.card p { font-size: 0.8rem; color: var(--text-muted); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.skill-group h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.75rem; }

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-size: 0.8rem; font-weight: 500;
  padding: 0.35rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}
.tag-primary { border-color: var(--accent); color: var(--accent-light); background: var(--accent-glow); }
.tag-muted { opacity: 0.6; }

/* Timeline */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute; left: 6px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-marker {
  position: absolute; left: -2rem; top: 0.35rem;
  width: 14px; height: 14px;
  background: var(--accent);
  border: 3px solid var(--bg);
  border-radius: 50%;
  transform: translateX(-1px);
}

.timeline-date {
  font-size: 0.75rem; font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.timeline-content h3 { font-size: 1.15rem; margin: 0.25rem 0; }
.timeline-company { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.timeline-content ul { padding-left: 1.25rem; color: var(--text-muted); font-size: 0.9rem; }
.timeline-content li { margin-bottom: 0.35rem; }
.timeline-content strong { color: var(--text); }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s;
}
.project-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.project-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem;
}
.project-type { font-size: 0.75rem; font-weight: 600; color: var(--accent-light); text-transform: uppercase; letter-spacing: 0.04em; }
.project-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.project-card p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; }

.projects-more { text-align: center; margin-top: 2rem; color: var(--text-muted); font-size: 0.9rem; }

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -1rem 0 2rem;
}
.section-subtitle code {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent-light);
}

/* Project filter */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-family: var(--font);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.project-card.hidden { display: none; }

/* Engineering highlights */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.highlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.highlight-card:hover { border-color: var(--accent); }
.highlight-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.highlight-card p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.highlight-meta {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--accent-light);
}

/* Writing */
.writing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.writing-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
  color: inherit;
}
.writing-card:hover { border-color: var(--accent); transform: translateY(-2px); color: inherit; }

.writing-platform {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent-light);
}
.writing-card h3 { font-size: 1rem; margin: 0.5rem 0; color: var(--text); }
.writing-card p { font-size: 0.85rem; color: var(--text-muted); }

/* Contact */
.section-contact {
  text-align: center;
  background: radial-gradient(ellipse at 50% 100%, var(--accent-glow) 0%, transparent 60%);
}
.contact-inner h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.contact-inner > p { color: var(--text-muted); margin-bottom: 2rem; }
.contact-links { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.contact-note { font-size: 0.85rem; color: var(--text-muted); }

/* Footer */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .about-grid, .skills-grid, .projects-grid, .writing-grid, .highlights-grid {
    grid-template-columns: 1fr;
  }
  .hero-terminal { order: -1; }
  .about-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem 1.5rem;
    gap: 1rem;
  }
  .nav-links.open { display: flex; }
  .hero { padding-top: 6rem; }
  .hero-stats { gap: 1.5rem; }
  .about-cards { grid-template-columns: 1fr; }
}
