:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #eef2f8;
  --text: #172033;
  --muted: #61708a;
  --line: #dfe5ef;
  --primary: #183a63;
  --primary-2: #2f6690;
  --accent: #b27a2b;
  --shadow: 0 18px 50px rgba(28, 48, 76, .10);
  --radius: 20px;
  --max: 1160px;
}

[data-theme="dark"] {
  --bg: #0d1420;
  --surface: #141f2f;
  --surface-soft: #19283b;
  --text: #edf2f8;
  --muted: #aebbd0;
  --line: #2b3a4f;
  --primary: #8db7df;
  --primary-2: #6fa1d0;
  --accent: #e0ad5f;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, textarea { font: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: .8rem 1rem;
  background: var(--surface);
  color: var(--text);
}
.skip-link:focus { left: 1rem; top: 1rem; }

.container { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; }
.narrow { width: min(calc(100% - 2rem), 860px); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.navbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #183a63, #2f6690);
  font-size: .88rem;
  box-shadow: 0 7px 18px rgba(24, 58, 99, .28);
}
.nav-links { display: flex; align-items: center; gap: 1.1rem; }
.nav-links a { color: var(--text); font-weight: 650; font-size: .94rem; }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn, .lang-btn, .menu-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  min-height: 40px;
  padding: .45rem .7rem;
  cursor: pointer;
}
.icon-btn:hover, .lang-btn:hover, .menu-btn:hover { border-color: var(--primary-2); }
.menu-btn { display: none; }

.hero { padding: 6.4rem 0 4.5rem; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: 4.5rem;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .7rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  color: var(--primary-2);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 1rem 0 .8rem;
  max-width: 820px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.045em;
}
.hero-role {
  margin: 0 0 1.2rem;
  color: var(--primary-2);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 760;
}
.hero-copy { max-width: 720px; color: var(--muted); font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .76rem 1rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  font-weight: 760;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; border-color: var(--primary-2); box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: var(--bg); border-color: var(--primary); }
[data-theme="dark"] .btn-primary { color: #0d1420; }

.profile-card {
  position: relative;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.profile-visual {
  min-height: 330px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    radial-gradient(circle at 80% 20%, rgba(178,122,43,.24), transparent 28%),
    radial-gradient(circle at 15% 80%, rgba(47,102,144,.28), transparent 31%),
    linear-gradient(145deg, #173654, #2d668f);
  color: #fff;
  overflow: hidden;
}
.profile-initials {
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(8px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4rem;
  letter-spacing: -.06em;
}
.profile-meta { padding: 1rem .25rem .15rem; }
.profile-meta strong { display: block; font-size: 1.05rem; }
.profile-meta span { color: var(--muted); font-size: .93rem; }

.section { padding: 5rem 0; }
.section-soft { background: var(--surface-soft); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.section-kicker { margin: 0 0 .35rem; color: var(--accent); font-size: .8rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.section h2, .page-hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}
.section-intro { max-width: 760px; color: var(--muted); }

.about-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 3rem; align-items: start; }
.prose p:first-child { margin-top: 0; }
.fact-list { display: grid; gap: .8rem; }
.fact {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}
.fact-label { display: block; color: var(--muted); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.fact-value { display: block; margin-top: .15rem; font-weight: 750; }

.tag-list { display: flex; flex-wrap: wrap; gap: .55rem; padding: 0; margin: 1.4rem 0 0; list-style: none; }
.tag { padding: .38rem .68rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .86rem; font-weight: 650; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(28,48,76,.04);
}
.card-status { display: inline-flex; width: max-content; padding: .28rem .55rem; border-radius: 999px; background: var(--surface-soft); color: var(--primary-2); font-size: .75rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.card h3 { margin: .9rem 0 .55rem; font-size: 1.13rem; line-height: 1.35; }
.card p { color: var(--muted); font-size: .93rem; }
.card-footer { margin-top: auto; padding-top: 1rem; display: flex; flex-wrap: wrap; gap: .7rem; }
.text-link { font-weight: 800; font-size: .9rem; }

.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 150px 1fr; gap: 1.5rem; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 1px solid var(--line); }
.timeline-date { color: var(--primary-2); font-weight: 800; }
.timeline-body h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.timeline-body p { margin: .15rem 0; color: var(--muted); }

.contact-panel {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.contact-links { display: grid; gap: .65rem; justify-items: start; }

.site-footer { padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.page-hero { padding: 5rem 0 2.5rem; }
.page-hero p { max-width: 760px; color: var(--muted); font-size: 1.05rem; }
.breadcrumbs { margin-bottom: 1rem; color: var(--muted); font-size: .9rem; }

.paper-list { display: grid; gap: 1rem; }
.paper {
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.paper-top { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.paper h2 { margin: 0; font-size: 1.25rem; font-family: inherit; line-height: 1.38; letter-spacing: -.01em; }
.paper-meta { margin: .4rem 0 0; color: var(--muted); font-size: .9rem; }
.paper-abstract { margin: 1rem 0; color: var(--muted); }
.paper-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.paper details { margin-top: 1rem; }
.paper pre { overflow: auto; padding: 1rem; border-radius: 12px; background: var(--surface-soft); font-size: .8rem; }

.course-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.course-card { padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.course-card h3 { margin-top: 0; }
.course-card ul { padding-left: 1.2rem; color: var(--muted); }

.cv-toolbar { position: sticky; top: 86px; z-index: 20; display: flex; justify-content: flex-end; gap: .6rem; margin-bottom: 1rem; }
.cv-sheet { padding: 2.5rem; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.cv-head { display: grid; grid-template-columns: 1fr auto; gap: 2rem; padding-bottom: 1.4rem; border-bottom: 2px solid var(--text); }
.cv-head h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 2.3rem; line-height: 1.05; }
.cv-title { margin: .4rem 0 0; color: var(--primary-2); font-weight: 750; }
.cv-contact { text-align: right; font-size: .9rem; }
.cv-contact p { margin: .12rem 0; }
.cv-section { margin-top: 1.7rem; }
.cv-section h2 { margin: 0 0 .85rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; }
.cv-entry { display: grid; grid-template-columns: 145px 1fr; gap: 1.2rem; margin: .8rem 0; }
.cv-date { font-weight: 800; color: var(--primary-2); }
.cv-entry h3 { margin: 0; font-size: 1rem; }
.cv-entry p { margin: .2rem 0; color: var(--muted); font-size: .92rem; }
.cv-list { margin: .4rem 0 0; padding-left: 1.1rem; }
.cv-list li { margin: .25rem 0; }
.notice { padding: 1rem; border-left: 4px solid var(--accent); background: var(--surface-soft); color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .hero-grid, .about-grid, .contact-panel { grid-template-columns: 1fr; }
  .hero { padding-top: 4rem; }
  .profile-card { max-width: 480px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .nav-links {
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 68px;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .menu-btn { display: inline-flex; }
}

@media (max-width: 640px) {
  .navbar { min-height: 64px; }
  .brand span:last-child { display: none; }
  .hero { padding: 3.2rem 0; }
  .hero-grid { gap: 2.5rem; }
  .profile-visual { min-height: 270px; }
  .section { padding: 3.6rem 0; }
  .card-grid, .course-grid { grid-template-columns: 1fr; }
  .timeline-item, .cv-entry { grid-template-columns: 1fr; gap: .25rem; }
  .section-head, .paper-top, .footer-row { align-items: flex-start; flex-direction: column; }
  .cv-sheet { padding: 1.2rem; }
  .cv-head { grid-template-columns: 1fr; }
  .cv-contact { text-align: left; }
}

@media print {
  body { background: #fff; color: #000; font-size: 10pt; }
  .site-header, .site-footer, .cv-toolbar, .breadcrumbs, .page-hero > .container > p { display: none !important; }
  .page-hero { display: none !important; }
  .section { padding: 0; }
  .cv-sheet { border: 0; box-shadow: none; padding: 0; }
  .cv-section { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
