/* ==========================================================================
   SARGO Productions — shared stylesheet
   Minimal, image-led portfolio in the vein of a classic photography site:
   white ground, quiet type, the work doing the talking.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --text: #141414;
  --text-dim: #767671;
  --text-faint: #a8a7a1;
  --border: #e6e4de;
  --max-width: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2.75rem);
  --nav-height: 68px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

/* ---------- Layout helpers ---------- */

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.eyebrow {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.6rem;
}

/* ---------- Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand span {
  font-weight: 400;
  color: var(--text-dim);
}

.nav-links {
  display: flex;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}

.nav-links a {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 20px;
  height: 1px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}

/* ---------- Page intro (every page) ---------- */

.page-intro {
  padding-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.page-intro h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.page-intro p {
  margin-top: 0.75rem;
  color: var(--text-dim);
  max-width: 56ch;
  font-size: 0.95rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.back-link:hover {
  color: var(--text);
  border-color: var(--text);
}

/* ---------- Simple grid gallery ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.75rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.grid figure {
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.grid .frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f4f3f0;
}

.grid.film-grid .frame {
  aspect-ratio: 16 / 9;
}

.grid.landscape .frame {
  aspect-ratio: 3 / 2;
}

.grid .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.grid figure:hover .frame img {
  transform: scale(1.02);
}

.grid figcaption {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
}

.grid figcaption .title {
  color: var(--text);
}

.grid figcaption .credit {
  color: var(--text-faint);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Masonry grid: thumbnails at their native aspect ratio ---------- */

.grid.masonry,
.grid.folders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.75rem);
}

.grid.masonry .frame,
.grid.folders-grid .frame {
  aspect-ratio: auto;
  background: none;
}

.grid.masonry .frame img,
.grid.folders-grid .frame img {
  width: 100%;
  height: auto;
  object-fit: unset;
}

/* .folders-grid is deliberately NOT picked up by the JS masonry packer
   (initMasonry() in main.js only targets .grid.masonry) — a folder-tile row
   is a handful of curated cover images, not a photo gallery, and reads as
   cleaner in plain uniform rows than staggered/packed. */

/* Combined diptych slide: two images stacked with a thin white gap between */

.grid.masonry .frame.combo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
}

.grid.masonry .frame.combo > div {
  cursor: pointer;
}

.grid.masonry .frame.combo img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.grid.masonry .frame.combo > div:hover img {
  transform: scale(1.02);
}

/* Row variant: two photos side by side (left/right) instead of stacked
   top/bottom, same small 4px white gap. The base .frame.combo img rule
   (width:100%) already does the right thing once the wrapping divs are
   50/50 via flex-direction:row — no extra width rule needed here. */
.grid.masonry .frame.combo.combo-row {
  flex-direction: row;
}

.grid.masonry .frame.combo.combo-row > div {
  flex: 1 1 0;
  min-width: 0;
}

/* small centred play mark for film thumbnails */
.grid.film-grid .frame {
  position: relative;
}

.grid.film-grid .frame::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent rgba(20, 20, 20, 0.55);
  transform: translate(-40%, -50%);
}

/* ---------- Film grid: two columns, stacked captions with description text ---------- */

.grid.film-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 3vw, 2.5rem);
}

.grid.film-grid figcaption {
  display: block;
}

.grid.film-grid figcaption .title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.grid.film-grid figcaption .desc {
  margin-top: 0.4rem;
  color: var(--text-dim);
  font-size: 0.88rem;
  max-width: 56ch;
}

.grid.film-grid figcaption .credits {
  margin-top: 0.5rem;
  color: var(--text-faint);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

/* ---------- Film page sections ---------- */

.film-section {
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.film-section:not(:first-of-type) {
  border-top: 1px solid var(--border);
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

.film-section-head {
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}

.film-section-head .section-note {
  margin-top: 0.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 60ch;
}

/* ---------- Home: full-height autoplaying video, no other content ---------- */

body.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* allow flex child to shrink below content size so it never overflows */
}

.home-video-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.home-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--bg);
}

.home-credit {
  text-align: right;
  padding: 0.5rem var(--gutter) 0;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #000;
}

/* Film link below the hero animation — shown immediately on the home page. */
.home-film-link {
  align-self: center;
  margin: 0.9rem 0 0.1rem;
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--text);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
}

.home-film-link:hover {
  background: var(--text);
  color: var(--bg);
}

/* ---------- About ---------- */

.about-intro {
  padding-bottom: clamp(2rem, 5vw, 3rem);
}

.about-intro p {
  max-width: 62ch;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.about-intro p + p {
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
}

.people {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.person .frame {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f4f3f0;
  margin-bottom: 1rem;
}

.person .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person h3 {
  font-size: 1rem;
  font-weight: 700;
}

.person p {
  margin-top: 0.35rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

a.person .frame img {
  transition: transform 0.5s ease;
}

a.person:hover .frame img {
  transform: scale(1.03);
}

a.person .link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

a.person:hover .link {
  color: var(--text);
  border-color: var(--text);
}

/* ---------- Profile pages (Joseph / Oscar / Caspar) ---------- */

.profile-header {
  display: flex;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: flex-start;
  flex-wrap: wrap;
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.profile-header .portrait {
  width: 260px;
  max-width: 100%;
  flex-shrink: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f4f3f0;
}

.profile-header .portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  flex: 1 1 320px;
  max-width: 62ch;
}

.profile-info .bio {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.profile-info .contact-list {
  margin-top: 0;
}

.folders-section {
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.folders-head {
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}

/* ---------- Contact ---------- */

.contact-block {
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.contact-list {
  max-width: 62ch;
}

.contact-list {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.contact-list a {
  font-size: 1rem;
  display: inline-block;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  transition: border-color 0.15s;
}

.contact-list a:hover {
  border-color: var(--text);
}

.contact-list .k {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.3rem;
}

.contact-note {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-faint);
  max-width: 50ch;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.97);
  padding: var(--gutter);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-inner {
  max-width: 1000px;
  width: 100%;
  max-height: 88vh;
}

.lightbox-inner img,
.lightbox-inner .video-placeholder {
  max-width: 100%;
  max-height: 76vh;
  margin: 0 auto;
  display: block;
}

/* Combo diptych in the lightbox: same stacked-with-a-gap look as the grid's
   .frame.combo, sized so both photos together still fit the 76vh budget. */
.lightbox-combo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-height: 76vh;
}

.lightbox-combo img {
  max-width: 100%;
  max-height: 38vh;
  width: auto;
  margin: 0;
  display: block;
}

/* Row variant, matching the grid's .combo-row — side by side instead of
   stacked, each photo gets the full 76vh height budget (not halved like
   the stacked variant) since they sit next to each other, not on top. */
.lightbox-combo.lightbox-combo-row {
  flex-direction: row;
  align-items: center;
}

.lightbox-combo.lightbox-combo-row img {
  max-width: calc(50% - 2px);
  max-height: 76vh;
  height: auto;
}

/* ---------- Gallery video embed: a single YouTube animation shown above a
   masonry photo gallery (e.g. Billy Wilder's Painted Lens), under a small
   "Animation" eyebrow subheading. Reuses the film page's play-mark styling
   at a smaller, single-item scale. ---------- */
.gallery-video-section {
  padding-bottom: clamp(2rem, 5vw, 3rem);
  margin-bottom: clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--border);
}

.gallery-video-section .eyebrow,
.gallery-renders-section .eyebrow {
  margin-bottom: 0.75rem;
}

.gallery-video {
  display: block;
  width: 100%;
  max-width: 420px;
  cursor: pointer;
}

.gallery-video .frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.gallery-video .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-video:hover .frame img {
  transform: scale(1.03);
}

.gallery-video .frame::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.92);
  transform: translate(-35%, -50%);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  background: #f4f3f0;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
}

.video-embed {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 76vh;
  aspect-ratio: 16 / 9;
  background: #000;
  margin: 0 auto;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.lightbox-caption {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.lightbox-close {
  position: absolute;
  top: 1.4rem;
  right: 1.6rem;
  font-size: 1.3rem;
  color: var(--text);
  line-height: 1;
  width: 32px;
  height: 32px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--text-dim);
  width: 40px;
  height: 40px;
}

.lightbox-nav:hover {
  color: var(--text);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-footer p {
  color: var(--text-faint);
  font-size: 0.76rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.76rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links a:hover {
  color: var(--text);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem var(--gutter) 2rem;
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
  }

  .nav-links.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links a {
    width: 100%;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.is-active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid.masonry,
  .grid.folders-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .people {
    grid-template-columns: 1fr;
    max-width: 360px;
  }
}

@media (max-width: 520px) {
  .grid,
  .grid.film-grid {
    grid-template-columns: 1fr;
  }

  .grid.masonry,
  .grid.folders-grid {
    grid-template-columns: 1fr;
  }
}
