:root {
  --bg: #0e0e0f;
  --surface: #17171a;
  --text: #ecebe8;
  --muted: #9a9894;
  --line: #2a2a2e;
  --accent: #c9c3b6;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1400px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  background: rgba(14, 14, 15, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header.over-hero {
  position: fixed; left: 0; right: 0;
  transition: background 0.3s, border-color 0.3s;
}
.site-header.over-hero:not(.scrolled) {
  background: linear-gradient(rgba(0,0,0,0.55), transparent);
  border-bottom-color: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
/* Same cut as the hero title: forcing the largest optical size keeps the
   high-contrast display letterforms at header size. */
.wordmark { font: 400 26px/1 var(--serif); font-variation-settings: "opsz" 144; letter-spacing: -0.01em; }
.nav { display: flex; gap: clamp(16px, 3vw, 32px); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.nav a { color: var(--muted); transition: color 0.2s; }
@media (max-width: 480px) {
  .wordmark { font-size: 22px; }
  .nav { gap: 14px; font-size: 11px; letter-spacing: 0.1em; }
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* Hero */
.hero {
  position: relative; height: 100svh; min-height: 520px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: grayscale(0.15) brightness(0.62);
  animation: settle 2.4s ease-out both;
}
@keyframes settle { from { transform: scale(1.06); } to { transform: scale(1); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,8,9,0.85), rgba(8,8,9,0.2) 55%, transparent 75%); }
.hero-text { position: relative; z-index: 1; padding: 0 var(--gutter) clamp(48px, 10vh, 110px); max-width: 900px; }
.eyebrow { font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.hero h1 { font: 400 clamp(52px, 10vw, 128px)/0.95 var(--serif); margin: 0; letter-spacing: -0.02em; }
.hero p.lede { font-size: clamp(16px, 2vw, 20px); color: #d6d4cf; max-width: 34ch; margin: 22px 0 30px; }
.button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border: 1px solid rgba(236,235,232,0.5); border-radius: 999px;
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
}
.button:hover { background: var(--text); color: var(--bg); }

/* Sections */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 10vw, 120px) var(--gutter); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { font: 400 clamp(32px, 5vw, 52px)/1.05 var(--serif); margin: 0; }
.section-head p { color: var(--muted); margin: 0; }

/* Project cards */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: clamp(14px, 2vw, 24px); }
.card { position: relative; display: block; overflow: hidden; border-radius: 4px; background: var(--surface); aspect-ratio: 4 / 5; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s cubic-bezier(.2,.7,.2,1), filter 0.4s; filter: brightness(0.82); }
.card:hover img { transform: scale(1.045); filter: brightness(0.95); }
.card .label {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 60px 22px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
}
.card h3 { font: 400 26px/1.1 var(--serif); margin: 0; }
.card .count { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }

/* About teaser & about page */
.split { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (min-width: 860px) { .split { grid-template-columns: 5fr 7fr; } }
.split .statement { font: 300 clamp(24px, 3vw, 34px)/1.35 var(--serif); margin: 0; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.facts li { padding: 12px 0; border-bottom: 1px solid var(--line); color: #d6d4cf; }
.facts li::before { content: "—"; color: var(--muted); margin-right: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.tags li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: #cfcdc8; }
.subhead { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin: 48px 0 18px; }
.subhead:first-child { margin-top: 0; }

/* Project page */
.page-head { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 8vw, 96px) var(--gutter) 28px; }
.page-head h1 { font: 400 clamp(44px, 8vw, 96px)/1 var(--serif); margin: 0; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin: 14px 0 0; }
.gallery { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 40px; columns: 3 320px; column-gap: 14px; }
.gallery a { display: block; margin-bottom: 14px; break-inside: avoid; overflow: hidden; border-radius: 3px; background: var(--surface); cursor: zoom-in; }
.gallery img { width: 100%; transition: transform 0.6s cubic-bezier(.2,.7,.2,1), opacity 0.3s; }
.gallery a:hover img { transform: scale(1.025); }
.pager { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 0; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 4px; padding: 16px 0; }
.pager a span { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.pager a strong { font: 400 22px/1.2 var(--serif); }
.pager a.next { text-align: right; margin-left: auto; }

/* Lightbox */
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(8,8,9,0.96); color: var(--text); }
.lightbox::backdrop { background: rgba(0,0,0,0.9); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 110px); width: auto; height: auto; object-fit: contain; user-select: none; }
.lb-btn { position: fixed; background: none; border: 0; color: var(--text); font: 300 34px/1 var(--sans); padding: 14px 18px; cursor: pointer; opacity: 0.75; }
.lb-btn:hover { opacity: 1; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
.lb-count { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 12px; letter-spacing: 0.2em; color: var(--muted); }
@media (max-width: 600px) { .lb-prev, .lb-next { display: none; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: clamp(48px, 8vw, 96px); }
.site-footer .inner { max-width: var(--max); margin: 0 auto; padding: 40px var(--gutter); display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--text); border-bottom: 1px solid var(--line); }
.site-footer a:hover { border-bottom-color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
