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

:root {
  --primary:   #1a4f8a;
  --primary-d: #12376b;
  --accent:    #e87722;
  --bg:        #ffffff;
  --bg-alt:    #f4f7fb;
  --text:      #1e2530;
  --text-2:    #4a5568;
  --border:    #dde3ee;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(26,79,138,.10);
  --nav-h:     64px;
  --transition: .25s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Nav ─── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
#navbar.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,.08); }

.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
  height: 100%; display: flex; align-items: center; gap: 2rem;
}
.nav-logo {
  font-weight: 700; font-size: .95rem; color: var(--primary);
  white-space: nowrap; flex-shrink: 0;
}
.nav-links {
  list-style: none; display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap;
}
.nav-links a {
  padding: .35rem .65rem; border-radius: 6px;
  font-size: .85rem; font-weight: 500; color: var(--text-2);
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--bg-alt); color: var(--primary); text-decoration: none;
}
.nav-toggle {
  display: none; background: none; border: none;
  font-size: 1.4rem; cursor: pointer; color: var(--text);
  margin-left: auto;
}

/* ─── Hero ─── */
#hero {
  padding: calc(var(--nav-h) + 4rem) 2rem 3rem;
  background: linear-gradient(135deg, #0d2d5e 0%, #1a4f8a 55%, #1e6bb0 100%);
  color: #fff;
}
.hero-content {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap;
}
.hero-avatar {
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 3px solid rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden; position: relative;
}
.hero-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.hero-avatar.avatar-fallback::after {
  content: '';
  display: block;
  width: 60%; height: 60%;
  background: rgba(255,255,255,.35);
  border-radius: 50%;
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
}
.hero-avatar.avatar-fallback::before {
  content: '';
  display: block;
  width: 38%; height: 38%;
  background: rgba(255,255,255,.45);
  border-radius: 50%;
  position: absolute; top: 22%; left: 50%; transform: translateX(-50%);
  z-index: 1;
}
.hero-text { flex: 1; min-width: 260px; }
.hero-text h1 {
  font-family: 'Merriweather', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700; line-height: 1.2; margin-bottom: .5rem;
}
.hero-title { font-size: 1rem; opacity: .9; margin-bottom: .2rem; }
.hero-org    { font-size: .95rem; opacity: .75; margin-bottom: 1rem; }

.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.badge {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px; padding: .25rem .8rem; font-size: .78rem; font-weight: 500;
}

.hero-links { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: .55rem 1.3rem; border-radius: 8px;
  font-size: .88rem; font-weight: 600; transition: all var(--transition);
  cursor: pointer; border: 2px solid transparent;
}
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { background: #d0661a; border-color: #d0661a; text-decoration: none; }
.btn-outline {
  background: transparent; color: #fff; border-color: rgba(255,255,255,.6);
}
.btn-outline:hover { background: rgba(255,255,255,.15); text-decoration: none; }

.hero-stats {
  max-width: 1200px; margin: 2.5rem auto 0;
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.stat-card {
  flex: 1; min-width: 110px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  text-align: center;
}
.stat-num  { display: block; font-size: 2rem; font-weight: 700; }
.stat-label{ display: block; font-size: .78rem; opacity: .8; margin-top: .1rem; }

/* ─── Sections ─── */
.section     { padding: 5rem 2rem; }
.section-alt { background: var(--bg-alt); }

.container { max-width: 1200px; margin: 0 auto; }

.section-title {
  font-family: 'Merriweather', serif;
  font-size: 1.75rem; font-weight: 700;
  color: var(--primary); margin-bottom: .5rem;
  position: relative; padding-bottom: .75rem;
}
.section-title::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 48px; height: 3px; background: var(--accent); border-radius: 2px;
}
.section-sub {
  color: var(--text-2); margin-top: .75rem; margin-bottom: 2.5rem; font-size: .95rem;
}

/* ─── About ─── */
.about-grid {
  display: grid; grid-template-columns: 1fr 320px; gap: 3rem; margin-top: 2.5rem;
  align-items: start;
}
.about-text p { color: var(--text-2); margin-bottom: 1rem; }
.about-text strong { color: var(--text); }

.info-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow);
}
.info-card h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: .75rem; }
.info-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.info-list li { display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: var(--text-2); }
.info-list a  { color: var(--primary); }
.info-icon { font-size: 1rem; }

.tag-list {
  list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem;
}
.tag-list li {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 20px; padding: .25rem .75rem; font-size: .8rem; color: var(--text-2);
}

/* ─── Timeline ─── */
.timeline { margin-top: 2.5rem; position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-dot {
  position: absolute; left: -2rem; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary); border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-dot.accent { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.timeline-content {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.section-alt .timeline-content { background: #fff; }

.timeline-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem;
}
.timeline-header h3 { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.timeline-date { font-size: .8rem; color: var(--accent); font-weight: 600; white-space: nowrap; }
.timeline-org  { font-size: .88rem; color: var(--primary); font-weight: 500; margin-bottom: .3rem; }
.timeline-gpa  { font-size: .82rem; color: var(--text-2); margin-bottom: .3rem; }
.timeline-detail { font-size: .88rem; color: var(--text-2); margin-top: .4rem; }
.timeline-bullets { margin-top: .6rem; padding-left: 1.2rem; }
.timeline-bullets li { font-size: .88rem; color: var(--text-2); margin-bottom: .3rem; }

/* ─── Research Cards ─── */
.research-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 1.5rem; margin-top: 2.5rem;
}
.research-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
  box-shadow: var(--shadow); transition: transform var(--transition), box-shadow var(--transition);
}
.research-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(26,79,138,.14); }
.research-icon { font-size: 2rem; margin-bottom: .75rem; }
.research-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .6rem; color: var(--primary); }
.research-card p  { font-size: .88rem; color: var(--text-2); }

/* ─── Publications ─── */
.pub-list { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.pub-item {
  display: flex; gap: 1.5rem; align-items: flex-start;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  transition: box-shadow var(--transition);
}
.pub-item:hover { box-shadow: var(--shadow); }
.pub-year {
  font-size: .8rem; font-weight: 700; color: var(--accent);
  min-width: 40px; padding-top: .2rem;
}
.pub-details h3 { font-size: .97rem; font-weight: 600; color: var(--text); margin-bottom: .3rem; }
.pub-authors { font-size: .84rem; color: var(--text-2); margin-bottom: .2rem; }
.pub-venue   { font-size: .84rem; color: var(--primary); font-style: italic; margin-bottom: .3rem; }
.pub-cite    { font-size: .8rem; color: var(--text-2); }

/* ─── Teaching ─── */
.teaching-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.5rem;
}
.course-group {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow);
}
.section-alt .course-group { background: #fff; }
.course-group h3 {
  font-size: 1rem; font-weight: 600; color: var(--primary);
  margin-bottom: 1rem; padding-bottom: .5rem;
  border-bottom: 2px solid var(--bg-alt);
}
.course-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.course-list li { font-size: .88rem; color: var(--text-2); display: flex; align-items: baseline; gap: .6rem; }
.course-code {
  font-size: .78rem; font-weight: 700; color: var(--accent);
  background: #fff4ec; border-radius: 4px; padding: .1rem .45rem;
  white-space: nowrap; flex-shrink: 0;
}
.section .course-code { background: var(--bg-alt); }

/* ─── Skills ─── */
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 1.5rem; margin-top: 2.5rem;
}
.skill-group {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
}
.skill-group h3 {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--primary); margin-bottom: .75rem; font-weight: 600;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.skill-tags span {
  background: #fff; border: 1px solid var(--border);
  border-radius: 20px; padding: .25rem .75rem;
  font-size: .8rem; color: var(--text-2);
}

/* ─── Contact ─── */
.contact-grid { margin-top: 2.5rem; }
.contact-info > p { color: var(--text-2); max-width: 560px; margin-bottom: 2rem; }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2rem; }
.contact-list li { display: flex; align-items: flex-start; gap: 1rem; }
.contact-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: .1rem; }
.contact-list strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); }
.contact-list span, .contact-list a { font-size: .95rem; color: var(--text); }
.contact-list a:hover { color: var(--primary); }

.contact-social { display: flex; gap: .75rem; flex-wrap: wrap; }
.social-btn {
  display: inline-block; padding: .6rem 1.4rem;
  background: var(--primary); color: #fff;
  border-radius: 8px; font-size: .88rem; font-weight: 600;
  transition: background var(--transition);
}
.social-btn:hover { background: var(--primary-d); text-decoration: none; }

/* ─── Nav contact button ─── */
.nav-contact-btn {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 6px;
  padding: .35rem .85rem !important;
}
.nav-contact-btn:hover, .nav-contact-btn.active {
  background: var(--primary-d) !important;
  color: #fff !important;
}

/* ─── Page hero (contact page) ─── */
.page-hero {
  padding: calc(var(--nav-h) + 3rem) 2rem 3rem;
  background: linear-gradient(135deg, #0d2d5e 0%, #1a4f8a 60%, #1e6bb0 100%);
  color: #fff;
  text-align: center;
}
.page-hero h1 {
  font-family: 'Merriweather', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700; margin-bottom: .6rem;
}
.page-hero p { opacity: .85; font-size: 1rem; }

/* ─── Contact page layout ─── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  align-items: start;
  margin-top: 1rem;
}

/* ─── Contact form ─── */
.contact-form-wrap .section-title { margin-bottom: 1.5rem; }

.alert {
  padding: .9rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: .92rem;
}
.alert-success { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; }
.alert-error   { background: #fdecea; border: 1px solid #f5c6c6; color: #c62828; }

.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
}

.form-group { display: flex; flex-direction: column; gap: .4rem; }

.form-group label {
  font-size: .85rem; font-weight: 600; color: var(--text);
}
.req { color: var(--accent); }

.form-group input,
.form-group textarea {
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit; font-size: .93rem; color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,79,138,.1);
}

.btn-submit {
  align-self: flex-start;
  background: var(--primary); color: #fff;
  border: none; padding: .75rem 2rem;
  border-radius: var(--radius);
  font-size: .95rem; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn-submit:hover { background: var(--primary-d); transform: translateY(-1px); }

/* ─── Contact side panel ─── */
.contact-side .section-title { margin-bottom: 1.5rem; }

.contact-list { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: .5rem; }
.contact-list li { display: flex; align-items: flex-start; gap: 1rem; }
.contact-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: .1rem; }
.contact-list strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); }
.contact-list span, .contact-list a { font-size: .95rem; color: var(--text); }
.contact-list a:hover { color: var(--primary); }

.contact-social { display: flex; gap: .75rem; flex-wrap: wrap; }
.social-btn {
  display: inline-block; padding: .6rem 1.4rem;
  background: var(--primary); color: #fff;
  border-radius: 8px; font-size: .88rem; font-weight: 600;
  transition: background var(--transition);
}
.social-btn:hover { background: var(--primary-d); text-decoration: none; }

.office-note {
  margin-top: 1.75rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
}
.office-note strong { display: block; font-size: .88rem; margin-bottom: .4rem; color: var(--text); }
.office-note p { font-size: .85rem; color: var(--text-2); }

/* ─── Footer ─── */
footer {
  background: var(--text); color: rgba(255,255,255,.6);
  padding: 1.75rem 2rem; font-size: .85rem;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
}
.footer-contact {
  color: rgba(255,255,255,.7); font-size: .85rem; font-weight: 500;
  transition: color var(--transition);
}
.footer-contact:hover { color: #fff; text-decoration: none; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .about-grid    { grid-template-columns: 1fr; }
  .teaching-grid { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .form-row      { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; gap: .25rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hero-content { flex-direction: column; text-align: center; }
  .hero-badges, .hero-links { justify-content: center; }
  .hero-stats { justify-content: center; }
  .stat-card { min-width: 120px; flex: none; }
}

@media (max-width: 480px) {
  .pub-item { flex-direction: column; gap: .5rem; }
  .section { padding: 3.5rem 1.25rem; }
}
