/* ──────────────────────────────────────────
   Fonts & Reset
────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@300;400;500;600&display=swap');

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

/* ──────────────────────────────────────────
   Tokens
────────────────────────────────────────── */
:root {
  --bg:            #F7FAFF;
  --bg-card:       #E8F0FB;
  --bg-card-hover: #D9E6F7;
  --blue:          #5A8FCC;
  --blue-dark:     #2B5490;
  --blue-pale:     #C9DDF4;
  --text:          #1A2B3C;
  --text-muted:    #526275;
  --border:        #C0D4EC;
  --radius-card:   14px;
  --radius-pill:   50px;
  --max-w:         780px;
  --nav-h:         66px;
}

/* ──────────────────────────────────────────
   Base
────────────────────────────────────────── */
html { scroll-behavior: smooth; }

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

h1, h2, h3 {
  font-family: 'DM Serif Display', serif;
  line-height: 1.2;
  color: var(--text);
}

a {
  color: var(--blue-dark);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

/* ──────────────────────────────────────────
   Navigation
────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 250, 255, 0.93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  width: 100%;
  max-width: calc(var(--max-w) + 80px);
  margin: 0 auto;
  padding: 12px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-name:hover { text-decoration: none; color: var(--blue-dark); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--blue-dark);
  background: var(--bg-card);
}

.nav-links a.active {
  color: var(--blue-dark);
  font-weight: 600;
  border-bottom: 2px solid var(--blue);
  border-radius: 0;
  padding-bottom: 2px;
}

/* ──────────────────────────────────────────
   Alternating section backgrounds
────────────────────────────────────────── */
section { width: 100%; }
section:nth-child(odd)  { background: var(--bg); }
section:nth-child(even) { background: #EDF3FC; }

/* ──────────────────────────────────────────
   Page wrapper (inner pages)
────────────────────────────────────────── */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 52px 32px 80px;
}

/* ──────────────────────────────────────────
   About hero (about.html)
────────────────────────────────────────── */
.about-hero {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 52px;
}

.about-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 3px solid var(--blue-pale);
  box-shadow: 0 8px 32px rgba(43, 84, 144, 0.14);
  flex-shrink: 0;
}

.about-avatar-placeholder {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 3px solid var(--blue-pale);
  flex-shrink: 0;
}

.about-text h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}

.about-role {
  font-size: 1rem;
  color: var(--blue-dark);
  font-weight: 500;
  margin-bottom: 4px;
}

.about-institution {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ──────────────────────────────────────────
   Buttons
────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: var(--blue-dark);
  color: #fff;
  border: 2px solid var(--blue-dark);
}

.btn-primary:hover {
  background: #1e3f6e;
  border-color: #1e3f6e;
  text-decoration: none;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--blue-dark);
  border: 2px solid var(--blue-pale);
}

.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--blue);
  text-decoration: none;
}

/* ──────────────────────────────────────────
   Section labels & dividers
────────────────────────────────────────── */
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 6px;
  padding-left: 10px;
  border-left: 3px solid var(--blue-pale);
}

.section-title {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--blue-pale);
  padding-bottom: 10px;
  margin-bottom: 28px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 44px 0;
}

/* ──────────────────────────────────────────
   Cards
────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 24px 28px;
  border-left: 4px solid var(--blue-pale);
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 16px;
}

.card:hover {
  background: var(--bg-card-hover);
  border-left-color: var(--blue);
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card p {
  font-size: 0.93rem;
  color: var(--text-muted);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ──────────────────────────────────────────
   Tags
────────────────────────────────────────── */
.tag {
  display: inline-block;
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

/* ──────────────────────────────────────────
   CV entries
────────────────────────────────────────── */
.cv-section {
  margin-bottom: 40px;
}

.cv-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cv-entry:last-child { border-bottom: none; }

.cv-year {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 2px;
}

.cv-content strong {
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.cv-content span {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ──────────────────────────────────────────
   Course rows (teaching.html)
────────────────────────────────────────── */
.course-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.course-row:last-child { border-bottom: none; }

.course-name { font-weight: 500; font-size: 0.95rem; }

.course-detail {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.course-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--blue-dark);
  background: var(--blue-pale);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ──────────────────────────────────────────
   Contact items
────────────────────────────────────────── */
.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.contact-item:last-child { border-bottom: none; }

.contact-icon {
  width: 38px;
  height: 38px;
  background: var(--bg-card);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.contact-value {
  font-size: 0.95rem;
  color: var(--text);
}

/* ──────────────────────────────────────────
   Responsive
────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-inner { padding: 10px 20px; }
  .page { padding: 36px 20px 64px; }

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

  .about-avatar,
  .about-avatar-placeholder {
    width: 140px;
    height: 140px;
  }

  .about-text h1 { font-size: 1.6rem; }

  .cv-entry { grid-template-columns: 1fr; gap: 2px; }
  .cv-year { font-size: 0.8rem; }

  .course-row { grid-template-columns: 1fr; }
}
