/* ---------- Design tokens ---------- */
:root {
  --navy: #12305c;
  --blue: #1e4d91;
  --blue-mid: #2f6fbf;
  --blue-light: #e8f0fb;
  --blue-border: #cddcf0;
  --bg: #fbfcfe;
  --bg-alt: #f2f6fb;
  --text: #1c2b42;
  --text-muted: #4a5b78;
  --white: #ffffff;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --radius: 6px;
  --shadow: 0 2px 10px rgba(18, 48, 92, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--navy);
  margin: 0 0 12px;
}

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

ul { padding-left: 20px; }
li { margin-bottom: 6px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 252, 254, 0.92);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--blue-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--navy);
}
.brand:hover { text-decoration: none; color: var(--blue-mid); }

.main-nav {
  display: flex;
  gap: 28px;
}

.main-nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover {
  color: var(--blue);
  text-decoration: none;
  border-bottom-color: var(--blue-mid);
}

.main-nav a.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.lang-switch {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--blue-border);
}

.lang-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--sans);
}
.lang-btn:hover {
  color: var(--blue);
  background: var(--blue-light);
}
.lang-btn.active {
  color: var(--white);
  background: var(--blue);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--navy);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--blue-light) 0%, var(--bg) 100%);
  padding: 72px 0 56px;
  text-align: center;
  border-bottom: 1px solid var(--blue-border);
}

.hero-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: 2.6rem;
  margin-bottom: 8px;
}

.hero-title {
  color: var(--blue);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 16px;
}

.hero-subtitle {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 0.98rem;
}

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

.btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--blue);
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--blue);
}
.btn-outline:hover {
  background: var(--blue-light);
  text-decoration: none;
}

/* ---------- Sections ---------- */
.section {
  padding: 64px 0;
}
.section.alt {
  background: var(--bg-alt);
}

.section h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.6rem;
  margin-bottom: 32px;
}

.bar {
  display: inline-block;
  width: 30px;
  height: 4px;
  background: var(--blue-mid);
  border-radius: 2px;
}

.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 760px;
}

/* ---------- Entries (education / experience) ---------- */
.entry {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--blue-border);
}
.entry:first-of-type { border-top: none; }

.entry-date {
  color: var(--blue);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.entry-body h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.entry-org {
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.entry-body ul {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

/* ---------- Publications ---------- */
.pub-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pub-list li {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-left: 4px solid var(--blue-mid);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 0.95rem;
  color: var(--text);
  box-shadow: var(--shadow);
}
.pub-list em { color: var(--navy); font-style: italic; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.skill-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.skill-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 8px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  color: var(--text);
}
a.contact-item:hover {
  border-color: var(--blue-mid);
  text-decoration: none;
}
.contact-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  font-weight: 700;
}
.contact-value {
  font-size: 0.95rem;
  word-break: break-word;
}

/* ---------- Page header (subpages) ---------- */
.page-header {
  background: linear-gradient(180deg, var(--blue-light) 0%, var(--bg) 100%);
  padding: 56px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--blue-border);
}
.page-header h1 {
  font-size: 2.1rem;
  margin-bottom: 10px;
}
.page-header p {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: 1rem;
}

/* ---------- Timeline (Home / Journey) ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--blue-border);
}
.timeline-item {
  position: relative;
  padding-bottom: 32px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid var(--blue-light);
}
.timeline-date {
  color: var(--blue);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.timeline-item h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.timeline-org {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.92rem;
  margin: 0 0 6px;
}
.timeline-desc {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text);
  max-width: 640px;
}

/* ---------- Theme / research cards ---------- */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.theme-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  position: relative;
}
.theme-num {
  display: block;
  font-family: var(--serif);
  color: var(--blue-border);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.theme-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}
.theme-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ---------- Publications teaser (home) ---------- */
.pubs-teaser-text {
  color: var(--text-muted);
  margin: 0 0 20px;
}

/* ---------- Contact band (home) ---------- */
.contact-band {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: 56px 0;
}
.contact-band h2 { color: var(--white); }
.contact-band p {
  color: #cfe0f7;
  max-width: 520px;
  margin: 0 auto 24px;
}
.contact-band .btn-primary {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}
.contact-band .btn-primary:hover {
  background: var(--blue-light);
}

/* ---------- Research project card ---------- */
.project-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-left: 4px solid var(--blue-mid);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}
.project-card h3 {
  font-size: 1.15rem;
  margin-bottom: 18px;
}
.project-meta {
  display: grid;
  gap: 16px;
}
.project-meta-item .meta-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 4px;
}
.project-meta-item p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text);
}

.activities-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.activities-list li {
  position: relative;
  padding-left: 24px;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0;
}
.activities-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-mid);
}

/* ---------- Experience cards (research page) ---------- */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.experience-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.experience-card h3 {
  font-size: 1.02rem;
  margin-bottom: 4px;
}
.experience-org {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.88rem;
  margin: 0 0 10px;
}
.experience-card p:last-child {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
}

/* ---------- Teaching & Supervision cards ---------- */
.role-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-left: 4px solid var(--blue-mid);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
}
.role-card h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.role-org {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.92rem;
  margin: 0 0 12px;
}
.role-card p:last-child {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

/* ---------- Software page (empty state) ---------- */
.software-empty {
  text-align: center;
  padding: 64px 24px;
  border: 2px dashed var(--blue-border);
  border-radius: var(--radius);
  background: var(--white);
}
.software-empty h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.software-empty p {
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto;
}

/* ---------- Software project cards (for future use) ---------- */
.soft-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.soft-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.soft-screen-wrap {
  margin: 0 -24px 16px;
  border-top: 1px solid var(--blue-border);
  border-bottom: 1px solid var(--blue-border);
  background: var(--bg-alt);
  overflow: hidden;
}
.soft-screen-frame {
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.soft-screen-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.soft-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.soft-card-num {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--blue-border);
  font-weight: 700;
}
.soft-card-badges {
  display: flex;
  gap: 6px;
}
.soft-kind-badge, .soft-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 4px;
}
.soft-kind-badge {
  background: var(--blue-light);
  color: var(--blue);
}
.soft-status-badge {
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--blue-border);
}
.soft-card-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.soft-card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.soft-card-footer {
  margin-top: auto;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.ptag {
  font-size: 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--blue-border);
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: 12px;
}
.software-link {
  font-weight: 600;
  font-size: 0.9rem;
}
.software-link.disabled {
  color: var(--text-muted);
  cursor: default;
}

/* ---------- Contact page layout ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
}
.contact-panel {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.contact-panel .contact-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
}
.contact-map-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.contact-map-caption {
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--blue-border);
}
.contact-map-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  display: block;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #cfe0f7;
  padding: 22px 0;
  text-align: center;
  font-size: 0.85rem;
}
.site-footer a { color: #cfe0f7; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .main-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--blue-border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .main-nav.open {
    max-height: 420px;
  }
  .main-nav a {
    padding: 14px 24px;
    border-bottom: 1px solid var(--blue-border);
    width: 100%;
  }
  .nav-toggle { display: flex; }

  .lang-switch {
    margin: 8px 24px 14px;
    padding: 10px 0 0;
    border-left: none;
    border-top: 1px solid var(--blue-border);
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: 1fr; }
  .experience-grid { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .timeline { padding-left: 22px; }
  .timeline-item::before { left: -28px; }
  .hero h1 { font-size: 2rem; }
}
