/*
  Academic Portfolio — Jesús M. Rodríguez-de-Vera
  Aesthetic: Editorial Serif — the warmth of printed research, alive on screen
  Fonts: Cormorant Garamond (headings) · Source Serif 4 (body) · JetBrains Mono (labels)
*/

/* ── Tokens ─────────────────────────────────────────── */
:root {
  /* Light palette */
  --bg:           #ffffff;
  --bg-tint:      #f8f9fa;
  --surface:      #ffffff;
  --border:       #dee2e6;
  --border-faint: #e9ecef;
  /* Grays chosen to keep ≥4.5:1 contrast on both --bg and --bg-tint */
  --text:         #212529;
  --text-2:       #495057;
  --text-3:       #697279;
  --accent:       #1a6b6b;
  --accent-hi:    #1f8282;
  --accent-bg:    rgba(26,107,107,.08);
  --accent-rim:   rgba(26,107,107,.2);
  --nav-bg:       rgba(255,255,255,.92);

  /* Typography */
  --f-display: 'Cormorant Garamond', 'Palatino Linotype', Georgia, serif;
  --f-body:    'Source Serif 4', Georgia, serif;
  --f-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Scale */
  --w:         1060px;
  --nav-h:     58px;

  --tr: 0.22s ease;
}

[data-theme="dark"] {
  --bg:           #1d1d1d;
  --bg-tint:      #252525;
  --surface:      #222222;
  --border:       #3d3d3d;
  --border-faint: #333333;
  --text:         #ffffff;
  --text-2:       #b0b7c3;
  --text-3:       #8a939c;
  --accent:       #4ecece;
  --accent-hi:    #6edcdc;
  --accent-bg:    rgba(78,206,206,.1);
  --accent-rim:   rgba(78,206,206,.25);
  --nav-bg:       rgba(29,29,29,.92);
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
}

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background var(--tr), color var(--tr);
}

::selection {
  background: var(--accent);
  color: #fff;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--tr);
}
a:hover { color: var(--accent-hi); }

strong { font-weight: 600; }

/* ── Skip link ──────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 300;
  background: var(--accent);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
}
.skip-link:focus {
  top: 0;
  color: #fff;
}

/* ── Navigation ─────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--tr), background var(--tr);
}

#navbar.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-brand {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand .dot       { color: var(--border); }
.nav-brand .accent-dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.6rem;
  margin-left: auto;
}

.nav-link {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  position: relative;
  transition: color var(--tr);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.18s ease;
}
.nav-link:hover       { color: var(--text); }
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }
.nav-link.active      { color: var(--text); }

/* Theme toggle */
#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  flex-shrink: 0;
  transition: border-color var(--tr), color var(--tr), transform 0.25s;
}
#theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(18deg);
}
#theme-toggle svg { width: 14px; height: 14px; }

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* Burger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.2s;
}

/* Mobile nav */
.mobile-nav {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 190;
  padding: calc(var(--nav-h) + 3rem) 2.5rem 2.5rem;
  gap: 1.75rem;
  visibility: hidden;
  transform: translateY(-8px);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.mobile-nav.open {
  visibility: visible;
  transform: translateY(0);
  opacity: 1;
}
.mobile-nav a {
  font-family: var(--f-display);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-faint);
  padding-bottom: 1rem;
  transition: color var(--tr);
}
.mobile-nav a:hover { color: var(--accent); }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 4rem) 1.5rem 3rem;
  position: relative;
}

/* Noise grain texture */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 1;
  pointer-events: none;
}

.hero-inner {
  max-width: var(--w);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3.5rem;
  align-items: start;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-name {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}
.name-first { display: block; }
.name-last  {
  display: block;
  white-space: nowrap;
  font-style: normal;
  color: var(--text-2);
}
.name-last em { font-style: italic; }
.hy {
  font-family: var(--f-body);
  font-style: normal;
}

.hero-affil {
  font-size: 0.92rem;
  color: var(--text-2);
  margin-bottom: 1.25rem;
  line-height: 1.65;
}
.hero-affil em { font-style: italic; }

.hero-bio {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.75;
  max-width: 48ch;
  margin-bottom: 2rem;
}

/* Social pills */
.hero-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  text-decoration: none;
  transition: all var(--tr);
}
.social-pill svg { width: 11px; height: 11px; flex-shrink: 0; }
.social-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* Per-platform brand colours */
.social-pill--linkedin:hover { border-color: #0077b5; color: #0077b5; background: rgba(0,119,181,.08); }
.social-pill--scholar:hover  { border-color: #4285f4; color: #4285f4; background: rgba(66,133,244,.08); }
.social-pill--github:hover   { border-color: #24292e; color: #24292e; background: rgba(36,41,46,.08); }
.social-pill--orcid:hover       { border-color: #a6ce39; color: #a6ce39; background: rgba(166,206,57,.10); }
.social-pill--huggingface:hover { border-color: #ff9d00; color: #ff9d00; background: rgba(255,157,0,.08); }

[data-theme="dark"] .social-pill--github:hover {
  border-color: #e6edf3;
  color: #e6edf3;
  background: rgba(230,237,243,.08);
}

/* CV download button */
.hero-cta { margin-top: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.55rem; }
.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-rim);
  padding: 0.45rem 1.1rem;
  border-radius: 99px;
  text-decoration: none;
  transition: all var(--tr);
}
.cv-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.cv-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cv-btn--email {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.cv-btn--email:hover {
  background: var(--bg-tint);
  border-color: var(--text-2);
  color: var(--text);
}

/* Portrait */
.hero-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding-top: 1.5rem;
}

.portrait-frame {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  outline: 1px solid var(--accent);
  outline-offset: 6px;
  transition: outline-color var(--tr);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  display: block;
}

.portrait-caption {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Hero aside — sidebar stat lines below portrait caption */
.hero-aside {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}
.hero-aside-rule {
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
  opacity: 0.45;
  border: none;
  margin: 0;
}
.hero-aside-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: center;
}
.hero-aside-items li {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.4;
}

/* Scroll hint */
.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-3);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: bounce 2s ease-in-out infinite;
  transition: color var(--tr);
}
.hero-scroll:hover { color: var(--accent); }
.hero-scroll svg { width: 20px; height: 20px; }

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(5px); }
}

/* ── Sections ───────────────────────────────────────── */
.section {
  padding: 5rem 1.5rem;
  border-top: 1px solid var(--border);
}
.section-tinted   { background: var(--bg-tint); }
.section-featured { padding-top: 3rem; padding-bottom: 3rem; }

.section-inner {
  max-width: var(--w);
  margin: 0 auto;
}

.section-label {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.section-heading {
  font-family: var(--f-display);
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 2.5rem;
}

/* ── About grid ─────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3.5rem;
  row-gap: 1.25rem;
  align-items: start;
}

.about-right {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.lead {
  font-size: 1.02rem;
  line-height: 1.8;
  margin-bottom: 1rem;
  color: var(--text);
}
.lead em { font-style: italic; color: var(--text-2); }

.body-text {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.tag-row-label {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.7rem;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.tag {
  font-family: var(--f-mono);
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-rim);
  padding: 0.28rem 0.7rem;
  border-radius: 99px;
}

/* Timeline */
.timeline-head {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.25rem;
}

.timeline {
  list-style: none;
  padding-left: 1.5rem;
  position: relative;
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.tl-item {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  gap: 0.75rem;
  margin-bottom: 1.6rem;
  position: relative;
}
.tl-item:last-child {
  margin-bottom: 0;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.52rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-2px);
}

.tl-year {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  color: var(--accent);
  padding-top: 0.1rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tl-degree { font-size: 0.88rem; font-weight: 500; color: var(--text); margin-bottom: 0.15rem; }
.tl-inst   { font-size: 0.8rem; color: var(--text-2); }
.tl-note   { font-size: 0.75rem; color: var(--text-3); font-style: italic; margin-top: 0.15rem; }

/* ── Ruled list (news / service / teaching) ─────────── */
.ruled-list { list-style: none; }

.ruled-item {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border-faint);
  align-items: baseline;
}
.ruled-item:first-child { border-top: 1px solid var(--border-faint); }

.ruled-date {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 0.05rem;
}

.ruled-body {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.65;
}
.ruled-body strong { color: var(--text); font-weight: 600; }
.ruled-body em     { color: var(--text-3); }
.ruled-sub {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 0.15rem;
}

/* ── Featured / Highlighted papers ─────────────────── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.featured-card {
  background: var(--bg);
  border: 1px solid var(--border-faint);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1.5rem 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: box-shadow var(--tr), transform var(--tr);
}
.featured-card:hover {
  box-shadow: 0 6px 28px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
[data-theme="dark"] .featured-card {
  background: var(--bg-tint);
}
[data-theme="dark"] .featured-card:hover {
  box-shadow: 0 6px 28px rgba(0,0,0,.35);
}

.featured-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.featured-card-title {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
  flex: 1;
}

.featured-card .pub-authors { margin-top: auto; padding-top: 0.4rem; }
.featured-card .pub-abstract { margin-top: 0; }
.featured-card .pub-links { margin-top: 0.65rem; }

.pub-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.pub-divider::before,
.pub-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-faint);
}
.pub-divider-label {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

/* Publication filters */
.pub-filters {
  display: flex;
  gap: 0.4rem;
}
.pub-filter {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  background: none;
  border: 1px solid var(--border-faint);
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--tr);
}
.pub-filter:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pub-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Filtered-out items */
.pub-item.hidden {
  display: none;
}

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

/* ── News year separators ───────────────────────────── */
.ruled-year {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
  list-style: none;
  margin-top: 0.4rem;
}
.ruled-year::before,
.ruled-year::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-faint);
}
.ruled-year-label {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── Publications ───────────────────────────────────── */
.pub-list { list-style: none; }

.pub-item {
  padding: 1.75rem 1rem;
  margin: 0 -1rem;
  border-bottom: 1px solid var(--border-faint);
  border-radius: 6px;
  position: relative;
  transition: background var(--tr);
}
.pub-item:first-child { border-top: 1px solid var(--border-faint); }
.pub-item:hover { background: var(--accent-bg); }

/* Left-edge reading marker */
.pub-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.22s ease;
}
.pub-item:hover::before { transform: scaleY(1); }

.pub-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.pub-venue {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.pub-year {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  color: var(--text-3);
}
.pub-badge {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-rim);
  padding: 0.12rem 0.5rem;
  border-radius: 99px;
}

.pub-title {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.pub-item:hover .pub-title { color: var(--accent); }

.pub-authors {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: 0.3rem;
}
.pub-authors strong { color: var(--text); }

.pub-abstract {
  font-size: 0.8rem;
  color: var(--text-3);
  font-style: italic;
  line-height: 1.55;
  margin-top: 0.3rem;
}

.pub-links { margin-top: 0.75rem; display: flex; gap: 0.6rem; }

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 0.22rem 0.65rem;
  border-radius: 99px;
  text-decoration: none;
  transition: all var(--tr);
}
.pub-link svg { width: 11px; height: 11px; flex-shrink: 0; }

.pub-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* Platform-specific hover colours — must come after the generic rule */
.pub-link--arxiv:hover  { border-color: #b31b1b; color: #b31b1b; background: rgba(179,27,27,.07); }
.pub-link--cvf:hover    { border-color: #1565c0; color: #1565c0; background: rgba(21,101,192,.07); }
.pub-link--scidir:hover { border-color: #e07b00; color: #e07b00; background: rgba(224,123,0,.07); }
.pub-link--acm:hover      { border-color: #0085ca; color: #0085ca; background: rgba(0,133,202,.07); }
.pub-link--springer:hover { border-color: #e6001c; color: #e6001c; background: rgba(230,0,28,.07); }
.pub-link--project:hover  { border-color: var(--text-2); color: var(--text); background: var(--bg-tint); }


/* ── Footer ─────────────────────────────────────────── */
footer {
  padding: 1.75rem 1.5rem;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-text {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.footer-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Animations ─────────────────────────────────────── */
/* Initial hide is gated on the .js class (set by the inline head script)
   so content stays visible when JavaScript is disabled. */
.animate {
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.js .animate {
  opacity: 0;
  transform: translateY(16px);
}
.js .animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children of hero */
.hero-eyebrow.visible { transition-delay: 0.05s; }
.hero-name.visible    { transition-delay: 0.12s; }
.hero-affil.visible   { transition-delay: 0.2s;  }
.hero-social.visible  { transition-delay: 0.28s; }
.hero-portrait.visible{ transition-delay: 0.1s;  }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 780px) {
  html { font-size: 16px; }

  .nav-links { display: none; }
  .nav-burger { display: flex; }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-portrait { order: -1; }
  .portrait-frame { width: 160px; height: 160px; }
  .hero-aside { display: none; }

  .about-grid    { grid-template-columns: 1fr; gap: 2.5rem; }

  .ruled-item { grid-template-columns: 5rem 1fr; }

  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 2.4rem; }
  .social-pill { font-size: 0.62rem; padding: 0.3rem 0.65rem; }
  .pub-item:hover { padding-left: 0; }
  .pub-item::before { display: none; }
}

/* ── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .animate {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-scroll { animation: none; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── Print ──────────────────────────────────────────── */
@media print {
  #navbar, .hero-scroll, .nav-burger, .mobile-nav { display: none !important; }
  .hero { min-height: auto; padding-top: 1rem; }
  .js .animate { opacity: 1; transform: none; }
}
