:root {
  --bg: #f6f4ef;
  --paper: #ffffff;
  --ink: #141414;
  --muted: #6b675f;
  --rule: #d9d4c9;
  --accent: #9b2f1f;
  --ink-2: #2f2d29;
  --shadow: rgba(60, 45, 20, .16);
  color-scheme: light;
  --serif: "Source Serif 4", Georgia, serif;
  --display: "Fraunces", "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141412;
    --paper: #1d1c1a;
    --ink: #eeebe4;
    --ink-2: #cfcbc2;
    --muted: #9a958b;
    --rule: #34322e;
    --accent: #e2836d;
  --shadow: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141412;
  --paper: #1d1c1a;
  --ink: #eeebe4;
  --ink-2: #cfcbc2;
  --muted: #9a958b;
  --rule: #34322e;
  --accent: #e2836d;
  --shadow: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  transition: background-color .3s, color .3s;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: 14px;
}
.brand { font-family: var(--display); font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -0.01em; }
.top nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
.top nav { align-items: center; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--rule); background: transparent; color: var(--muted);
  font: 500 12px/1 var(--sans); cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle svg { width: 14px; height: 14px; }

main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* hero */
.hero {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px 56px; align-items: center;
  padding: clamp(48px, 9vw, 120px) 0 clamp(40px, 7vw, 96px);
}
.hero > :not(.hero-img) { grid-column: 1; }
.hero-img { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
.eyebrow, .meta, .section-label {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.04em; color: var(--muted); margin: 0;
}
.section-label { text-transform: uppercase; letter-spacing: 0.12em; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.02; margin: 0; }
h1 { font-size: clamp(44px, 6.4vw, 92px); }
.lede { font-size: clamp(19px, 1.6vw, 22px); color: var(--ink-2); max-width: 30ch; margin: 0; }

/* index */
.index { border-top: 2px solid var(--ink); padding: 20px 0 clamp(48px, 7vw, 96px); }
.project-list { list-style: none; margin: 16px 0 0; padding: 0; }
.project-list a {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
  font-family: var(--display); font-weight: 600; font-size: clamp(22px, 2.6vw, 34px);
  text-decoration: none; transition: padding .25s, color .25s;
}
.project-list a:hover { padding-left: 10px; color: var(--accent); }
.project-list span, .project-list em { font-family: var(--sans); font-size: 13px; font-style: normal; font-weight: 400; color: var(--muted); }

/* projects */
.project { border-top: 2px solid var(--ink); padding: 20px 0 clamp(56px, 8vw, 112px); }
.project > header { display: grid; gap: 14px; margin-bottom: clamp(24px, 3vw, 40px); }
.project h2 { font-size: clamp(36px, 5vw, 68px); max-width: 18ch; }
.project h3 {
  font-size: clamp(24px, 2.6vw, 34px); margin: clamp(48px, 6vw, 80px) 0 20px;
  padding-top: 18px; border-top: 1px solid var(--rule);
}
.text { max-width: 64ch; margin-bottom: 28px; }
.text p { margin: 0 0 1em; }
.specs {
  display: grid; grid-template-columns: max-content 1fr; gap: 2px 18px; margin: 18px 0 0;
  font-family: var(--sans); font-size: 13px;
}
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.pull {
  font-family: var(--display); font-weight: 600; font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15; max-width: 24ch; margin: 56px 0 28px;
}
.caption-line { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* galleries */
.gallery { display: grid; gap: clamp(10px, 1.5vw, 20px); align-items: start; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-6 { grid-template-columns: repeat(6, 1fr); }
.g-pen { grid-template-columns: 2fr 1fr 1fr; }
.g-3 .wide { grid-column: 1 / -1; }
.gallery.g-3:has(.wide) figure:not(.wide) { grid-column: span 1; }
.gallery.g-3:has(.wide) { grid-template-columns: repeat(2, 1fr); }
.gallery.g-3:has(.wide) .wide { max-width: 980px; justify-self: center; }
.g-6 figure img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
figure { margin: 0; }
figure img { width: 100%; cursor: zoom-in; background: var(--paper); }
/* model cutouts: transparent PNG/WebP, soft contour shadow */
:is(.plain figure, .hero-img) img { background: transparent; filter: drop-shadow(0 18px 22px var(--shadow)); }
:root[data-theme="dark"] main img { filter: brightness(.92); }
:root[data-theme="dark"] :is(.plain figure, .hero-img) img { filter: brightness(.95) drop-shadow(0 18px 26px var(--shadow)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) main img { filter: brightness(.92); }
  :root:not([data-theme="light"]) :is(.plain figure, .hero-img) img { filter: brightness(.95) drop-shadow(0 18px 26px var(--shadow)); }
}
figcaption { font-family: var(--sans); font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 8px; }
figcaption b { color: var(--ink); font-weight: 500; margin-right: 6px; }

.masonry { columns: 3; column-gap: clamp(10px, 1.5vw, 20px); }
.masonry figure { break-inside: avoid; margin-bottom: clamp(10px, 1.5vw, 20px); }

/* image reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* about + footer */
.about { border-top: 2px solid var(--ink); padding: 20px 0 clamp(56px, 8vw, 112px); display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px 56px; }
.about h2 { font-size: clamp(36px, 5vw, 68px); }
.about p { font-size: clamp(19px, 1.7vw, 23px); margin: 0; max-width: 40ch; }
.foot {
  max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 40px;
  display: flex; justify-content: space-between; border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: 13px; color: var(--muted);
}
.foot a { text-decoration: none; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(12, 12, 12, .94);
  display: grid; grid-template-columns: 64px 1fr 64px; grid-template-rows: 1fr auto; align-items: center;
}
.lightbox[hidden] { display: none; }
.lightbox img { grid-column: 2; max-height: 86vh; max-width: 100%; margin: auto; object-fit: contain; cursor: zoom-out; }
.lightbox button {
  background: none; border: 0; color: #fff; font-size: 44px; line-height: 1; cursor: pointer; opacity: .7; padding: 12px;
}
.lightbox button:hover { opacity: 1; }
.lb-close { position: absolute; top: 8px; right: 12px; }
.lb-prev { grid-column: 1; } .lb-next { grid-column: 3; }
.lb-cap { grid-column: 1 / -1; text-align: center; color: #cfcac0; font-family: var(--sans); font-size: 13px; margin: 0 16px 20px; min-height: 1em; }

/* responsive */
@media (max-width: 860px) {
  .hero, .about { grid-template-columns: 1fr; }
  .hero-img { grid-column: 1; grid-row: auto; }
  .g-3, .g-pen { grid-template-columns: repeat(2, 1fr); }
  .g-pen .wide { grid-column: 1 / -1; }
  .g-6 { grid-template-columns: repeat(3, 1fr); }
  .masonry { columns: 2; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .top nav a:not(:first-child) { display: none; }
  .theme-toggle span { display: none; }
  .project-list a { grid-template-columns: 36px 1fr; }
  .project-list em { grid-column: 2; }
  .g-2, .g-3, .g-pen, .gallery.g-3:has(.wide) { grid-template-columns: 1fr; }
  .g-6 { grid-template-columns: repeat(2, 1fr); }
  .masonry { columns: 1; }
  .lightbox { grid-template-columns: 40px 1fr 40px; }
}
