*, *::before, *::after { box-sizing: border-box; }
html { background: #171210; }

:root {
  --text: #1f1f1f;
  --text-light: #777;
  --bg: #fff;
  --header-bg: rgba(32, 26, 22, 0.9);
  --accent: #2aa5a0;
  --max-width: 669px;
  --section-width: 1054px;
  --font-heading: 'Jost', sans-serif;
  --font-body: 'Nunito Sans', sans-serif;
}

/* ── Accessibility ───────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--header-bg);
  color: #fff;
  padding: 12px 24px;
  z-index: 1000;
  font-size: 14px;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

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

/* ── Base ──────────────────────────────────────────── */
/* Original: europa 15px/24px, weight 300, ls 0.5px, color #1f1f1f */

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  letter-spacing: 0.5px;
  line-height: 24px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

p { margin: 0 0 15px; }
a { color: var(--text); }
a:hover { opacity: 0.7; }

/* ── Hero ─────────────────────────────────────────── */
/* Original: 984px tall at 1400w viewport, image object-fit fill */

.hero {
  position: relative;
  width: 100%;
  height: 984px;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-caption {
  position: absolute;
  bottom: 24px;
  left: 40px;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
}

/* ── Sticky header ───────────────────────────────── */
/* Original: fixed, rgba(32,26,22,0.9), height 89px, padding 0 20px */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 89px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: background 0.3s, opacity 0.3s;
}

.has-hero .site-header {
  background: transparent;
}

.site-header.scrolled {
  background: var(--header-bg);
}

/* Page header (non-hero pages) */
.site-header--page {
  position: relative;
  height: 89px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--header-bg);
}

.site-header--page .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* ── Site name ───────────────────────────────────── */
/* Original: futura-pt, ~13px, weight 500, ls 3px */

.site-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  line-height: 1.4;
  white-space: nowrap;
}

.site-name:hover { opacity: 0.8; }

/* ── Navigation ──────────────────────────────────── */
/* Original: futura-pt, 15px, weight 500, ls 2px, padding 11.25px 15px */

nav {
  display: flex;
  align-items: center;
  gap: 0;
}

nav a {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  padding: 11px 15px;
}

nav a:hover { opacity: 0.7; }
nav a[aria-current="page"] { opacity: 0.7; }

.nav-dropdown {
  position: relative;
}

.nav-dropdown > a {
  cursor: pointer;
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--header-bg);
  min-width: 200px;
  padding: 8px 0;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-content {
  display: block;
}

.nav-dropdown-content a {
  display: block;
  padding: 8px 20px;
  white-space: nowrap;
}

/* Original: border 2px solid white, padding 15px 22.5px */
.nav-contact {
  border: 2px solid #fff;
  padding: 10px 18px;
  margin-left: 10px;
}

.nav-contact:hover {
  background: #fff;
  color: var(--text);
  opacity: 1;
}

/* ── About section ───────────────────────────────── */
/* Original: section 1054px wide, 263px tall, starts 96px below hero */

.about-section {
  max-width: var(--section-width);
  margin: 0 auto;
  padding: 96px 0 89px;
}

.about-inner {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* Original: portrait 230x230, object-fit cover */
.about-portrait {
  flex: 0 0 230px;
}

.about-portrait img {
  width: 230px;
  height: 230px;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}

/* Original: text container 757px wide */
.about-text {
  flex: 1;
  max-width: 757px;
}

.about-text p:last-child { margin-bottom: 0; }

/* ── Research intro ──────────────────────────────── */
/* Original: heading at ~192px below about section, 32px, weight 300 */

.research-intro {
  text-align: center;
  padding: 100px 20px 17px;
}

.research-intro h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: normal;
  line-height: 1.2;
  text-transform: none;
  color: #1c1c1c;
  margin: 0;
}

/* ── Research cards ──────────────────────────────── */
/* Original: card images 317x317 square, titles 25px weight 400 ls 4px dark */

.research-cards {
  display: flex;
  gap: 0;
  max-width: var(--section-width);
  margin: 0 auto;
  padding: 0 0 80px;
}

.research-card {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  padding: 0 17px;
}

.research-card:hover { opacity: 0.8; }

.research-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  margin-bottom: 12px;
}

/* Original: futura-pt, 25px, weight 400, ls 4px, dark color */
.research-card h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

.research-card p {
  font-size: 15px;
  font-weight: 300;
  line-height: 24px;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin: 0;
}

/* ── Research banners ────────────────────────────── */
/* Original: full-width, ~1050px tall, img with object-fit fill */

.research-banner {
  position: relative;
  width: 100%;
  height: 860px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.research-label {
  position: absolute;
  font-family: var(--font-heading);
  color: #fff;
  font-size: 50px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

#historical-ecology .banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62.5%;
}

.publications-banner .banner-img {
  position: absolute;
  bottom: 0;
  left: 0;
}

/* ── Research detail text ────────────────────────── */
/* Original: section 1054px, text 669px wide, heading 32px centered */

.research-detail {
  background: var(--bg);
}

.research-detail-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 34px 0;
}

/* Original: futura-pt, 32px, weight 300, centered, color #1c1c1c */
.research-detail h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 300;
  letter-spacing: normal;
  line-height: 1.2;
  text-transform: none;
  text-align: center;
  margin: 0 0 34px;
  color: #1c1c1c;
}

.research-detail p:last-child { margin-bottom: 0; }

.research-detail a { color: var(--accent); text-decoration: none; }
.research-detail a:hover { opacity: 0.7; text-decoration: underline; }

/* ── Publications banner ─────────────────────────── */

.publications-banner {
  position: relative;
  width: 100%;
  height: 860px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Publications list ───────────────────────────── */

.publications-list {
  background: var(--bg);
}

.publications-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.pub-profiles {
  text-align: center;
  margin-bottom: 24px;
}

.pub-profiles a {
  color: var(--accent);
  text-decoration: none;
}

.pub-profiles a:hover { text-decoration: underline; }

.publications-inner h2 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

.publications-inner h2:first-of-type { margin-top: 0; }

.publications-inner p {
  margin: 15px 0;
}

.publications-inner a {
  color: var(--accent);
}

/* ── Main content (inner pages) ──────────────────── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

main { padding: 0; flex: 1; }

body:not(.has-hero) main {
  padding: 40px 0;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

/* ── Typography (inner pages) ────────────────────── */

h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--text);
}

h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}

ul, ol {
  margin: 0 0 15px;
  padding-left: 1.5rem;
}

li { margin-bottom: 4px; }

em { font-style: italic; }

hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 2.5rem 0;
}

strong { font-weight: 600; }

/* ── Images in content (inner pages) ─────────────── */

main .container img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

main .container img[src*="team/"] {
  max-width: 280px;
  width: 280px;
}

main .container img[src*="ella-logo"] {
  max-width: 300px;
}

/* ── Footer ──────────────────────────────────────── */
/* Original: "Contact me" 20px weight 300, dark bg */

.site-footer {
  background: #201a16;
  color: #ccc;
  text-align: center;
}

.footer-inner {
  padding: 40px 20px 30px;
}

/* Original: futura-pt, 20px, weight 300 */
.footer-heading {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: normal;
  margin: 0 0 20px;
  text-transform: none;
}

.footer-icons {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.footer-icons a {
  color: #ccc;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.footer-icons a:hover { color: #fff; }

.footer-bottom {
  background: #171210;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  font-size: 12px;
  color: #888;
}

.footer-bottom p { margin: 0; }

/* ── ELLA Lab page ──────────────────────────────── */

.ella-lab-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px 60px;
  text-align: center;
}

.ella-lab-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: none;
  margin: 0 0 30px;
}

.ella-lab-logo {
  display: block;
  margin: 0 auto 40px;
  max-width: 400px;
  width: 100%;
  height: auto;
}

.ella-lab-subtitle {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: none;
  margin: 0 0 30px;
}

.ella-lab-subtitle strong {
  font-weight: 600;
}

.ella-lab-content {
  text-align: left;
}

.ella-lab-content a {
  color: var(--accent);
  text-decoration: none;
}

.ella-lab-content a:hover {
  text-decoration: underline;
  opacity: 1;
}

.ella-lab-links {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.ella-btn {
  display: inline-block;
  border: 2px solid var(--text);
  padding: 15px 25px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

.ella-btn:hover {
  background: var(--text);
  color: #fff;
  opacity: 1;
}

/* ── Team page ──────────────────────────────────── */

.team-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.team-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 2px;
  text-align: center;
  text-transform: none;
  margin: 0 0 50px;
}

.team-member {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #e0e0e0;
}

.team-member:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.team-member-photo {
  flex: 0 0 280px;
}

.team-member-photo img {
  width: 280px;
  height: 350px;
  object-fit: cover;
  border-radius: 30px;
  display: block;
}

.team-member-info {
  flex: 1;
  min-width: 0;
}

.team-member-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  margin: 0 0 8px;
}

.team-member-role {
  font-size: 15px;
  color: var(--text-light);
  margin: 0 0 16px;
}

.team-member-bio {
  font-size: 14px;
  line-height: 22px;
  margin: 0;
}

/* ── Projects page ──────────────────────────────── */

.projects-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.projects-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 2px;
  text-align: center;
  text-transform: none;
  margin: 0 0 50px;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

.project-card {
  text-align: center;
}

.project-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  margin: 0 0 20px;
}

.project-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 15px;
}

.project-card p {
  font-size: 14px;
  line-height: 22px;
  text-align: left;
  margin: 0 0 20px;
}

.project-btn {
  display: inline-block;
  background: var(--text);
  border: 2px solid var(--text);
  padding: 12px 22px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s;
}

.project-btn:hover {
  opacity: 0.8;
  color: #fff;
}

/* ── Footer (inner pages) ───────────────────────── */

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
}

.footer-links a {
  color: #ccc;
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover {
  color: #fff;
}

.site-footer a {
  color: #ccc;
}

.site-footer a:hover {
  color: #fff;
  opacity: 1;
}

/* ── Hamburger toggle ────────────────────────────── */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 768px) {
  /* Header */
  .site-header {
    height: auto;
    padding: 16px 20px;
  }

  .site-header--page {
    height: auto;
  }

  /* Hamburger */
  .nav-toggle { display: flex; }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-bg);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 16px;
    z-index: 200;
  }

  .nav-open nav { display: flex; }

  nav a {
    padding: 12px 20px 12px 40px;
    font-size: 11px;
    text-align: left;
  }

  .nav-dropdown-content {
    display: block;
    position: static;
    min-width: 0;
    padding: 0;
    background: transparent;
  }

  .nav-dropdown-content a {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    padding-left: 60px;
  }

  .nav-contact {
    border: none;
    margin-left: 0;
    padding: 12px 20px 12px 40px;
  }

  .nav-contact:hover {
    background: transparent;
    color: #fff;
  }

  .nav-open .nav-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Hero */
  .hero { height: 60vh; }

  /* About */
  .about-section { padding: 40px 20px 0; }

  .about-inner {
    flex-direction: column;
    gap: 24px;
  }

  .about-portrait {
    flex: none;
    margin: 0 auto;
  }

  .about-portrait img {
    width: 200px;
    height: 200px;
  }

  /* Research */
  .research-intro { padding: 60px 20px 12px; }
  .research-intro h2 { font-size: 24px; }

  .research-cards {
    flex-direction: column;
    padding: 0 20px 30px;
    gap: 24px;
  }

  .research-banner,
  .publications-banner { height: 300px; }

  .research-label {
    font-size: 24px;
    letter-spacing: 2px;
  }

  .research-detail-inner { padding: 24px 20px; }

  /* Inner pages */
  .page-title { font-size: 1.4rem; }
  .container { padding: 0 20px; }

  .ella-lab-page { padding: 30px 20px 40px; }
  .ella-lab-title { font-size: 26px; }
  .ella-lab-logo { max-width: 250px; }
  .ella-lab-links { flex-direction: column; align-items: center; }

  .team-page { padding: 30px 20px 40px; }
  .team-title { font-size: 26px; margin-bottom: 30px; }
  .team-member { flex-direction: column; align-items: center; text-align: center; }
  .team-member-photo { flex: none; }

  .projects-page { padding: 30px 20px 40px; }
  .projects-title { font-size: 26px; margin-bottom: 30px; }
  .projects-grid { grid-template-columns: 1fr; gap: 40px; }

  .footer-links { flex-direction: column; gap: 8px; }
}
