@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Theme Variables ──────────────────────────────────────────── */
:root {
  --bg:       #0d0d0d;
  --surface:  #1a1a1a;
  --surface2: #252525;
  --border:   #2e2e2e;
  --red:      #e63946;
  --green:    #2dc653;
  --yellow:   #ffd166;
  --white:    #f0f0f0;
  --muted:    #888888;
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius:   12px;
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg:       #f5f5f5;
  --surface:  #ffffff;
  --surface2: #ebebeb;
  --border:   #d0d0d0;
  --white:    #111111;
  --muted:    #555555;
}

/* ─── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--white);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ─── Typography ───────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p  { color: var(--muted); }

/* ─── Layout Utilities ─────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.section-heading { margin-bottom: 3rem; }
.section-heading h2 { color: var(--white); }

/* ─── Header / Nav ─────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,13,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
[data-theme="light"] .header { background: rgba(245,245,245,0.85); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--red);
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--white); }

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition);
  position: relative;
}
.nav-links a:hover,
.nav-links a.active { color: var(--white); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
}

.nav-right { display: flex; gap: 1rem; align-items: center; }

.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--red); color: var(--white); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Nav Overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--muted);
  transition: color var(--transition);
}
.mobile-nav a:hover { color: var(--red); }
.mobile-nav-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.8rem;
  cursor: pointer;
}

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #c1121f; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--white); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-green { background: var(--green); color: #000; font-weight: 600; }
.btn-green:hover { background: #24a844; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.82rem; }

/* ─── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}
.card:hover { border-color: var(--red); transform: translateY(-4px); }

/* ─── Tags / Badges ────────────────────────────────────────────── */
.tag {
  display: inline-block;
  background: var(--yellow);
  color: #000;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}
.tag-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }

/* ─── Grid ─────────────────────────────────────────────────────── */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }

/* ─── Hero Section ─────────────────────────────────────────────── */
.hero {
  padding: 7rem 0 5rem;
  position: relative;
}
.hero-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}
.hero h1 { color: var(--white); }
.hero h1 .accent { color: var(--red); }
.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--muted);
  margin: 1rem 0 1.5rem;
  min-height: 1.5em;
}
.hero-role .cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--green);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-tagline {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 540px;
  margin-bottom: 2.5rem;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ─── About Section ────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-photo {
  width: 100%;
  aspect-ratio: 1;
  max-width: 340px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  overflow: hidden;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-text h2 { color: var(--white); margin-bottom: 1rem; }
.about-text p { margin-bottom: 1rem; }

/* ─── Skills Section ───────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}
.skill-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
  cursor: default;
}
.skill-item:hover { border-color: var(--green); transform: translateY(-3px); }
.skill-item .icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.skill-item span { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

/* ─── Unified Timeline (Experience + Education) ────────────────── */
.unified-timeline {
  position: relative;
  padding-left: 56px;
}
.unified-timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 6px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--red), var(--border) 80%);
}
.tl-item {
  position: relative;
  margin-bottom: 2.75rem;
}
/* Dot on the vertical line */
.tl-item::before {
  content: '';
  position: absolute;
  left: -43px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px currentColor;
}
/* Horizontal connector line */
.tl-item::after {
  content: '';
  position: absolute;
  left: -33px;
  top: 10px;
  width: 28px;
  height: 1px;
  background: var(--border);
}
.tl-item.tl-work::before { background: var(--red); color: var(--red); }
.tl-item.tl-edu::before  { background: var(--green); color: var(--green); }

.tl-header { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.3rem; }
.tl-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.tl-badge-work { background: rgba(230,57,70,0.15); color: var(--red); border: 1px solid rgba(230,57,70,0.3); }
.tl-badge-edu  { background: rgba(45,198,83,0.12); color: var(--green); border: 1px solid rgba(45,198,83,0.25); }
.tl-current {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--green);
  background: rgba(45,198,83,0.1);
  border: 1px solid rgba(45,198,83,0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  animation: pulse-text 2s ease-in-out infinite;
}
@keyframes pulse-text { 0%,100% { opacity:1; } 50% { opacity:0.6; } }

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.tl-role { font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 0.15rem; }
.tl-org  { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.6rem; }
.tl-bullets { padding-left: 1rem; margin-top: 0.4rem; }
.tl-bullets li {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  list-style: disc;
}

/* Keep old .timeline classes for backward compat just in case */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0.4rem; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--green); margin-bottom: 0.3rem; }
.timeline-role { font-size: 1rem; font-weight: 600; color: var(--white); }
.timeline-org  { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.6rem; }
.timeline-bullets { padding-left: 1rem; }
.timeline-bullets li { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.3rem; list-style: disc; }

/* ─── Publications ─────────────────────────────────────────────── */
.pub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.5rem;
  transition: border-color var(--transition);
}
.pub-card:hover { border-left-color: var(--green); }
.pub-card h3 { color: var(--white); margin-bottom: 0.4rem; }
.pub-card .pub-journal {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green);
  margin-bottom: 0.6rem;
}
.pub-card p { font-size: 0.875rem; }

/* ─── Contact ──────────────────────────────────────────────────── */
.contact-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition);
}
.contact-link:hover { border-color: var(--red); color: var(--white); }

/* ─── Blog / Project Cards ─────────────────────────────────────── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition), transform var(--transition);
}
.post-card:hover { border-color: var(--red); transform: translateY(-4px); }
.post-card h3 { color: var(--white); line-height: 1.4; }
.post-card .post-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.post-card p { font-size: 0.875rem; flex: 1; }
.post-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition), transform var(--transition);
}
.project-card:hover { border-color: var(--red); transform: translateY(-4px); }
.project-card h3 { color: var(--white); }
.project-card p { font-size: 0.875rem; flex: 1; }
.project-card-footer {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ─── Empty State ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 1rem; }

/* ─── Page Hero ────────────────────────────────────────────────── */
.page-hero {
  padding: 5rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4rem;
}
.page-hero h1 { color: var(--white); font-size: clamp(2rem, 4vw, 3rem); }
.page-hero p { margin-top: 0.75rem; font-size: 1.05rem; max-width: 540px; }

/* ─── Footer ───────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy { font-size: 0.85rem; color: var(--muted); }
.footer-copy a { color: var(--red); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.85rem; color: var(--muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--white); }

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 200px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; text-align: center; }
}
