:root {
  --primary: #1f4fd8;
  /* deep blue */
  --secondary: #6b4fd8;
  /* soft purple */
  --accent: #f06a2f;
  /* warm orange (very limited use) */

  --text: #1f2933;
  --muted: #6b7280;
  --bg: #ffffff;

  --border: #eee;
}

/* ---------- Base reset / rhythm ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

/* Tighten default element margins (major source of “gaps”) */
h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding-left: 1.2rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0;
  /* tighter than before */
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Branding */
.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo {
  height: 84px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-line.primary,
.brand-line.secondary {
  font-size: 1.25rem;
  font-weight: 650;
}

.brand-line.tertiary {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-link:hover {
  opacity: 0.9;
}

.brand-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 6px;
}

/* Nav */
.nav a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 550;
}

.nav a:hover {
  color: var(--primary);
}

.nav a.active,
.nav a[aria-current="page"] {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* ---------- Typography spacing (compact but readable) ---------- */
h1 {
  font-size: 2.05rem;
  line-height: 1.2;
  color: var(--primary);
}

h2 {
  font-size: 1.25rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

p {
  margin-top: 0.75rem;
  /* smaller than default */
  color: var(--muted);
  max-width: 720px;
}

ul {
  margin-top: 0.6rem;
  margin-bottom: 0.5rem;
}

li {
  margin: 0.25rem 0;
}

/* ---------- Hero ---------- */
.hero {
  padding: 1.6rem 0 1.4rem;
  /* tighter top/bottom */
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 2rem;
  align-items: start;
}

.hero-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-actions {
  margin-top: 1.05rem;
}

.hero-photo .social-links {
  margin-top: 0.6rem;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-block;
  margin-right: 0.65rem;
  margin-top: 0.4rem;
  /* helps on narrow widths */
  padding: 0.58rem 1.05rem;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  text-decoration: none;
  color: var(--text);
  background: #fff;
  transition: all 0.2s ease;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn.primary:hover {
  background: var(--secondary);
  border-color: var(--secondary);
}

/* Social links */
.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

/* ⬇️ KEY FIX: make each icon a positioning context */
.social-links a {
  position: relative;
  /* ✅ REQUIRED */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--muted);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.social-links a:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(31, 79, 216, 0.08);
}

.social-links svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.social-links a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Tooltip */
.social-links a::after {
  content: attr(aria-label);
  position: absolute;
  bottom: -1.6rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--muted);
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.social-links a:hover::after,
.social-links a:focus-visible::after {
  opacity: 1;
}



/* Hero photo */
.hero-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-photo img {
  max-width: 100%;
  width: 320px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.photo-address {
  margin-top: 0.55rem;
  /* tighter */
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}

/* ---------- Selected Publications ---------- */
.selected {
  background: linear-gradient(to right,
      rgba(31, 79, 216, 0.04),
      rgba(107, 79, 216, 0.04));
  padding: 1.1rem 0;
  /* tighter section */
}

.selected-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.selected-list li {
  margin: 0.45rem 0;
  /* tighter rows */
}

.year {
  font-weight: 650;
  margin-right: 0.5rem;
  color: var(--text);
}

/* ---------- Two-column section ---------- */
.two-column {
  padding: 1.35rem 0 1.6rem;
  /* tighter */
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  /* slightly tighter than before */
}

/* Tags */
.tags {
  margin-top: 0.65rem;
}

.tags span {
  display: inline-block;
  margin: 0.2rem 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  /* tighter */
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero {
    padding: 1.35rem 0 1.1rem;
  }

  .hero-photo {
    margin-top: 0.25rem;
  }

  .hero-photo img {
    width: 240px;
  }

  .nav a {
    margin-left: 0.75rem;
  }
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0 1.2rem;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

/* Logos row */
/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0 1.2rem;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

/* Logos row */
.footer-logos {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-logos img {
  height: 60px;
  /* consistent visual weight */
  width: auto;
  max-width: 240px;
  object-fit: contain;
  opacity: 1;
  /* full color */
  transition: transform 0.15s ease;
}

.footer-logos img:hover {
  transform: scale(1.03);
  /* subtle, professional hover */
}

/* Footer text */
.footer-text {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}