:root {
  --ink: rgba(0, 0, 0, 0.85);
  --muted: rgba(163, 163, 163, 0.85);
  --active: #ff0000;
  --bg: #ffffff;
  --serif: "Newsreader", "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --pad: 6rem;
}

html { font-size: 10px; }
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 300;
  font-size: 3rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.mac { position: relative; }
.mac::after {
  content: ""; position: absolute; left: 22%; right: 22%; top: -0.04em;
  border-top: 0.055em solid currentColor;
}
a:active { opacity: 0.7; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- top navigation (fixed, overlays content) ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2.8rem 2.8rem 0 calc(2.8rem + 2rem);
  pointer-events: none;
}
.site-nav a { pointer-events: auto; }
.site-name { font-size: 3.3rem; }
.site-info { font-size: 2.8rem; padding-right: 2rem; }
.site-info.active { color: var(--active); }

/* ---------- category filter ---------- */
.filters {
  text-align: center;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0;
  padding: 10.8rem 0 4.8rem;
}
.filters a, .filters span { margin: 0 0.75em; }
.filters a { color: var(--muted); }
.filters a:hover { color: var(--ink); }

/* ---------- homepage collage ---------- */
.home { padding: 0 var(--pad) 12rem; }
.collage-wrap { container-type: inline-size; overflow-x: clip; }
html, body { overflow-x: clip; }
.collage { position: relative; height: calc(var(--h) * 1cqw); }
.collage + .collage { margin-top: 10rem; }
.ci {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1cqw);
  width: calc(var(--w) * 1%);
}
.ci img { width: 100%; }
.collage-mobile { display: none; }

/* ---------- archive grid ---------- */
.archive { padding: 0 var(--pad) 12rem; }
/* The bar (name, Info, filters) stays; images disappear cleanly as they pass under it. */
.archive .filters {
  position: sticky; top: 0; z-index: 50;
  margin: 0 calc(-1 * var(--pad)) 4.8rem; padding-bottom: 2.4rem; background: var(--bg);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 5rem;
}
.cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.cell img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- project page ---------- */
.project { padding: 16rem 0 12rem; }
.project-images {
  margin-left: 9rem;
  width: calc(52.5vw - 11.3rem);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.project-text {
  position: fixed;
  top: 16rem;
  left: calc(48vw + 15rem);
  right: 9rem;
  max-height: calc(100vh - 18rem);
  overflow-y: auto;
}
.project-title { font-weight: 300; font-size: 3rem; line-height: 1.2; margin: 0 0 1.2em; }
.project-credits { font-family: var(--sans); font-weight: 400; font-size: 1.4rem; letter-spacing: 0; line-height: 1.45; color: var(--muted); }
.project-credits a:hover { color: var(--ink); }

/* ---------- about ---------- */
.about { padding: 16rem var(--pad) 8rem; }
.about-photo img { width: max(14rem, 12vw); }
.about-links { margin: 3.6rem 0 0; }

/* ---------- portfolio (link only) ---------- */
/* no links back to the main site, so visitors don't leave the portfolio by accident */
.is-portfolio .site-nav { display: none; }
.portfolio { padding: 12rem var(--pad) 12rem; }
.pf-name { font-weight: 300; font-size: 3.3rem; margin: 0 0 1.2rem; }
.pf-label, .pf-role, .pf-p, .pf-n {
  font-family: var(--sans); font-weight: 500; font-size: 1.1rem;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); margin: 0;
}
.pf-intro { max-width: 62rem; margin: 0 auto 12rem; text-align: center; }
.pf-lede { font-size: 2.4rem; line-height: 1.25; margin: 2.4rem 0; text-wrap: balance; }
.pf-contact { font-size: 1.8rem; margin: 0; }
.pf-contact a, .pf-end a { border-bottom: 1px solid currentColor; }

.pf-index { list-style: none; padding: 0; margin: 0 0 20rem; }
.pf-index li a, .pf-index li.pf-soon {
  display: grid; grid-template-columns: 1fr 3fr 1fr; align-items: baseline;
  padding: 0.6rem 0;
}
.pf-index .pf-t { text-align: center; font-size: 3rem; }
.pf-index .pf-p { text-align: right; }
.pf-index li a:hover .pf-t { color: var(--active); }
.pf-index li.pf-soon .pf-t { color: var(--muted); }
.pf-index li.pf-cv-link { margin-top: 5rem; }

.pf-project { margin-bottom: 24rem; }
.pf-index { scroll-margin-top: 10rem; }
.pf-top[hidden] { display: none; }
.pf-head {
  display: grid; grid-template-columns: 1fr 3fr 1fr 1fr; align-items: baseline;
  margin-bottom: 4rem;
  /* stays at the top while its project scrolls by; the next project's header takes over */
  position: sticky; top: 0; z-index: 5;
  background: var(--bg); padding: 2.4rem 0 2rem;
}
.pf-head .pf-t { font-weight: 300; font-size: 4.2rem; margin: 0; }
.pf-head .pf-p { text-align: right; }

.pf-head a.pf-n:hover { color: var(--active); }

.pf-row {
  display: flex; justify-content: center; align-items: var(--va);
  gap: 2%; width: 100%;
}
/* Normal reading: rows one after another. While auto scroll runs (.pf-autoscroll on <html>)
   each row and the team list fills one screen under a 10rem header, centred, so the rows
   above and below stay out of view. */
.pf-page { margin-bottom: 12rem; }
.pf-autoscroll .pf-head { height: 10rem; margin-bottom: 0; }
.pf-autoscroll .pf-page {
  min-height: calc(100vh - 10rem); margin: 0; padding: 3rem 0;
  display: flex; flex-direction: column; justify-content: center;
}
.pf-autoscroll .pf-page img { max-height: calc(100vh - 16rem); object-fit: contain; }
.pf-autoscroll .pf-page video { max-height: calc(100vh - 16rem); width: auto; max-width: 100%; margin: 0 auto; }
.pf-item { width: calc(var(--w) * 1%); flex: 0 1 auto; min-width: 0; margin: 0; }
.pf-row figure { margin: 0; }
.pf-row img, .pf-row video { width: 100%; }
.pf-video video { display: block; height: auto; aspect-ratio: var(--ratio, 16 / 9); background: #eee; object-fit: cover; }
.pf-grid { display: grid; grid-template-columns: repeat(var(--c), 1fr); gap: 1.2rem; align-items: start; }

.pf-top {
  position: fixed; right: 2.8rem; bottom: 2.8rem; z-index: 50;
  font-family: var(--sans); font-weight: 500; font-size: 1.1rem; letter-spacing: 0.02em;
  text-transform: uppercase; background: var(--bg); padding: 0.8rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.pf-top a:hover, .pf-auto:hover { color: var(--active); }
.pf-auto {
  position: fixed; left: 2.8rem; bottom: 2.8rem; z-index: 50; cursor: pointer;
  border: 0; color: var(--ink); background: var(--bg); padding: 0.8rem 1.2rem; font-variant-emoji: text;
  font-family: var(--sans); font-weight: 500; font-size: 1.1rem; letter-spacing: 0.02em; text-transform: uppercase;
}
.pf-auto[hidden] { display: none; }
.pf-top a[hidden] { display: none; }

.pf-team { text-align: center; max-width: 80rem; margin: -3rem auto 0; font-size: 1.6rem; line-height: 1.3; letter-spacing: 0; }
.pf-team .pf-label { margin-bottom: 1.6rem; }
.pf-team p { margin: 0 0 0.8rem; }
.pf-team b { display: block; font-weight: 400; }
.pf-team p:not(.pf-label) { color: var(--ink); }

.pf-end { text-align: center; font-size: 3rem; margin: 0; }

/* CV: same look as the projects; each block has its label on the left */
.pf-cv { font-size: 1.6rem; line-height: 1.35; letter-spacing: 0; }
/* label in the header's number column; content starts under the title (header is 1fr 3fr 1fr 1fr) */
.cv-block { display: grid; grid-template-columns: 1fr 5fr; margin-bottom: 5rem; }
.cv-block p { margin: 0 0 0.6rem; }
.cv-block > .pf-label { padding-top: 0.3rem; }
.cv-row { display: grid; grid-template-columns: 11rem 2fr 2fr; gap: 1.6rem; align-items: baseline; }
.cv-row .cv-wide { grid-column: 2 / 4; }
.cv-row a { border-bottom: 1px solid rgba(0, 0, 0, 0.2); }
.cv-row a:hover { color: var(--active); border-color: currentColor; }
.cv-y { font-family: var(--sans); font-weight: 500; font-size: 1.1rem; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.cv-m { color: var(--muted); }

/* ---------- zoom view ---------- */
[data-zoom] { cursor: zoom-in; }
.ci a [data-zoom], a.ci [data-zoom] { cursor: pointer; }
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; cursor: pointer; }
.lightbox button {
  position: absolute; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 2.4rem; color: var(--ink); padding: 1.6rem;
}
.lightbox .lb-close { top: 1.2rem; right: 1.6rem; }
.lightbox .lb-prev { left: 0.8rem; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 0.8rem; top: 50%; transform: translateY(-50%); }

/* ---------- phones ---------- */
@media (max-width: 768px) {
  :root { --pad: 1.6rem; }
  .site-nav { padding: 1.6rem; background: none; }
  .site-name, .site-info { font-size: 2.2rem; padding-right: 0; }
  .filters { padding: 7rem 0 3rem; }
  .collage-desktop { display: none; }
  .collage-mobile { display: block; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .project { padding: 8rem var(--pad) 6rem; }
  .project-text { position: static; max-height: none; margin-bottom: 3rem; }
  .project-title { font-size: 2.4rem; margin-bottom: 0.8em; }
  .project-images { margin: 0; width: 100%; gap: 1.2rem; }
  .about { padding-top: 9rem; }
  .about-photo img { width: 50vw; }
  .about-links { font-size: 2.2rem; }
  .portfolio { padding-top: 6rem; }
  .pf-name { font-size: 2.6rem; }
  .pf-intro { margin-bottom: 7rem; }
  .pf-lede { font-size: 2rem; }
  .pf-index { margin-bottom: 10rem; }
  .pf-index li a, .pf-index li.pf-soon { grid-template-columns: 3rem 1fr auto; }
  .pf-index .pf-t { text-align: left; font-size: 2.2rem; }
  .pf-project { margin-bottom: 12rem; }
  .pf-head { grid-template-columns: 3rem 1fr auto; row-gap: 0.6rem; margin-bottom: 2.4rem; padding: 1.4rem 0 1.2rem; }
  .pf-head .pf-t { font-size: 2.8rem; }
  .pf-head .pf-role { grid-column: 2; grid-row: 2; }
  .pf-head .pf-p { grid-column: 3; grid-row: 1 / span 2; }
  .pf-row { flex-wrap: wrap; align-items: flex-start; gap: 1.2rem; }
  .pf-page { margin-bottom: 1.2rem; }
  .pf-item { width: 100%; }
  .pf-item.pf-small { width: calc(50% - 0.6rem); }
  .pf-grid { grid-template-columns: 1fr 1fr; }
  .pf-top { right: 1.6rem; bottom: 1.6rem; }
  .pf-auto { left: 1.6rem; bottom: 1.6rem; }
  .pf-index li.pf-cv-link { margin-top: 2.4rem; }
  .cv-block { grid-template-columns: 1fr; gap: 1.6rem; margin-bottom: 3.6rem; }
  .cv-row { grid-template-columns: 10rem 1fr; row-gap: 0; }
  .cv-row .cv-y { white-space: nowrap; }
  .cv-row .cv-m { grid-column: 2; }
  .pf-team { margin: 2.8rem auto 2.8rem; }

  /* Portfolio on phones: one image (or small image grid, or the team list) per screen under
     an 11rem header; a finger swipe settles on the next one. */
  html:has(.portfolio) { scroll-snap-type: y mandatory; }
  html.pf-autoscroll:has(.portfolio) { scroll-snap-type: none; }   /* auto scroll moves itself */
  .pf-autoscroll .pf-head { height: 11rem; }
  .pf-intro, .pf-index { scroll-snap-align: start; }
  .pf-end { scroll-snap-align: end; }
  .pf-head { height: 11rem; margin-bottom: 0; align-content: start; }
  .pf-page, .pf-autoscroll .pf-page { margin: 0; padding: 0; min-height: 0; display: block; }
  .pf-row { display: block; }
  .pf-item, .pf-item.pf-small, .pf-team, .cv-block {
    scroll-snap-align: start; scroll-margin-top: 11rem;
  }
  .pf-item, .pf-item.pf-small, .pf-team {
    width: 100%; min-height: calc(100svh - 11rem); margin: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
  }
  .pf-item.pf-grid { display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 1.2rem; }
  .pf-row video, .pf-autoscroll .pf-page video { width: 100%; max-height: calc(100svh - 14rem); }
  /* rows of small images (NERRĀ): four to a screen instead of one each */
  .pf-row.pf-row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-content: center;
    min-height: calc(100svh - 11rem); scroll-snap-align: start; scroll-margin-top: 11rem; }
  .pf-row-grid .pf-item, .pf-row-grid .pf-item.pf-small { width: 100%; min-height: 0; scroll-snap-align: none; }
  .pf-row.pf-row-grid .pf-item img { max-height: calc((100svh - 14rem) / 2 - 0.6rem); }
  .pf-row .pf-item:not(.pf-grid) img, .pf-autoscroll .pf-page img {
    width: auto; max-width: 100%; max-height: calc(100svh - 14rem); object-fit: contain;
  }
}
