/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --text-primary: #e8e8ed;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent: #00ff9d;
  --accent-dim: #00cc7d;
  --accent-glow: rgba(0, 255, 157, 0.15);
  --accent-glow-strong: rgba(0, 255, 157, 0.3);
  --border: #1e1e2e;
  --border-accent: rgba(0, 255, 157, 0.2);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --nav-bg: rgba(10, 10, 15, 0.92);
  --terminal-bg: #0d0d14;
  --code-bg: #13131c;
}

:root, :root[data-theme="light"] {
  --bg-primary: #f5f5f8;
  --bg-secondary: #eaeaf0;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f5;
  --text-primary: #1a1a2e;
  --text-secondary: #555570;
  --text-muted: #8888a0;
  --accent: #00995e;
  --accent-dim: #007a4b;
  --accent-glow: rgba(0, 153, 94, 0.1);
  --accent-glow-strong: rgba(0, 153, 94, 0.2);
  --border: #d8d8e0;
  --border-accent: rgba(0, 153, 94, 0.25);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --nav-bg: rgba(245, 245, 248, 0.92);
  --terminal-bg: #f0f0f5;
  --code-bg: #e8e8f0;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ===== NAVIGATION ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: 'Courier New', monospace;
  font-weight: 700; font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 1px;
}
.nav-logo span { color: var(--text-muted); }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-link {
  color: var(--text-secondary); font-size: 0.85rem;
  font-weight: 500; letter-spacing: 0.5px;
  text-transform: uppercase; transition: color 0.2s;
  position: relative;
}
.nav-link::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: var(--accent);
  transition: width 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); opacity: 1; }
.nav-link.active::after { width: 100%; }

#theme-toggle {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; cursor: pointer;
  font-size: 1.1rem; transition: all 0.2s;
}
#theme-toggle:hover { border-color: var(--accent); background: var(--accent-glow); }

/* Mobile nav */
#nav-toggle { display: none; }
.nav-hamburger { display: none; cursor: pointer; flex-direction: column; gap: 5px; }
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-secondary); transition: all 0.3s;
}

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0;
    background: var(--nav-bg); backdrop-filter: blur(16px);
    flex-direction: column; align-items: center;
    padding: 24px 0; gap: 20px;
    transform: translateY(-120%); transition: transform 0.3s;
    border-bottom: 1px solid var(--border);
  }
  #nav-toggle:checked ~ .nav-inner .nav-links { transform: translateY(0); }
  #nav-toggle:checked ~ .nav-inner .nav-hamburger span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  #nav-toggle:checked ~ .nav-inner .nav-hamburger span:nth-child(2) { opacity: 0; }
  #nav-toggle:checked ~ .nav-inner .nav-hamburger span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
}

/* ===== SCROLL ANIMATIONS ===== */
.animate-in {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-in.visible { opacity: 1; transform: translateY(0); }
.animate-in:nth-child(2) { transition-delay: 0.1s; }
.animate-in:nth-child(3) { transition-delay: 0.2s; }

/* ===== HERO ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding-top: 64px;
  background:
    radial-gradient(ellipse at 20% 50%, var(--accent-glow) 0%, transparent 50%),
    var(--bg-primary);
}
.hero-content { width: 100%; }
.hero-terminal {
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
}
.terminal-dots {
  display: flex; gap: 8px; margin-bottom: 24px;
}
.terminal-dots span {
  width: 12px; height: 12px; border-radius: 50%;
}
.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }

.hero-pre {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem; color: var(--text-muted);
  margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 12px;
}
.hero h1 .accent { color: var(--accent); }
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.hero-tagline {
  font-family: 'Courier New', monospace;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 24px;
  min-height: 1.5em;
}
.hero-tagline .cursor {
  display: inline-block; width: 2px; height: 1.1em;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-links { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600;
  transition: all 0.2s;
}
.hero-link.primary {
  background: var(--accent); color: #0a0a0f;
}
.hero-link.primary:hover { box-shadow: 0 0 20px var(--accent-glow-strong); opacity: 1; }
.hero-link.secondary {
  border: 1px solid var(--border-accent);
  color: var(--accent); background: var(--accent-glow);
}
.hero-link.secondary:hover { background: var(--accent-glow-strong); opacity: 1; }

/* ===== SECTIONS ===== */
section { padding: 80px 0; }
.section-label {
  font-family: 'Courier New', monospace;
  color: var(--accent); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 3px;
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700; margin-bottom: 40px;
}
.section-title::after {
  content: ''; display: block;
  width: 48px; height: 3px;
  background: var(--accent); margin-top: 12px;
  border-radius: 2px;
}

/* ===== ABOUT ===== */
.about-text {
  font-size: 1.05rem; color: var(--text-secondary);
  max-width: 720px; line-height: 1.8;
}
.about-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px; margin-top: 32px;
}
.stat {
  text-align: center; padding: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px;
}
.stat-num {
  font-size: 2rem; font-weight: 800; color: var(--accent);
  font-family: 'Courier New', monospace;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item {
  position: relative; margin-bottom: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; transition: all 0.2s;
}
.timeline-item:hover { border-color: var(--border-accent); }
.timeline-item::before {
  content: ''; position: absolute; left: -27px; top: 24px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-primary);
  z-index: 1;
}
.timeline-header {
  padding: 20px 24px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
}
.timeline-header:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px; }
.timeline-role { font-weight: 700; font-size: 1.05rem; }
.timeline-company { color: var(--accent); font-weight: 600; }
.timeline-meta {
  font-size: 0.8rem; color: var(--text-muted);
  white-space: nowrap;
}
.timeline-toggle {
  color: var(--text-muted); font-size: 1.2rem;
  transition: transform 0.3s; flex-shrink: 0;
}
.timeline-item.expanded .timeline-toggle { transform: rotate(180deg); }
.timeline-details {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
}
.timeline-item.expanded .timeline-details { max-height: 300px; }
.timeline-details-inner {
  padding: 0 24px 20px;
  color: var(--text-secondary); font-size: 0.9rem;
}
.timeline-details-inner ul { padding-left: 18px; }
.timeline-details-inner li { margin-bottom: 6px; }
.timeline-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  font-size: 0.7rem; padding: 3px 10px;
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid var(--border-accent);
  border-radius: 20px; font-family: 'Courier New', monospace;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.skill-group {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 24px;
  transition: border-color 0.2s;
}
.skill-group:hover { border-color: var(--border-accent); }
.skill-group-title {
  font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 2px; color: var(--accent);
  font-family: 'Courier New', monospace;
  margin-bottom: 16px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
  padding: 6px 14px; font-size: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px; transition: all 0.2s;
  color: var(--text-primary);
}
.skill-tag:hover {
  background: var(--accent-glow);
  border-color: var(--border-accent);
  color: var(--accent);
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 28px;
  transition: all 0.3s; position: relative; overflow: hidden;
}
.project-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 255, 157, 0.08);
}
.project-icon {
  font-size: 2rem; margin-bottom: 16px;
}
.project-card h3 {
  font-size: 1.1rem; margin-bottom: 10px;
}
.project-card p {
  color: var(--text-secondary); font-size: 0.9rem;
  margin-bottom: 16px;
}
.project-link {
  font-size: 0.85rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.project-link::after { content: ' →'; }

/* ===== EDUCATION ===== */
.edu-grid { display: grid; gap: 20px; }
.edu-card {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 24px;
}
.edu-icon {
  font-size: 2rem; flex-shrink: 0;
}
.edu-card h3 { font-size: 1rem; margin-bottom: 4px; }
.edu-card .edu-school { color: var(--accent); font-size: 0.9rem; }
.edu-card .edu-year { color: var(--text-muted); font-size: 0.8rem; }

.certs-list {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px;
}
.cert-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.9rem;
}
.cert-badge .cert-icon { font-size: 1.2rem; }

/* ===== LANGUAGES ===== */
.lang-grid { display: grid; gap: 16px; max-width: 540px; }
.lang-item { display: flex; align-items: center; gap: 16px; }
.lang-name {
  width: 100px; font-weight: 600; font-size: 0.9rem;
  flex-shrink: 0;
}
.lang-bar {
  flex: 1; height: 8px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden;
}
.lang-fill {
  height: 100%; background: var(--accent);
  border-radius: 4px;
  transition: width 1s ease;
}
.lang-level {
  width: 100px; font-size: 0.75rem; color: var(--text-muted);
  text-align: right;
}

/* ===== CONTACT ===== */
.contact-section { background: var(--bg-secondary); }
.contact-grid {
  display: flex; gap: 24px; flex-wrap: wrap;
}
.contact-card {
  flex: 1; min-width: 200px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 24px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.2s;
}
.contact-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}
.contact-icon { font-size: 1.5rem; }
.contact-card .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.contact-card .value { font-weight: 600; font-size: 0.95rem; }

/* ===== FOOTER ===== */
.footer {
  padding: 32px 0; text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.8rem;
}
.footer-line {
  font-family: 'Courier New', monospace;
}

/* ===== PRINT ===== */
@media print {
  .nav, #theme-toggle, .hero-links, .timeline-toggle, .nav-hamburger { display: none !important; }
  body { background: white; color: black; }
  section { padding: 20px 0; }
  .hero { min-height: auto; padding: 40px 0; }
  .hero-terminal { box-shadow: none; border: 1px solid #ccc; }
  .animate-in { opacity: 1 !important; transform: none !important; }
  .timeline-details { max-height: none !important; }
  .timeline-details-inner { padding: 0 24px 16px !important; }
  a { color: black; }
  a::after { content: ' (' attr(href) ')'; font-size: 0.7rem; }
}

/* Publications */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pub-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  transition: transform 0.2s;
}

.pub-item:hover {
  transform: translateX(4px);
}

.pub-badge {
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #000;
  white-space: nowrap;
  flex-shrink: 0;
}

.pub-badge.ack {
  background: #666;
  color: #fff;
}

.pub-item a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
}

.pub-item a:hover {
  color: var(--accent);
}
