:root {
  color-scheme: light;
  --ink: #20302e;
  --muted: #66736f;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --line: #dbe3dc;
  --green: #3e7d66;
  --green-soft: #e7f1eb;
  --blue: #477ea7;
  --blue-soft: #e8f2f7;
  --clay: #b66f45;
  --warning: #fff5dc;
  --shadow: 0 18px 50px rgba(32, 48, 46, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  color: var(--ink);
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
}

.site-header.scrolled {
  background: rgba(251, 250, 246, 0.94);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(14px);
}

.brand,
.nav,
.hero-actions,
.contact-links,
.footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green);
  font-size: 13px;
  letter-spacing: 0;
}

.nav {
  gap: clamp(12px, 2.8vw, 28px);
  font-size: 14px;
  font-weight: 660;
}

.nav a {
  opacity: 0.78;
}

.nav a:hover,
.nav a.active {
  color: var(--green);
  opacity: 1;
}

.hero {
  position: relative;
  min-height: 96svh;
  display: grid;
  align-items: end;
  background: var(--paper) url("/e-portfolio/assets/portfolio-hero.png") center / cover no-repeat;
  overflow: hidden;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(251, 250, 246, 0.94), rgba(251, 250, 246, 0.68) 50%, rgba(251, 250, 246, 0.12)),
    linear-gradient(0deg, rgba(251, 250, 246, 0.82), rgba(251, 250, 246, 0.08) 48%);
}

.hero-content {
  position: relative;
  width: min(820px, calc(100% - 36px));
  margin: 120px clamp(18px, 7vw, 96px) clamp(52px, 8vh, 92px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 790;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 24px;
  font-size: clamp(42px, 6.8vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.title-serif {
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  color: var(--ink);
  text-wrap: balance;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 23px;
  line-height: 1.18;
  letter-spacing: 0;
}

h4 {
  margin-bottom: 10px;
  color: var(--green);
  font-size: 15px;
  text-transform: uppercase;
}

p,
li {
  color: var(--muted);
  line-height: 1.68;
}

.bio-card {
  max-width: 760px;
  padding: 24px;
  border: 1px solid rgba(219, 227, 220, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 30px rgba(32, 48, 46, 0.08);
  backdrop-filter: blur(10px);
}

.bio-card p:last-child {
  margin-bottom: 0;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(62, 125, 102, 0.3);
  border-radius: 8px;
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.button.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.78);
  color: var(--green);
}

.section-pad {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(58px, 8vw, 104px) 0;
}

.overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.overview-item,
.document-panel,
.supporting-work article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.overview-item {
  min-height: 120px;
  padding: 22px;
}

.overview-item strong {
  display: block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 22px;
}

.overview-item span {
  color: var(--muted);
  line-height: 1.5;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.research-grid {
  display: grid;
  gap: 22px;
}

.research-card {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(32, 48, 46, 0.04);
}

.research-card img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.research-body {
  padding: clamp(24px, 4vw, 42px);
}

.project-meta,
.small-label {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 760;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

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

.yeast-gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.lightbox-trigger {
  display: block;
  width: 100%;
  height: 118px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}

.yeast-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.lightbox-trigger:hover img {
  transform: scale(1.04);
}

.yeast-gallery figcaption {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tags span {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 740;
}

.tags.compact span {
  background: var(--blue-soft);
  color: var(--blue);
}

.supporting-work {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.supporting-work article {
  padding: 24px;
}

.resume {
  width: 100%;
  max-width: none;
  padding-inline: max(18px, calc((100% - 1180px) / 2));
  background: #f1f6f2;
}

.privacy-note {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #e5cf8b;
  border-radius: 8px;
  background: var(--warning);
  color: #6b5420;
  font-weight: 650;
}

.document-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 18px;
}

.document-grid.single {
  grid-template-columns: minmax(0, 820px);
}

.document-panel {
  padding: clamp(22px, 4vw, 34px);
}

.document-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.text-link {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 760;
}

.doc-section {
  margin-bottom: 24px;
}

.doc-section ul {
  margin: 0;
  padding-left: 20px;
}

.letter-preview {
  max-height: 660px;
  overflow: auto;
  padding-right: 8px;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.8fr) minmax(220px, 0.55fr);
  gap: 24px;
  align-items: start;
}

.contact-form,
.contact-links {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.contact-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 720;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(62, 125, 102, 0.22);
  border-color: var(--green);
}

.contact-links {
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
}

.contact-links a {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--green);
  font-weight: 760;
}

.footer {
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer a {
  color: var(--green);
  font-weight: 760;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 56px 22px 28px;
  background: rgba(18, 28, 26, 0.82);
}

.lightbox.open {
  display: flex;
}

.lightbox figure {
  width: min(1100px, 100%);
  margin: 0;
}

.lightbox img {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.lightbox figcaption {
  margin-top: 12px;
  color: #fff;
  font-weight: 720;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 0 14px;
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

@media (max-width: 940px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-content {
    margin-top: 138px;
  }

  .overview,
  .research-card,
  .supporting-work,
  .document-grid,
  .contact {
    grid-template-columns: 1fr;
  }

  .research-card img {
    min-height: 300px;
    aspect-ratio: 16 / 10;
  }

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

  .yeast-gallery img {
    height: 100%;
  }

  .lightbox-trigger {
    height: 210px;
  }

  .section-heading,
  .document-head,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 40px;
  }

  .bio-card,
  .overview-item,
  .document-panel,
  .supporting-work article,
  .contact-form,
  .contact-links {
    padding: 18px;
  }

  .button {
    width: 100%;
  }
}
