/* Basics */
:root {
  --bg: #fff;
  --text: #202735;
  --muted: #626b78;
  --blue: #2859bd;
  --border: #e2e5e9;
  --content-width: 1040px;
  --font-body: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 150ms ease;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

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

main {
  min-height: 70vh;
}

.page-section {
  padding-block: 42px;
  border-bottom: 1px solid var(--border);
}

.section-label {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 600;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 600;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

p {
  margin-top: 0;
}

.lead {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* Navigation */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.navbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
}

.brand:hover {
  color: var(--blue);
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  padding-block: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--blue);
}

/* Homepage */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.65fr);
  align-items: start;
  gap: 48px;
  padding-block: 60px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  margin-bottom: 18px;
}

.hero-copy {
  max-width: 650px;
}

.hero-image {
  width: 100%;
  max-width: 250px;
  aspect-ratio: 4 / 5;
  justify-self: end;
  object-fit: cover;
  object-position: center top;
  background: #f0f3f8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 22px;
}

/* Simple links and optional buttons */
.button {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  font: inherit;
  font-size: 0.92rem;
}

.button:hover {
  background: #1d438f;
  color: white;
}

.button-secondary {
  background: transparent;
  color: var(--blue);
}

.button-secondary:hover {
  background: #f3f6fc;
  color: var(--blue);
}

/* Projects */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 36px;
  margin-top: 28px;
}

.card {
  min-width: 0;
  padding: 0 0 22px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.gallery-item {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: #f5f7fb;
  border: 1px solid #dce3ef;
  border-radius: 10px;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-item figcaption {
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.92rem;
}

.card h3 {
  margin-bottom: 8px;
}

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

.card-meta {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 600;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.tag-list li {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Interior pages */
.page-heading {
  padding-block: 48px 32px;
  border-bottom: 1px solid var(--border);
}

.page-heading h1 {
  margin-bottom: 14px;
}

.page-heading .lead {
  margin-bottom: 0;
}

/* Research and publication entries */
.entry-list {
  margin-top: 20px;
}

.entry {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 24px;
  padding-block: 24px;
  border-bottom: 1px solid var(--border);
}

.entry-date {
  color: var(--muted);
  font-size: 0.9rem;
}

.entry h3 {
  margin-bottom: 8px;
}

.entry p {
  margin-bottom: 10px;
  color: var(--muted);
}

/* Contact and footer */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-footer {
  padding-block: 24px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Mobile */
@media (max-width: 720px) {
  .container {
    width: calc(100% - 32px);
  }

  .navbar {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding-block: 12px;
  }

  .nav-links {
    gap: 8px 18px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-block: 38px;
  }

  .hero-image {
    max-width: 190px;
    justify-self: start;
  }

  .page-section {
    padding-block: 32px;
  }

  .page-heading {
    padding-block: 36px 26px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Homepage refinements */

/* Black text throughout, with blue reserved for subtle backgrounds */
body,
h1,
h2,
h3,
h4,
p,
strong,
.section-label,
.card-meta,
.entry-date,
.tag-list li,
.site-footer {
  color: #171717;
}

/* Keep links black, with an underline to identify them */
a {
  color: #171717;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

a:hover {
  color: #171717;
  text-decoration-color: #2859bd;
}

/* A small blue detail without coloring all the text */
.section-label {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 2px solid #2859bd;
  font-weight: 600;
}

/* About: text wraps around the portrait */
.hero {
  display: block;
  padding-block: 64px;
}

.hero-copy {
  max-width: 900px;
}

.about-photo {
  float: right;
  width: 260px;
  max-width: 40%;
  height: auto;
  margin: 4px 0 20px 28px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
}

.hero-copy .lead,
.hero-copy p:not(.section-label) {
  color: #171717;
}

.hero-actions {
  clear: both;
}

/* Soft blue buttons with black text */
.button,
.button-secondary {
  background: #edf2fc;
  color: #171717;
  border: 1px solid #cbd7ed;
  border-radius: 6px;
  font-weight: 600;
}

.button:hover,
.button-secondary:hover {
  background: #e0e9fa;
  color: #171717;
  border-color: #9db7e8;
  transform: none;
}

/* Research interests as readable paragraphs */
.interest-list {
  max-width: 800px;
  margin-block: 24px;
}

.interest-list p {
  margin-bottom: 20px;
  color: #171717;
}

.interest-list strong {
  font-weight: 700;
}

/* News entries */
.entry p {
  color: #171717;
}

/* Project cards: structured but not overly corporate */
.card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.card {
  padding: 24px;
  background: #f5f7fb;
  border: 1px solid #dce3ef;
  border-radius: 10px;
  transition: border-color 180ms ease,
              background-color 180ms ease;
}

.card:hover {
  background: #eff4fc;
  border-color: #9db7e8;
  transform: none;
}

.card p {
  color: #171717;
}

.card-meta {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tag-list {
  gap: 8px;
}

.tag-list li {
  padding: 3px 9px;
  background: #fff;
  border: 1px solid #dce3ef;
  border-radius: 5px;
  font-size: 0.8rem;
}

/* Section heading and "View all" link */
.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-title-row h2 {
  margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 720px) {
  .hero {
    padding-block: 40px;
  }

  .about-photo {
    width: 38%;
    max-width: 160px;
    margin-left: 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .about-photo {
    float: none;
    display: block;
    width: 150px;
    max-width: 100%;
    margin: 0 0 20px;
  }
}
