/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --tint: #F1EDE8;
  --text: #1B1D1F;
  --text-muted: #5B6167;
  --border: #E2DFD8;

  --maroon: #7C2331;
  --maroon-dark: #5E1A25;
  --slate: #2F4858;
  --maroon-soft: #F4E6E8;

  --font-display: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --max-w: 1080px;
  --max-w-narrow: 720px;
  --radius: 8px;
  --header-h: 76px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0 0 0.5em; color: var(--text); }
p { margin: 0 0 1em; color: var(--text); max-width: 68ch; }
p:last-child { margin-bottom: 0; }
a { color: var(--maroon); }
ul { padding: 0; margin: 0; list-style: none; }
img { max-width: 100%; display: block; }
table { border-collapse: collapse; width: 100%; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--maroon); color: #fff; padding: 10px 16px; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 3px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 246, 243, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex; align-items: center;
}
.header-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.avatar {
  position: relative;
  width: 46px; height: 46px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--maroon), var(--slate));
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-initials {
  color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 15px;
  letter-spacing: 0.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text); }
.brand-role { font-size: 12.5px; color: var(--text-muted); }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  color: var(--text); text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 6px 0; border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.site-nav a:hover { border-color: var(--maroon); color: var(--maroon); }
.nav-cta {
  background: var(--maroon); color: #fff !important; padding: 8px 18px !important;
  border-radius: var(--radius); border-bottom: none !important;
  transition: background 0.15s ease, transform 0.1s ease;
}
.nav-cta:hover { background: var(--maroon-dark); transform: translateY(-1px); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: none; cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); }

/* ==========================================================================
   Hero / Carousel
   ========================================================================== */
.hero { padding: 28px 24px 0; max-width: var(--max-w); margin: 0 auto; }

.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  border-radius: 12px;
  overflow: hidden;
  background: #0d1117;
  border: 1px solid var(--border);
  box-shadow: 0 12px 36px rgba(0,0,0,0.12);
}
.carousel-track {
  display: flex; height: 100%;
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}
@media (prefers-reduced-motion: reduce) {
  .carousel-track { transition: none; }
}

.slide { position: relative; flex: 0 0 100%; height: 100%; overflow: hidden; background: #000; }
.slide video, .slide iframe {
  width: 100%; height: 100%; object-fit: contain; background: #05070a; border: none; display: block;
}

.slide-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 32px;
}
.slide-placeholder svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.slide-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 24px 28px 20px;
  background: linear-gradient(to top, rgba(12,14,18,0.88) 0%, rgba(12,14,18,0.5) 70%, transparent 100%);
  color: #fff;
  pointer-events: none;
}
.slide-caption .slide-tag {
  display: inline-block; font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase;
  color: #F4D3D7; margin-bottom: 4px; font-family: var(--font-mono); font-weight: 500;
}
.slide-caption h3 { color: #fff; font-size: 20px; margin-bottom: 4px; text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.slide-caption p { color: #E5E7EB; font-size: 13.5px; margin: 0; max-width: 58ch; text-shadow: 0 1px 2px rgba(0,0,0,0.4); line-height: 1.45; }

.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: var(--text);
  border: 1px solid rgba(0,0,0,0.08); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.carousel-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.carousel-arrow--prev { left: 16px; }
.carousel-arrow--next { right: 16px; }

.carousel-dots {
  position: absolute; right: 20px; bottom: 20px; z-index: 5;
  display: flex; gap: 8px;
}
.carousel-dots button {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.4); border: none; padding: 0; cursor: pointer;
  transition: all 0.2s ease;
}
.carousel-dots button[aria-selected="true"] { background: #fff; width: 22px; border-radius: 10px; }

.hero-intro { padding: 26px 4px 18px; max-width: 720px; }
.hero-line { font-size: 17.5px; color: var(--text); line-height: 1.55; }
.hero-actions { display: flex; gap: 14px; margin-top: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: var(--radius);
  font-weight: 500; font-size: 14.5px; text-decoration: none;
  border: 1px solid transparent; transition: all 0.15s ease;
}
.btn--primary { background: var(--maroon); color: #fff; }
.btn--primary:hover { background: var(--maroon-dark); transform: translateY(-1px); }
.btn--ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn--ghost:hover { border-color: var(--maroon); color: var(--maroon); transform: translateY(-1px); }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 64px 24px; }
.section--tinted { background: var(--tint); }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-inner--narrow { max-width: var(--max-w-narrow); }
.section-title { font-size: 26px; margin-bottom: 24px; letter-spacing: -0.01em; }

.divider { color: var(--border); max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.divider svg { width: 100%; height: 40px; display: block; }

/* Research */
.research-block { margin-bottom: 48px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px; box-shadow: 0 4px 16px rgba(0,0,0,0.02); }
.research-block:last-child { margin-bottom: 0; }
.research-head h3 { font-size: 20px; margin-bottom: 6px; }
.research-meta { font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 16px; }

.progress-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 22px; }
.progress-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--maroon); margin-bottom: 12px; font-family: var(--font-mono); font-weight: 600; }
.progress-col ul { display: flex; flex-direction: column; gap: 12px; }
.progress-col li {
  font-size: 14.5px; color: var(--text); padding-left: 16px;
  border-left: 2px solid var(--border); line-height: 1.6;
}

/* Publications */
.pub-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 30px; box-shadow: 0 4px 16px rgba(0,0,0,0.02);
}
.pub-card h3 { font-size: 18.5px; margin-bottom: 8px; line-height: 1.4; }
.pub-authors { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }
.pub-status {
  display: inline-block; margin-left: 6px; font-size: 11.5px; font-family: var(--font-mono);
  background: var(--maroon-soft); color: var(--maroon-dark); padding: 3px 10px; border-radius: 20px;
  vertical-align: middle; font-weight: 500;
}
.pub-card ul { display: flex; flex-direction: column; gap: 10px; }
.pub-card li { font-size: 14.5px; padding-left: 18px; position: relative; line-height: 1.55; }
.pub-card li::before { content: ''; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; background: var(--maroon); border-radius: 50%; }

/* Projects */
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 26px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.02); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.project-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.project-course { font-size: 12px; font-family: var(--font-mono); color: var(--slate); margin-bottom: 10px; font-weight: 500; }
.project-card h3 { font-size: 17px; margin-bottom: 10px; }
.project-card p { font-size: 14px; color: var(--text-muted); line-height: 1.55; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 36px; }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.skill-group h4 { font-size: 13px; color: var(--maroon); font-family: var(--font-mono); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.skill-group p { font-size: 14px; color: var(--text); margin: 0; line-height: 1.5; }

.courses-heading { font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.course-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.course-chips li {
  font-size: 13.5px; background: var(--surface); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 20px; color: var(--text); font-weight: 500;
}
.chip-note { color: var(--maroon); font-size: 11.5px; margin-left: 4px; font-family: var(--font-mono); }

/* Experience / Achievements */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.plain-list { display: flex; flex-direction: column; gap: 16px; }
.plain-list li { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 22px; }
.plain-list strong { font-size: 15.5px; font-weight: 600; color: var(--text); }
.plain-list span { font-size: 13.5px; color: var(--text-muted); }

/* Education */
.edu-table { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.edu-table td { padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 14.5px; vertical-align: top; }
.edu-table tr:last-child td { border-bottom: none; }
.edu-degree { font-weight: 600; color: var(--text); width: 44%; }
.edu-inst { color: var(--text-muted); }
.edu-year { color: var(--text-muted); font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.edu-score { color: var(--maroon); font-weight: 600; text-align: right; white-space: nowrap; font-family: var(--font-mono); }

/* Contact */
.contact-list { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 20px; }
.contact-list a { font-size: 15.5px; text-decoration: none; border-bottom: 1.5px solid var(--border); padding-bottom: 3px; font-weight: 500; transition: all 0.15s ease; }
.contact-list a:hover { border-color: var(--maroon); color: var(--maroon); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 24px; text-align: center; }
.site-footer p { font-size: 13.5px; color: var(--text-muted); margin: 0 auto; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .progress-columns { grid-template-columns: 1fr; gap: 24px; }
  .project-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 24px 16px;
    display: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.06);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-cta { margin-top: 10px; text-align: center; }
  .brand-role { display: none; }

  /* Carousel: video takes natural 16:9, caption moves below */
  .carousel { aspect-ratio: auto; min-height: unset; border-radius: 10px; }
  .carousel-track { flex-direction: row; }
  .slide { display: flex; flex-direction: column; }
  .slide video, .slide iframe {
    width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: contain; flex-shrink: 0;
  }

  /* Caption: static position below video, not overlaying */
  .slide-caption {
    position: relative; left: auto; right: auto; bottom: auto;
    background: #0d1117;
    padding: 14px 16px 12px;
  }
  .slide-caption .slide-tag { font-size: 10.5px; margin-bottom: 2px; }
  .slide-caption h3 { font-size: 15px; margin-bottom: 2px; text-shadow: none; }
  .slide-caption p { font-size: 12px; text-shadow: none; line-height: 1.4; max-width: none; }

  /* Arrows: smaller, positioned on the video area only */
  .carousel-arrow { width: 30px; height: 30px; }
  .carousel-arrow svg { width: 14px; height: 14px; }
  .carousel-arrow--prev { left: 8px; }
  .carousel-arrow--next { right: 8px; }

  /* Dots: above the caption */
  .carousel-dots { bottom: auto; top: 8px; right: 10px; }
  .carousel-dots button { width: 7px; height: 7px; }
  .carousel-dots button[aria-selected="true"] { width: 18px; }

  .skills-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 48px 20px; }
  .edu-table { font-size: 13px; }
  .edu-inst { display: none; }
}

@media (max-width: 420px) {
  .skills-grid { grid-template-columns: 1fr; }
  .slide-caption h3 { font-size: 14px; }
  .slide-caption p { font-size: 11.5px; }
}

