:root {
  --text: #000;
  --muted: #555;
  --link: #253551;
  --accent: #253551;
  --bg: #fff;
  --gutter: max(16px, 3vw);
  --max: 1500px;
  --gap: 10px;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

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

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

a { color: var(--link); text-underline-offset: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: #000; color: #fff; padding: 8px 12px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  background: var(--bg);
}
.logo {
  color: var(--text); text-decoration: none;
  font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -0.01em;
}
.site-header nav { display: flex; gap: 18px; }
.site-header nav a {
  color: var(--text); text-decoration: none; font-size: 17px;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { border-bottom-color: currentColor; }

/* Project pages: header floats over the full-screen hero */
.has-hero .site-header {
  position: absolute; left: 0; right: 0;
  background: transparent;
}
.has-hero .site-header a { color: #fff; }
.has-hero .site-header nav a { text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
/* Darken the top of photo heroes so the white header stays readable */
.has-hero .hero::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 160px;
  background: linear-gradient(rgba(0, 0, 0, .45), transparent);
  pointer-events: none;
}

main { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; }
.has-hero main { max-width: none; }
.has-hero main > :not(.hero) {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-left: auto; margin-right: auto;
}

/* ---------- home grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  padding: 12px var(--gutter) 60px;
}
.tile {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 4 / 3; background: #f2f2f2;
}
.tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.tile--contain { background: #fff; }
.tile--contain img { object-fit: contain; padding: 4% 10%; }
.tile-title {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, .88); color: var(--text);
  font-size: 20px; font-weight: 500;
  opacity: 0; transition: opacity .3s ease;
}
.tile:hover .tile-title,
.tile:focus-visible .tile-title { opacity: 1; }
.tile:hover img { transform: scale(1.02); }

/* ---------- project pages ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 420px;
  background: #000; overflow: hidden;
}
.hero img, .hero video { width: 100%; height: 100%; object-fit: cover; }
.hero--logo { background: #fff; height: auto; min-height: 0; padding: 110px var(--gutter) 40px; }
.hero--logo img { height: auto; width: min(560px, 70%); margin: 0 auto; object-fit: contain; }

.intro {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 40px 8%;
  padding: 90px var(--gutter);
}
.role {
  margin: 0 0 40px;
  font-size: clamp(28px, 3vw, 38px); line-height: 1.2; font-weight: 700;
}
.side-block p { margin: 0 0 6px; font-size: 15px; }
.side-block { margin-bottom: 28px; }
.intro-body p { margin: 0 0 1em; font-size: 15px; line-height: 1.8; }
.intro-body .lead h4 {
  margin: 0 0 1.4em; text-align: center; color: #005741;
  font-size: 15px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  padding: 0 var(--gutter) 60px;
}
.gallery a { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #f2f2f2; cursor: zoom-in; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.gallery a:hover img { opacity: .9; }
.gallery--wide a { aspect-ratio: auto; background: none; }
.gallery--wide img { height: auto; object-fit: contain; }

.pager {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 40px var(--gutter) 80px;
}
.pager a {
  color: var(--text); text-decoration: none;
  font-size: clamp(20px, 2vw, 28px); font-weight: 700; line-height: 1.2;
}
.pager a span {
  display: block; font-size: 13px; font-weight: 400; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px;
}
.pager .prev::before { content: "‹ "; }
.pager .next { text-align: right; margin-left: auto; }
.pager .next::after { content: " ›"; }
.pager a:hover { text-decoration: underline; }

/* ---------- contact ---------- */
.contact-top {
  display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: center;
  padding: 80px var(--gutter) 40px;
}
.portrait {
  width: min(320px, 100%); aspect-ratio: 1; object-fit: cover;
  border-radius: 50%; justify-self: end;
}
.expertise > p { margin: 0 0 6px; font-size: 15px; }
.expertise ul { margin: 0; padding-left: 1.2em; }
.expertise h3 { margin: 0 0 6px; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.3; }
.contact-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  padding: 20px var(--gutter) 100px;
}
.contact-body p { margin: 0 0 1em; font-size: 15px; line-height: 1.8; }
.contact-details { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 1em; }
.contact-details p { margin: 0 0 .6em; }
.contact-details a { color: var(--link); text-decoration: underline; }
.contact-details a:hover { text-decoration-thickness: 2px; }

/* ---------- footer ---------- */
.site-footer {
  padding: 30px var(--gutter) 40px; text-align: center;
  font-size: 13px; color: var(--muted);
}

/* ---------- lightbox ---------- */
.lightbox {
  border: 0; padding: 0; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; background: rgba(0, 0, 0, .92);
}
.lightbox::backdrop { background: rgba(0, 0, 0, .92); }
.lightbox img { width: 100%; height: 100%; object-fit: contain; padding: 48px; }
.lightbox button {
  position: absolute; background: none; border: 0; color: #fff;
  font: 300 40px/1 var(--font); cursor: pointer; padding: 12px 18px;
}
.lightbox .close { top: 8px; right: 8px; }
.lightbox .prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---------- small screens ---------- */
@media (max-width: 767px) {
  .grid, .gallery { grid-template-columns: 1fr; }
  .gallery { gap: 12px; }
  .intro, .contact-top, .contact-body { grid-template-columns: 1fr; padding-top: 50px; padding-bottom: 50px; }
  .intro { gap: 0; }
  .role { margin-bottom: 24px; }
  .portrait { justify-self: center; width: 220px; }
  .contact-body > div:empty { display: none; }
  .hero { height: 70svh; }
  .lightbox img { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
