@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;700;800&display=swap");

:root {
  --ink: #000;
  --paper: #fff;
  --hover-paper: #eee;
  --logo-filter: none;
  color-scheme: light;
  font-family: Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  font-size: 16px;
  letter-spacing: .04em;
  --heading-font: "Syne", "Arial Black", sans-serif;
  --rule: 1px solid var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; padding: 0 32px; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  padding: 32px 0 26px;
  border-bottom: 3px solid var(--ink);
}
.wordmark {
  font-family: var(--heading-font);
  font-size: clamp(24px, 3.4vw, 54px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
  overflow-wrap: anywhere;
  min-width: 0;
  text-transform: uppercase;
}
.wordmark:hover { text-decoration: none; }
.wordmark span {
  font-family: Helvetica, Arial, sans-serif;
  display: block;
  margin-top: 18px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .035em;
  line-height: 1.4;
}
nav { display: flex; gap: 6px; flex-wrap: wrap; }
nav a {
  border: var(--rule);
  padding: 10px 12px;
  font-size: 12px;
  text-transform: uppercase;
}
nav a:hover, nav [aria-current] { background: var(--ink); color: var(--paper); text-decoration: none; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  font-size: 12px;
  text-transform: uppercase;
}
h1 { margin: 0; font-family: var(--heading-font); font-size: 22px; font-weight: 800; line-height: 1.05; }
.section-heading h1 { font-size: 30px; line-height: 1.05; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  background: var(--paper);
}
.card { display: block; width: 100%; min-width: 0; margin: 0; padding: 16px; border: var(--rule); background: var(--paper); break-inside: avoid; vertical-align: top; }
.card:hover { text-decoration: none; }
.card img, .card video { display: block; width: 100%; height: auto; aspect-ratio: auto; }
.caption { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 7px 12px; padding: 16px 0 2px; font-size: 14px; font-weight: 700; line-height: 1.5; text-transform: uppercase; }
.caption > div { line-height: 1.1; grid-column: 1 / -1; font-family: var(--heading-font); font-size: 24px; font-weight: 800; overflow-wrap: anywhere; min-width: 0; }
.caption small { font-family: Helvetica, Arial, sans-serif; letter-spacing: 0.2em; display: block; margin-top: 0; font-size: 14px; font-weight: 400; }
.caption time { font-size: 16px; font-weight: 400; }
.card:hover .caption > div { text-decoration: underline; text-underline-offset: 4px; }
.about { border-top: 3px solid var(--ink); margin-top: 80px; padding: 28px 0 65px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.about h2 { font-family: var(--heading-font); font-size: clamp(20px, 2vw, 30px); font-weight: 800; line-height: 1.05; letter-spacing: 0; overflow-wrap: anywhere; text-transform: uppercase; margin: 0; }
.about h2::before { font-family: Helvetica, Arial, sans-serif; content: "ABOUT"; display: block; font-size: 11px; font-weight: 400; letter-spacing: 0; margin-bottom: 30px; }
.about p { font-size: 16px; line-height: 1.65; max-width: 560px; margin: 0 0 24px; }
.about .note { font-size: 16px; }
.about a { display: inline-block; border: var(--rule); padding: 12px 16px; font-size: 12px; text-transform: uppercase; }
.about a:hover { color: var(--paper); background: var(--ink); text-decoration: none; }
footer { border-top: var(--rule); padding: 22px 0 26px; display: flex; justify-content: space-between; gap: 20px; font-size: 10px; text-transform: uppercase; }
.project-top { padding: 40px 0; }
.back { font-size: 16px; display: inline-block; margin: 25px 0 50px; text-transform: uppercase; }
.project-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.project-intro h1 { grid-column: 1; font-size: clamp(30px, 3.75vw, 60px); font-weight: 800; letter-spacing: 0; line-height: 1.05; text-transform: uppercase; overflow-wrap: anywhere; }
.project-intro > div { grid-column: 2; grid-row: 1; min-width: 0; }
.project-intro p { font-size: 16px; line-height: 1.65; margin: 0 0 28px; max-width: 560px; }
.metadata { border-top: var(--rule); padding-top: 16px; display: flex; gap: 35px; font-size: 16px; line-height: 1.6; }
.metadata dt { text-transform: uppercase; font-weight: 700; margin-bottom: 5px; }
.metadata dd { margin: 0; }
.next { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 60px; font-size: 16px; text-transform: uppercase; }
@media (min-width: 1600px) { body { max-width: 1800px; margin: auto; } }
@media (max-width: 900px) {
  body { padding: 0 22px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header { align-items: flex-start; }
  nav { justify-content: flex-end; }
}
@media (max-width: 560px) {
  body { padding: 0 14px; }
  .header { flex-direction: column; gap: 24px; padding-top: 26px; }
  .wordmark { font-size: clamp(20px, 5.5vw, 30px); }
  .wordmark span { margin-top: 14px; }
  nav { justify-content: flex-start; }
  nav a { font-size: 11px; padding: 9px 12px; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 12px; }
  .about, .project-intro { grid-template-columns: 1fr; gap: 28px; }
  .about { margin-top: 55px; padding-bottom: 45px; }
  .about h2::before { margin-bottom: 20px; }
  .back { margin-bottom: 32px; }
    .metadata { gap: 20px; flex-wrap: wrap; }
}

.next a { font-size: 16px; display: flex; flex-direction: column; gap: 8px; border: var(--rule); padding: 14px 16px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.next a:last-child { text-align: right; }
.next a span { font-size: 14px; }
.next a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.back { border: var(--rule); padding: 12px 16px; }
@media (max-width: 560px) { .next { flex-direction: column; } }

footer a { font-size: 16px; }

/* Masonry columns keep each asset at its natural aspect ratio. */
.project-gallery { column-count: 3; column-gap: 20px; margin: 40px 0 20px; }
.gallery-item { padding: 16px; background: var(--paper); margin: 0 0 20px; break-inside: avoid; display: inline-block; width: 100%; border: var(--rule); vertical-align: top; }
.gallery-item img, .gallery-item video { display: block; width: 100%; height: auto; }
@media (max-width: 900px) { .project-gallery { column-count: 2; } }
@media (max-width: 560px) { .project-gallery { column-count: 1; margin-top: 25px; } .gallery-item { padding: 12px; } }

.video-toggle { font: inherit; font-size: 12px; background: var(--paper); color: var(--ink); border: var(--rule); padding: 8px 10px; margin-top: 12px; cursor: pointer; }

@media (max-width: 560px) { .project-intro > div { grid-column: 1; grid-row: auto; } }

.project-intro > div > p:empty { display: none; }
.project-intro > div > p:empty + .metadata { margin-top: 0; }

/* Row-wise masonry: DOM order stays left-to-right, without dense backfilling. */
.grid.masonry { grid-auto-rows: 1px; row-gap: 0; }

.media-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; cursor: zoom-in; }
.media-open:focus-visible, .media-viewer button:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
body.viewer-open { overflow: hidden; }
.media-viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border: 0; background: var(--paper); color: var(--ink); }
.media-viewer[open] { display: flex; flex-direction: column; gap: 16px; }
.media-viewer::backdrop { background: rgba(0,0,0,.8); }
.viewer-bar, .viewer-navigation { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; }
.viewer-count { margin: 0; font-size: 14px; }
.media-viewer button { min-height: 44px; padding: 10px 16px; border: var(--rule); background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; }
.viewer-stage img, .viewer-stage video { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

/* Signature logo: preserve SVG proportions at all viewport sizes. */
.wordmark .signature { display: block; width: clamp(150px, 19vw, 260px); max-width: 100%; height: auto; }
@media (max-width: 560px) { .wordmark .signature { width: 170px; max-width: 75vw; } }

.skip-link { position: fixed; top: 12px; left: 12px; padding: 12px 16px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); z-index: 100; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.card-shell { position: relative; min-width: 0; align-self: start; }
.card-shell > .video-toggle { position: absolute; right: 24px; top: 24px; margin: 0; min-height: 44px; }
.video-toggle { min-height: 44px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* Small visible icon inside a comfortably sized touch target. */
.card-shell > .video-toggle-icon { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; display: grid; place-items: center; }
.video-toggle-icon::before { content: ""; position: absolute; width: 28px; height: 28px; background: var(--paper); border: 1px solid var(--ink); border-radius: 50%; }
.video-toggle-icon svg { position: relative; }
.video-toggle-icon:hover::before { background: var(--hover-paper); }
.video-toggle-icon:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

:root[data-theme="dark"] {
  --ink: #f2f2f2;
  --paper: #141414;
  --hover-paper: #333;
  --logo-filter: invert(1);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ink: #f2f2f2;
    --paper: #141414;
    --hover-paper: #333;
    --logo-filter: invert(1);
    color-scheme: dark;
  }
}
.wordmark .signature { filter: var(--logo-filter); }
.theme-toggle {
  border: var(--rule);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-size: 12px;
  letter-spacing: inherit;
  text-transform: uppercase;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--ink); color: var(--paper); }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.header nav > a, .header nav > .theme-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; line-height: 1.2; }
.header nav > .theme-toggle[hidden] { display: none; }
@media (max-width: 560px) { .theme-toggle { font-size: 11px; padding: 9px 12px; } }
