/* =========================================
   Root variables & resets
========================================= */
:root {
  --bg: #0b0f19;
  --bg-alt: #10152233;
  --surface: #131a2a;
  --surface-2: #1a2236;
  --text: #e8ecf6;
  --text-muted: #9aa4bf;
  --primary: #6c63ff;
  --primary-2: #00d4b5;
  --accent-grad: linear-gradient(135deg, #6c63ff, #00d4b5);
  --border: #232b40;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 16px;
  --transition: 0.3s ease;
  --max-width: 1140px;
}

[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-alt: #eef0f9;
  --surface: #ffffff;
  --surface-2: #f2f3fb;
  --text: #171a2b;
  --text-muted: #5a6079;
  --border: #e2e5f1;
  --shadow: 0 10px 30px rgba(30, 40, 90, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--primary); color: #fff; }

/* scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

/* =========================================
   Scroll progress bar
========================================= */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent-grad);
  z-index: 2000;
  transition: width 0.1s ease-out;
}

/* =========================================
   Navbar
========================================= */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 18px 0;
  background: transparent;
  transition: background var(--transition), padding var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  padding: 12px 0;
  box-shadow: var(--shadow);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(255,255,255,0.85);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.logo span { color: var(--primary); }

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--accent-grad);
  transition: width var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
}
.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ---- Dark / light mode switch (sun + moon) ---- */
.theme-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* The real checkbox stays in the DOM for keyboard + screen readers, visually hidden. */
.theme-switch input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 66px; height: 34px;
  padding: 0 8px;
  border-radius: 50px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}
.theme-switch:hover .switch-track { border-color: var(--primary); }

/* Focus ring appears only for keyboard users. */
.theme-switch input:focus-visible + .switch-track {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.switch-icon {
  width: 16px; height: 16px;
  position: relative;
  z-index: 1;
  transition: opacity var(--transition), transform var(--transition);
}
.icon-sun { fill: #f9b81c; }
.icon-sun path { fill: none; stroke: #f9b81c; }

.icon-moon { fill: #cdd5ee; }
[data-theme="light"] .icon-moon { fill: #7b83a8; }

.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: 0 3px 10px rgba(108, 99, 255, 0.45);
  transition: transform 0.35s cubic-bezier(0.4, 0.1, 0.2, 1);
}

/* The switch position follows data-theme on <html> rather than :checked, because
   the theme is applied before first paint — otherwise the thumb would visibly
   slide across on every load for light-mode visitors. */

/* Dark mode (the default): thumb rests over the moon and the sun dims. */
.switch-thumb { transform: translateX(32px); }
.icon-sun { opacity: 0.35; transform: scale(0.85); }

/* Light mode: thumb slides back over the sun and the moon dims. */
[data-theme="light"] .switch-thumb { transform: translateX(0); }
[data-theme="light"] .icon-sun { opacity: 1; transform: none; }
[data-theme="light"] .icon-moon { opacity: 0.35; transform: scale(0.85); }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}
.hamburger span {
  width: 100%; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================
   Buttons
========================================= */
.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  text-align: center;
}
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 26px rgba(108, 99, 255, 0.45); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px);
}
.btn.full { width: 100%; }

/* =========================================
   Hero
========================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 90px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.16;
  filter: saturate(1.1);
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, transparent 35%, transparent 65%, var(--bg) 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: float 10s ease-in-out infinite;
}
.blob-1 {
  width: 420px; height: 420px;
  background: var(--primary);
  top: -100px; right: -80px;
}
.blob-2 {
  width: 380px; height: 380px;
  background: var(--primary-2);
  bottom: -120px; left: -100px;
  animation-delay: -5s;
}
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.08); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.25;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 24px;
  border: 3px solid var(--primary);
  box-shadow: var(--shadow);
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
}
.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-greeting {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 14px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
}

.hero-name {
  /* Kept on one line: the cap is what fits .hero-content's 760px (712px of
     content box), and the vw term keeps it fitting down to ~300px wide. */
  font-size: clamp(1.15rem, 7.2vw, 3.8rem);
  white-space: nowrap;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 10px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.15s forwards;
}

.hero-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 22px;
  min-height: 2.2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.3s forwards;
}

#typed {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}
.hero-desc {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 620px;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.45s forwards;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 34px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.6s forwards;
}

.hero-socials {
  display: flex;
  gap: 16px;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.75s forwards;
}
.hero-socials a {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background var(--transition);
}
.hero-socials svg { width: 20px; height: 20px; fill: var(--text); }
.hero-socials a:hover { transform: translateY(-4px); background: var(--primary); }
.hero-socials a:hover svg { fill: #fff; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-down {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.scroll-down span {
  display: block;
  width: 24px; height: 40px;
  border: 2px solid var(--border);
  border-radius: 20px;
  position: relative;
}
.scroll-down span::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 8px;
  border-radius: 2px;
  background: var(--primary);
  animation: scrollDot 1.6s ease infinite;
}
@keyframes scrollDot {
  0% { top: 6px; opacity: 1; }
  70% { top: 20px; opacity: 0.3; }
  100% { top: 6px; opacity: 1; }
}

/* =========================================
   Sections general
========================================= */
.section {
  padding: 110px 0;
  position: relative;
}
.section.alt { background: var(--bg-alt); }

.section-tag {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 20px;
  max-width: 700px;
}

.section-sub {
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 40px;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   About
========================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 50px;
  align-items: start;
  margin-top: 40px;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 18px;
}
.about-text strong { color: var(--text); }

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
}
.stat-num, .stat-plus {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 6px;
}

.about-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-image {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  aspect-ratio: 16 / 10;
}
.about-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(108,99,255,0.35), rgba(0,212,181,0.15));
  mix-blend-mode: multiply;
}
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.about-image:hover img { transform: scale(1.06); }

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.info-list li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  gap: 12px;
}
.info-list li:last-child { border-bottom: none; }
.info-list span { color: var(--text-muted); }
.info-list strong { text-align: right; word-break: break-word; }

/* =========================================
   Timeline (Experience)
========================================= */
.timeline {
  position: relative;
  margin-top: 50px;
  padding-left: 34px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 48px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -43px;
  top: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--primary);
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
}

.timeline-date {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 1px;
  background: rgba(108,99,255,0.12);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.timeline-content h3 {
  font-size: 1.2rem;
  margin-bottom: 2px;
}
.timeline-content h4 {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 14px;
}
.timeline-content ul { padding-left: 4px; }
.timeline-content li {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 5px 0 5px 20px;
  position: relative;
}
.timeline-content li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary-2);
}

/* =========================================
   Skills
========================================= */
.skills-banner {
  position: relative;
  margin-top: 40px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: 220px;
}
.skills-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) saturate(1.1);
}
.skills-banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(120deg, rgba(108,99,255,0.35), rgba(0,212,181,0.25));
}
.skills-banner-overlay p {
  color: #fff;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  font-weight: 600;
  text-align: center;
  max-width: 640px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.skill-icon { font-size: 1.8rem; margin-bottom: 12px; }
.skill-card h3 { font-size: 1.05rem; margin-bottom: 16px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags span {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition);
}
.skill-card:hover .tags span:hover {
  background: var(--primary);
  color: #fff;
}

.skill-bars { margin-top: 60px; }
.bars-title { font-size: 1.2rem; margin-bottom: 24px; }
.bar { margin-bottom: 22px; }
.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.bar-track {
  width: 100%;
  height: 10px;
  background: var(--surface-2);
  border-radius: 10px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  background: var(--accent-grad);
  transition: width 1.2s ease;
}

/* =========================================
   Education
========================================= */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform var(--transition), border-color var(--transition);
}
.edu-card:hover { transform: translateY(-6px); border-color: var(--primary-2); }
.edu-year {
  display: inline-block;
  color: var(--primary-2);
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 12px;
}
.edu-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.edu-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; }
.edu-grade {
  display: inline-block;
  background: var(--surface-2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text);
}

.honors { margin-top: 56px; }

.honors-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: center;
}

.honors-list li {
  color: var(--text-muted);
  padding: 10px 0 10px 26px;
  border-bottom: 1px solid var(--border);
  position: relative;
  font-size: 0.92rem;
}
.honors-list li::before {
  content: '🏅';
  position: absolute;
  left: 0;
}
.honors-list li:last-child { border-bottom: none; }

.honors-image {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}
.honors-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.honors-image:hover img { transform: scale(1.06); }

/* =========================================
   Publications
========================================= */
.pub-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 8px;
}

.pub-note {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 14px;
}

.pub-list {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

.pub-card {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  transition: transform var(--transition), border-color var(--transition);
}
.pub-card:hover { transform: translateY(-4px); border-color: var(--primary); }

.pub-cites {
  flex-shrink: 0;
  min-width: 72px;
  text-align: center;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 8px;
}
.pub-cites-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}
.pub-cites-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 8px;
}
.pub-title a { color: var(--text); transition: color var(--transition); }
.pub-title a:hover { color: var(--primary); }

.pub-authors {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.pub-venue {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}
.pub-year {
  font-style: normal;
  display: inline-block;
  background: var(--surface-2);
  color: var(--text);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  margin-left: 8px;
}

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

/* =========================================
   Certifications
========================================= */
.cert-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.cert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  font-size: 0.88rem;
  display: none;
  animation: fadeIn 0.5s ease forwards;
  transition: transform var(--transition), border-color var(--transition);
}
.cert-card.show { display: block; }
.cert-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.cert-card .cert-org {
  display: inline-block;
  color: var(--primary-2);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.cert-card .cert-name { color: var(--text); }

@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

#loadMoreCerts { display: block; margin: 0 auto; }

/* =========================================
   Contact
========================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 50px;
  margin-top: 40px;
}

.contact-image {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
  margin-bottom: 28px;
  position: relative;
}
.contact-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(108,99,255,0.3), rgba(0,212,181,0.15));
  mix-blend-mode: multiply;
}
.contact-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.contact-image:hover img { transform: scale(1.06); }

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}
.contact-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.contact-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.contact-item a { font-weight: 600; }
.contact-socials { margin-top: 20px; animation: none; opacity: 1; }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group {
  position: relative;
  margin-bottom: 22px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 14px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--primary); }

.form-group label {
  position: absolute;
  left: 14px;
  top: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  transition: all var(--transition);
  background: transparent;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group input:valid:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -8px;
  left: 10px;
  font-size: 0.7rem;
  padding: 0 6px;
  background: var(--surface);
  color: var(--primary);
}

.form-group input:placeholder-shown ~ label,
.form-group textarea:placeholder-shown ~ label {}

.form-status {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--primary-2);
  min-height: 1.2em;
}

/* =========================================
   Footer
========================================= */
.footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.visitor-count {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
}
.visitor-count[hidden] { display: none; }
.visitor-count svg {
  width: 16px;
  height: 16px;
  fill: var(--primary);
  flex-shrink: 0;
}
.visitor-count #visitorNumber {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.back-to-top {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background var(--transition);
}
.back-to-top:hover { background: var(--primary); color: #fff; transform: translateY(-4px); }

/* =========================================
   Responsive
========================================= */
/* Eight nav items no longer fit at 32px spacing once the viewport narrows. */
@media (max-width: 1080px) {
  .nav-links { gap: 20px; }
  .nav-link { font-size: 0.88rem; }
}

@media (max-width: 900px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .honors-grid { grid-template-columns: 1fr; }
  .honors-image { order: -1; aspect-ratio: 16 / 9; }
  .pub-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: 70%;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    transition: right var(--transition);
    box-shadow: var(--shadow);
  }
  .nav-links.active { right: 0; }
  .hamburger { display: flex; }

  .about-stats { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .timeline { padding-left: 26px; }
  .timeline-dot { left: -35px; }
}

@media (max-width: 480px) {
  .hero-buttons { flex-direction: column; }
  .btn { width: 100%; }
  .hero-avatar { width: 110px; height: 110px; margin-bottom: 18px; }
  .pub-stats { grid-template-columns: 1fr; }
  .pub-card { flex-direction: column; gap: 14px; }
  .pub-cites { display: flex; align-items: baseline; gap: 8px; min-width: 0; align-self: flex-start; }
  .pub-cites-num { font-size: 1.15rem; }
}
