/* ============ fonts ============ */
/* Jost ≈ Futura PT (headings), Inter ≈ Proxima Nova (body) */
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/jost-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}

/* ============ base ============ */
:root {
  --bg: #fcfcfc;
  --text: #575757;
  --heading: #222;
  --muted: #d1d1d1;
  --nav: #111;
  --nav-idle: #999;
  --strong: #3d3d3d;
  --lightbox-bg: rgba(252, 252, 252, 0.97);
  --heading-font: "Jost", "Futura", sans-serif;
  --body-font: "Inter", "Helvetica Neue", sans-serif;
  --site-width: 1200px;
}

/* Per-page theme, set via `theme: dark-red` in a project's frontmatter */
.theme-dark-red {
  --bg: #000;
  --text: #d94f43;
  --heading: #ff2f23;
  --muted: #8a201a;
  --nav: #ff2f23;
  --nav-idle: #8a201a;
  --strong: #ff5347;
  --lightbox-bg: rgba(0, 0, 0, 0.96);
}
.theme-dark-red .site-title { color: var(--heading); }
.theme-dark-red .lightbox button { color: var(--text); }
.theme-dark-red .lightbox button:hover { color: var(--heading); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }

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

/* ============ header ============ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 34px 20px 40px;
}

.site-title {
  font-family: var(--heading-font);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--heading);
}

.site-nav a {
  font-family: var(--heading-font);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1.5px;
  color: var(--nav);
  transition: color 0.15s ease;
}
.site-nav a:hover, .site-nav a.active { color: var(--nav); }

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

/* ============ home poster grid ============ */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 1000px) { .poster-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .poster-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px)  { .poster-grid { grid-template-columns: 1fr; } }

.poster { display: block; overflow: hidden; border-radius: 3px; }
.poster img {
  width: 100%;
  aspect-ratio: 5 / 8;
  object-fit: cover;
  border-radius: 3px;
  transition: opacity 0.2s ease;
}
.poster:hover img { opacity: 0.85; }

/* ============ project pages ============ */
.project-title {
  font-family: var(--heading-font);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--heading);
  line-height: 1.4;
  /* Overline sits just above the letters, like the original */
  text-decoration: overline;
  /* Span only the text width, not the full content box */
  display: table;
  margin: 20px 0 10px;
}
.project-body > .project-title:first-child { margin-top: 0; }

.project-body h3 {
  font-family: var(--heading-font);
  font-size: 19.5px;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
  margin: 1.6em 0 0.6em;
}
.project-title + h3 { margin-top: 0.4em; }

.project-body h2 {
  font-family: var(--heading-font);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--heading);
  margin: 1.8em 0 0.6em;
}

.project-body p { margin: 0 0 1.1em; }
.project-body strong { font-weight: 600; color: var(--strong); }
.project-body a { text-decoration: underline; text-underline-offset: 3px; }

.project-body > p > img,
.project-body > p > .content-video {
  margin: 28px auto;
}

/* ============ project footer nav ============ */
.project-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 48px 0 40px;
  font-family: var(--body-font);
  font-size: 15px;
}
.project-nav a { color: var(--heading); }
.project-nav a:hover { opacity: 0.6; }
.project-nav .prev-next { color: var(--muted); }
.project-nav .prev-next a { color: var(--muted); }
.project-nav .prev-next a:hover { color: var(--heading); opacity: 1; }
.project-nav .prev-next .sep { margin: 0 4px; }
.project-nav .prev-next .disabled { color: var(--muted); opacity: 0.45; }

/* ============ video embeds ============ */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 28px;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============ galleries ============ */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
}
@media (max-width: 720px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

.gallery p { margin: 0; display: contents; }

/* Explicit column counts: "::: gallery 2" etc. Media fills its cell. */
.gallery.cols-1 { grid-template-columns: 1fr; }
.gallery.cols-1 img { aspect-ratio: auto; }
.gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }
.gallery video { width: 100%; }
/* Video loops inside a grid crop to the same cell shape as the images beside them */
.gallery.cols-2 video, .gallery.cols-3 video, .gallery.cols-4 video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
@media (max-width: 720px) {
  .gallery.cols-3, .gallery.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Default galleries of video loops (no column count): center the row */
.gallery:not([class*="cols-"]):has(video) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.gallery:not([class*="cols-"]):has(video) video { width: min(100%, 460px); }
.gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}
.gallery img:hover { opacity: 0.9; }
.gallery video { width: 100%; }

/* ============ lightbox ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--lightbox-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.15);
}
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  font-family: var(--heading-font);
  font-size: 28px;
  font-weight: 300;
  color: #555;
  cursor: pointer;
  padding: 20px;
  line-height: 1;
}
.lightbox button:hover { color: #000; }
.lightbox .lb-close { top: 12px; right: 16px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }

@media (max-width: 720px) {
  .site-header { flex-direction: column; gap: 10px; padding: 26px 20px 30px; }
  .project-title { font-size: 24px; }
}
