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

:root {
  /* Mineral blue, charcoal, and silver */
  --slate-950: #181b1b;
  --slate-900: #1a1d22;
  --slate-800: #2a2d32;
  --slate-700: #404650;
  --slate-600: #52606c;
  --slate-500: #61737c;
  --slate-400: #a9b3bf;
  --slate-300: #cad0d7;
  --slate-200: #e5e6e9;
  --slate-100: #f1f3f3;
  --slate-50:  #f8fcfc;
  --white:     #ffffff;
  --accent:    #4672a1;
  --accent-dark: #2f608b;
  --accent-light: #98beda;
  --accent-glow: rgba(79, 129, 170, 0.15);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

  /* Layout */
  --max-w: 860px;
  --nav-h: 64px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--slate-800);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: var(--white);
}

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

/* ===== Layout ===== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--slate-50);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 40px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  transition: background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  background: rgba(24, 27, 27, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  transition: box-shadow 0.2s;
}
.nav-logo img { display: block; width: 48px; height: 48px; }
.nav-logo:hover { box-shadow: 0 0 0 2px rgba(152, 190, 218, 0.4); }
.nav-logo:focus-visible { outline: 2px solid #98beda; outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  .nav-logo { transition: none; }
}

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

.nav-links a {
  color: var(--slate-400);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--slate-200); }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--slate-200); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--slate-300);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  background: var(--slate-950);
  color: var(--white);
  padding: 160px 24px 120px;
  overflow: hidden;
  min-height: 600px;
  display: flex;
  align-items: center;
}

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

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 70%);
}

.hero-glow {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 129, 170, 0.08) 0%, transparent 60%);
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-light);
  background: rgba(79, 129, 170, 0.1);
  border: 1px solid rgba(79, 129, 170, 0.2);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 28px;
  letter-spacing: 0.3px;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, var(--white) 0%, var(--slate-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: 1.2rem;
  color: var(--slate-300);
  margin-bottom: 12px;
  font-weight: 400;
}
.hero-title a { color: var(--accent-light); }
.hero-title a:hover { color: #98beda; }

.hero-subtitle {
  font-size: 1rem;
  color: var(--slate-400);
  margin-bottom: 40px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(79, 129, 170, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--slate-300);
  border: 1px solid var(--slate-700);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.05);
  color: var(--white);
  border-color: var(--slate-500);
}

.btn-ghost {
  background: transparent;
  color: var(--slate-400);
  padding: 11px 16px;
}
.btn-ghost:hover { color: var(--slate-200); }

/* ===== Hero Photo ===== */
.hero-photo-wrapper {
  margin-bottom: 28px;
}

.hero-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ===== About ===== */
.about-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--slate-700);
  max-width: 680px;
}

.about-content p + p {
  margin-top: 18px;
}

.about-content strong {
  color: var(--slate-900);
  font-weight: 600;
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 20px;
}

.project-card {
  --project-accent: #2f608b;
  --project-tint: #edf2f8;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 32px 28px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-top: 3px solid var(--project-accent);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(26, 29, 34, 0.04);
}

.project-card-transit {
  --project-accent: #496c8e;
  --project-tint: #edf1f8;
}

.project-category {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--project-accent);
  font-size: 0.875rem;
  font-weight: 600;
}

.project-category svg { flex-shrink: 0; }

.project-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  line-height: 1.2;
  color: var(--slate-900);
  margin-bottom: 12px;
}

.project-summary {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--slate-800);
  margin-bottom: 16px;
}

.project-description {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--slate-600);
  margin-bottom: 24px;
}

.project-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--slate-200);
}

.project-link {
  color: var(--project-accent);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.project-link:hover { color: var(--slate-900); }
.project-link:focus-visible {
  outline: 2px solid var(--project-accent);
  outline-offset: 5px;
  border-radius: 2px;
}

.project-domain {
  color: var(--slate-500);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

/* ===== Cards Grid ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  padding: 32px 24px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  border-color: var(--slate-300);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: 12px;
  margin-bottom: 20px;
  color: var(--accent-dark);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--slate-900);
  line-height: 1.3;
}

.card-text {
  font-size: 0.9rem;
  color: var(--slate-600);
  line-height: 1.7;
}

/* ===== Publications ===== */
.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-item {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--slate-100);
  transition: background 0.2s;
}

.pub-item:first-child {
  border-top: 1px solid var(--slate-100);
}

.pub-item:hover {
  background: var(--slate-50);
  margin-left: -16px;
  margin-right: -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 8px;
}

.pub-year-col {
  flex-shrink: 0;
  width: 50px;
  padding-top: 2px;
}

.pub-year {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.pub-body { flex: 1; min-width: 0; }

.pub-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 6px;
  color: var(--slate-900);
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--slate-500);
  margin-bottom: 4px;
  line-height: 1.5;
}
.pub-authors strong { color: var(--slate-800); font-weight: 600; }

.pub-journal {
  font-size: 0.8rem;
  color: var(--slate-400);
}

.journal-name {
  font-style: italic;
}

/* ===== Contact ===== */
.contact-container {
  text-align: center;
}

.contact-text {
  color: var(--slate-600);
  margin-bottom: 36px;
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-email {
  margin: -12px 0 36px;
  color: var(--slate-900);
  font-size: 1.125rem;
  line-height: 1.8;
}

.contact-email-label {
  display: block;
  margin-bottom: 4px;
  color: var(--slate-600);
  font-size: 0.875rem;
  font-weight: 600;
}

.contact-email-separator {
  color: var(--slate-600);
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  color: var(--slate-700);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s var(--ease);
}
.contact-card:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transform: translateY(-2px);
}

/* ===== Footer ===== */
.footer {
  background: var(--slate-950);
  padding: 32px 0;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer p {
  color: var(--slate-500);
  font-size: 0.8rem;
}

.footer-sub {
  color: var(--slate-600);
  font-size: 0.75rem;
}

/* ===== Scroll Animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 130px 24px 80px;
    min-height: auto;
  }

  .hero-name { letter-spacing: -1px; }

  .section { padding: 64px 0; }

  .section-title { font-size: 1.85rem; margin-bottom: 28px; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(24, 27, 27, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }

  .pub-item {
    flex-direction: column;
    gap: 4px;
  }

  .pub-year-col { width: auto; }

  .pub-item:hover {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .about-content { font-size: 0.95rem; }

  .hero-photo {
    width: 110px;
    height: 110px;
  }
}

@media (max-width: 480px) {
  .hero-links {
    flex-direction: column;
    align-items: center;
  }
  .btn { width: 100%; max-width: 260px; justify-content: center; }

  .contact-links { flex-direction: column; align-items: center; }
  .contact-card { width: 100%; max-width: 260px; justify-content: center; }
}
