:root {
  --bg: #fff9ee;
  --surface: #ffffffa7;
  --surface-strong: #ffffffa0;
  --text: #111111;
  --muted: #5e5a54;
  --line: rgba(17, 17, 17, 0.14);
  --accent: #cd891b;
  --accent-soft: #f0e7dc;
  --shadow: 0 18px 50px rgba(39, 32, 24, 0.06);
  --radius: 0;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(29, 93, 121, 0.12), transparent 28%),
  linear-gradient(180deg, #f7f4ef 0%, var(--bg) 100%)
}

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

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

.site-shell {
  /* width: min(calc(100% - 40px), var(--max-width)); */
  margin: 0 auto;
  padding: 0 0 48px;
}

.site-header,
.site-footer,
.section,
.legal-shell {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header,
.site-footer,
.section,
.legal-shell,
.portrait,
.hero-media,
.project-row,
.gallery-card,
.service-block {
  border-radius: var(--radius);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 32px 40px 48px 40px;
  position: sticky;
  top: 0;
  z-index: 10;
  isolation: isolate;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 40px), transparent 100%);
}

.header-meta {
  display: grid;
  align-items: center;
  justify-items: end;
}

.brand img {
  width: 400px;
}

.site-nav,
.footer-links,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.site-nav {
  color: var(--muted);
  align-items: center;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
}

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

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover {
  border-color: rgba(17, 17, 17, 0.22);
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  flex-shrink: 0;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.site-header.is-nav-open .nav-toggle-bars {
  background: transparent;
  box-shadow: none;
  height: 14px;
}

.site-header.is-nav-open .nav-toggle-bars::before,
.site-header.is-nav-open .nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 20px;
  height: 2px;
  margin-top: -1px;
  background: currentColor;
}

.site-header.is-nav-open .nav-toggle-bars::before {
  transform: rotate(45deg);
}

.site-header.is-nav-open .nav-toggle-bars::after {
  transform: rotate(-45deg);
}

.nav-backdrop {
  display: none;
}

body.nav-open,
body.media-overlay-open {
  overflow: hidden;
}

/* [hidden] alone can lose to display:flex in the author sheet; keep closed until JS opens. */
.media-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 24px;
  box-sizing: border-box;
}

.media-overlay[hidden] {
  display: none !important;
}

.media-overlay:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-overlay-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(17, 17, 17, 0.82);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.media-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 1120px);
  max-height: min(90vh, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.media-overlay-close {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.media-overlay-close:hover {
  border-color: rgba(17, 17, 17, 0.22);
  background: #ffffff;
}

.media-overlay-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  max-height: 90vh;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.media-overlay-image {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.media-overlay-content--carousel {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px 12px 18px;
}

.media-overlay-content--carousel .media-overlay-image {
  max-height: min(78vh, 100%);
}

.media-overlay-gallery {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
}

.media-overlay-figure {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-overlay-nav {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.96);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.media-overlay-nav:hover {
  border-color: rgba(17, 17, 17, 0.22);
  background: #ffffff;
}

.media-overlay-gallery-status {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.media-overlay-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(85vh, 100%);
  margin: 0 auto;
  background: #0a0a0a;
}

.media-overlay-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.section,
.legal-shell {
  padding: 40px;
  margin-top: 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.55fr);
  gap: 22px;
}

.hero-intro,
.hero-sidebar {
  padding-bottom: 12px;
}

.hero h1,
.section-heading h2,
.legal-copy h1 {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-note,
.lede,
.prose p,
.service-block p,
.project-meta p,
.legal-copy p,
.legal-copy li,
.section-summary {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.02rem;
}

.hero-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.55fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  max-height: 450px;
  min-height: 0;
  overflow: hidden;
}

.hero-media {
  min-height: 0;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-stats {
  display: grid;
  align-content: end;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
}

.hero-stats p {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(17, 17, 17, 0.12);
  font-weight: 600;
}

.hero-stats span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.hero-note {
  max-width: 30rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  font-weight: 600;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.button:hover,
.card-link:hover,
.gallery-card:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--text);
  color: #ffffff;
}

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

.button-secondary {
  background: transparent;
}

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

.section-heading h2,
.legal-copy h1 {
  max-width: 18ch;
  font-size: clamp(2rem, 4.8vw, 4rem);
}

.split-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
  gap: 22px;
  align-items: end;
}

.service-grid,
.gallery-grid {
  display: grid;
  gap: 18px;
}

.alt-service-grid {
  margin-top: 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-block {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.service-block h3,
.project-meta h3 {
  margin: 0 0 10px;
  font-family: "Source Sans 3", sans-serif;
  font-size: 1.5rem;
}

.profile-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(200px, 0.4fr);
  gap: 24px;
  align-items: stretch;
}

.profile-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-list li {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  font-size: 0.95rem;
}

.portrait {
  overflow: hidden;
  border: 1px solid var(--line);
}

.portrait img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.project-index {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.project-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 24px;
}

.project-media {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.project-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-row img,
.project-row video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  object-fit: cover;
}

.project-preview-video {
  pointer-events: none;
}

.gallery-grid-alt {
  margin-top: 18px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.gallery-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: 22px;
  align-items: end;
}

.contact-copy-alt {
  padding: 8px 0 0;
}

.site-footer {
  margin-top: 24px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.legal-page {
  min-height: 100vh;
}

.legal-shell {
  max-width: 860px;
  margin: 24px auto;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.legal-header img {
  width: 150px;
}

.legal-copy h1 {
  margin-bottom: 24px;
}

.legal-copy ol {
  padding-left: 20px;
}

.legal-copy a,
.prose a {
  color: var(--accent);
}

@media (max-width: 760px) {

  .site-shell {
    /* width: min(calc(100% - 20px), var(--max-width)); */
    padding-top: 12px;
  }

  .site-header,
  .site-footer,
  .section,
  .legal-shell {
    padding: 22px;
  }

  /* Let the logo/header scroll with the page on mobile. The burger stays fixed on the
     viewport, and the header filter remains disabled so WebKit keeps the drawer viewport-fixed. */
  .site-header {
    position: relative;
    top: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .site-header.is-nav-open {
    z-index: 30;
  }

  .header-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    position: relative;
    z-index: 1;
  }

  .nav-toggle {
    display: inline-flex;
    flex-shrink: 0;
    position: fixed;
    top: 34px;
    top: calc(env(safe-area-inset-top, 0px) + 34px);
    z-index: 25;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(320px, calc(100vw - 48px));
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: calc(16px + 70px + 20px) 24px 24px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--line);
    border-right: none;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 1.05rem;
    line-height: 1.2;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0.25s ease;
    z-index: 12;
  }

  .site-nav a {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .site-header.is-nav-open .site-nav {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 11;
    background: rgba(17, 17, 17, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-footer,
  .legal-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand img {
    width: 280px;
  }

  .hero h1,
  .section-heading h2,
  .legal-copy h1 {
    max-width: none;
  }

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

  .media-overlay-close {
    top: 8px;
    right: 8px;
  }

  .media-overlay-panel {
    width: 100%;
  }

  .hero,
  .hero-grid,
  .split-lead,
  .contact-layout,
  .alt-service-grid,
  .gallery-grid-alt,
  .project-row {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }

  .project-media {
    min-height: 220px;
  }

  .project-row img,
  .project-row video {
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
  }
}

@media (max-width: 520px) {
  .profile-section {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav {
    transition-duration: 0.01ms;
  }

  .nav-backdrop {
    transition-duration: 0.01ms;
  }
}
