:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6760;
  --line: #e2ded6;
  --accent: #b4552d;
  --max: 1200px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1c1c1a;
    --text: #eeebe5;
    --muted: #9a958c;
    --line: #2c2b28;
    --accent: #e08a5f;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px max(16px, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: Fraunces, serif; font-weight: 600; font-size: 20px; text-decoration: none; }
nav { display: flex; gap: 24px; }
nav a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; }
nav a:hover { color: var(--text); }

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

.hero { padding: 96px 0 64px; }
.hero h1 {
  font-family: Fraunces, serif; font-weight: 400;
  font-size: clamp(44px, 9vw, 104px); line-height: 1; margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.hero p { margin: 0; color: var(--muted); font-size: clamp(17px, 2vw, 20px); }

.section { padding: 48px 0; border-top: 1px solid var(--line); }
.section h2 {
  font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 24px;
}

/* Justified photo rows: order preserved, no cropping */
.justified { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.justified::after { content: ""; flex-grow: 1e6; }
.jitem {
  position: relative; padding: 0; border: 0; margin: 0; background: none;
  cursor: zoom-in; overflow: hidden; border-radius: 3px;
}
.jitem img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.jitem:hover img { transform: scale(1.02); }
.jitem:focus-visible, .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }

/* Projects grouped by year */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.year-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.year-nav a {
  font-size: 13px; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px;
}
.year-nav a:hover { color: var(--text); border-color: var(--muted); }
.year-block { padding-top: 24px; }
.year {
  font-family: Fraunces, serif; font-weight: 400; font-size: 32px; margin: 0 0 16px;
  display: flex; align-items: center; gap: 16px;
}
.year::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 28px 20px; }
.card { text-decoration: none; display: block; }
.card-img { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px; background: var(--line); margin-bottom: 10px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.card-title { display: block; font-weight: 600; }
.card-meta { display: block; color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); }

/* Project page */
.project-head { padding: 48px 0 32px; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }
.project-head h1 {
  font-family: Fraunces, serif; font-weight: 400; letter-spacing: -0.01em;
  font-size: clamp(36px, 6vw, 64px); line-height: 1.05; margin: 20px 0 8px;
}
.project-head .meta { color: var(--muted); margin: 0; }
.project-head .desc { max-width: 680px; font-size: 18px; margin: 20px 0 0; }
.project-photos { padding-bottom: 48px; }
.project-pager {
  display: flex; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); padding: 28px 0 8px;
}
.project-pager a { text-decoration: none; font-weight: 600; }
.project-pager a:hover { color: var(--accent); }
.project-pager small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.project-pager .next { text-align: right; }
.hero.small h1 { font-size: 48px; }

/* Videos */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 32px 24px; }
.video-card h3 { font-size: 17px; font-weight: 600; margin: 12px 0 2px; }
.video-card p { margin: 0; color: var(--muted); font-size: 14px; }
.player {
  position: relative; aspect-ratio: 16 / 9; background: #000;
  border-radius: 4px; overflow: hidden;
}
.player button { all: unset; cursor: pointer; position: absolute; inset: 0; }
.player img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.player button:hover img { opacity: .85; }
.player .play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 68px; height: 48px; border-radius: 12px; background: rgba(0,0,0,.7);
  display: grid; place-items: center; transition: background .2s;
}
.player button:hover .play { background: #f00; }
.player .play::after {
  content: ""; border-style: solid; border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff; margin-left: 4px;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.about p { max-width: 640px; font-size: 18px; margin: 0 0 16px; }
.about .contact { font-size: 15px; display: flex; flex-wrap: wrap; gap: 20px; }
.about .contact a { color: var(--accent); text-underline-offset: 3px; }

.site-footer {
  max-width: var(--max); margin: 0 auto; padding: 32px 16px 48px;
  color: var(--muted); font-size: 13px; border-top: 1px solid var(--line);
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(10,10,10,.95);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; text-align: center; }
.lightbox img { display: block; margin: 0 auto; width: auto; height: auto; max-width: 92vw; max-height: 84vh; object-fit: contain; }
.lightbox figcaption { color: #bbb; font-size: 14px; margin-top: 12px; }
.lightbox button {
  position: absolute; background: none; border: 0; color: #fff;
  font-size: 44px; line-height: 1; cursor: pointer; padding: 16px; opacity: .7;
}
.lightbox button:hover { opacity: 1; }
.lb-close { top: 4px; right: 8px; }
.lb-prev { left: 4px; top: 50%; translate: 0 -50%; }
.lb-next { right: 4px; top: 50%; translate: 0 -50%; }

@media (max-width: 560px) {
  nav { gap: 16px; }
  .hero { padding: 64px 0 40px; }
}
