/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  --bg-base:        #faf9f7;
  --bg-surface:     #f0ede9;
  --bg-elevated:    #e8e4df;
  --accent:         #c4612e;
  --accent-hover:   #a8501f;
  --accent-muted:   rgba(196, 97, 46, 0.1);
  --text-primary:   #1a1612;
  --text-secondary: #5c5650;
  --text-muted:     #8c8680;
  --border:         #dedad5;
  --radius:         8px;
  --max-width:      860px;
  --header-h:       64px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  background: #faf9f7; /* hard fallback in case variables load late */
}
body {
  font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100dvh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ── Focus ──────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  min-height: var(--header-h);
  gap: 0.75rem;
}
/* ── Header Logo ─────────────────────────────────────────────── */
.header-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 150ms ease;
}
.header-logo:hover { opacity: 1; }
.header-logo-img {
  height: 36px;
  width: auto;
}

/* ── Header Right Group ──────────────────────────────────────── */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── CV Button ───────────────────────────────────────────────── */
.cv-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}
.cv-btn:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ── Page Navigation ─────────────────────────────────────────── */
.page-nav {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.page-nav::-webkit-scrollbar { display: none; }
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
  height: var(--header-h);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease;
  text-decoration: none;
}
.nav-link:hover { color: var(--text-primary); text-decoration: none; }
.nav-link:active { opacity: 0.75; }
.nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Main Content ───────────────────────────────────────────── */
.content-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Section Headings ───────────────────────────────────────── */
.section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent);
  margin-bottom: 1rem;
}
.section-block { margin-bottom: 2.5rem; }
.section-block:last-child { margin-bottom: 0; }

/* ── Profile Block ───────────────────────────────────────────── */
.profile-block {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.profile-photo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  width: 160px;
}
.profile-photo {
  width: 150px;
  height: 150px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
}
.profile-photo-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 3rem;
}
.profile-address {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}
.photo-social {
  display: grid;
  grid-template-columns: repeat(4, 28px);
  justify-content: center;
  gap: 0.125rem;
  margin-top: 0.5rem;
}
.photo-email {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.375rem;
  line-height: 1.4;
  word-break: break-word;
}

/* ── Social Links (icon-only) ────────────────────────────────── */
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 0.9375rem;
  color: var(--text-muted);
  border-radius: 5px;
  transition: color 150ms ease, background 150ms ease;
  text-decoration: none;
  flex-shrink: 0;
}
.social-link .ai { font-size: 1.05rem; line-height: 1; }
.social-link:hover {
  color: var(--accent);
  background: var(--accent-muted);
  text-decoration: none;
}

/* ── Profile Bio ─────────────────────────────────────────────── */
.profile-bio {
  flex: 1;
  min-width: 0;
}
.profile-name {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}
.profile-affiliation {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.bio-text {
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.7;
}
.bio-text p + p { margin-top: 0.75rem; }

/* ── Liquid Glass Box ────────────────────────────────────────── */
.liquid-glass-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.62) 0%,
    rgba(255, 255, 255, 0.28) 100%
  );
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 2px 12px rgba(196, 97, 46, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.6;
}
.liquid-glass-icon {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

/* ── Research Interests ──────────────────────────────────────── */
.interests-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.interests-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
}
.interests-list li::before {
  content: '▸';
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1.65;
}

/* ── News Scroll Box ─────────────────────────────────────────── */
.news-scroll {
  max-height: 220px;
  overflow-y: scroll;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.news-scroll::-webkit-scrollbar { width: 6px; }
.news-scroll::-webkit-scrollbar-track { background: transparent; }
.news-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.news-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── News ────────────────────────────────────────────────────── */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.news-item {
  display: flex;
  gap: 0.875rem;
  align-items: baseline;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}
.news-date {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.news-text { color: var(--text-primary); }

/* ── Publication Cards ───────────────────────────────────────── */
.pub-year-group { margin-bottom: 2rem; }
.pub-year-group:last-child { margin-bottom: 0; }
.pub-year-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1;
}
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pub-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: background 150ms ease, border-color 150ms ease;
}
.pub-card:hover { background: var(--bg-elevated); border-color: rgba(196,97,46,0.35); }
.pub-corner-label {
  position: absolute;
  top: 0.875rem;
  right: 1.25rem;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: rgba(140, 134, 128, 0.5);
  white-space: nowrap;
}
.pub-header {
  margin-bottom: 0.375rem;
  padding-right: 6rem;
}
.pub-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}
.pub-title a { color: inherit; text-decoration: none; }
.pub-title a:hover { color: var(--accent); text-decoration: underline; }
.pub-authors {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  line-height: 1.5;
}
.pub-authors .me { font-weight: 600; color: var(--text-primary); }
.pub-venue {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.5;
  font-style: italic;
}
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}
.pub-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-muted);
  text-decoration: none;
}

/* ── Experience ──────────────────────────────────────────────── */
.exp-list {
  display: flex;
  flex-direction: column;
}
.exp-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}
.exp-item:last-child { border-bottom: none; }
.exp-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
  overflow: hidden;
}
.exp-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.exp-body { flex: 1; min-width: 0; }
.exp-role {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}
.exp-org {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}
.exp-org a { color: var(--text-secondary); }
.exp-org a:hover { color: var(--accent); }
.exp-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.exp-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  line-height: 1.55;
}

/* ── Misc Page ───────────────────────────────────────────────── */
.prose-block {
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.7;
}
.prose-block p + p { margin-top: 0.875rem; }
.travel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.travel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  transition: border-color 150ms ease, background 150ms ease;
}
.travel-card:hover {
  background: var(--bg-elevated);
  border-color: rgba(196, 97, 46, 0.3);
}
.travel-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.travel-flag { font-size: 1.125rem; line-height: 1; }
.travel-card-country {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}
.travel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.travel-chip {
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

/* ── Service Page ────────────────────────────────────────────── */
.service-table { width: 100%; border-collapse: collapse; }
.service-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.service-table tr:last-child td { border-bottom: none; }
.service-year {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  width: 4rem;
}
.service-venues { color: var(--text-primary); }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
/* push page content above the fixed footer */
.content-wrap { padding-bottom: 3.5rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header {
    padding: 0 1rem;
    min-height: var(--header-h);
  }
  .nav-link { height: var(--header-h); padding: 0 0.75rem; font-size: 0.8125rem; }
  .content-wrap { padding: 1.5rem 1rem 3rem; }
  .profile-block { flex-direction: column; align-items: center; gap: 1.25rem; }
  .profile-photo-col { width: 100%; max-width: 220px; }
  .profile-address { text-align: center; }
  .profile-name { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
