/* =========================================================
   Timeless — Tim Elias, Melbourne photography
   Dark, hyper-modern, compact
   ========================================================= */

:root,
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --bg-soft: #161616;
  --border: #1f1f1f;
  --border-strong: #2a2a2a;
  --text: #f4f1ea;
  --text-mute: #8a8a8a;
  --text-dim: #5e5e5e;
  --accent: #e9e2d0;
  --nav-bg: rgba(10, 10, 10, 0.6);
  --nav-bg-scrolled: rgba(10, 10, 10, 0.88);
  --badge-bg: rgba(10, 10, 10, 0.65);
  --badge-border: rgba(255, 255, 255, 0.08);
  --lightbox-bg: rgba(5, 5, 5, 0.97);
  --caption-overlay: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.7));
  --image-filter: brightness(0.92);
  --image-filter-card: brightness(0.82) saturate(0.95);
  --image-filter-card-hover: brightness(1) saturate(1.05);
  --hero-bg: #000000;
  --map-filter: grayscale(1) invert(0.92) contrast(0.85);
  --shadow-card: 0 24px 48px -16px rgba(0, 0, 0, 0.55);
  --max: 1280px;
  --pad: clamp(20px, 4vw, 48px);
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] {
/*   --bg: #f7f5ef; */
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-soft: #ecebe5;
  --border: #e0ddd5;
  --border-strong: #c8c5be;
  --text: #1a1816;
  --text-mute: #6e6c66;
  --text-dim: #a3a09a;
  --accent: #2a2825;
/*   --nav-bg: rgba(247, 245, 239, 0.7); */
  --nav-bg: rgba(255, 255, 255, 0.7);
/*   --nav-bg-scrolled: rgba(247, 245, 239, 0.92); */
  --nav-bg-scrolled: rgba(255, 255, 255, 0.92);
  --badge-bg: rgba(255, 255, 255, 0.88);
  --badge-border: rgba(0, 0, 0, 0.08);
/*   --lightbox-bg: rgba(247, 245, 239, 0.97); */
  --lightbox-bg: rgba(255, 255, 255, 0.97);
  --caption-overlay: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  --image-filter: none;
  --image-filter-card: brightness(0.97) saturate(1.02);
  --image-filter-card-hover: brightness(1.02) saturate(1.05);
  --hero-bg: #ffffff;
  --map-filter: grayscale(0.8) contrast(0.95);
  --shadow-card: 0 24px 48px -16px rgba(60, 50, 35, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

::selection { background: var(--text); color: var(--bg); }

/* =========================================================
   Typography
   ========================================================= */
.brand-mark {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 300;
  letter-spacing: -0.02em;
  font-style: italic;
}

h1, h2, h3, h4 {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 { font-size: clamp(40px, 7vw, 96px); }
h2 { font-size: clamp(28px, 4vw, 48px); }
h3 { font-size: clamp(20px, 2.4vw, 28px); }

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-mute);
  font-weight: 500;
}

.lead {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--text);
  max-width: 65ch;
}

.mute { color: var(--text-mute); }

/* =========================================================
   Layout
   ========================================================= */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section {
  padding: clamp(40px, 6.5vw, 80px) 0;
}

.section-tight {
  padding: clamp(28px, 4.5vw, 56px) 0;
}

/* =========================================================
   Navigation
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px var(--pad);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav.scrolled {
  border-bottom-color: var(--border);
  background: var(--nav-bg-scrolled);
}

.nav-brand { flex-shrink: 0; }

.nav-brand {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.nav-brand span { color: var(--text-mute); }

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
  margin-left: auto;
}


.nav-links a {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  transition: color 0.2s var(--ease);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--text);
}

/* Theme toggle button — sits between nav-links and nav-toggle */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-mute);
  flex-shrink: 0;
  margin-left: 20px;
  transition: background 0.2s var(--ease),
              border-color 0.2s var(--ease),
              color 0.2s var(--ease),
              transform 0.2s var(--ease);
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-mute);
  transform: rotate(15deg);
}
.theme-toggle svg {
  width: 15px;
  height: 15px;
  display: block;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* =========================================================
   Mobile / tablet menu — full rewrite
   ---------------------------------------------------------
   Layout when the menu kicks in (≤ 860px):
   - .nav stays as a fixed bar at the top with brand + theme + hamburger
   - .nav-links becomes a full-viewport overlay sliding in from the top
   - Links render as big editorial serif italic with numbered prefixes
   - Hamburger animates cleanly into an X
   - JS handles Esc, outside-click, link-tap, resize, body scroll-lock
   ========================================================= */

/* Hamburger — clean, no border by default (matches editorial look) */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
  margin-left: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s var(--ease);
}
.nav-toggle:hover { background: var(--bg-soft); }
.nav-toggle:focus-visible {
  outline: 1px solid var(--text-mute);
  outline-offset: 2px;
}

.nav-toggle .bar {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: top 0.35s var(--ease),
              transform 0.35s var(--ease),
              opacity 0.2s var(--ease);
}
.nav-toggle .bar-1 { top: 17px; }
.nav-toggle .bar-2 { top: 21.25px; }
.nav-toggle .bar-3 { top: 25.5px; }

/* Hamburger → X morph */
.nav-toggle.open .bar-1 { top: 21.25px; transform: rotate(45deg); }
.nav-toggle.open .bar-2 { opacity: 0; transform: scaleX(0); }
.nav-toggle.open .bar-3 { top: 21.25px; transform: rotate(-45deg); }

/* ====== ≤ 860px — tablet portrait and below ====== */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .theme-toggle { margin-left: auto; }

  /* Drop backdrop-filter on mobile — it creates a containing block for
     position:fixed descendants, which would clip the menu overlay to the
     nav's ~60px height instead of filling the viewport. Use solid bg. */
  .nav {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav.scrolled { background: var(--bg); }

  /* Keep the nav-bar items above the menu overlay (within .nav's stacking context) */
  .nav-brand,
  .theme-toggle,
  .nav-toggle {
    position: relative;
    z-index: 2;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    margin: 0;
/*     padding: clamp(96px, 14vw, 140px) var(--pad) clamp(40px, 8vw, 80px); */
    padding: clamp(60px, 14vw, 140px) var(--pad) clamp(40px, 8vw, 80px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
/*     justify-content: space-between; */
    gap: 1px;
    background: var(--bg);
    z-index: 1;        /* sits below brand/theme/hamburger (z:2) inside .nav */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
    counter-reset: menu-item;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Each link — italic serif with a small index prefix.
     Flex + min-height keeps the text properly centred between the dividers
     above and below it (rather than relying on symmetric padding, which
     drifts visually for italic faces with descenders). */
  .nav-links a {
    display: flex;
    align-items: center;
    position: relative;
    padding: 14px 0;
    min-height: clamp(64px, 11vw, 100px);
    width: 100%;
    color: var(--text);
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 200;
/*     font-size: clamp(26px, 4.8vw, 53px); */
    font-size: clamp(26px, 1vw, 53px);
    letter-spacing: -0.03em;
    line-height: 1;
    counter-increment: menu-item;
    border-bottom: 1px solid var(--border);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s var(--ease),
                transform 0.45s var(--ease),
                color 0.2s var(--ease);
  }
  .nav-links.open a {
    opacity: 1;
    transform: translateY(0);
  }
  /* Stagger the link entry */
  .nav-links.open a:nth-child(1) { transition-delay: 0.10s, 0.10s, 0s; }
  .nav-links.open a:nth-child(2) { transition-delay: 0.16s, 0.16s, 0s; }
  .nav-links.open a:nth-child(3) { transition-delay: 0.22s, 0.22s, 0s; }
  .nav-links.open a:nth-child(4) { transition-delay: 0.28s, 0.28s, 0s; }

  .nav-links a:first-child { border-top: 1px solid var(--border); }

  /* Number prefix — small Inter caps on the right edge of each row,
     vertically centred to match the now-flex-centred link text */
  .nav-links a::before {
    content: counter(menu-item, decimal-leading-zero);
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--text-mute);
  }

  /* Active page indicator — a small dot in front of the title */
  .nav-links a.active { color: var(--text); }
  .nav-links a.active::after {
    content: '';
    position: static;
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text);
    border-radius: 50%;
    margin-right: 18px;
    margin-bottom: 6px;
    vertical-align: middle;
    border: none;
  }
  .nav-links a:not(.active):hover { color: var(--text-mute); }

  /* Lock body scroll when menu is open */
  body.nav-open { overflow: hidden; }
}

/* ====== ≤ 520px — phones ====== */
@media (max-width: 520px) {
  .nav { padding: 10px var(--pad); gap: 8px; }
  .nav-brand { font-size: 20px; }
/*   .nav-brand span { display: none; } */

  .theme-toggle { width: 36px; height: 36px; margin-left: auto; }
  .theme-toggle svg { width: 14px; height: 14px; }

  .nav-toggle { width: 40px; height: 40px; margin-left: 6px; }
  .nav-toggle .bar { left: 10px; right: 10px; }
  .nav-toggle .bar-1 { top: 15px; }
  .nav-toggle .bar-2 { top: 19.25px; }
  .nav-toggle .bar-3 { top: 23.5px; }
  .nav-toggle.open .bar-1,
  .nav-toggle.open .bar-3 { top: 19.25px; }
}

/* =========================================================
   Page header (non-home pages)
   ========================================================= */
.page-head {
  padding-top: clamp(100px, 12vw, 140px);
  padding-bottom: clamp(28px, 4.5vw, 48px);
  border-bottom: 1px solid var(--border);
}

.page-head .eyebrow { margin-bottom: 16px; display: inline-block; }

.page-head h1 {
  margin-bottom: 20px;
  font-size: clamp(40px, 6vw, 80px);
}

.page-head p {
  color: var(--text-mute);
  max-width: 60ch;
}

/* =========================================================
   Buttons / Links
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-ghost {
  border-color: var(--border);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.link-arrow:hover { border-color: var(--text); }
.link-arrow svg { transition: transform 0.25s var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px var(--pad) 24px;
  background: var(--bg);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer-brand .brand-large {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 40px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  display: block;
}
.footer-brand p {
  color: var(--text-mute);
  font-size: 13px;
  max-width: 30ch;
}
.footer ul { list-style: none; }
.footer ul li {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-mute);
}
.footer ul li a {
  color: var(--text-mute);
  transition: color 0.2s;
}
.footer ul li a:hover { color: var(--text); }

.footer-bottom {
  max-width: var(--max);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
}

@media (max-width: 800px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* =========================================================
   Gallery grids
   ========================================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease), filter 0.3s var(--ease);
  filter: var(--image-filter);
}
.gallery-item:hover img {
  transform: scale(1.04);
  filter: none;
}

.gallery-item .caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px;
  background: var(--caption-overlay);
  font-size: 12px;
  color: #f4f1ea;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.gallery-item:hover .caption { opacity: 1; }

/* Home featured layout — 6 items, varying spans */
.gallery-featured .gallery-item:nth-child(1) { grid-column: span 7; aspect-ratio: 60 / 53; }
.gallery-featured .gallery-item:nth-child(2) { grid-column: span 5; aspect-ratio: 4 / 5; }
.gallery-featured .gallery-item:nth-child(3) { grid-column: span 4; aspect-ratio: 4 / 5; }
.gallery-featured .gallery-item:nth-child(4) { grid-column: span 4; aspect-ratio: 4 / 5; }
.gallery-featured .gallery-item:nth-child(5) { grid-column: span 4; aspect-ratio: 4 / 5; }
.gallery-featured .gallery-item:nth-child(6) { grid-column: span 12; aspect-ratio: 16 / 8; }

@media (max-width: 720px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gallery-featured .gallery-item { grid-column: span 1 !important; aspect-ratio: 4 / 5 !important; }
  .gallery-featured .gallery-item:nth-child(6) { grid-column: span 2 !important; aspect-ratio: 16 / 9 !important; }
}

/* =========================================================
   Project blocks (projects page)
   ========================================================= */
.project {
  padding: clamp(40px, 6vw, 72px) 0;
  border-bottom: 1px solid var(--border);
}
.project:last-child { border-bottom: none; }

.project-head {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 40px;
}
.project-head .meta {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 12px;
}
.project-head .meta span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-mute);
}
.project-head h2 { margin-bottom: 8px; }
.project-head p { color: var(--text-mute); max-width: 50ch; }

@media (max-width: 720px) {
  .project-head { grid-template-columns: 1fr; gap: 16px; }
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.project-grid .gallery-item {
  grid-column: span 2;
  aspect-ratio: 4 / 5;
}
.project-grid .gallery-item.wide { grid-column: span 3; aspect-ratio: 4 / 3; }
.project-grid .gallery-item.tall { grid-column: span 2; aspect-ratio: 3 / 4; }
.project-grid .gallery-item.full { grid-column: span 6; aspect-ratio: 16 / 7; }

@media (max-width: 720px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid .gallery-item,
  .project-grid .gallery-item.wide,
  .project-grid .gallery-item.tall { grid-column: span 1; aspect-ratio: 4 / 5; }
  .project-grid .gallery-item.full { grid-column: span 2; aspect-ratio: 16 / 9; }
}

/* =========================================================
   About page
   ========================================================= */
.about-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: clamp(32px, 5vw, 60px) 0;
  align-items: center;
}
.about-hero .photo {
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
  overflow: hidden;
  border-radius: var(--radius);
}
.about-hero .photo img { width: 100%; height: 100%; object-fit: cover; }
.about-hero h1 { margin-bottom: 24px; }
.about-hero p { color: var(--text-mute); margin-bottom: 16px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat {
  padding: 32px 24px;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat .num {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 12px;
}
.stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-mute);
}

.timeline {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.timeline:last-child { border-bottom: none; }
.timeline .year {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.timeline h3 { margin-bottom: 8px; }
.timeline p { color: var(--text-mute); }

.bio-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  padding: clamp(24px, 4vw, 48px) 0;
}
.bio-grid h2 { font-size: clamp(28px, 3.5vw, 40px); }
.bio-grid p { color: var(--text-mute); margin-bottom: 16px; }

@media (max-width: 800px) {
  .about-hero,
  .bio-grid { grid-template-columns: 1fr; gap: 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--border); }
  .timeline { grid-template-columns: 1fr; gap: 8px; }
}

/* =========================================================
   Contact page
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding: clamp(40px, 6vw, 72px) 0;
  align-items: start;
}
.contact-info h2 { margin-bottom: 24px; }
.contact-info p {
  color: var(--text-mute);
  margin-bottom: 32px;
  max-width: 40ch;
}
.contact-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.contact-row .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  padding-top: 4px;
}
.contact-row .value {
  font-size: 17px;
}
.contact-row .value a {
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.contact-row .value a:hover { border-color: var(--text); }

.map-wrap {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  position: relative;
}
.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  filter: var(--map-filter);
}

@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .map-wrap { aspect-ratio: 1 / 1; }
}

/* =========================================================
   Home — history section
   ========================================================= */
.history {
  padding: clamp(56px, 8vw, 100px) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.history-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  align-items: start;
}
.history h2 { margin-bottom: 32px; }
.history p {
  color: var(--text-mute);
  margin-bottom: 18px;
  font-size: 16px;
  line-height: 1.65;
}
.history .signature {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 32px;
  margin-top: 32px;
  color: var(--text);
}

@media (max-width: 800px) {
  .history-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* =========================================================
   Reveal animation utilities (subtle, non-3D)
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   Section header pattern
   ========================================================= */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  gap: 24px;
}
.section-head h2 { font-size: clamp(28px, 3.5vw, 44px); }
.section-head .eyebrow { display: block; margin-bottom: 12px; }
@media (max-width: 600px) {
  .section-head { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   Contact form (home page, also reusable)
   ========================================================= */
.home-contact {
  padding: clamp(56px, 7.5vw, 100px) 0;
  border-top: 1px solid var(--border);
}
.home-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.home-contact-intro h2 {
  font-size: clamp(32px, 4vw, 52px);
  margin-bottom: 20px;
  line-height: 1.05;
}
.home-contact-intro p {
  color: var(--text-mute);
  margin-bottom: 32px;
  max-width: 36ch;
}
.home-contact-direct {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.home-contact-direct .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.home-contact-direct .row:last-child { border-bottom: none; }
.home-contact-direct .row .label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.home-contact-direct .row a {
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.home-contact-direct .row a:hover { border-color: var(--text); }

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 24px;
  position: relative;
}
.contact-form .field {
  display: flex;
  flex-direction: column;
  position: relative;
}
.contact-form .field.full { grid-column: span 2; }

.contact-form label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 8px;
  transition: color 0.2s;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 10px 0 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.25s var(--ease);
  border-radius: 0;
}
.contact-form select {
  /* Hide native chevron + add ours */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%238a8a8a' stroke-width='1.4'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 24px;
  cursor: pointer;
}
.contact-form select option {
  background: var(--bg-elev);
  color: var(--text);
}
.contact-form textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.55;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-bottom-color: var(--text);
}
.contact-form .field:focus-within label {
  color: var(--text);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-dim);
}

.contact-form-actions {
  grid-column: span 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}
.contact-form-actions .small {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.contact-form-actions button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid var(--text);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.contact-form-actions button:hover {
  background: transparent;
  color: var(--text);
  transform: translateY(-1px);
}
.contact-form-actions button svg { transition: transform 0.25s var(--ease); }
.contact-form-actions button:hover svg { transform: translateX(3px); }

.form-status {
  grid-column: span 2;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--text);
  margin-top: 4px;
}
.form-status.show { display: flex; }
.form-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b9d39c;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .home-contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .contact-form { grid-template-columns: 1fr; }
  .contact-form .field.full,
  .contact-form-actions,
  .form-status { grid-column: span 1; }
}

/* =========================================================
   Page head with portrait (About)
   ========================================================= */
.page-head-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: end;
}
.page-head-text h1 { margin-bottom: 20px; }
.page-head-text p { color: var(--text-mute); max-width: 60ch; }
.page-head-portrait {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  max-width: 360px;
  justify-self: end;
  width: 100%;
}
.page-head-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.95);
}
@media (max-width: 800px) {
  .page-head-grid { grid-template-columns: 1fr; gap: 32px; }
  .page-head-portrait { max-width: 280px; justify-self: start; }
}

/* =========================================================
   Project grid (projects.html — index)
   ========================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 18px;
  padding: clamp(20px, 3.5vw, 40px) 0;
}

.project-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  position: relative;
}

.project-card-img {
  position: relative;
/*   aspect-ratio: 4 / 5; //changed */
  aspect-ratio: 5 / 5;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: var(--radius);
  transition: border-color 0.4s var(--ease),
              transform 0.5s var(--ease),
              box-shadow 0.5s var(--ease);
  will-change: transform;
}
.project-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease),
              filter 0.5s var(--ease);
  filter: var(--image-filter-card);
}
.project-card:hover .project-card-img {
  border-color: var(--text-mute);
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
}
.project-card:hover .project-card-img img {
  transform: scale(1.06);
  filter: var(--image-filter-card-hover);
}

/* Number badge — sits on the image, fades in on hover */
.project-card-number {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--badge-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--badge-border);
  opacity: 0.55;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.project-card:hover .project-card-number {
  opacity: 1;
  transform: translateY(-2px);
}

/* "View →" badge — slides in from bottom of image on hover */
.project-card-cta {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--badge-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--badge-border);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.project-card:hover .project-card-cta {
  opacity: 1;
  transform: translateY(0);
}
.project-card-cta svg { transition: transform 0.3s var(--ease); }
.project-card:hover .project-card-cta svg { transform: translateX(3px); }

/* Title block beneath the bordered image */
.project-card-info {
  padding-top: 14px;
}
.project-card-info .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.project-card-info .meta span:not(:last-child)::after {
  content: '·';
  margin-left: 10px;
  color: var(--text-dim);
}
.project-card-info h3 {
  font-size: clamp(14px, 1.15vw, 16px);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.25;
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--text), var(--text));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size 0.5s var(--ease);
}
.project-card:hover .project-card-info h3 {
  background-size: 100% 1px;
}

@media (max-width: 1100px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); gap: 40px 18px; }
}
@media (max-width: 800px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 14px; }
}
@media (max-width: 480px) {
  .projects-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* =========================================================
   Project detail page
   ========================================================= */
.project-detail-head {
  padding-top: clamp(100px, 12vw, 140px);
  padding-bottom: clamp(28px, 4.5vw, 48px);
  border-bottom: 1px solid var(--border);
}
.project-detail-head .back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-mute);
  margin-bottom: 32px;
  transition: color 0.2s;
}
.project-detail-head .back:hover { color: var(--text); }
.project-detail-head .back svg { transition: transform 0.25s var(--ease); }
.project-detail-head .back:hover svg { transform: translateX(-3px); }

.project-detail-head .meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-mute);
  margin-bottom: 16px;
}
.project-detail-head .meta span:not(:last-child)::after {
  content: '·';
  margin-left: 16px;
  color: var(--text-dim);
}
.project-detail-head h1 {
  font-size: clamp(40px, 6vw, 80px);
  margin-bottom: 24px;
  max-width: 18ch;
}
.project-detail-head .desc {
  color: var(--text-mute);
  max-width: 60ch;
  font-size: 16px;
  line-height: 1.6;
}

.project-detail-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.project-detail-info > div { padding-right: 24px; }
.project-detail-info .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.project-detail-info .value {
  font-size: 14px;
  color: var(--text);
}
@media (max-width: 700px) {
  .project-detail-info { grid-template-columns: repeat(2, 1fr); row-gap: 24px; }
}

/* Project gallery — clickable items */
.project-gallery {
  padding: clamp(20px, 3.5vw, 40px) 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.project-gallery .lb-item {
  grid-column: span 2;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-soft);
  border-radius: var(--radius);
  cursor: zoom-in;
  position: relative;
}
.project-gallery .lb-item.wide { grid-column: span 3; aspect-ratio: 4 / 3; }
.project-gallery .lb-item.tall { grid-column: span 2; aspect-ratio: 3 / 4; }
.project-gallery .lb-item.full { grid-column: span 6; aspect-ratio: 16 / 7; }
.project-gallery .lb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.3s;
  filter: brightness(0.92);
}
.project-gallery .lb-item:hover img {
  transform: scale(1.03);
  filter: brightness(1);
}
.project-gallery .lb-item .num {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text);
  background: rgba(0,0,0,0.5);
  padding: 4px 8px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.project-gallery .lb-item:hover .num { opacity: 1; }

@media (max-width: 700px) {
  .project-gallery { grid-template-columns: repeat(2, 1fr); }
  .project-gallery .lb-item,
  .project-gallery .lb-item.wide,
  .project-gallery .lb-item.tall { grid-column: span 1; aspect-ratio: 4 / 5; }
  .project-gallery .lb-item.full { grid-column: span 2; aspect-ratio: 16 / 9; }
}

/* Next project strip */
.next-project {
  border-top: 1px solid var(--border);
  padding: clamp(28px, 4.5vw, 56px) 0;
}
.next-project a {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  flex-wrap: wrap;
}
.next-project .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-mute);
  margin-bottom: 12px;
  display: block;
}
.next-project h2 {
  font-size: clamp(28px, 4vw, 48px);
  transition: opacity 0.2s;
}
.next-project a:hover h2 { opacity: 0.7; }
.next-project .arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-mute);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
}
.next-project a:hover .arrow { color: var(--text); border-color: var(--text); }
.next-project a:hover .arrow svg { transform: translateX(3px); }
.next-project .arrow svg { transition: transform 0.25s var(--ease); }

/* =========================================================
   Lightbox / Photo viewer
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: var(--lightbox-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  touch-action: pan-y pinch-zoom;
}
.lightbox.open {
  display: flex;
  opacity: 1;
}

.lb-stage {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.lb-img {
  max-width: 100%;
  max-height: calc(100vh - 100px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  will-change: transform;
}
.lb-img.loaded { opacity: 1; }

.lb-close,
.lb-prev,
.lb-next {
  position: fixed;
  color: var(--text);
  background: var(--badge-bg);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  z-index: 2;
}
.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.lb-close { top: 24px; right: 24px; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.lb-next:hover { transform: translateY(-50%) translateX(2px); }

.lb-meta {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-mute);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  pointer-events: none;
}
.lb-counter {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}
.lb-title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.lb-thumbs {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  max-width: calc(100vw - 200px);
  overflow-x: auto;
  padding: 6px;
  scrollbar-width: none;
}
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumbs button {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid transparent;
  opacity: 0.45;
  transition: opacity 0.2s, border-color 0.2s;
  padding: 0;
  background: var(--bg-soft);
}
.lb-thumbs button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lb-thumbs button:hover { opacity: 0.85; }
.lb-thumbs button.active {
  opacity: 1;
  border-color: var(--text);
}

@media (max-width: 700px) {
  .lightbox { padding: 12px; }
  .lb-close { top: 12px; right: 12px; width: 40px; height: 40px; }
  .lb-prev { left: 8px; width: 40px; height: 40px; }
  .lb-next { right: 8px; width: 40px; height: 40px; }
  .lb-thumbs { display: none; }
  .lb-img { max-height: calc(100vh - 80px); }
  .lb-meta { font-size: 10px; bottom: 16px; left: 12px; right: 12px; }
}
