/* ---------- Base ---------- */

:root {
  --background: #f7f8fa;
  --surface: #ffffff;
  --text: #18202a;
  --muted: #5d6876;
  --border: #dfe4ea;
  --accent: #285b8f;
  --accent-dark: #1d466f;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

.container {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}


/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 248, 250, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.nav {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 32px;
}

.nav a {
  text-decoration: none;
}

.site-name {
  color: var(--text);
  font-size: 1.14rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.nav-link {
  color: var(--muted);
  font-size: 1.06rem;
  font-weight: 650;
  transition: color 160ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.external-nav-link {
  color: var(--accent);
}


/* ---------- Homepage hero ---------- */

.hero {
  padding: 70px 0 66px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
  gap: clamp(48px, 7vw, 82px);
}

.profile-column {
  width: 250px;
}

.portrait {
  width: 250px;
  aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover;
  background: #e9edf2;
  border: 1px solid var(--border);
}

.profile-card {
  margin-top: 14px;
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.profile-card p {
  margin: 0;
}

.profile-name {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
}

.profile-position {
  margin-top: 4px !important;
  color: var(--accent);
  font-size: 0.98rem;
  font-weight: 700;
}

.profile-institution {
  margin-top: 9px !important;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.hero-content {
  padding-top: 2px;
}

.hero-title {
  margin: 0 0 20px;
  color: var(--text);
  font-size: clamp(1.7rem, 2.6vw, 2.05rem);
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.bio {
  max-width: 690px;
  color: var(--muted);
  font-size: 1.07rem;
}

.bio p {
  margin: 0 0 17px;
}


/* ---------- wdifmr.org feature ---------- */

.research-site {
  max-width: 690px;
  margin-top: 28px;
  padding: 17px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}

.research-site-description {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.research-site-description strong {
  color: var(--text);
  font-size: 1rem;
}

.research-site-description span {
  color: var(--muted);
  font-size: 0.93rem;
}

.research-site-link {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.97rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.research-site-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* ---------- Buttons and profile links ---------- */

.primary-links {
  margin-top: 27px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 46px;
  padding: 0 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border);
}

.button-secondary:hover {
  border-color: var(--accent);
}

.social-links {
  margin-top: 21px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-size: 0.98rem;
}

.social-links a {
  color: var(--accent);
  text-underline-offset: 4px;
}


/* ---------- Latest news ---------- */

.latest-news {
  padding: 0 0 82px;
}

.latest-news h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1.65rem;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.news-content {
  min-height: 110px;
  border-top: 1px solid var(--border);
}


/* ---------- Interior pages ---------- */

.page-main {
  flex: 1;
  padding: 92px 0;
}

.page-main h1 {
  margin: 0 0 24px;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.page-intro {
  max-width: 700px;
  margin: -8px 0 30px;
  color: var(--muted);
  font-size: 1.1rem;
}


/* ---------- Footer ---------- */

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

.site-footer p {
  margin: 0;
}


/* ---------- Responsive ---------- */

@media (max-width: 760px) {

  .container {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .nav {
    min-height: auto;
    padding: 18px 0;
    gap: 13px 22px;
  }

  .site-name {
    width: 100%;
    text-align: center;
  }

  .nav-link {
    font-size: 0.98rem;
  }

  .hero {
    padding: 48px 0 58px;
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .profile-column {
    width: min(100%, 250px);
    margin-inline: auto;
  }

  .portrait {
    width: 100%;
  }

  .hero-content {
    padding-top: 0;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .research-site {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .primary-links {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .latest-news {
    padding-bottom: 60px;
  }

}
