/* ==========================================================================
   Anmol — Computational Chemistry Research
   Nature-journal inspired design system
   
   Type scale: Perfect Fourth (1.333)
   Spacing: Strict 8px grid
   Palette: Nature red + academic neutrals
   ========================================================================== */

/* -------------------------------------------------------------------------
   § TOKENS
   ------------------------------------------------------------------------- */
:root {
  /* ---- Fonts ---- */
  --f-display: 'Newsreader', 'Noto Serif Devanagari', Georgia, 'Times New Roman', serif;
  --f-body:    'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* ---- Perfect Fourth scale (1.333×) ---- */
  --fs-xs:   0.75rem;    /* 12px */
  --fs-sm:   0.875rem;   /* 14px */
  --fs-base: 1rem;       /* 16px */
  --fs-md:   1.125rem;   /* 18px – body reading */
  --fs-lg:   1.25rem;    /* 20px */
  --fs-xl:   1.5rem;     /* 24px */
  --fs-2xl:  2rem;       /* 32px */
  --fs-3xl:  2.5rem;     /* 40px */
  --fs-4xl:  3rem;       /* 48px */

  /* ---- 8px spacing grid ---- */
  --s-1:  0.25rem;  /*  4px  (half-step) */
  --s-2:  0.5rem;   /*  8px */
  --s-3:  1rem;     /* 16px */
  --s-4:  1.5rem;   /* 24px */
  --s-5:  2rem;     /* 32px */
  --s-6:  2.5rem;   /* 40px */
  --s-7:  3rem;     /* 48px */
  --s-8:  4rem;     /* 64px */
  --s-9:  5rem;     /* 80px */
  --s-10: 6rem;     /* 96px */
  --s-12: 8rem;     /* 128px */

  /* ---- Layout ---- */
  --max-w:      1080px;
  --max-w-wide: 1200px;
  --max-prose:  65ch;
  --gutter:     var(--s-4);     /* 24px */
  --r:          6px;            /* border-radius */
  --r-lg:       10px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur:  0.15s;

  /* ---- Navbar ---- */
  --nav-h:       56px;
  --nav-h-small: 48px;
}

/* -------------------------------------------------------------------------
   § DARK THEME  (default)
   All text colours verified WCAG AA against --bg
   ------------------------------------------------------------------------- */
:root,
[data-theme="dark"] {
  --bg:        #0e1016;
  --bg-raised: #161922;
  --bg-card:   #1a1e2c;
  --bg-card-h: #21263a;
  --bg-inset:  #13151e;
  --bg-nav:    rgba(14,16,22,.92);

  --border:    rgba(255,255,255,.07);
  --border-h:  rgba(255,255,255,.13);

  --fg:   #e6e6ec;   /* 15.3:1 ✓ */
  --fg-2: #a1a1b5;   /*  7.4:1 ✓ */
  --fg-3: #7e7e96;   /*  4.6:1 AA ✓ */

  --accent:      #c0392b;
  --accent-h:    #e74c3c;
  --accent-sub:  rgba(192,57,43,.12);
  --accent-ring: rgba(192,57,43,.40);

  --link:   #6ea8fe;  /* 8.5:1 ✓ */
  --link-h: #9ec5fe;

  --tag-bg:     rgba(110,168,254,.10);
  --tag-fg:     #7ab0ff;
  --tag-border: rgba(110,168,254,.18);

  --footer-bg: #0a0b10;
  --shadow:    0 1px 3px rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.18);
  --shadow-nav:0 1px 3px rgba(0,0,0,.50);
}

/* -------------------------------------------------------------------------
   § LIGHT THEME
   ------------------------------------------------------------------------- */
[data-theme="light"] {
  --bg:        #fafbfc;
  --bg-raised: #ffffff;
  --bg-card:   #ffffff;
  --bg-card-h: #f6f7fa;
  --bg-inset:  #f0f2f5;
  --bg-nav:    rgba(250,251,252,.94);

  --border:    rgba(0,0,0,.08);
  --border-h:  rgba(0,0,0,.14);

  --fg:   #1a1d2e;
  --fg-2: #4a4d62;
  --fg-3: #6b6e82;

  --accent:      #b71c1c;
  --accent-h:    #d32f2f;
  --accent-sub:  rgba(183,28,28,.06);
  --accent-ring: rgba(183,28,28,.28);

  --link:   #1a56db;
  --link-h: #1347c2;

  --tag-bg:     rgba(26,86,219,.06);
  --tag-fg:     #1a56db;
  --tag-border: rgba(26,86,219,.14);

  --footer-bg: #eef0f4;
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.03);
  --shadow-nav:0 1px 3px rgba(0,0,0,.06);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: 1.625;              /* 16×1.625 = 26px ≈ 3.25×8 */
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background .3s var(--ease), color .3s var(--ease);
}

img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--link); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--link-h); }

/* -------------------------------------------------------------------------
   § ACCESSIBILITY
   ------------------------------------------------------------------------- */
.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;
}

.skip-link {
  position: absolute; top: -100%; left: var(--s-3);
  background: var(--accent); color: #fff;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r); font-size: var(--fs-sm);
  font-weight: 600; z-index: 9999; text-decoration: none;
}
.skip-link:focus {
  top: var(--s-2); outline: 2px solid #fff; outline-offset: 2px; color: #fff;
}

:focus-visible  { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }
::selection     { background: var(--accent); color: #fff; }

/* -------------------------------------------------------------------------
   § LAYOUT
   ------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main.container { padding-bottom: var(--s-9); }  /* 80px breathing room before footer */

.container-narrow {
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* -------------------------------------------------------------------------
   § TYPOGRAPHY  —  vertical rhythm via explicit line-heights + margins
   All margin-bottom values are multiples of 8px.
   ------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: var(--fg);
  font-weight: 700;
  letter-spacing: -.015em;
}

h1 {
  font-size: var(--fs-4xl);       /* 48px */
  line-height: 1.125;             /* 54 ≈ 56 = 7×8 */
  letter-spacing: -.025em;
  margin-bottom: var(--s-4);      /* 24 */
}
h2 {
  font-size: var(--fs-2xl);       /* 32px */
  line-height: 1.25;              /* 40 = 5×8 */
  font-weight: 600;
  margin-bottom: var(--s-3);      /* 16 */
}
h3 {
  font-size: var(--fs-lg);        /* 20px */
  line-height: 1.4;               /* 28 ≈ 3.5×8 */
  font-weight: 600;
  margin-bottom: var(--s-2);      /* 8 */
}
h4 {
  font-size: var(--fs-md);        /* 18px */
  line-height: 1.333;             /* 24 = 3×8 */
  font-weight: 600;
  margin-bottom: var(--s-2);      /* 8 */
}

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

/* Justified prose — long-form reading text only */
.bio-text,
.research-area > p,
.project-description {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* -------------------------------------------------------------------------
   § NAVBAR
   ------------------------------------------------------------------------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: height var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

/* Blur only on pointer devices for perf */
@media (hover: hover) {
  .navbar { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}

.navbar.scrolled { height: var(--nav-h-small); box-shadow: var(--shadow-nav); }

.nav-inner {
  max-width: var(--max-w-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
}

.nav-brand {
  font-family: var(--f-display);
  font-size: var(--fs-lg);
  font-weight: 700; color: var(--fg);
  text-decoration: none; letter-spacing: -.02em; flex-shrink: 0;
}
.nav-brand:hover { color: var(--accent); }

.nav-links {
  display: flex; align-items: center;
  gap: var(--s-1); list-style: none;
}
.nav-links li { position: relative; }
.nav-links a {
  display: flex; align-items: center;
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-sm); font-weight: 500;
  color: var(--fg-2); text-decoration: none;
  border-radius: var(--r);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
  white-space: nowrap; min-height: 36px;
}
.nav-links a:hover { color: var(--fg); background: var(--accent-sub); }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.nav-links a.active::after {
  content: ''; position: absolute;
  bottom: 0; left: var(--s-3); right: var(--s-3);
  height: 2px; background: var(--accent); border-radius: 1px;
}

.nav-right { display: flex; align-items: center; gap: var(--s-2); flex-shrink: 0; }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: transparent; color: var(--fg-2);
  cursor: pointer; font-size: var(--fs-sm);
  transition: all var(--dur) var(--ease);
}
.theme-toggle:hover { color: var(--fg); border-color: var(--border-h); background: var(--accent-sub); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Hamburger – 44px touch target */
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: none; background: transparent; cursor: pointer;
  color: var(--fg); border-radius: var(--r);
  -webkit-tap-highlight-color: transparent;
}
.hamburger { display: flex; flex-direction: column; gap: 5px; width: 18px; }
.hamburger span {
  display: block; width: 100%; height: 2px;
  background: currentColor; border-radius: 1px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -------------------------------------------------------------------------
   § PAGE HEADER
   ------------------------------------------------------------------------- */
.page-header {
  padding-top: calc(var(--nav-h) + var(--s-8));   /* 56+64=120 */
  padding-bottom: var(--s-7);                       /* 48 */
  text-align: center;
}
.page-header h1 { margin-bottom: var(--s-3); }
.page-header .subtitle {
  font-size: var(--fs-md); color: var(--fg-2);
  max-width: 56ch; margin-inline: auto; line-height: 1.6;
}
.page-header .badge {
  display: inline-block; font-family: var(--f-body);
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); margin-bottom: var(--s-4);
}

/* -------------------------------------------------------------------------
   § HERO  (index.html only)
   ------------------------------------------------------------------------- */
.hero {
  min-height: 88vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: var(--s-12) var(--gutter) var(--s-8);
}
.hero-inner { max-width: 660px; }
.hero .badge {
  display: inline-block; font-family: var(--f-body);
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); margin-bottom: var(--s-5);
}
.hero h1 {
  font-size: clamp(var(--fs-2xl), 5vw, var(--fs-4xl));
  margin-bottom: var(--s-4);
}
.hero-subtitle {
  font-size: var(--fs-md); color: var(--fg-2);
  margin-bottom: var(--s-6); line-height: 1.65;
}
.hero-cta { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }

/* -------------------------------------------------------------------------
   § BUTTONS  —  all padding on 8px grid, 44px min touch
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4);                  /* 8 24 */
  font-family: var(--f-body); font-size: var(--fs-sm);
  font-weight: 600; line-height: 1.4;
  border-radius: var(--r); text-decoration: none;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
  white-space: nowrap; min-height: 44px;
}
.btn i { font-size: .85em; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); color: #fff; }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border-h); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-sub); }
.btn-sm { padding: var(--s-1) var(--s-3); font-size: var(--fs-xs); min-height: 32px; }

/* -------------------------------------------------------------------------
   § ABOUT / PROFILE  (index)
   ------------------------------------------------------------------------- */
.about-section { padding-block: var(--s-9); }
.about-grid { display: grid; grid-template-columns: 260px 1fr; gap: var(--s-8); align-items: start; }
.profile-card { text-align: center; position: sticky; top: calc(var(--nav-h-small) + var(--s-4)); }
.profile-photo {
  width: 148px; height: 148px; border-radius: 50%;
  object-fit: cover; margin: 0 auto var(--s-4);
  border: 2px solid var(--border);
}
.profile-name { font-family: var(--f-display); font-size: var(--fs-xl); font-weight: 700; margin-bottom: var(--s-1); line-height: 1.3; }
.profile-role  { font-size: var(--fs-sm); color: var(--accent); font-weight: 500; margin-bottom: var(--s-2); }
.profile-institution {
  font-size: var(--fs-xs); color: var(--fg-3);
  display: flex; align-items: center; justify-content: center;
  gap: var(--s-2); margin-bottom: var(--s-4); line-height: 1.4;
}
.profile-institution img { width: 20px; height: 20px; flex-shrink: 0; }
[data-theme="dark"] .profile-institution img { filter: brightness(0) invert(1); }

.social-links { display: flex; justify-content: center; gap: var(--s-2); }
.social-link {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r);
  border: 1px solid var(--border); color: var(--fg-2);
  text-decoration: none; transition: all var(--dur) var(--ease);
}
.social-link:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-sub); }

.bio-content h2 { margin-bottom: var(--s-4); }
.tags { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-5); }
.tag {
  font-size: var(--fs-xs); font-weight: 500;
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r); line-height: 1.4;
  background: var(--tag-bg); color: var(--tag-fg); border: 1px solid var(--tag-border);
}
.bio-text {
  font-size: var(--fs-md);          /* 18px reading size */
  line-height: 1.778;               /* 18×1.778 = 32px = 4×8 ✓ */
  color: var(--fg-2);
  margin-bottom: var(--s-4);        /* 24 */
  max-width: 68ch;
}
.bio-text:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------------------
   § SECTIONS  —  simple rule-top, centred header
   ------------------------------------------------------------------------- */
.section {
  padding-block: var(--s-8);           /* 64 top & bottom */
  border-top: 1px solid var(--border);
}
.section-header { text-align: center; margin-bottom: var(--s-6); }
.section-header h2 { margin-bottom: var(--s-2); }
.section-rule {
  width: 40px; height: 2px; background: var(--accent);
  margin: var(--s-3) auto 0; border: none;
}

/* -------------------------------------------------------------------------
   § CARDS  —  applied selectively for editorial feel
   Only interactive content cards get full card treatment.
   CV items, stats, controls use lighter styling.
   ------------------------------------------------------------------------- */
.research-card,
.pub-card,
.publication-card,
.highlight-card,
.research-area,
.contact-card,
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.research-card:hover, .pub-card:hover,
.publication-card:hover, .highlight-card:hover {
  box-shadow: var(--shadow); border-color: var(--border-h);
}

/* --- Research cards (index) --- */
.research-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
.research-card { overflow: hidden; }
.research-card-img { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-inset); }
.research-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.research-card:hover .research-card-img img { transform: scale(1.03); }
.research-card-body { padding: var(--s-4); }
.research-card-body h3 { font-size: var(--fs-md); margin-bottom: var(--s-2); }
.research-card-body p  { font-size: var(--fs-sm); line-height: 1.65; }

/* --- Pub cards (index) --- */
.pub-card { padding: var(--s-4) var(--s-5); margin-bottom: var(--s-3); }
.pub-card:last-child { margin-bottom: 0; }
.pub-card h3 { font-size: var(--fs-md); line-height: 1.4; margin-bottom: var(--s-2); }
.pub-authors { font-size: var(--fs-sm); color: var(--accent); font-weight: 500; margin-bottom: var(--s-2); }
.pub-meta { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.pub-journal { font-size: var(--fs-sm); color: var(--fg-3); display: flex; align-items: center; gap: var(--s-2); }
.pub-journal i { font-size: .8em; }

/* -------------------------------------------------------------------------
   § RESEARCH PAGE
   ------------------------------------------------------------------------- */
.research-area { padding: var(--s-6) var(--s-6); margin-bottom: var(--s-7); }
.research-area:last-of-type { margin-bottom: 0; }
.research-area > h2 {
  font-size: var(--fs-xl);      /* 24px — clearly subordinate to page h1 */
  margin-bottom: var(--s-5); padding-bottom: var(--s-3);
  border-bottom: 2px solid var(--accent); display: inline-block;
}
.research-area > p {
  font-size: var(--fs-md); line-height: 1.778;
  max-width: 68ch; color: var(--fg-2); margin-bottom: var(--s-5);
}

.project-card {
  border-left: 3px solid var(--accent);
  background: transparent;
  border-radius: 0;
  padding: var(--s-4) 0 var(--s-4) var(--s-5); margin-top: var(--s-5);
}
.project-card h3 { font-size: var(--fs-lg); margin-bottom: var(--s-2); }  /* 20px */
.project-meta {
  display: flex; align-items: center; gap: var(--s-3);
  font-size: var(--fs-sm); color: var(--fg-3); margin-bottom: var(--s-4);
}
.project-meta i { color: var(--accent); }
.project-description {
  font-size: var(--fs-md); line-height: 1.778;    /* match bio reading size */
  color: var(--fg-2); max-width: 68ch;
}
.project-description + .project-description { margin-top: var(--s-4); }

/* Highlights */
.highlights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-4); }
.highlight-card { padding: var(--s-4) var(--s-5); display: flex; gap: var(--s-4); align-items: flex-start; }
.highlight-icon {
  flex-shrink: 0; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r); background: var(--accent-sub); color: var(--accent);
  font-size: var(--fs-xl);
}
.highlight-content h3 { font-size: var(--fs-base); font-weight: 600; margin-bottom: var(--s-1); }
.highlight-content p  { font-size: var(--fs-sm); line-height: 1.65; }

/* -------------------------------------------------------------------------
   § PUBLICATIONS PAGE
   ------------------------------------------------------------------------- */
.stats-row { display: flex; justify-content: center; gap: var(--s-4); flex-wrap: wrap; margin-top: var(--s-5); }
.stat-item { text-align: center; padding: var(--s-3) var(--s-5); }
.stat-number { font-family: var(--f-display); font-size: var(--fs-2xl); font-weight: 700; color: var(--accent); display: block; line-height: 1.25; }
.stat-label { font-size: var(--fs-xs); color: var(--fg-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-top: var(--s-1); display: block; }

.controls-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-6);
  background: var(--bg-inset); border-radius: var(--r-lg); border: 1px solid var(--border);
}
.filter-group { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.filter-label { font-size: var(--fs-sm); font-weight: 600; color: var(--fg-2); display: flex; align-items: center; gap: var(--s-2); }
.filter-btn {
  font-family: var(--f-body); font-size: var(--fs-sm); font-weight: 500;
  padding: var(--s-2) var(--s-3); border-radius: var(--r);
  border: 1px solid var(--border); background: transparent;
  color: var(--fg-2); cursor: pointer;
  transition: all var(--dur) var(--ease); min-height: 44px;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-sub); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.scholar-link { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); font-weight: 600; color: var(--link); min-height: 44px; }
.scholar-link:hover { color: var(--link-h); }

.year-section { margin-bottom: var(--s-6); }
.year-section:last-child { margin-bottom: 0; }
.year-header {
  display: flex; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-4);
  position: sticky; top: var(--nav-h-small);
  background: var(--bg); padding: var(--s-2) 0; z-index: 10;
}
.year-title { font-family: var(--f-display); font-size: var(--fs-xl); font-weight: 700; flex-shrink: 0; line-height: 1.3; }
.year-line  { flex: 1; height: 1px; background: var(--border); }
.year-count { font-size: var(--fs-xs); color: var(--fg-3); white-space: nowrap; font-weight: 500; }

.publication-card { padding: var(--s-4) var(--s-5); margin-bottom: var(--s-3); }
.publication-card:last-child { margin-bottom: 0; }
.publication-type {
  display: inline-block; font-size: .6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: var(--s-1) var(--s-2); border-radius: 3px;
  margin-bottom: var(--s-2); line-height: 1.4;
}
.publication-type.journal  { background: var(--accent-sub); color: var(--accent); }
.publication-type.preprint { background: rgba(217,164,6,.10); color: #b8860b; }
[data-theme="dark"] .publication-type.preprint { background: rgba(250,204,21,.12); color: #fbbf24; }

.publication-title { font-family: var(--f-display); font-size: var(--fs-md); font-weight: 600; line-height: 1.4; margin-bottom: var(--s-2); color: var(--fg); }
.publication-authors { font-size: var(--fs-sm); color: var(--accent); font-weight: 500; font-style: italic; margin-bottom: var(--s-2); }
.publication-venue { font-size: var(--fs-sm); color: var(--fg-3); display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.publication-venue i { font-size: .8em; }
.publication-links { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3); }
.publication-link {
  display: inline-flex; align-items: center; gap: var(--s-1);
  font-size: var(--fs-xs); font-weight: 600;
  padding: var(--s-1) var(--s-3); border-radius: var(--r);
  border: 1px solid var(--border); color: var(--fg-2);
  transition: all var(--dur) var(--ease); min-height: 32px; text-decoration: none;
}
.publication-link:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-sub); }
.publication-tags { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.publication-tag {
  font-size: var(--fs-xs); font-weight: 500; padding: var(--s-1) var(--s-2);
  border-radius: var(--r); background: var(--tag-bg); color: var(--tag-fg);
  border: 1px solid var(--tag-border); line-height: 1.4;
}
.empty-state { text-align: center; padding: var(--s-9) var(--gutter); color: var(--fg-3); display: none; }
.empty-state i { font-size: var(--fs-2xl); margin-bottom: var(--s-3); display: block; opacity: .4; }

/* -------------------------------------------------------------------------
   § CV PAGE
   ------------------------------------------------------------------------- */
.cv-section { margin-bottom: var(--s-7); }
.cv-section:last-child { margin-bottom: 0; }
.cv-section > h2 { margin-bottom: var(--s-4); padding-bottom: var(--s-2); border-bottom: 2px solid var(--accent); display: inline-block; }

.cv-item {
  padding: var(--s-4) var(--s-5);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  margin-bottom: var(--s-3);
  transition: background var(--dur) var(--ease);
}
.cv-item:last-child { margin-bottom: 0; }
.cv-item:hover { background: var(--bg-card-h); }
.cv-item h3 { font-size: var(--fs-base); font-weight: 600; margin-bottom: var(--s-1); line-height: 1.4; }
.cv-item-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2); font-size: var(--fs-sm); color: var(--fg-3); margin-bottom: var(--s-2); }
.cv-item p { font-size: var(--fs-sm); line-height: 1.65; color: var(--fg-2); }
.skills-list { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.skill-tag {
  font-size: var(--fs-xs); font-weight: 500; padding: var(--s-1) var(--s-2);
  border-radius: var(--r); background: var(--tag-bg); color: var(--tag-fg);
  border: 1px solid var(--tag-border); line-height: 1.4;
}

/* -------------------------------------------------------------------------
   § CONTACT PAGE
   ------------------------------------------------------------------------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); margin-bottom: var(--s-7); }
.contact-card { padding: var(--s-5) var(--s-6); }
.contact-card h3 { margin-bottom: var(--s-5); }
.contact-item { display: flex; gap: var(--s-3); margin-bottom: var(--s-4); align-items: flex-start; }
.contact-item:last-child { margin-bottom: 0; }
.contact-icon {
  width: 40px; height: 40px; border-radius: var(--r);
  background: var(--accent-sub);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0; margin-top: 2px;
}
.contact-details h4 { font-size: var(--fs-sm); font-weight: 600; color: var(--fg); margin-bottom: 0; line-height: 1.4; }
.contact-details p, .contact-details a { font-size: var(--fs-sm); color: var(--fg-2); text-decoration: none; line-height: 1.6; }
.contact-details a:hover { color: var(--accent); }

.contact-form { padding: var(--s-5) var(--s-6); }
.contact-form h3 { margin-bottom: var(--s-5); }
.form-group { margin-bottom: var(--s-4); }
.form-group label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--fg); margin-bottom: var(--s-2); }
.form-control {
  width: 100%; padding: var(--s-2) var(--s-3);
  font-family: var(--f-body); font-size: var(--fs-base); line-height: 1.5;
  color: var(--fg); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.form-control::placeholder { color: var(--fg-3); }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
textarea.form-control { min-height: 128px; resize: vertical; }

.map-section { margin-bottom: var(--s-7); text-align: center; }
.map-section h2 { margin-bottom: var(--s-4); }
.map-frame { width: 100%; height: 344px; border: 1px solid var(--border); border-radius: var(--r-lg); }

/* -------------------------------------------------------------------------
   § FOOTER
   ------------------------------------------------------------------------- */
.footer {
  background: var(--footer-bg); border-top: 1px solid var(--border);
  padding: var(--s-7) var(--gutter) var(--s-5);
}
.footer-grid {
  max-width: var(--max-w); margin: 0 auto var(--s-5);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5);
}
.footer-section h3 {
  font-family: var(--f-body); font-size: var(--fs-xs); font-weight: 700;
  color: var(--fg-2); margin-bottom: var(--s-2);
  text-transform: uppercase; letter-spacing: .08em;
}
.footer-section p, .footer-section a { font-size: var(--fs-sm); color: var(--fg-3); text-decoration: none; line-height: 1.7; }
.footer-section a:hover { color: var(--accent); }
.copyright {
  max-width: var(--max-w); margin-inline: auto;
  border-top: 1px solid var(--border); padding-top: var(--s-4);
  text-align: center; font-size: var(--fs-xs); color: var(--fg-3);
}

/* -------------------------------------------------------------------------
   § RESPONSIVE
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .profile-card { position: static; }
  .contact-layout { grid-template-columns: 1fr; }
  .highlights-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  :root { --gutter: var(--s-3); }
  h1 { font-size: var(--fs-2xl); line-height: 1.2; }
  h2 { font-size: var(--fs-xl); line-height: 1.3; }

  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-raised); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: var(--s-2) 0;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: var(--s-3) var(--gutter); min-height: 48px; width: 100%; border-radius: 0; }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { background: var(--accent-sub); }
  .nav-toggle { display: flex; }

  .page-header { padding-top: calc(var(--nav-h) + var(--s-6)); padding-bottom: var(--s-5); }
  .hero { min-height: auto; padding: calc(var(--nav-h) + var(--s-7)) var(--gutter) var(--s-7); }

  .research-grid { grid-template-columns: 1fr; }
  .research-area { padding: var(--s-4); }
  .project-card { padding: var(--s-3) var(--s-4); }
  .cv-item { padding: var(--s-3) var(--s-4); }
  .contact-card, .contact-form { padding: var(--s-4); }
  .publication-card { padding: var(--s-3) var(--s-4); }
  .controls-bar { flex-direction: column; align-items: stretch; }
  .stats-row { gap: var(--s-2); }
  .stat-item { padding: var(--s-2) var(--s-3); min-width: 96px; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--s-4); }
}

@media (max-width: 400px) {
  .hero-cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
}

/* -------------------------------------------------------------------------
   § PRINT
   ------------------------------------------------------------------------- */
@media print {
  .navbar, .nav-toggle, .theme-toggle, .hero-cta, .map-section { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .container, .container-narrow { max-width: 100%; padding: 0; }
  a { color: #000; text-decoration: underline; }
  .section { border-top: 1px solid #ccc; page-break-inside: avoid; }
}
