:root {
  --bg: #F3F5D9;
  --surface: #ffffff;
  --surface-soft: #D0EFB0;
  --text: #476443;
  --muted: #86B87D;
  --accent: #86B87D;
  --accent-dark: #476443;
  --line: #D0EFB0;
  --shadow: 0 10px 30px rgba(71, 100, 67, 0.06);
  --radius: 18px;
  --hero-top-height: clamp(190px, 22vw, 248px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 56px;
}

.site-header {
  position: sticky;
  top: 8px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(243, 245, 217, 0.96);
  box-shadow: var(--shadow);
}

.brand {
  font-family: "Instrument Serif", serif;
  font-size: 1.55rem;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-nav a {
  color: var(--muted);
  font-weight: 600;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: stretch;
  padding: 56px 0 24px;
}

.hero-copy,
.hero-panel,
.section,
.interest-card,
.project-card,
.section-split > div,
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 48px;
}

.hero-copy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) clamp(160px, 21vw, 230px);
  column-gap: 14px;
  row-gap: 18px;
  align-items: end;
}

.hero-photo-slot {
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  height: var(--hero-top-height);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

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

.hero-panel {
  padding: 28px;
  background: var(--surface-soft);
}

.eyebrow,
.panel-label,
.project-tag {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

h1,
h2 {
  font-family: "Instrument Serif", serif;
}

h1 {
  max-width: 14ch;
  font-size: clamp(3rem, 7vw, 5.6rem);
}

.hero-title {
  grid-column: 1;
  grid-row: 1;
  max-width: none;
  width: 100%;
  height: var(--hero-top-height);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.1em;
  font-size: clamp(1.62rem, 2.25vw, 2.3rem);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.hero-title-line {
  display: block;
  white-space: nowrap;
}

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

h3 {
  font-size: 1.35rem;
}

p,
li,
span,
strong {
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.hero-text,
.section p,
.project-card p,
.interest-card p,
.contact-section p,
.facts-list span,
.bullet-list li,
.project-card li {
  color: var(--muted);
}

.hero-text {
  max-width: 64ch;
  margin: 0;
  font-size: 1.08rem;
}

.hero-text-wide {
  grid-column: 1 / -1;
}

.hero-text-wide {
  grid-column: 1;
  grid-row: 1;
}

.hero-text-wide {
  max-width: none;
  margin-top: 0;
}

.editable {
  color: var(--text);
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

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

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

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

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

.facts-list,
.bullet-list,
.project-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.facts-list li:first-child {
  border-top: 0;
}

.facts-list strong {
  text-align: right;
}

.section {
  margin-top: 24px;
  padding: 36px;
}

.section-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.about-grid,
.section-split,
.interest-grid,
.project-grid {
  display: grid;
  gap: 20px;
}

.about-grid,
.section-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.interest-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.interests-grid-extended {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.interest-card,
.project-card,
.section-split > div,
.contact-card {
  min-width: 0;
}

.section-split > div,
.contact-card {
  padding: 24px;
}

.interest-card {
  position: relative;
  display: grid;
  gap: 0;
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.project-card {
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.interest-card:hover,
.interest-card:focus-within,
.project-card:hover,
.project-card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(110, 191, 101, 0.82);
  box-shadow: 0 0 0 1px rgba(110, 191, 101, 0.48), 0 0 28px rgba(110, 191, 101, 0.28), 0 18px 44px rgba(31, 71, 47, 0.12);
}

#research .interest-card {
  gap: 18px;
  padding: 24px;
}

.interest-card-media {
  margin-bottom: 0;
  height: 220px;
  min-height: 0;
  transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.interest-card:hover .interest-card-media,
.interest-card:focus-within .interest-card-media {
  transform: scale(1.015);
  border-color: rgba(31, 107, 79, 0.22);
  background: #e8f1e8;
}

.interest-card-copy {
  display: grid;
  gap: 10px;
  min-height: 112px;
  padding: 24px;
}

.interest-card-copy h3 {
  line-height: 1.15;
}

.interest-card-hover {
  display: grid;
  gap: 14px;
}

.interest-card-hover p {
  margin: 0;
}

#interests .interest-card-copy {
  grid-template-areas: "interest-stack";
  align-items: start;
  min-height: 122px;
}

#interests .interest-card-copy > h3,
#interests .interest-card-hover {
  grid-area: interest-stack;
}

#interests .interest-card-copy > h3,
#interests .interest-card-hover {
  transition: opacity 180ms ease, transform 220ms ease;
}

#interests .interest-card-hover {
  max-height: none;
  opacity: 0;
  overflow: visible;
  transform: translateY(8px);
}

#interests .interest-card:hover .interest-card-copy > h3,
#interests .interest-card:focus .interest-card-copy > h3,
#interests .interest-card:focus-within .interest-card-copy > h3 {
  opacity: 0;
  transform: translateY(-8px);
}

#interests .interest-card:hover .interest-card-hover,
#interests .interest-card:focus .interest-card-hover,
#interests .interest-card:focus-within .interest-card-hover {
  max-height: none;
  opacity: 1;
  transform: translateY(0);
}

.project-card-featured {
  grid-column: span 2;
  background: var(--surface-soft);
}

.project-card > :not(.media-placeholder) {
  margin-left: 24px;
  margin-right: 24px;
}

.project-card > .project-tag {
  margin-top: 24px;
}

.media-placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin-bottom: 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  font-weight: 600;
  overflow: hidden;
}

.interest-card > .media-placeholder,
.project-card > .media-placeholder {
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
}

.media-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.media-image-contain {
  padding: 12px;
  background: #f8fbf1;
  object-fit: contain;
}

.media-image-focus-top {
  object-fit: cover;
  object-position: 50% 22%;
}

.media-placeholder-large {
  min-height: 220px;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
}

.text-link:hover {
  color: var(--accent-dark);
}

.project-card ul {
  margin-top: 16px;
}

.project-card li,
.bullet-list li {
  position: relative;
  padding-left: 18px;
}

.project-card li::before,
.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.contact-section {
  text-align: center;
}

.contact-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-top: 22px;
  background: var(--surface-soft);
}

.contact-card a {
  font-size: 1.1rem;
  font-weight: 800;
}

.detail-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 112px;
}

.detail-header {
  position: fixed;
  left: 50%;
  top: auto;
  right: auto;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 30;
  width: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.detail-header .text-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: min(320px, calc(100vw - 32px));
  min-height: 50px;
  padding: 0 28px;
  border: 1px solid rgba(110, 191, 101, 0.46);
  border-radius: 999px;
  background: rgba(208, 239, 176, 0.86);
  box-shadow: 0 0 0 1px rgba(110, 191, 101, 0.16), 0 14px 34px rgba(31, 71, 47, 0.16);
  color: var(--accent-dark);
  text-align: center;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.detail-header .text-link:hover,
.detail-header .text-link:focus {
  border-color: rgba(110, 191, 101, 0.82);
  background: rgba(208, 239, 176, 0.96);
  box-shadow: 0 0 26px rgba(110, 191, 101, 0.32), 0 14px 34px rgba(31, 71, 47, 0.16);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 24px;
}

.detail-main,
.detail-side,
.detail-media {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-main,
.detail-side {
  padding: 28px;
}

.detail-media {
  display: grid;
  place-items: center;
  min-height: 280px;
  margin-bottom: 24px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.detail-stack {
  display: grid;
  gap: 16px;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.detail-list li + li {
  margin-top: 10px;
}

.detail-meta {
  display: grid;
  gap: 14px;
}

.detail-meta div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-meta div:first-child {
  padding-top: 0;
  border-top: 0;
}

.detail-meta strong {
  display: block;
  margin-bottom: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .interest-card-copy {
    min-height: 72px;
  }

  .interest-card-hover {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(8px);
    transition: max-height 220ms ease, opacity 180ms ease, transform 220ms ease;
  }

  .interest-card:hover .interest-card-hover,
  .interest-card:focus-within .interest-card-hover {
    max-height: 180px;
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .hero,
  .about-grid,
  .section-split,
  .detail-grid,
  .interest-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card-featured {
    grid-column: auto;
  }

  .hero-copy,
  .section,
  .detail-main,
  .detail-side {
    padding: 28px;
  }

  .hero-photo-slot {
    width: 100%;
    max-width: 280px;
  }

  .interest-card-copy {
    min-height: 0;
  }
}

@media (max-width: 960px) and (min-width: 501px) {
  .hero-copy-layout {
    grid-template-columns: minmax(0, 1fr) clamp(136px, 32vw, 220px);
    align-items: start;
  }
}

@media (max-width: 500px) {
  .hero-copy-layout {
    grid-template-columns: minmax(0, 1fr) clamp(58px, 26vw, 120px);
    column-gap: 10px;
    --hero-top-height: clamp(132px, 52vw, 190px);
  }

  .hero-text {
    font-size: clamp(0.82rem, 4.1vw, 1rem);
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .site-header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    gap: 12px 16px;
  }

  h1 {
    max-width: none;
  }

  .hero-copy,
  .hero-panel,
  .section,
  .section-split > div,
  .contact-card {
    padding: 22px;
  }

  .interest-card-copy {
    padding: 22px;
  }

  #research .interest-card {
    padding: 22px;
  }

  .project-card > :not(.media-placeholder) {
    margin-left: 22px;
    margin-right: 22px;
  }

  .project-card > .project-tag {
    margin-top: 22px;
  }

}

@media (max-width: 340px) {
  .hero-copy,
  .hero-panel,
  .section,
  .section-split > div,
  .contact-card {
    padding: 16px;
  }

  .interest-card-copy {
    padding: 16px;
  }

  #research .interest-card {
    padding: 16px;
  }

  .project-card > :not(.media-placeholder) {
    margin-left: 16px;
    margin-right: 16px;
  }

  .project-card > .project-tag {
    margin-top: 16px;
  }

}

@media (max-width: 250px) {
  .hero-copy-layout {
    grid-template-columns: 1fr;
  }

  .hero-photo-slot,
  .hero-text-wide {
    grid-column: 1;
  }

  .hero-photo-slot {
    grid-row: 1;
  }

  .hero-text-wide {
    grid-row: 2;
  }

}
