/* ========================================
   Gopikrishna Deshpande — Academic Website
   Refined editorial academic aesthetic
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,300..900,0..100,0..1&family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ----- Design Tokens ----- */
:root {
  /* Surfaces */
  --bg: #faf7f2;
  --bg-paper: #ffffff;
  --bg-elevated: #f5f0e6;
  --bg-deep: #1a1d2e;

  /* Text */
  --text-primary: #1a1d2e;
  --text-secondary: #4a5266;
  --text-muted: #8b8f9a;
  --text-on-dark: #f5f0e6;
  --text-on-dark-muted: #a8adb8;

  /* Accent — scholarly burgundy */
  --accent: #7c2d3a;
  --accent-soft: #a14454;
  --accent-pale: #f4e8eb;

  /* Borders */
  --border: #e8e3d8;
  --border-strong: #c8c1b3;

  /* Type */
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* Layout */
  --max-w: 1200px;
  --max-w-prose: 720px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 8vw, 6rem);
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-soft); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 0;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 12px;
  margin-bottom: 3px;
}

/* ----- Layout ----- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container-narrow {
  max-width: 920px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

section { padding-top: var(--section-y); padding-bottom: var(--section-y); }

.section-divider {
  height: 1px;
  background: var(--border);
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ----- Header / Nav ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  font-variation-settings: 'opsz' 30;
}

.brand .brand-mark {
  color: var(--accent);
  font-style: italic;
  margin-right: 0.4rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

.menu-toggle {
  display: none;
  width: 32px;
  height: 32px;
  position: relative;
}
.menu-toggle span {
  position: absolute;
  left: 4px; right: 4px;
  height: 1.5px;
  background: var(--text-primary);
  transition: all 0.25s ease;
}
.menu-toggle span:nth-child(1) { top: 10px; }
.menu-toggle span:nth-child(2) { top: 16px; }
.menu-toggle span:nth-child(3) { top: 22px; }

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem var(--gutter);
    gap: 1.25rem;
    align-items: flex-start;
    transform: translateY(-110%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }
}

/* ----- Hero (Home) ----- */
.hero {
  padding-top: clamp(3rem, 8vw, 5rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(135deg, var(--accent-pale) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-strong);
  overflow: hidden;
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.hero-portrait .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 7rem);
  color: var(--accent);
  font-style: italic;
  opacity: 0.35;
  letter-spacing: -0.04em;
}

.hero-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}

.hero-content .eyebrow { margin-bottom: 1.5rem; }

.hero-name {
  font-size: clamp(2.5rem, 6.5vw, 4.5rem);
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'WONK' 0;
  line-height: 0.98;
  margin-bottom: 1.25rem;
}

.hero-name em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}

.hero-titles {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 1.75rem;
  line-height: 1.55;
  max-width: 540px;
}

.hero-titles strong {
  color: var(--text-primary);
  font-weight: 500;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 400;
}

.hero-meta a { color: var(--text-secondary); }
.hero-meta a:hover { color: var(--accent); }

.hero-meta-item { display: inline-flex; align-items: center; gap: 0.4rem; }

@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-portrait { max-width: 280px; aspect-ratio: 4 / 5; }
}

/* ----- Bio statement ----- */
.bio-statement {
  background: var(--bg-paper);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.bio-statement .container-narrow {
  position: relative;
}

.bio-quote-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 8rem;
  line-height: 0.6;
  color: var(--accent);
  opacity: 0.18;
  position: absolute;
  top: 1rem;
  left: calc(var(--gutter) - 1rem);
  pointer-events: none;
  user-select: none;
}

.bio-statement p {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.5;
  color: var(--text-primary);
  font-weight: 300;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  position: relative;
}

.bio-statement p + p { margin-top: 1.25rem; }
.bio-statement p em { color: var(--accent); font-style: italic; }

/* ----- Section heading ----- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}

.section-head h2 em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}

.section-head .section-link {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: all 0.2s ease;
}

.section-head .section-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ----- Metrics ----- */
.metrics {
  background: var(--bg-deep);
  color: var(--text-on-dark);
  position: relative;
  overflow: hidden;
}

.metrics::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top right, rgba(124, 45, 58, 0.18), transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(124, 45, 58, 0.08), transparent 50%);
  pointer-events: none;
}

.metrics .container { position: relative; z-index: 1; }

.metrics .eyebrow { color: var(--accent-soft); }
.metrics .eyebrow::before { background: var(--accent-soft); }

.metrics h2 { color: var(--text-on-dark); margin-bottom: 0.5rem; }
.metrics .metrics-subtitle {
  color: var(--text-on-dark-muted);
  font-size: 0.95rem;
  margin-bottom: 3rem;
}
.metrics .metrics-subtitle a {
  color: var(--text-on-dark);
  border-bottom: 1px solid rgba(245, 240, 230, 0.4);
  padding-bottom: 1px;
}
.metrics .metrics-subtitle a:hover { color: #fff; border-color: #fff; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid rgba(245, 240, 230, 0.15);
  border-left: 1px solid rgba(245, 240, 230, 0.15);
}

.metric {
  padding: 2.25rem 1.5rem;
  border-right: 1px solid rgba(245, 240, 230, 0.15);
  border-bottom: 1px solid rgba(245, 240, 230, 0.15);
}

.metric-value {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6vw, 4rem);
  font-weight: 300;
  line-height: 1;
  color: var(--text-on-dark);
  letter-spacing: -0.03em;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  margin-bottom: 0.5rem;
}

.metric-value sup {
  font-size: 0.45em;
  vertical-align: super;
  color: var(--accent-soft);
  font-style: italic;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-on-dark-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

@media (max-width: 768px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ----- Research focus cards ----- */
.focus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.focus-card {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  padding: 2.25rem;
  position: relative;
  transition: all 0.3s ease;
}

.focus-card::before {
  content: attr(data-num);
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.focus-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.focus-card h3 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1.25rem;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}

.focus-card h3 em {
  font-style: italic;
  color: var(--accent);
}

.focus-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.focus-list li {
  padding: 0.625rem 0;
  border-top: 1px dashed var(--border);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.focus-list li:first-child { border-top: none; }

@media (max-width: 768px) {
  .focus-grid { grid-template-columns: 1fr; }
}

/* ----- Recent publications (homepage) ----- */
.recent-pubs { background: var(--bg-paper); }

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

.pub-item {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.pub-item:last-child { border-bottom: 1px solid var(--border); }

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  padding-top: 0.15rem;
}

.pub-content { display: flex; flex-direction: column; gap: 0.5rem; }

.pub-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--text-primary);
  font-weight: 400;
  font-variation-settings: 'opsz' 30, 'SOFT' 30;
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.pub-authors strong { color: var(--text-primary); font-weight: 500; }

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.pub-venue .journal { color: var(--text-secondary); font-style: italic; }

@media (max-width: 640px) {
  .pub-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ----- Highlights / Media ----- */
.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.highlight-card {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  padding: 1.75rem;
  position: relative;
  transition: all 0.3s ease;
}

.highlight-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.highlight-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.highlight-card h4 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.highlight-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.highlight-card .highlight-source {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
  display: block;
}

@media (max-width: 768px) {
  .highlights { grid-template-columns: 1fr; }
}

/* ----- Subpage hero ----- */
.page-hero {
  padding-top: clamp(3rem, 6vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1;
  margin-bottom: 1rem;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}

.page-hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}

.page-hero .lede {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 720px;
  line-height: 1.5;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}

/* ----- Research page ----- */
.research-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border);
}

.research-section:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.research-label .eyebrow { margin-bottom: 1rem; display: block; }
.research-label h2 {
  font-size: 2rem;
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}
.research-label h2 em { font-style: italic; color: var(--accent); }

.research-body p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 640px;
}

.research-body ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 2rem;
  margin-top: 1.5rem;
}

.research-body ul li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

.research-body ul li::before {
  content: '◆';
  position: absolute;
  left: 0;
  top: 0.5rem;
  color: var(--accent);
  font-size: 0.6rem;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .research-section { grid-template-columns: 1fr; gap: 1.5rem; }
  .research-body ul { grid-template-columns: 1fr; }
}

/* ----- Funding ----- */
.funding-section { background: var(--bg-paper); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.funding-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.funding-item {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 200px 1fr 140px;
  gap: 2rem;
  align-items: start;
}

.funding-item:last-child { border-bottom: 1px solid var(--border); }

.funding-source {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.funding-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.4;
  font-variation-settings: 'opsz' 30, 'SOFT' 30;
  margin-bottom: 0.4rem;
}

.funding-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.funding-amount {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 400;
  text-align: right;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}

.funding-amount .role {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

@media (max-width: 768px) {
  .funding-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .funding-amount { text-align: left; font-size: 1rem; }
}

/* ----- Publications page ----- */
.pubs-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.pubs-search {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.pubs-search input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.pubs-search input:focus { border-color: var(--accent); }

.pubs-search::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--text-muted);
  border-radius: 50%;
  box-shadow: 6px 6px 0 -3px var(--bg-paper), 7px 7px 0 -2.5px var(--text-muted);
}

.pubs-filter {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pubs-filter button {
  padding: 0.55rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.pubs-filter button:hover { color: var(--text-primary); border-color: var(--text-primary); }

.pubs-filter button.active {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

.pubs-count {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.pub-section-head {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.pub-section-head:first-child { margin-top: 0; }

.pub-section-head .count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.pubs-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-display);
  font-size: 1.125rem;
}

/* ----- Teaching page ----- */
.courses-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.courses-table thead tr {
  border-bottom: 2px solid var(--text-primary);
}

.courses-table th {
  text-align: left;
  padding: 0.875rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.courses-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.courses-table tbody tr:hover { background: var(--bg-paper); }

.courses-table .course-code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

.courses-table .course-title {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 400;
  font-size: 1rem;
  font-variation-settings: 'opsz' 30, 'SOFT' 30;
}

.students-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

.students-block h3 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.students-block h3 .count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.student-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.student-list li {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: baseline;
}

.student-name {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 1rem;
  font-variation-settings: 'opsz' 30, 'SOFT' 30;
}

.student-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.student-position {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-basis: 100%;
  margin-top: 0.15rem;
  font-style: italic;
}

@media (max-width: 768px) {
  .students-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .courses-table { font-size: 0.85rem; }
  .courses-table th, .courses-table td { padding: 0.625rem 0.5rem; }
}

/* ----- CV page ----- */
.cv-toc {
  position: sticky;
  top: 90px;
  align-self: start;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.cv-toc h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.cv-toc ul { list-style: none; }
.cv-toc ul li { margin-bottom: 0.6rem; }
.cv-toc ul a {
  color: var(--text-secondary);
  border-left: 2px solid var(--border);
  padding-left: 0.875rem;
  display: block;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.cv-toc ul a:hover, .cv-toc ul a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.cv-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 4rem;
}

.cv-section {
  margin-bottom: 4rem;
  scroll-margin-top: 90px;
}

.cv-section h2 {
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}

.cv-section h2 em { font-style: italic; color: var(--accent); }

.cv-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.cv-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.cv-list .cv-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  letter-spacing: 0.03em;
  padding-top: 0.15rem;
}

.cv-list .cv-detail {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.cv-list .cv-detail strong { color: var(--text-primary); font-weight: 500; }
.cv-list .cv-detail .place { color: var(--text-muted); font-size: 0.85rem; display: block; margin-top: 0.15rem; }

.cv-prose p { margin-bottom: 0.875rem; color: var(--text-secondary); line-height: 1.65; max-width: 720px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .cv-layout { grid-template-columns: 1fr; gap: 2rem; }
  .cv-toc { position: static; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
  .cv-list li { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* ----- Awards / honors special block ----- */
.awards-list { list-style: none; display: flex; flex-direction: column; }
.awards-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.awards-list .award-year {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--accent);
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}
.awards-list .award-detail { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.55; }
.awards-list .award-detail strong { color: var(--text-primary); font-weight: 500; display: block; margin-bottom: 0.2rem; }

/* ----- Contact page ----- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-block {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-card h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.contact-card .contact-content {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--text-primary);
  line-height: 1.5;
  font-variation-settings: 'opsz' 30, 'SOFT' 30;
}

.contact-card .contact-content a { color: var(--text-primary); border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.contact-card .contact-content a:hover { color: var(--accent); }

.contact-content address { font-style: normal; }

.social-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.social-links a {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
  transition: all 0.2s ease;
  position: relative;
}

.social-links a:hover {
  color: var(--accent);
  padding-left: 0.75rem;
}

.social-links a .label {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-variation-settings: 'opsz' 30, 'SOFT' 30;
}

.social-links a .platform {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.social-links a:hover .platform { color: var(--accent); }

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ----- Footer ----- */
.site-footer {
  background: var(--bg-deep);
  color: var(--text-on-dark);
  padding: 3rem 0 2rem;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(245, 240, 230, 0.15);
  margin-bottom: 2rem;
}

.footer-brand .footer-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}
.footer-brand .footer-name em { font-style: italic; color: var(--accent-soft); }
.footer-brand p { color: var(--text-on-dark-muted); font-size: 0.9rem; line-height: 1.55; }

.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul a { color: var(--text-on-dark); font-size: 0.9rem; opacity: 0.85; }
.footer-col ul a:hover { color: #fff; opacity: 1; }

.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-on-dark-muted);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-base { flex-direction: column; align-items: flex-start; }
}

/* ----- Reveal animations ----- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* ----- Print ----- */
@media print {
  .site-header, .site-footer, .pubs-controls, .cv-toc { display: none; }
  body { background: white; color: black; }
  .cv-layout { grid-template-columns: 1fr; }
  a { color: black; text-decoration: underline; }
}
