:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #e9eee8;
  --ink: #111414;
  --muted: #5f6662;
  --line: rgba(17, 20, 20, 0.16);
  --line-strong: rgba(17, 20, 20, 0.28);
  --sage: #637466;
  --moss: #24372d;
  --rust: #b15f43;
  --clay: #d9c6b6;
  --shadow: 0 24px 70px rgba(17, 20, 20, 0.12);
  --max: min(1180px, calc(100% - 32px));
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Manrope,
    Montserrat,
    "Segoe UI",
    system-ui,
    sans-serif;
}

body.is-loading .project-grid,
body.is-loading .masonry-gallery,
body.is-loading .visual-grid {
  min-height: 220px;
}

img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface-2);
}

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

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 20;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--ink);
  border-radius: var(--radius);
}

.skip-link:not(:focus):not(:focus-visible) {
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: var(--max);
  margin: 0 auto;
  padding: 18px 0;
  color: var(--surface);
  mix-blend-mode: difference;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 750;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 650;
}

.site-nav a {
  padding: 9px 11px;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.hero {
  position: relative;
  min-height: 84svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--surface);
  background: var(--ink);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 14, 12, 0.78) 0%, rgba(10, 14, 12, 0.42) 44%, rgba(10, 14, 12, 0.12) 100%),
    linear-gradient(0deg, rgba(10, 14, 12, 0.58) 0%, transparent 42%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: var(--max);
  margin: 0 auto;
  padding: 150px 0 86px;
}

.hero-location {
  margin: 0 0 22px;
  font-size: 0.95rem;
  font-weight: 700;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: 5rem;
  line-height: 0.92;
  font-weight: 800;
}

.hero-copy {
  max-width: 560px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.18rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 750;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button-light {
  color: var(--ink);
  background: var(--surface);
}

.button-ghost {
  color: var(--surface);
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.08);
}

.button-dark {
  color: var(--surface);
  background: var(--ink);
}

.hero-panel {
  position: absolute;
  z-index: 2;
  right: max(16px, calc((100vw - 1180px) / 2));
  bottom: 28px;
  width: min(410px, calc(100% - 32px));
  padding: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 14px;
}

.hero-stats div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.hero-stats dt {
  font-size: 1.18rem;
  font-weight: 800;
}

.hero-stats dd {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.hero-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.hero-rail img {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.intro-band,
.section {
  position: relative;
}

.intro-band {
  background: var(--moss);
  color: var(--surface);
}

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

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  padding: 30px 0;
}

.intro-grid p {
  max-width: 760px;
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.86);
}

.text-link {
  border-bottom: 1px solid currentColor;
  font-size: 0.92rem;
  font-weight: 750;
}

.section {
  padding: 92px 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 0.55fr);
  gap: 44px;
  align-items: end;
  margin-bottom: 36px;
}

.section-heading h2,
.project-stage h2,
.about-copy h2,
.research-section h2,
.contact-section h2 {
  margin: 0;
  font-size: 3rem;
  line-height: 1;
  font-weight: 800;
}

.section-heading p,
.research-layout p,
.contact-layout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.project-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.project-tab {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.project-tab.is-active {
  color: var(--surface);
  background: var(--moss);
  border-color: var(--moss);
}

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

.project-card {
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.project-card button {
  display: grid;
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.project-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 340ms ease;
}

.project-card:hover img,
.project-card:focus-within img {
  transform: scale(1.035);
}

.project-card-copy {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.project-card h3 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.15;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.project-card span {
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 800;
}

.project-stage {
  background: var(--surface);
}

.project-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
  margin-bottom: 12px;
}

.project-type {
  margin: 0 0 8px;
  color: var(--rust);
  font-size: 0.82rem;
  font-weight: 800;
}

.project-meta {
  margin: 0 0 28px;
  color: var(--muted);
}

.masonry-gallery {
  columns: 3 250px;
  column-gap: 12px;
}

.gallery-button {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  overflow: hidden;
  background: var(--surface-2);
  border: 0;
  border-radius: var(--radius);
  cursor: zoom-in;
  break-inside: avoid;
}

.gallery-button img {
  border-radius: var(--radius);
  transition:
    transform 260ms ease,
    filter 260ms ease;
}

.gallery-button:hover img,
.gallery-button:focus-visible img {
  transform: scale(1.025);
  filter: saturate(1.05);
}

.gallery-button:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

.visual-section {
  background: var(--surface-2);
}

.visual-layout {
  display: grid;
  gap: 28px;
}

.tour-frame {
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tour-frame iframe {
  display: block;
  width: 100%;
  height: min(70svh, 760px);
  min-height: 480px;
  border: 0;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.visual-grid .gallery-button {
  margin: 0;
}

.visual-grid img {
  aspect-ratio: 1;
  height: 100%;
  object-fit: cover;
}

.about-section {
  background: var(--bg);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 0.62fr);
  gap: 52px;
  align-items: start;
}

.about-portrait {
  position: sticky;
  top: 96px;
}

.about-portrait img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about-copy p {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.academic-block {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.academic-block h3 {
  margin: 0 0 16px;
  font-size: 1rem;
}

.academic-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.academic-list li {
  padding: 12px 14px;
  color: var(--moss);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 700;
}

.research-section {
  color: var(--surface);
  background: var(--moss);
}

.research-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
  gap: 34px;
  align-items: start;
}

.research-layout p {
  color: rgba(255, 255, 255, 0.78);
  margin-top: 16px;
}

.research-links {
  display: grid;
  gap: 10px;
}

.research-link,
.contact-link {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
}

.research-link:hover,
.contact-link:hover,
.research-link:focus-visible,
.contact-link:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.contact-section {
  background: var(--ink);
  color: var(--surface);
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
  gap: 44px;
}

.contact-layout p {
  color: rgba(255, 255, 255, 0.76);
  margin-top: 16px;
}

.contact-list {
  display: grid;
  gap: 10px;
}

.contact-link {
  align-items: center;
}

.contact-link span:last-child,
.research-link span:last-child {
  color: rgba(255, 255, 255, 0.68);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: var(--max);
  margin: 0 auto;
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.image-dialog {
  width: min(1120px, calc(100% - 28px));
  max-height: calc(100svh - 28px);
  padding: 0;
  overflow: hidden;
  background: var(--ink);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.image-dialog::backdrop {
  background: rgba(17, 20, 20, 0.72);
}

.image-dialog img {
  width: 100%;
  max-height: calc(100svh - 88px);
  object-fit: contain;
  background: var(--ink);
}

.image-dialog p {
  margin: 0;
  padding: 14px 18px 18px;
  color: var(--surface);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 38px;
  height: 38px;
  color: var(--surface);
  background: rgba(17, 20, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
}

.status-message {
  grid-column: 1 / -1;
  padding: 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 250px;
  }

  .hero {
    min-height: 88svh;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .hero-panel {
    position: relative;
    right: auto;
    bottom: auto;
    width: var(--max);
    margin: -68px auto 22px;
  }

  .intro-grid,
  .section-heading,
  .about-layout,
  .research-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }

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

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

  .about-portrait {
    position: static;
  }

  .tour-frame iframe {
    min-height: 420px;
  }
}

@media (max-width: 620px) {
  :root {
    --max: min(100% - 24px, 1180px);
  }

  .site-header {
    position: absolute;
    mix-blend-mode: normal;
  }

  .brand {
    font-size: 0.84rem;
  }

  .site-nav {
    gap: 2px;
    font-size: 0.74rem;
  }

  .site-nav a {
    padding: 7px 8px;
  }

  .hero-content {
    padding: 128px 0 104px;
  }

  .hero h1 {
    font-size: 2.9rem;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .hero-panel {
    margin-top: -78px;
  }

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

  .visual-grid,
  .academic-list,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 70px 0;
  }

  .tour-frame iframe {
    height: 68svh;
    min-height: 360px;
  }

  .section-heading h2,
  .project-stage h2,
  .about-copy h2,
  .research-section h2,
  .contact-section h2 {
    font-size: 2.25rem;
  }

  .project-stage-head {
    display: grid;
  }

  .masonry-gallery {
    columns: 1;
  }
}
