:root {
  --color-text: #1a1a1a;
  --color-muted: #5d5d5d;
  --color-bg: #ffffff;
  --color-bg-alt: #f6f4ee;
  --color-accent: #3d5a40;
  --color-accent-dark: #2c4430;
  --color-accent-soft: #e7ede4;
  --color-border: #e6e2d9;

  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --max-width: 1180px;
  --content-width: 760px;
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

a:hover {
  color: var(--color-accent-dark);
  border-bottom-color: var(--color-accent-dark);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); letter-spacing: -0.005em; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

p.lead {
  font-size: 1.15rem;
  color: var(--color-muted);
  line-height: 1.6;
}

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

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--color-text);
  border-bottom: none;
  letter-spacing: 0.01em;
}

.wordmark:hover {
  color: var(--color-accent);
  border-bottom: none;
}

.wordmark .accent {
  color: var(--color-accent);
}

nav.primary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}

nav.primary a {
  color: var(--color-text);
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

nav.primary a:hover,
nav.primary a.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  width: 100%;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

.hero .hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  width: 100%;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 0.4em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.hero .tagline {
  font-size: 1.15rem;
  max-width: 600px;
  color: #f0ece2;
  margin: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* ---------- Page Header (non-hero) ---------- */

.page-header {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  padding: 3.5rem 1.5rem 3rem;
}

.page-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header h1 {
  margin: 0 0 0.4em;
}

.page-header p {
  color: var(--color-muted);
  max-width: 640px;
  font-size: 1.1rem;
  margin: 0;
}

.page-header .eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

/* ---------- Sections ---------- */

main { display: block; }

section.block {
  padding: 4rem 1.5rem;
}

section.block.alt {
  background: var(--color-bg-alt);
}

section.block .inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

section.block .narrow {
  max-width: var(--content-width);
  margin: 0 auto;
}

.section-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

/* ---------- Cards / Grids ---------- */

.grid {
  display: grid;
  gap: 2rem;
}

.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 800px) {
  .grid.cols-2,
  .grid.cols-3 { grid-template-columns: 1fr; }
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-alt);
  padding: 0.75rem;
  box-sizing: border-box;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.card:hover .thumb img {
  transform: scale(1.04);
}

.card .body {
  padding: 1.4rem 1.5rem 1.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card h3 {
  margin: 0 0 0.4em;
}

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

/* ---------- Project rows (alt layout) ---------- */

.project-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 3rem 0;
  border-bottom: 1px solid var(--color-border);
}

.project-row:last-child { border-bottom: none; }

.project-row.reverse .project-img { order: 2; }

.project-row.stacked {
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: stretch;
}

.project-row.stacked .project-img img {
  width: 100%;
  height: auto;
  display: block;
}

.project-row .project-img img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.project-row .project-text h2 {
  margin-top: 0;
}

@media (max-width: 800px) {
  .project-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .project-row.reverse .project-img { order: 0; }
}

/* ---------- People ---------- */

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2.5rem;
}

.person {
  text-align: left;
}

.person .portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-bg-alt);
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-family: var(--font-serif);
  font-size: 2rem;
}

.person .portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person h3 {
  margin: 0 0 0.2em;
  font-size: 1.15rem;
}

.person .role {
  color: var(--color-accent);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin: 0 0 0.6rem;
}

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

.pi-feature {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

.pi-feature .portrait {
  width: 280px;
  height: 280px;
  border-radius: var(--radius);
}

@media (max-width: 700px) {
  .pi-feature {
    grid-template-columns: 1fr;
  }
  .pi-feature .portrait {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }
}

/* ---------- Publication / list items ---------- */

.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

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

.pub-list .pub-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 0 0 0.3em;
  color: var(--color-text);
}

.pub-list .pub-authors {
  color: var(--color-muted);
  margin: 0 0 0.3em;
  font-size: 0.95rem;
}

.pub-list .pub-venue {
  font-size: 0.9rem;
  color: var(--color-muted);
  font-style: italic;
}

.pub-list .pub-year {
  display: inline-block;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 0.6rem;
  vertical-align: middle;
}

/* ---------- Protocols ---------- */

.protocol-list {
  display: grid;
  gap: 1rem;
}

.protocol {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  background: var(--color-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.protocol h3 {
  margin: 0 0 0.3em;
  font-size: 1.1rem;
}

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

.protocol .download {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  color: var(--color-accent);
}

.protocol .download:hover {
  background: var(--color-accent);
  color: #fff;
  border-bottom: 1px solid var(--color-accent);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: none;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--color-accent-dark);
  color: #fff;
  border-bottom: none;
}

.btn.secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn.secondary:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ---------- Gallery (masonry via columns) ---------- */

.gallery {
  column-count: 3;
  column-gap: 14px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 900px) { .gallery { column-count: 2; } }
@media (max-width: 540px) { .gallery { column-count: 1; } }

.gallery figure {
  margin: 0 0 14px;
  break-inside: avoid;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.gallery figure img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease, filter 0.3s ease;
}

.gallery figure:hover img {
  transform: scale(1.03);
  filter: brightness(1.05);
}

.gallery figure figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery figure:hover figcaption { opacity: 1; }

/* ---------- Placeholder banner ---------- */

.placeholder-note {
  background: #fffbe6;
  border: 1px solid #ecd97a;
  color: #6e5a00;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin: 1.5rem 0;
}

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

footer.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  padding: 2.5rem 1.5rem;
  margin-top: 4rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

footer.site-footer .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

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

footer.site-footer a:hover {
  color: var(--color-accent);
}

footer .lab-mark {
  font-family: var(--font-serif);
  color: var(--color-text);
  font-size: 1rem;
  margin-bottom: 0.3rem;
  display: block;
}

/* ---------- Mobile nav tweaks ---------- */

@media (max-width: 600px) {
  .site-header .inner {
    padding: 0.9rem 1rem;
  }
  nav.primary ul {
    gap: 1rem;
    font-size: 0.9rem;
  }
}
