:root {
  color-scheme: light;

  --color-primary: #1b3f82;
  --color-primary-hover: #14336d;
  --color-primary-soft: #eef3fb;
  --color-accent: #3566b8;

  --color-bg: #f7f9fc;
  --color-surface: #ffffff;

  --color-text: #1f2937;
  --color-text-strong: #111827;
  --color-muted: #667085;

  --color-border: #dce3ee;
  --color-border-strong: #c7d2e2;

  --content-width: 1180px;
  --article-width: 760px;
  --home-width: 920px;
  --padding-x-desktop: 32px;
  --padding-x-tablet: 24px;
  --padding-x-mobile: 20px;

  --radius-card: 13px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.25rem var(--padding-x-desktop) 3.5rem;
}

h1, h2, h3, h4 {
  color: var(--color-text-strong);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.9rem;
}

h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: -0.01em;
  margin: 2.75rem 0 1rem;
}

h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

p {
  margin: 0 0 1rem;
  color: var(--color-text);
}

ul, ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}

li {
  margin: 0.3rem 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

small, .muted, .meta {
  font-size: 0.9rem;
  color: var(--color-muted);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============ HEADER ============ */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--padding-x-desktop);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}

/* First row: brand (+ mobile toggle on small screens) */
.header-top {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 0;
}

.site-brand {
  min-width: 0;
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-strong);
  white-space: nowrap;
}

.site-brand:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* Desktop nav */
.site-nav {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav a {
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 0.35rem 0.1rem;
  border-radius: 6px;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 600;
}

.site-nav a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Mobile menu — hidden on desktop */
.mobile-menu {
  display: none;
}

@media (max-width: 1240px) {
  .site-nav {
    display: none;
  }
  .mobile-menu {
    display: block;
  }
}

/* ============ BREADCRUMBS + META ============ */
.breadcrumbs {
  margin: 0 0 1.75rem;
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.breadcrumbs a {
  color: var(--color-muted);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs li + li::before {
  content: "›";
  margin-right: 0.4rem;
  color: var(--color-border-strong);
}

.updated {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin: -0.25rem 0 1.5rem;
  list-style: none;
}

main > h1 + p.updated {
  margin-top: -0.25rem;
}

/* ============ ARTICLE ============ */
.page-content {
  max-width: var(--article-width);
}

.page-content h1 {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
}

.page-content h2 {
  font-size: clamp(1.25rem, 2.25vw, 1.6rem);
  margin: 3.4rem 0 1.2rem;
  scroll-margin-top: 84px;
}

.page-content h3 {
  font-size: 1.12rem;
}

.page-content p,
.page-content li {
  color: var(--color-text);
}

.page-content strong {
  font-weight: 600;
  color: var(--color-text-strong);
}

.page-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-content a:hover {
  color: var(--color-primary-hover);
}

.page-content ul, .page-content ol {
  padding-left: 1.4rem;
}

/* ============ TABLE OF CONTENTS ============ */
.table-of-contents {
  max-width: var(--article-width);
  margin: 0 0 2.5rem;
  padding: 1.25rem 0 1.25rem 1rem;
  border-left: 3px solid var(--color-border);
}

.toc-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-strong);
  margin: 0 0 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1.5rem;
}

.toc-list li {
  margin: 0;
}

.toc-list a {
  display: block;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.25rem 0;
}

.toc-list a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

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

/* ============ SECTION LINKS (HUB NAVIGATION) ============ */
.section-links {
  max-width: var(--article-width);
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.section-links-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-strong);
  margin: 0 0 1.25rem;
}

.section-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text-strong);
}

.section-link:nth-child(odd) {
  border-right: 1px solid var(--color-border);
  padding-right: 1rem;
}

.section-link:nth-child(even) {
  padding-left: 1rem;
}

.section-link:nth-child(1),
.section-link:nth-child(2) {
  border-top: 1px solid var(--color-border);
}

.section-link-label {
  font-weight: 600;
  color: var(--color-text-strong);
}

.section-link-arrow {
  color: var(--color-muted);
  font-weight: 600;
  transition: transform 0.15s ease;
}

.section-link:hover {
  background: var(--color-primary-soft);
  text-decoration: none;
}

.section-link:hover .section-link-label {
  color: var(--color-primary);
}

.section-link:hover .section-link-arrow {
  color: var(--color-primary);
  transform: translateX(3px);
}

.section-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

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

  .section-link:nth-child(odd) {
    border-right: none;
    padding-right: 0.5rem;
  }

  .section-link:nth-child(even) {
    padding-left: 0.5rem;
  }

  .section-link:nth-child(1) {
    border-top: 1px solid var(--color-border);
  }

  .section-link:nth-child(2) {
    border-top: none;
  }
}

/* ============ RELATED ============ */
.related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  max-width: var(--article-width);
}

.related h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.related ul {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.related li {
  margin: 0.4rem 0;
}

.related a {
  color: var(--color-primary);
}

/* ============ SCIENCE-EDUCATION PAGE ============ */
.science-page {
  max-width: 900px;
}

.science-page > p {
  max-width: 70ch;
  color: var(--color-text);
}

/* Editorial photo block, scoped to /science-education/. No cards, borders,
   shadows, or decorative background. Wide frame is primary; the vertical
   portrait is a lighter secondary accent. */
.science-photos {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 24px;
  align-items: start;
  margin: 2.4rem 0 2.5rem;
  max-width: 900px;
}

.science-photos img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius-card);
}

/* Stack on tablet/mobile: wide frame first, vertical accent second.
   On tablet keep the tall portrait compact and left-aligned. */
@media (max-width: 768px) {
  .science-photos {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .science-photos .science-photo-vertical {
    max-width: 320px;
  }
}

/* On small screens keep the tall portrait compact and left-aligned so it
   does not dominate the article. */
@media (max-width: 480px) {
  .science-photos .science-photo-vertical {
    max-width: 230px;
  }
}

.science-section {
  margin-bottom: 2rem;
  max-width: 70ch;
}

.science-section h2 {
  margin-top: 2.5rem;
}

.science-section h2:first-of-type {
  margin-top: 0;
}

/* Academic structured data blocks */
.academic-data {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-border);
}

.academic-section {
  margin-bottom: 2.5rem;
}

.academic-section:last-child {
  margin-bottom: 0;
}

.academic-section h2 {
  font-size: 1.2rem;
  margin: 0 0 1.25rem;
  border: none;
  padding: 0;
}

.academic-list {
  margin: 0;
}

.academic-row {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.academic-row:first-of-type {
  border-top: 1px solid var(--color-border);
}

.academic-row dt {
  font-weight: 600;
  color: var(--color-text-strong);
  font-size: 0.95rem;
}

.academic-row dd {
  margin: 0;
  color: var(--color-text);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .academic-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .academic-row dt {
    font-size: 0.9rem;
    color: var(--color-primary);
  }
}

/* ============ HOME ============ */
.home {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.home .hero {
  padding: 0.75rem 0 1.5rem;
}

.home .hero h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  letter-spacing: -0.02em;
}

.home .hero .tagline {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 1.25rem;
}

.home .hero .positioning {
  font-size: 1.05rem;
  color: var(--color-text);
  margin: 0 0 1.75rem;
  font-weight: 500;
  line-height: 1.5;
}

.home .hero .intro {
  color: var(--color-text);
  max-width: 66ch;
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0 0 1.15rem;
}

.home .hero .intro:last-of-type {
  margin-bottom: 0;
}

.hero-portrait {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius-card);
}

.home .section + .section {
  margin-top: 2.5rem;
}

.home > .section {
  padding: 0 0;
}

/* Homepage composition: wider sections, unchanged readable text width.
   The page wrapper is capped at the article width by default; the homepage
   opts into the wider --home-width so grids/rows fill the desktop canvas,
   while long-form text keeps its readable measure. */
@media (min-width: 1025px) {
  .page-content:has(.home) {
    max-width: var(--home-width);
  }

  .home .hero {
    align-self: center;
    width: min(1040px, calc(100vw - 2 * var(--padding-x-desktop)));
    max-width: 1040px;
    display: grid;
    grid-template-columns: 688px 320px;
    align-items: start;
    gap: 32px;
    padding: 1.5rem 0 2.5rem;
  }

  .hero-text {
    min-width: 0;
  }

  /* Enhanced rhythm for key semantic transitions */
  .home .section:has(#about-heading) {
    margin-top: 3.5rem;
  }

  .home .section:has(#topics-heading) {
    margin-top: 3rem;
  }

  .home .section:has(#materials-heading) {
    margin-top: 3.5rem;
  }

  .home .section:has(#work-heading) {
    margin-top: 3rem;
  }

  .home .section:has(#site-heading) {
    margin-top: 2.75rem;
  }
}

/* Hero portrait — reflows below the intro block on tablet/mobile */
@media (max-width: 1024px) {
  .hero-portrait {
    max-width: 240px;
    margin: 0.5rem 0 0;
  }

  .home .hero {
    padding: 0.5rem 0 1.5rem;
  }
}

/* Long-form text inside otherwise wide homepage sections stays readable. */
.home .section:has(#site-heading) p {
  max-width: 70ch;
}

.section h2 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 1.4rem;
  margin: 0 0 1.1rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.6rem;
}

/* Card grid + cards (shared by homepage and materials) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  display: block;
  min-width: 0;
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--color-text-strong);
  background: var(--color-surface);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  text-decoration: none;
}

.card:hover h3 {
  color: var(--color-primary);
}

.card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-strong);
  text-decoration: none;
}

.card .card-desc {
  color: var(--color-muted);
  font-size: 0.92rem;
  margin: 0;
  font-weight: 400;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .card-category {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--color-primary);
  margin-top: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Direction cards with number badge */
.card .card-num {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  font-size: 0.8rem;
  color: var(--color-border-strong);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.card .card-arrow {
  display: inline-block;
  margin-left: 0.2rem;
  color: var(--color-primary);
  font-weight: 600;
}

.card .card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-strong);
  margin: 0 0 0.3rem;
}

/* ---- Materials page density pass (scoped: /materials/ only) ---- */
.materials .section + .section {
  margin-top: 52px;
}

.materials .section h2 {
  margin: 0 0 20px;
}

.materials .card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.materials .card {
  padding: 26px 26px;
  min-height: 150px;
}

.materials .card h3 {
  line-height: 1.33;
  margin: 0;
}

.materials .card .card-desc {
  line-height: 1.55;
  margin: 11px 0 0;
  -webkit-line-clamp: 3;
}

/* Editorial topic navigation list */
.topic-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 0.25rem;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text-strong);
}

.topic-link:first-child,
.topic-link:nth-child(2) {
  border-top: 1px solid var(--color-border);
}

.topic-name {
  font-weight: 600;
  color: var(--color-text-strong);
}

.topic-arrow {
  color: var(--color-muted);
  font-weight: 600;
}

.topic-link:hover,
.topic-link:hover .topic-name,
.topic-link:hover .topic-arrow {
  color: var(--color-primary);
  text-decoration: none;
}

.topic-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Editorial wide cards (materials / science) */
.editorial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.editorial-card {
  display: block;
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--color-text-strong);
  background: var(--color-surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.editorial-card:hover {
  border-color: var(--color-primary);
  background: var(--color-surface);
  text-decoration: none;
}

.editorial-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.editorial-card h2 {
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
  border: none;
  padding: 0;
}

.editorial-card h2 .card-arrow {
  margin-left: 0;
  color: var(--color-primary);
  font-weight: 600;
}

.editorial-card p {
  color: var(--color-muted);
  margin: 0;
}

/* About — open section, no heavy box */
.about-section {
  max-width: 780px;
}

.about-section p {
  max-width: 70ch;
}

.about-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
}

.about-link:hover {
  color: var(--color-primary-hover);
}

/* Homepage-specific: soft editorial band for "Обо мне" */
.home .about-section {
  background: var(--color-primary-soft);
  border-radius: var(--radius-card);
  padding: 2rem 2.25rem 2.15rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

@media (max-width: 860px) {
  .home .about-section {
    padding: 1.75rem 1.5rem 1.85rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
  }
}

@media (max-width: 600px) {
  .home .about-section {
    padding: 1.5rem 1.25rem 1.65rem;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Work blocks */
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.work-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.5rem;
  background: var(--color-surface);
}

.work-block h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.work-block p {
  color: var(--color-muted);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.work-block .phones {
  list-style: none;
  padding: 0;
  margin: 0;
}

.work-block .phones li {
  margin: 0.35rem 0;
}

/* Org (used in contacts markup via base) kept for compatibility */
.org h3 {
  font-size: 1.05rem;
  margin: 0.75rem 0 0.35rem;
}

.org + .org {
  margin-top: 1.25rem;
}

.phones {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

/* ============ ABOUT PROFILE ============ */
.about-profile {
  max-width: 960px;
}

.profile-intro {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.profile-text {
  min-width: 0;
}

.profile-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
}

.profile-section {
  margin-bottom: 2rem;
  max-width: 70ch;
}

.profile-section h2 {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.profile-section h3 {
  margin-top: 1.5rem;
}

@media (max-width: 860px) {
  .profile-intro {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .profile-photo {
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .profile-photo {
    max-width: 240px;
  }
}

/* ============ CONTACTS PAGE ============ */
.contacts-page {
  max-width: 960px;
}

.contacts-intro {
  max-width: 70ch;
  margin-bottom: 2rem;
  color: var(--color-text);
}

.locations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.location-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 1.75rem 1.85rem;
  background: var(--color-surface);
}

.location-panel h2 {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
  border: none;
  padding: 0;
}

.location-panel .org-name {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin: 0 0 0.85rem;
}

.location-panel .address {
  font-weight: 500;
  color: var(--color-text-strong);
  margin: 0 0 1rem;
}

.contacts-info {
  margin-bottom: 1.5rem;
}

.contact-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-strong);
  margin: 0 0 0.35rem;
}

.location-panel .phones {
  list-style: none;
  padding: 0;
  margin: 0;
}

.location-panel .phones li {
  margin: 0.3rem 0;
  font-size: 0.95rem;
}

.map-container {
  margin: 1.5rem 0 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.map-container iframe {
  display: block;
  width: 100%;
  height: 300px;
  border: 0;
}

.map-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-top: 0.5rem;
}

.map-link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.site-info {
  max-width: 70ch;
  padding: 1.75rem 0;
  border-top: 1px solid var(--color-border);
}

.site-info h2 {
  font-size: 1.1rem;
  margin: 0 0 0.85rem;
  border: none;
  padding: 0;
}

.site-info p {
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.site-info code {
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--color-text-strong);
  background: var(--color-primary-soft);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

.site-info ul {
  list-style: none;
  padding-left: 1.25rem;
  margin: 0;
}

.site-info li {
  margin: 0.35rem 0;
  position: relative;
}

.site-info li::before {
  content: "–";
  position: absolute;
  left: -1.25rem;
  color: var(--color-muted);
}

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

@media (max-width: 600px) {
  .location-panel {
    padding: 1.5rem 1.35rem;
  }

  .map-container iframe {
    height: 280px;
  }
}

/* ============ PUBLICATIONS ============ */
.publications {
  max-width: 900px;
}

.publications > p {
  max-width: 70ch;
  color: var(--color-text);
}

.pub-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 1.75rem 0 2.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.pub-jump-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
}

.pub-jump-nav a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.publications .section h2 {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.6rem;
  scroll-margin-top: 100px;
}

.pub-group {
  border-bottom: 1px solid var(--color-border);
}

.pub-group:first-of-type {
  border-top: 1px solid var(--color-border);
}

.pub-group summary {
  cursor: pointer;
  padding: 1rem 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
  transition: background 0.15s ease;
}

.pub-group summary::-webkit-details-marker {
  display: none;
}

.pub-group summary::after {
  content: "▾";
  font-size: 0.8rem;
  color: var(--color-muted);
  transition: transform 0.15s ease;
}

.pub-group[open] summary::after {
  transform: rotate(180deg);
}

.pub-group summary:hover {
  background: var(--color-primary-soft);
}

.pub-group summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.pub-head {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.pub-year {
  color: var(--color-text-strong);
}

.pub-count {
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

/* Publications — mobile affordance & rhythm (≤768px only).
   Keeps year = strong, count/caret = secondary but more legible, and removes
   the cramped heading→divider→row cadence between categories. */
@media (max-width: 768px) {
  .publications .section + .section {
    margin-top: 1.5rem;
  }

  .publications .section h2 {
    margin-bottom: 1.6rem;
  }

  .pub-group summary {
    min-height: 48px;
    padding-block: 1.1rem;
  }

  .pub-count {
    color: #4b5563;
  }

  .pub-group summary::after {
    color: #475467;
  }
}

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 1.1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  background: var(--color-surface);
}

.pub-list li {
  padding: 1.2rem 0;
}

.pub-list li + li {
  border-top: 1px solid var(--color-border);
}

.pub-title {
  font-weight: 600;
  color: var(--color-text-strong);
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.pub-meta {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 0.15rem 0 0;
}

.pub-doi {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--color-primary);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.award {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* Flat list (schools, and non-grouped) */
.pub-flat {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pub-flat li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
}

.pub-flat li:last-child {
  border-bottom: none;
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--color-primary-soft);
  border-top: 1px solid var(--color-border);
  margin-top: 2.5rem;
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.5rem var(--padding-x-desktop) 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.footer-name {
  font-weight: 700;
  color: var(--color-text-strong);
  margin: 0 0 0.2rem;
}

.footer-role {
  color: var(--color-muted);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.footer-disclaimer {
  color: var(--color-muted);
  font-size: 0.85rem;
  max-width: 52ch;
  margin: 0;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.footer-nav a {
  color: var(--color-text);
  font-size: 0.95rem;
}

.footer-nav a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1rem var(--padding-x-desktop) 1.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1240px) {
  .mobile-menu { display: block; }
  .site-nav { display: none; }
}

@media (max-width: 860px) {
  main { padding: 1.75rem var(--padding-x-tablet) 2.5rem; }
  .header-inner { padding: 0 var(--padding-x-tablet); }
  .footer-inner { padding-left: var(--padding-x-tablet); padding-right: var(--padding-x-tablet); }
  .footer-bottom { padding-left: var(--padding-x-tablet); padding-right: var(--padding-x-tablet); }
  .editorial-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .topic-list { grid-template-columns: 1fr; }
  .home .section + .section { margin-top: 0.75rem; }
}

@media (max-width: 600px) {
  main { padding: 1.5rem var(--padding-x-mobile) 2.25rem; }
  .header-inner { padding: 0 var(--padding-x-mobile); }
  .footer-inner { padding-left: var(--padding-x-mobile); padding-right: var(--padding-x-mobile); grid-template-columns: 1fr; }
  .footer-bottom { padding-left: var(--padding-x-mobile); padding-right: var(--padding-x-mobile); }
  .card-grid { grid-template-columns: 1fr; }
  .home .hero h1 { font-size: clamp(1.9rem, 8vw, 2.4rem); }
}

@media (max-width: 400px) {
  main { padding-left: 16px; padding-right: 16px; }
  .header-inner { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 720px) {
  .materials .card-grid { grid-template-columns: 1fr; }
  .materials .card { min-height: 0; }
}

/* Mobile menu (details/summary) */
.mobile-menu {
  position: relative;
}

.mobile-menu summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary);
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  user-select: none;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu summary:hover {
  background: var(--color-primary-soft);
}

.mobile-menu summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.mobile-menu[open] summary {
  background: var(--color-primary-soft);
}

.mobile-menu nav {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 230px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 24px rgba(27, 63, 130, 0.08);
  padding: 0.4rem;
  margin-top: 0.4rem;
  z-index: 20;
  display: grid;
}

.mobile-menu nav a {
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--color-text);
  white-space: nowrap;
}

.mobile-menu nav a:hover {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  text-decoration: none;
}

.mobile-menu nav a[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 600;
}
