:root {
  --bg: #FAFAF8;
  --bg-alt: #F5F0EB;
  --accent: #C9A96E;
  --accent-dark: #A8883F;
  --text: #1A1A1A;
  --text-body: #4A4A4A;
  --white: #FFFFFF;
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 32px rgba(201,169,110,0.15);
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 700; line-height: 1.3; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }

img { max-width: 100%; }

/* Navbar */
.navbar-custom {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  padding: 0.8rem 0;
  transition: box-shadow var(--transition);
}
.navbar-custom .navbar-brand {
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: -0.5px;
}
.navbar-custom .nav-link {
  color: var(--text-body);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  transition: color var(--transition);
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active { color: var(--accent); }

.btn-cv {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.btn-cv:hover {
  background: var(--accent-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,169,110,0.3);
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(201,169,110,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content { text-align: center; position: relative; z-index: 1; }
.hero-row { position: relative; z-index: 1; }
.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 8px 30px rgba(201,169,110,0.2);
  margin-bottom: 1.5rem;
}
.hero-content h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
}
.hero-content .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-body);
  margin-bottom: 0.3rem;
}
.hero-content .tagline {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 2rem;
}
.metrics-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.metric-item {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.metric-item span { color: var(--accent); font-size: 1.3rem; font-weight: 800; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-primary-custom {
  background: var(--accent);
  color: var(--white);
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  display: inline-block;
}
.btn-primary-custom:hover {
  background: var(--accent-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,169,110,0.3);
}
.btn-outline-custom {
  background: transparent;
  color: var(--text);
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  border: 2px solid var(--accent);
  transition: all var(--transition);
  display: inline-block;
}
.btn-outline-custom:hover {
  background: var(--accent);
  color: var(--white);
  transform: translateY(-2px);
}

/* Sections */
section { padding: 3.5rem 0; }
section:nth-child(even) { background: var(--bg-alt); }
.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.section-title.visible::after { width: 100%; }
.section-subtitle { color: var(--text-body); margin-bottom: 3rem; }

/* Cards */
.card-custom {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  transition: all var(--transition);
  height: 100%;
}
.card-custom:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.card-custom .icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
}
.card-custom h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.card-custom p { font-size: 0.9rem; color: var(--text-body); margin: 0; }
.card-custom.compact { padding: 1.2rem; text-align: center; }
.card-custom.compact .icon { margin: 0 auto 0.7rem; width: 40px; height: 40px; font-size: 1rem; }
.card-custom.compact h4 { font-size: 0.9rem; margin-bottom: 0.3rem; }
.card-custom.compact p { font-size: 0.78rem; line-height: 1.4; }

/* Featured Work */
.project-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  transition: all var(--transition);
  height: 100%;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.project-card h4 { font-size: 1.1rem; margin-bottom: 0.7rem; }
.project-card .metric-badge {
  display: inline-block;
  background: rgba(201,169,110,0.12);
  color: var(--accent-dark);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  margin-right: 0.4rem;
}
.project-card p { font-size: 0.9rem; color: var(--text-body); }
.project-card .github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 1rem;
}

/* Timeline */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), rgba(201,169,110,0.2));
}
.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 1.5rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.55rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-item .date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.timeline-item h4 { font-size: 1rem; margin-bottom: 0.2rem; }
.timeline-item .company { font-weight: 600; color: var(--text); }
.timeline-item p { font-size: 0.88rem; color: var(--text-body); margin-top: 0.3rem; }

/* Publications */
.pub-list { list-style: none; padding: 0; counter-reset: pub; }
.pub-list li {
  counter-increment: pub;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 0.9rem;
  line-height: 1.6;
}
.pub-list li::before {
  content: counter(pub) ".";
  font-weight: 700;
  color: var(--accent);
  margin-right: 0.5rem;
}
.pub-list li:last-child { border-bottom: none; }
.pub-list .author-highlight { font-weight: 700; color: var(--text); }

/* Education */
.edu-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  transition: all var(--transition);
  height: 100%;
}
.edu-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.edu-card .degree { font-weight: 700; font-size: 1rem; color: var(--text); }
.edu-card .school { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.edu-card .details { font-size: 0.85rem; color: var(--text-body); margin-top: 0.5rem; }
.edu-card.compact { padding: 1.2rem; text-align: center; }
.edu-card.compact .degree { font-size: 0.9rem; margin-bottom: 0.2rem; }
.edu-card.compact .details { font-size: 0.8rem; margin-top: 0.2rem; }

/* Blog Preview */
.blog-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  transition: all var(--transition);
}
.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.blog-card .date { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.blog-card h5 { font-size: 1rem; margin-top: 0.3rem; }

/* Footer */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 3rem 0 2rem;
}
.footer h3 { color: var(--white); }
.footer a { color: var(--accent); }
.footer a:hover { color: #e0c48a; }
.social-links { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-top: 1.5rem; }
.social-links a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.1rem;
  transition: all var(--transition);
}
.social-links a:hover {
  background: var(--accent);
  color: var(--white);
  transform: translateY(-2px);
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Open Source Card */
.opensource-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 2px solid rgba(201,169,110,0.2);
  transition: all var(--transition);
}
.opensource-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.opensource-card .icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.4rem;
}
.opensource-card h4 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.opensource-card p { font-size: 0.9rem; color: var(--text-body); margin: 0; }
body.dark-mode .opensource-card { background: #1E1E30; border-color: rgba(201,169,110,0.3); }

/* News Banner */
.news-banner {
  background: linear-gradient(90deg, rgba(201,169,110,0.08), rgba(201,169,110,0.04));
  border-bottom: 1px solid rgba(201,169,110,0.15);
  padding: 0.8rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-body);
}
.news-badge {
  background: var(--accent);
  color: var(--white);
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 0.6rem;
}

/* Skills Grid */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.skill-tag {
  background: var(--white);
  border: 1px solid rgba(201,169,110,0.25);
  color: var(--text);
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}
.skill-tag:hover {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201,169,110,0.25);
}

/* Dark Mode Toggle */
.dark-toggle {
  background: none;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-body);
  font-size: 0.9rem;
  transition: all var(--transition);
}
.dark-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Dark Mode */
body.dark-mode {
  background: #1A1A2E;
  color: #B0B0B0;
}
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 { color: #E8E8E8; }
body.dark-mode .hero { background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%); }
body.dark-mode .hero::before { background: radial-gradient(ellipse at 70% 30%, rgba(201,169,110,0.08) 0%, transparent 60%); }
body.dark-mode .hero-content .subtitle { color: #B0B0B0; }
body.dark-mode .metric-item { color: #E8E8E8; }
body.dark-mode .navbar-custom {
  background: rgba(26,26,46,0.95);
  box-shadow: 0 1px 8px rgba(0,0,0,0.2);
}
body.dark-mode .navbar-custom .navbar-brand { color: #E8E8E8; }
body.dark-mode .navbar-custom .nav-link { color: #B0B0B0; }
body.dark-mode .navbar-custom .nav-link:hover,
body.dark-mode .navbar-custom .nav-link.active { color: #C9A96E; }
body.dark-mode .dark-toggle { border-color: rgba(255,255,255,0.2); color: #E8E8E8; }
body.dark-mode .dark-toggle:hover { color: #C9A96E; border-color: #C9A96E; }
body.dark-mode section:nth-child(even) { background: #16213E; }
body.dark-mode section:nth-child(odd) { background: #1A1A2E; }
body.dark-mode .card-custom,
body.dark-mode .project-card,
body.dark-mode .edu-card,
body.dark-mode .blog-card {
  background: #1E1E30;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
body.dark-mode .card-custom:hover,
body.dark-mode .project-card:hover,
body.dark-mode .edu-card:hover,
body.dark-mode .blog-card:hover {
  box-shadow: 0 8px 32px rgba(201,169,110,0.15);
}
body.dark-mode .card-custom p,
body.dark-mode .project-card p,
body.dark-mode .timeline-item p { color: #B0B0B0; }
body.dark-mode .edu-card .details { color: #B0B0B0; }
body.dark-mode .timeline-item::before { border-color: #1A1A2E; }
body.dark-mode .skill-tag {
  background: #1E1E30;
  border-color: rgba(201,169,110,0.3);
  color: #E8E8E8;
}
body.dark-mode .skill-tag:hover { background: #C9A96E; color: #fff; }
body.dark-mode .news-banner {
  background: rgba(201,169,110,0.05);
  border-color: rgba(201,169,110,0.1);
  color: #B0B0B0;
}
body.dark-mode .pub-list li { border-bottom-color: rgba(255,255,255,0.06); color: #B0B0B0; }
body.dark-mode .pub-list .author-highlight { color: #E8E8E8; }
body.dark-mode .btn-outline-custom { color: #E8E8E8; border-color: #C9A96E; }
body.dark-mode .btn-outline-custom:hover { color: #fff; }
body.dark-mode .footer { background: #0F0F1A; }
body.dark-mode .footer h3 { color: #E8E8E8; }
body.dark-mode .blog-card h5 a { color: #E8E8E8; }
body.dark-mode .blog-card h5 a:hover { color: #C9A96E; }

/* Responsive */
@media (max-width: 768px) {
  .hero-content h1 { font-size: 2rem; }
  .metrics-strip { gap: 0.8rem; }
  .metric-item { font-size: 0.85rem; }
  section { padding: 3.5rem 0; }
  .timeline { padding-left: 1.5rem; }
  .skills-grid { gap: 0.5rem; }
  .skill-tag { font-size: 0.78rem; padding: 0.4rem 0.9rem; }
}
