/* ==========================================================================
   Academic profile — shared stylesheet
   Used by index.html and everything in /pages/
   ========================================================================== */

:root{
  --bg: #fbfaf6;
  --bg-alt: #f3f1e8;
  --surface: #ffffff;
  --text: #1d2127;
  --text-muted: #5b6470;
  --accent: #1f5d6b;
  --accent-dark: #133b45;
  --accent-soft: rgba(31,93,107,0.08);
  --border: #e3e0d3;
  --shadow: rgba(20,30,35,0.10);

  --hl-author: #b8650f;
  --hl-journal: #4a7a23;
  --hl-affiliation: #8a6a4f;

  --serif: 'Lora', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-w: 1040px;
  --radius: 6px;

  color-scheme: light;
}

html[data-theme="dark"]{
  --bg: #13171b;
  --bg-alt: #191e23;
  --surface: #1a1f24;
  --text: #e8e6df;
  --text-muted: #98a1ab;
  --accent: #6fc4d4;
  --accent-dark: #a3dce6;
  --accent-soft: rgba(111,196,212,0.12);
  --border: #2a3037;
  --shadow: rgba(0,0,0,0.45);

  --hl-author: #e2a45c;
  --hl-journal: #8fc065;
  --hl-affiliation: #b59a82;

  color-scheme: dark;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }
a:focus-visible, button:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img{ max-width: 100%; display: block; }

h1, h2, h3{ font-family: var(--serif); font-weight: 600; margin: 0 0 .5em; color: var(--text); }

.wrap{
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow{
  display: block;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal{ opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible{ opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce){
  .reveal{ opacity: 1; transform: none; transition: none; }
}

/* ---------- Header / Nav ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: background-color .25s ease, border-color .25s ease;
}
.nav-inner{
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.nav-brand{
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
}
.nav-brand:hover{ text-decoration: none; }
.nav-group{
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.nav-links{
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav-links a{
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover{ color: var(--accent); text-decoration: none; }
.nav-links a.is-active{
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Theme toggle ---------- */
.theme-toggle{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.theme-toggle:hover{ color: var(--accent); border-color: var(--accent); }
.theme-toggle svg{ width: 17px; height: 17px; }
.theme-toggle .icon-sun{ display: none; }
.theme-toggle .icon-moon{ display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun{ display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon{ display: none; }

main{ display: block; }

section{ padding: 80px 0; }
section.alt{ background: var(--bg-alt); transition: background-color .25s ease; }
section + section{ border-top: 1px solid var(--border); }

/* ---------- Buttons ---------- */
.btn{
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.btn:hover{ background: var(--accent-soft); text-decoration: none; }
.btn-primary{ background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover{ background: var(--accent-dark); border-color: var(--accent-dark); color: var(--bg); }

/* ---------- Hero ---------- */
.hero{
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: center;
  padding-top: 56px;
}
.hero-photo-frame{
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1/1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 28px var(--shadow);
  background: var(--bg-alt);
}
.hero-photo-frame img{ width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder{
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
}
.photo-placeholder svg{ width: 50px; height: 50px; opacity: .5; }
.photo-placeholder span{ font-size: 12px; text-align: center; padding: 0 18px; }

.hero h1{ font-size: clamp(34px, 5vw, 48px); line-height: 1.1; margin-bottom: 10px; }
.hero-role{ color: var(--text-muted); font-size: 17px; margin-bottom: 22px; }
.hero-tagline{ color: var(--text); max-width: 560px; margin-bottom: 26px; }
.hero-actions{ display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- About / Research teaser ---------- */
.section-head{ max-width: 640px; margin-bottom: 36px; }
.section-head h2{ font-size: 28px; }
.lede{ font-size: 17px; color: var(--text); max-width: 700px; }
.instruction{ color: var(--text-muted); font-style: italic; font-size: 14px; margin-top: 10px; }
.tags{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; list-style: none; padding: 0; }
.tags li{
  font-size: 13px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: 999px;
}
html[data-theme="dark"] .tags li{ color: var(--text); }

.research-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* ---------- Timeline ---------- */
.timeline{ margin-top: 8px; position: relative; }
.timeline-item{
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--border);
}
.timeline-item:first-child{ border-top: none; }
.timeline-years{ font-weight: 600; color: var(--accent); font-size: 16px; }
.timeline-item h3{ font-size: 21px; margin-bottom: 4px; }
.timeline-meta{ color: var(--text-muted); font-size: 15px; margin-bottom: 10px; }
.timeline-item ul{ margin: 0; padding-left: 18px; }
.timeline-item li{ margin-bottom: 6px; font-size: 15px; }

/* ---------- Research theme blocks (research.html) ---------- */
.theme-block{
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 36px;
  align-items: center;
  padding: 36px 0;
  border-top: 1px solid var(--border);
}
.theme-block:first-child{ border-top: none; padding-top: 0; }
.theme-block:nth-child(even) .theme-image{ order: -1; }
.theme-block h3{ font-size: 20px; margin-bottom: 12px; }
.theme-block p{ color: var(--text-muted); margin: 0; }
.theme-image img{
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px var(--shadow);
}

/* ---------- Publications: card grid (index.html) ---------- */
.pub-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 8px;
}
.pub-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pub-card:hover{ transform: translateY(-3px); box-shadow: 0 14px 28px var(--shadow); }
.pub-thumb{
  aspect-ratio: 16/10;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.pub-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.pub-thumb span{ font-size: 12px; color: var(--text-muted); }
.pub-body{ padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pub-body h3{ font-size: 17px; line-height: 1.4; }
.pub-meta{ font-size: 14px; color: var(--text-muted); margin: 0; }
.pub-link{ font-size: 14px; font-weight: 600; margin-top: auto; }

/* ---------- Publications: full list (publications.html, cv.html) ---------- */
.pub-list{
  list-style: none;
  margin: 0;
  padding: 0;
}
.pub-list li{
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.pub-list li:first-child{ border-top: none; }
.pub-list h3{
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.4;
}
.pub-list .pub-meta{ font-size: 15px; margin-bottom: 6px; }
.pub-list .paper-link{ font-size: 14px; font-weight: 600; color: var(--accent); }

.author-highlight{ color: var(--hl-author); font-weight: 700; }
.journal{ color: var(--hl-journal); font-style: italic; }

/* ---------- CV page ---------- */
.cv-intro{ font-size: 16px; max-width: 760px; color: var(--text); }
.cv-section{ margin-bottom: 44px; }
.cv-section h2{ font-size: 22px; margin-bottom: 18px; }
.cv-list{ list-style: none; margin: 0; padding: 0; }
.cv-list li{
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.cv-list li:first-child{ border-top: none; }
.cv-list .yr{ color: var(--accent); font-weight: 600; font-size: 15px; }
.cv-list h3{ font-size: 17px; margin: 0 0 4px; }
.cv-list .cv-affiliation{ color: var(--hl-affiliation); font-size: 14px; margin: 0; }

/* ---------- Contact ---------- */
.contact-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 8px;
}
.contact-block h3{
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.contact-block p{ margin: 0 0 6px; font-size: 15px; }
.connect-list{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.connect-list a{ font-size: 15px; color: var(--text); }
.connect-list a:hover{ color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer{
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 36px 0;
  text-align: center;
  transition: background-color .25s ease, border-color .25s ease;
}
.site-footer p{ font-size: 13px; color: var(--text-muted); margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 820px){
  .hero{ grid-template-columns: 1fr; }
  .hero-photo-frame{ margin: 0 auto; }
  .contact-grid{ grid-template-columns: 1fr; gap: 30px; }
  .timeline-item{ grid-template-columns: 1fr; gap: 6px; }
  .cv-list li{ grid-template-columns: 90px 1fr; }
  .theme-block{ grid-template-columns: 1fr; }
  .theme-block:nth-child(even) .theme-image{ order: 0; }
  section{ padding: 56px 0; }
}
@media (max-width: 480px){
  .nav-inner{ padding: 14px 18px; }
  .nav-group{ gap: 16px; }
  .nav-links{ gap: 16px; }
}
