:root {
  --bg: #f4f6f8;
  --paper: #ffffff;
  --ink: #17212b;
  --muted: #5d6874;
  --accent: #0b5d7a;
  --accent-dark: #073f55;
  --accent-soft: #e7f1f5;
  --rule: #d9e0e6;
  --panel: #fafbfc;
  --success: #697b35;
  --radius: 6px;
  --shadow: 0 10px 30px rgba(20, 35, 50, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Bitter", Georgia, serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

h1,
h2,
h3,
.brand {
  font-family: "Space Mono", ui-monospace, monospace;
  line-height: 1.2;
  margin: 0;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.site-header .brand {
  flex: 1 1 auto;
}

body::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), #78964a);
}

.brand {
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.8vw, 1.08rem);
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 0 0 auto;
}

.nav-links a {
  text-decoration: none;
  color: var(--accent-dark);
  font-size: 1.22rem;
  font-weight: 700;
  padding: 0.46rem 0.82rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.nav-links a:hover {
  color: #ffffff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
}

.university-logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  text-decoration: none;
}

.university-logo img {
  display: block;
  width: min(360px, 36vw);
  max-height: 116px;
  object-fit: contain;
}

.hero,
.page-hero {
  padding: 3.2rem 0 2.2rem;
}

.group-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  align-items: start;
}

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

.hero-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 500px);
  gap: 1.4rem;
  align-items: center;
}

.hero-side-figure {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.6rem;
  box-shadow: var(--shadow);
}

.hero-side-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
  object-fit: contain;
  background: #ffffff;
}

.hero-kicker {
  margin: 0 0 0.65rem;
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 1.4px;
  color: var(--accent);
  font-family: "Space Mono", ui-monospace, monospace;
}

.hero h1,
.page-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  max-width: 19ch;
  margin-bottom: 0.9rem;
  color: var(--ink);
}

.page-hero h1 {
  max-width: 21ch;
}

.hero-subtext,
.page-hero p {
  margin: 0 0 1.3rem;
  color: var(--muted);
  max-width: 70ch;
  font-size: 1.03rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-block;
  text-decoration: none;
  color: #ffffff;
  background: var(--accent-dark);
  border: 1px solid var(--accent-dark);
  border-radius: 4px;
  padding: 0.62rem 0.92rem;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.86rem;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-secondary {
  color: var(--accent-dark);
  background: transparent;
}

.btn-secondary:hover {
  color: #ffffff;
}

.hero-visual {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.7rem;
  box-shadow: var(--shadow);
  max-width: none;
  justify-self: stretch;
}

.hero-visual figure {
  margin: 0;
}

.hero-visual figcaption,
.section-figure figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
}

.research-figures {
  display: grid;
  gap: 0.7rem;
}

.hero-figure-pair {
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  align-items: center;
}

.research-figures img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.section-figure {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.7rem;
  width: min(560px, 100%);
  margin: 0 auto 1rem;
  box-shadow: var(--shadow);
}

.section-figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.posts,
.team-section,
.research-layout {
  padding: 1rem 0 1.35rem;
}

.section-heading {
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.section-heading h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

.section-heading p {
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.featured-post,
.post-card,
.team-card,
.feature-panel,
.about,
.newsletter,
.post-template,
.publication-item {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.featured-post {
  padding: 1.1rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow);
}

.featured-post h3 {
  margin: 0.25rem 0 0.45rem;
  font-size: clamp(1.2rem, 2.1vw, 1.65rem);
}

.post-grid,
.team-grid,
.split-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.split-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0.65rem 0 1.35rem;
}

.post-card,
.team-card,
.feature-panel {
  padding: 1rem;
  box-shadow: var(--shadow);
}

a.team-card {
  color: inherit;
  display: block;
  text-decoration: none;
}

a.team-card:hover {
  border-color: #b8c8d3;
  transform: translateY(-1px);
}

.post-card h3,
.team-card h3,
.feature-panel h2 {
  margin: 0.35rem 0 0.45rem;
  font-size: 1.04rem;
}

.feature-panel h2 {
  font-size: 1.22rem;
}

.post-meta {
  margin: 0;
  color: var(--accent);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.post-card p,
.featured-post p,
.team-card p,
.feature-panel p,
.about p,
.newsletter p,
.post-template p,
.publication-item p {
  color: var(--muted);
}

.text-link,
.post-template a {
  color: var(--accent-dark);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.86rem;
  text-underline-offset: 3px;
}

.text-link:hover,
.post-template a:hover {
  color: var(--accent);
}

.team-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--accent-soft);
  display: block;
  margin-bottom: 0.85rem;
}

.profile-card .team-photo {
  object-position: center;
}

.publication-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.publication-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--paper);
}

.publication-item:hover {
  border-color: #b8c8d3;
  background: var(--panel);
}

.publication-year {
  color: var(--success);
  font-family: "Space Mono", ui-monospace, monospace;
  font-weight: 700;
}

.publication-item h3 {
  font-size: 0.98rem;
  margin: 0 0 0.28rem;
  color: var(--ink);
}

.publication-item p {
  margin: 0.12rem 0;
  font-size: 0.94rem;
}

.about,
.newsletter,
.post-template {
  padding: 1.15rem;
  margin: 1rem auto;
  box-shadow: var(--shadow);
}

.cv-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 0.75fr);
  gap: 1rem;
  margin-top: 0.8rem;
}

.cv-copy h3 {
  margin: 1.1rem 0 0.5rem;
  font-size: 0.98rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.3rem;
}

.cv-copy p {
  margin: 0.3rem 0;
}

.cv-summary {
  margin-bottom: 0.85rem;
}

.cv-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cv-entry {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 0.85rem;
  border: 1px solid var(--rule);
  background: var(--panel);
  border-radius: 4px;
  padding: 0.65rem 0.75rem;
}

.cv-date {
  margin: 0;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.cv-entry-body h4 {
  margin: 0;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.9rem;
  line-height: 1.3;
}

.cv-org {
  margin: 0.12rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.about .cv-org.cv-org-pink,
.about .cv-org.cv-org-blue {
  color: var(--accent);
}

.cv-entry ul {
  margin: 0;
  padding-left: 1rem;
}

.cv-entry li {
  margin: 0.2rem 0;
  color: var(--muted);
}

.cv-image-placeholder {
  border: 1px solid var(--rule);
  border-radius: 4px;
  min-height: 280px;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--panel);
  padding: 0.65rem;
}

.cv-image {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.newsletter-form input {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--rule);
  background: var(--panel);
  border-radius: 4px;
  padding: 0.62rem 0.72rem;
  font: inherit;
}

.newsletter-form button {
  border: 1px solid var(--accent-dark);
  background: var(--accent-dark);
  color: #ffffff;
  border-radius: 4px;
  padding: 0.62rem 0.88rem;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 0.84rem;
  cursor: pointer;
}

.newsletter-form button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.site-footer {
  padding: 1.6rem 0 2rem;
  border-top: 1px solid var(--rule);
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.post-template {
  max-width: 780px;
  margin-top: 1.8rem;
}

.post-template h1 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  margin: 0.45rem 0 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .group-hero,
  .hero-topline,
  .split-section {
    grid-template-columns: 1fr;
  }

  .hero-figure-pair {
    grid-template-columns: 1fr;
  }

  .post-grid,
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .container {
    width: min(100% - 1.25rem, 1120px);
  }

  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.65rem;
  }

  .nav-links {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .university-logo {
    justify-self: end;
  }

  .university-logo img {
    width: min(240px, 52vw);
    max-height: 82px;
  }

  .hero,
  .page-hero {
    padding: 2.2rem 0 1.6rem;
  }

  .post-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .cv-layout {
    grid-template-columns: 1fr;
  }

  .cv-entry,
  .publication-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .cv-image-placeholder {
    min-height: 220px;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form input,
  .newsletter-form button {
    width: 100%;
  }
}
