/* ==========================================================
   style.css  —  Minimalist High-End Academic Website
   ==========================================================
   Design principles:
     · Warm off-white ground — never pure white or dark
     · Cormorant Garamond serif for display, Inter for body
     · One accent colour (deep navy) used sparingly
     · Section rhythm via space + hairline rules, not backgrounds
     · Cards: white, 1px border, near-invisible shadow
     · No gradients, glows, transforms, or neon
   ==========================================================
   Sections:
     1. Variables & Reset
     2. Base Typography
     3. Layout & Grid
     4. Navigation
     5. Hero
     6. Section Wrapper & Headers
     7. Cards — Project & Publication
     8. Education Timeline
     9. Skills
    10. News
    11. Badges & Tags
    12. Buttons
    13. Dividers & Ornaments
    14. Footer
    15. Project Detail Pages
    16. Publications Page
    17. Projects Gallery Page
    18. Subtle Interactions
    19. Responsive
   ========================================================== */

/* ── 1. Variables & Reset ───────────────────────────────── */
:root {
  /* Ground — warm off-white */
  --bg:         #F9F8F6;
  --bg-white:   #FFFFFF;
  --bg-subtle:  #F2F0EC;

  /* Rules & borders */
  --rule:       #E3DFD8;
  --rule-hi:    #C8C3BA;

  /* Text — never pure black */
  --ink:        #1A1A1A;
  --ink-2:      #545454;
  --ink-3:      #9A9896;

  /* Accent — deep navy, used minimally */
  --accent:     #1E3A5F;
  --accent-2:   #2B5082;
  --accent-bg:  rgba(30, 58, 95, 0.06);

  /* Functional colours — muted, secondary only */
  --green:      #3A6B4A;
  --green-bg:   rgba(58, 107, 74, 0.07);
  --amber:      #7A5C28;
  --amber-bg:   rgba(122, 92, 40, 0.07);

  /* Typography */
  --serif:  'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --mono:   'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Layout */
  --nav-h:  60px;
  --max-w:  960px;
  --pad-x:  clamp(24px, 6vw, 72px);
  --sec-v:  112px;

  /* Elevation — extremely restrained */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.07), 0 12px 32px rgba(0,0,0,0.05);

  /* Shape */
  --r:     5px;
  --r-lg:  10px;

  /* Motion */
  --dur:   240ms;
  --ease:  cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a  { color: var(--accent); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--accent-2); }
::selection { background: rgba(30, 58, 95, 0.12); }

/* ── 2. Base Typography ─────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 { font-size: clamp(2.6rem, 5.5vw, 4rem);   font-weight: 400; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem);  font-weight: 400; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem);   font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }

p { color: var(--ink-2); }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  padding: 2px 6px;
  border-radius: var(--r);
  color: var(--ink);
}

/* Label overline — small uppercase with tracking */
.overline {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}

/* ── 3. Layout & Grid ───────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.section {
  padding: var(--sec-v) 0;
}

/* Thin rule between sections */
.section + .section { border-top: 1px solid var(--rule); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── 4. Navigation ──────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(249, 248, 246, 0.92);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}

.nav.scrolled { border-color: var(--rule); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.nav__logo {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink) !important;
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
}

.nav__links a {
  display: block;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2) !important;
  transition: color var(--dur) var(--ease);
}
.nav__links a:hover,
.nav__links a.active { color: var(--ink) !important; }

.nav__links .nav__cta {
  margin-left: 10px;
  padding: 7px 16px;
  border: 1px solid var(--rule-hi);
  border-radius: var(--r);
  color: var(--ink) !important;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
}
.nav__links .nav__cta:hover {
  background: var(--ink);
  color: var(--bg-white) !important;
  border-color: var(--ink);
}

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  color: var(--ink);
}
.nav__burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: all var(--dur) var(--ease);
}

.nav__mobile {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: var(--bg);
  z-index: 99;
  padding: 32px var(--pad-x);
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  border-top: 1px solid var(--rule);
}
.nav__mobile.open { display: flex; }

.nav__mobile a {
  display: block;
  padding: 14px 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--ink-2) !important;
  border-bottom: 1px solid var(--rule);
}
.nav__mobile a:last-child { border-bottom: none; }
.nav__mobile a:hover { color: var(--ink) !important; }

/* ── 5. Hero ────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--rule);
  /* Subtle dot-grid texture */
  background-image:
    radial-gradient(circle, var(--rule) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: 0 0;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 240px;
  align-items: start;
  gap: 64px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px var(--pad-x);
}

.hero__meta {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero__name {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 24px;
  white-space: nowrap;
}

/* Thin rule below name */
.hero__rule {
  width: 48px;
  height: 1px;
  background: var(--rule-hi);
  margin-bottom: 28px;
}

.hero__title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.hero__affiliation {
  font-size: 0.875rem;
  color: var(--ink-3);
  margin-bottom: 32px;
}
.hero__affiliation a { color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-hi); }
.hero__affiliation a:hover { color: var(--accent); }

.hero__bio {
  font-size: 0.975rem;
  color: var(--ink-2);
  line-height: 1.8;
  max-width: 540px;
  margin-bottom: 40px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero__social {
  display: flex;
  align-items: center;
  gap: 2px;
}

.hero__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--r);
  color: var(--ink-3) !important;
  transition: color var(--dur) var(--ease);
}
.hero__social a:hover { color: var(--ink) !important; }
.hero__social svg { width: 17px; height: 17px; }

/* Divider between social groups */
.hero__social-sep {
  width: 1px;
  height: 20px;
  background: var(--rule);
  margin: 0 6px;
}

.hero__avatar {
  width: 240px;
  height: 280px;
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
  flex-shrink: 0;
  align-self: start;
  position: relative;
  margin-top: 8px;
}
.hero__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.hero__avatar .placeholder-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rule-hi);
  font-size: 4rem;
}

/* ── 6. Section Wrapper & Headers ───────────────────────── */
.section-header { margin-bottom: 56px; }
.section-header--center { text-align: center; }

.section-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-title {
  color: var(--ink);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1rem;
  color: var(--ink-2);
  max-width: 520px;
  line-height: 1.75;
}

.section-header--center .section-desc { margin: 0 auto; }

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-hi);
  transition: all var(--dur) var(--ease);
}
.section-more:hover { color: var(--accent); border-color: var(--accent); gap: 12px; }
.section-more svg { transition: transform var(--dur) var(--ease); }
.section-more:hover svg { transform: translateX(2px); }

/* ── 7. Cards ───────────────────────────────────────────── */

/* --- Project Card --- */
.project-card {
  background: var(--bg-white);
  display: flex;
  flex-direction: column;
  transition: background var(--dur) var(--ease);
}
.project-card:hover { background: #FDFCFA; }

.project-card__fig {
  height: 200px;
  background: var(--bg-subtle);
  overflow: hidden;
  position: relative;
}
.project-card__fig img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 400ms var(--ease);
}
.project-card:hover .project-card__fig img { transform: scale(1.02); }

.project-card__fig-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rule-hi);
}
.project-card__fig-placeholder svg { width: 40px; height: 40px; }

.project-card__body { padding: 28px 28px 32px; flex: 1; display: flex; flex-direction: column; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.project-card__title { font-size: 1rem; font-weight: 700; font-family: var(--sans); margin-bottom: 10px; color: var(--ink); line-height: 1.4; }
.project-card__desc { font-size: 0.875rem; color: var(--ink-2); line-height: 1.65; flex: 1; margin-bottom: 24px; }
.project-card__links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }

/* --- Publication Item --- */
.pub-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pub-item:last-child { border-bottom: none; }
.pub-item:first-child { padding-top: 0; }

.pub-item__badge {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.pub-item__title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.pub-item__title a { color: var(--ink); transition: color var(--dur) var(--ease); }
.pub-item__title a:hover { color: var(--accent); }

.pub-item__authors { font-size: 0.875rem; color: var(--ink-2); line-height: 1.5; }
.pub-item__authors .me { font-weight: 700; color: var(--ink); }

.pub-item__venue {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-3);
}

.pub-item__abstract {
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.7;
  display: none;
  padding: 16px 20px;
  background: var(--bg-subtle);
  border-left: 2px solid var(--rule-hi);
  border-radius: 0 var(--r) var(--r) 0;
  margin-top: 4px;
}
.pub-item__abstract.open { display: block; }

.pub-item__links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.pub-item__toggle {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  transition: color var(--dur) var(--ease);
}
.pub-item__toggle:hover { color: var(--accent); }

/* ── 8. Education Timeline ──────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 28px;
  display: flex;
  flex-direction: column;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--rule);
}

.timeline-item { position: relative; padding: 0 0 40px 24px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--rule-hi);
}
.timeline-item.current::before {
  background: var(--accent);
  border-color: var(--accent);
}

.timeline-item__date {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}

.timeline-item__degree {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}

.timeline-item__school {
  font-size: 0.9rem;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.timeline-item__detail {
  font-size: 0.85rem;
  color: var(--ink-3);
  line-height: 1.65;
}

/* ── 9. Skills ──────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 24px;
}

.skill-group {
  padding: 24px 28px;
  background: var(--bg-white);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
}

.skill-group__title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 16px;
}

.skill-group__tags { display: flex; flex-wrap: wrap; gap: 7px; }

/* ── 10. News ───────────────────────────────────────────── */
.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.news-item:first-child { border-top: 1px solid var(--rule); }

.news-item__date {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--ink-3);
  white-space: nowrap;
}

.news-item__text {
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.65;
}
.news-item__text strong { color: var(--ink); font-weight: 600; }
.news-item__text a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-bg); }
.news-item__text a:hover { text-decoration-color: var(--accent); }

.news-more { display: none; }
.news-more.visible { display: grid; }

#news-toggle {
  margin-top: 20px;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
  transition: color var(--dur) var(--ease);
}
#news-toggle:hover { color: var(--accent); }

/* ── 11. Badges & Tags ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 3px;
  white-space: nowrap;
}

/* All badge colour variants map to the same neutral style */
.badge--blue,
.badge--cyan,
.badge--emerald,
.badge--amber,
.badge--purple,
.badge--gray    { background: var(--bg-subtle); color: var(--ink-2); border: 1px solid var(--rule); }

/* Only "featured" stands out slightly */
.badge--featured { background: var(--accent-bg); color: var(--accent); border: 1px solid rgba(30, 58, 95, 0.15); }

/* Type badges: slight differentiation */
.badge--journal    { background: var(--green-bg); color: var(--green); border: 1px solid rgba(58,107,74,0.2); }
.badge--conference { background: var(--bg-subtle); color: var(--ink-2); border: 1px solid var(--rule); }
.badge--workshop   { background: var(--bg-subtle); color: var(--ink-3); border: 1px solid var(--rule); }
.badge--preprint   { background: var(--bg-subtle); color: var(--ink-3); border: 1px solid var(--rule); }

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  color: var(--ink-2);
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
  cursor: default;
}
.tag:hover { border-color: var(--rule-hi); color: var(--ink); }

/* ── 12. Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--r);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--sans);
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  text-decoration: none !important;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn--primary {
  background: var(--ink);
  color: var(--bg-white) !important;
  border-color: var(--ink);
}
.btn--primary:hover {
  background: #000;
  color: var(--bg-white) !important;
  border-color: #000;
}

.btn--outline {
  background: transparent;
  color: var(--ink) !important;
  border-color: var(--rule-hi);
}
.btn--outline:hover {
  border-color: var(--ink);
  color: var(--ink) !important;
}

.btn--ghost {
  background: transparent;
  color: var(--ink-2) !important;
  border-color: var(--rule);
  padding: 6px 14px;
  font-size: 0.78rem;
}
.btn--ghost:hover {
  border-color: var(--rule-hi);
  color: var(--ink) !important;
}

.btn--sm { padding: 6px 13px; font-size: 0.78rem; }

/* ── 13. Dividers & Ornaments ───────────────────────────── */
.rule-h {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* Two-column with divider */
.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

/* Award card */
.award-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 20px;
  align-items: baseline;
}
.award-item:first-child { border-top: 1px solid var(--rule); }

.award-item__year {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 2px;
}

.award-item__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.award-item__org {
  font-size: 0.84rem;
  color: var(--ink-3);
}

/* ── 14. Footer ─────────────────────────────────────────── */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--rule);
  padding: 48px 0;
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer__brand {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--ink-3);
  margin-top: 3px;
}

.footer__social { display: flex; gap: 4px; }

.footer__social a {
  width: 36px; height: 36px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3) !important;
  transition: color var(--dur) var(--ease);
}
.footer__social a:hover { color: var(--ink) !important; }
.footer__social svg { width: 16px; height: 16px; }

/* ── 15. Project Detail Pages ───────────────────────────── */
.project-hero {
  padding: calc(var(--nav-h) + 72px) 0 72px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--rule);
}

.project-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3) !important;
  margin-bottom: 36px;
  transition: color var(--dur) var(--ease), gap var(--dur) var(--ease);
}
.project-hero__back:hover { color: var(--accent) !important; gap: 10px; }

.project-hero__tags { margin-bottom: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.project-hero__title { margin-bottom: 20px; }
.project-hero__desc {
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 640px;
  line-height: 1.8;
  margin-bottom: 32px;
}
.project-hero__links { display: flex; gap: 12px; flex-wrap: wrap; }

.project-hero__meta {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  margin-top: 32px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 40px;
  margin-right: 40px;
  border-right: 1px solid var(--rule);
}
.meta-item:last-child { border-right: none; margin-right: 0; }

.meta-item__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.meta-item__value { font-size: 0.875rem; color: var(--ink-2); font-weight: 500; }

.project-fig {
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 36px 0;
}
.project-fig img { width: 100%; height: auto; border-radius: 0; }
.project-fig__caption {
  padding: 14px 20px;
  font-size: 0.82rem;
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
  font-style: italic;
}

.figs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 20px;
  margin: 32px 0;
}

.project-section {
  padding: 72px 0;
  border-bottom: 1px solid var(--rule);
}
.project-section:last-of-type { border-bottom: none; }
.project-section h2 { margin-bottom: 24px; }

.finding-list { display: flex; flex-direction: column; gap: 1px; margin-top: 20px; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }

.finding-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px 24px;
  background: var(--bg-white);
}
.finding-item:nth-child(even) { background: var(--bg-subtle); }

.finding-item__num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  padding-top: 2px;
  flex-shrink: 0;
  min-width: 24px;
}

.finding-item__text { font-size: 0.9rem; color: var(--ink-2); line-height: 1.65; }
.finding-item__text strong { color: var(--ink); font-weight: 600; }

.tech-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Citation block */
.citation-block {
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-2);
  line-height: 1.7;
  overflow-x: auto;
}

/* ── 16. Publications Page ──────────────────────────────── */
.pub-page-header {
  padding: calc(var(--nav-h) + 72px) 0 72px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--rule);
}

.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 48px;
}

.pub-filter-btn {
  padding: 6px 14px;
  border-radius: var(--r);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--sans);
  transition: all var(--dur) var(--ease);
}
.pub-filter-btn:hover { border-color: var(--rule-hi); color: var(--ink); }
.pub-filter-btn.active { background: var(--ink); color: var(--bg-white); border-color: var(--ink); }

.pub-year-group { margin-bottom: 48px; }

.pub-year-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
  display: inline-block;
}

.pub-list { display: flex; flex-direction: column; }

/* ── 17. Projects Gallery ───────────────────────────────── */
.projects-page-header {
  padding: calc(var(--nav-h) + 72px) 0 72px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--rule);
}

.projects-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 48px;
}

/* ── PaperMod-style horizontal project rows ─────────────── */

/* Replaces .grid-3 for projects — vertical list of rows */
.project-list {
  display: flex;
  flex-direction: column;
  /* hairline between rows */
  gap: 0;
}

.project-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--bg-white);
  overflow: hidden;
  margin-bottom: 16px;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.project-row:hover {
  border-color: var(--rule-hi);
  box-shadow: var(--shadow-sm);
}

/* Left image block — clicking navigates to detail */
.project-row__img {
  display: block;          /* <a> wrapping the img */
  width: 200px;
  height: 100%;
  min-height: 160px;
  background: var(--bg-subtle);
  overflow: hidden;
  border-right: 1px solid var(--rule);
  flex-shrink: 0;
  position: relative;
}
.project-row__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms var(--ease);
}
.project-row:hover .project-row__img img { transform: scale(1.03); }

/* Placeholder SVG icon when no image */
.project-row__img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rule-hi);
}
.project-row__img-placeholder svg { width: 44px; height: 44px; }

/* Right body */
.project-row__body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.project-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

/* Title is a plain <a> — inherits hover colour */
.project-row__title {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 6px;
  transition: color var(--dur) var(--ease);
}
.project-row__title:hover { color: var(--accent); }

.project-row__desc {
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.65;
  flex: 1;
}

.project-row__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Responsive: stack vertically on narrow screens */
@media (max-width: 680px) {
  .project-row {
    grid-template-columns: 1fr;
  }
  .project-row__img {
    width: 100%;
    height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
}

/* ── 18. Subtle Interactions ────────────────────────────── */
/* Entrance fade — very subtle, no upward movement */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pub-item, .project-card, .project-row, .timeline-item, .skill-group {
  animation: fadeIn 0.4s var(--ease) both;
}

/* ── 19. Responsive ─────────────────────────────────────── */
@media (max-width: 860px) {
  :root { --sec-v: 80px; }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 72px var(--pad-x);
  }
  .hero__inner > *:first-child { order: 2; }
  .hero__avatar { order: 1; width: 160px; height: 190px; align-self: start; }
  .hero__bio { max-width: 100%; }
  .hero__name { white-space: normal; }

  .cols-2 { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 680px) {
  :root { --sec-v: 64px; }

  .nav__links { display: none; }
  .nav__burger { display: flex; }

  .timeline { padding-left: 20px; }
  .timeline-item { padding-left: 18px; }
  .timeline-item::before { left: -4px; }

  .project-hero__meta { flex-direction: column; gap: 20px; }
  .meta-item { border-right: none; margin-right: 0; padding-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 16px; }
  .meta-item:last-child { border-bottom: none; }

  .footer__inner { flex-direction: column; align-items: flex-start; }

  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  h1 { font-size: 2.4rem; }
  .hero__name { font-size: 2.8rem; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
}
