/* ============================================================
   site.css — shared stylesheet for the whole site
   Single source of truth: tokens, page frame, header/footer,
   the justified film-strip component, and responsive behaviour.
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  --bg: #000;
  --accent: #C8945A;
  --accent-hover: #d9a96e;

  --text-strong: rgba(255, 255, 255, 0.85);
  --text: rgba(255, 255, 255, 0.65);
  --text-dim: rgba(255, 255, 255, 0.38);
  --text-faint: rgba(255, 255, 255, 0.12);
  --hairline: rgba(255, 255, 255, 0.07);

  --maxw: 1600px;                       /* content column cap on wide screens */
  --gutter: clamp(20px, 5vw, 100px);    /* fluid page side margin */
  --gap: clamp(8px, 1.1vw, 16px);       /* gap between stills */
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- Page frame: one centred column, same on every page ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Header ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: clamp(24px, 4vw, 44px) 0;
}
.site-header a { text-decoration: none; color: inherit; }
.site-name {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: 0.01em;
  color: var(--accent);
  line-height: 1;
  display: block;
}
.site-role {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1;
  margin-top: 10px;
  display: block;
}
.site-nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 24px); }
.site-nav a {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.28);
  transition: color 0.2s;
}
.site-nav a:hover { color: rgba(255, 255, 255, 0.65); }
.site-nav a.active { color: rgba(255, 255, 255, 0.75); }
.site-nav a.contact { color: var(--accent); }
.site-nav a.contact:hover { color: var(--accent-hover); }

/* ============================================================
   Justified film-strip — the shared layout primitive.
   flex-grow = each image's aspect ratio (--ar) makes a row of
   images fill the width at one common height, no cropping.
   ============================================================ */
.strip { display: flex; gap: var(--gap); }
.strip-img {
  position: relative;
  flex-grow: var(--ar, 1.778);
  flex-basis: 0;
  min-width: 0;            /* allow shrink, else flex items overflow */
  overflow: hidden;
}
.strip-img img { width: 100%; height: auto; display: block; }
.strip-img .hover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
/* hover video only where a real pointer exists (desktop) */
@media (hover: hover) and (min-width: 900px) {
  .has-video:hover .strip-img.middle .hover-video { opacity: 1; }
  /* Fade the still out as the video fades in. The video (object-fit:cover)
     fills the whole cell, so once it's up the still underneath is redundant.
     Hiding it removes the two-layer GPU compositing seam that otherwise let
     the still's rightmost pixels show as a bright edge over the video. */
  .has-video .strip-img.middle img { transition: opacity 0.4s ease; }
  .has-video:hover .strip-img.middle img { opacity: 0; }
}

/* ---- Hover darkening (homepage, desktop only) ----
   Hovering a project dims its stills; a project with a hover video
   keeps its middle (video) cell bright so the motion stands out. */
@media (hover: hover) and (min-width: 900px) {
  .projects .strip-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    z-index: 3;
  }
  .projects .project:hover .strip-img::after { background: rgba(0, 0, 0, 0.4); }
  .projects .project.has-video:hover .strip-img.middle::after { background: rgba(0, 0, 0, 0); }
}

/* ============================================================
   Scroll-triggered fade-in (site.js adds .in via IntersectionObserver).
   Each element rises + fades as it enters the viewport. Disabled for
   users who prefer reduced motion — they see content immediately.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    will-change: opacity, transform;
  }
  .fade-in.in {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Homepage projects
   ============================================================ */
.project { margin-bottom: clamp(40px, 6vw, 72px); }
.project > a { display: block; text-decoration: none; color: inherit; }

.caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-top: 14px;
}
.caption-left { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.caption-title { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-strong); }
.caption-meta  { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.caption-sep   { color: rgba(255, 255, 255, 0.2); }
.caption-right { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

/* Mobile-first: each project shows only its centre still, no video */
.projects .strip-img.left,
.projects .strip-img.right { display: none; }
.projects .strip-img.middle { flex-grow: 1; flex-basis: 100%; }
.projects .strip-img.middle .hover-video { display: none; }

@media (min-width: 900px) {
  .projects .strip-img.left,
  .projects .strip-img.right { display: revert; }
  .projects .strip-img.middle { flex-grow: var(--ar, 1.778); flex-basis: 0; }
  .projects .strip-img.middle .hover-video { display: revert; }
}

/* ---- Optional Vimeo embed (inner page, above gallery) ---- */
.vimeo-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: var(--gap);
}
.vimeo-wrap iframe { width: 100%; height: 100%; border: none; display: block; }

/* ---- Local reel video (inner page, above gallery)
   Triggered by gallery/reel.mp4. Width matches gallery, height
   follows the video's native aspect ratio — no cropping, no fixed ratio. ---- */
.reel-wrap { width: 100%; margin-bottom: var(--gap); }
.reel-wrap video { width: 100%; height: auto; display: block; }

/* ============================================================
   Inner page: gallery = stack of justified rows (3 per row).
   Mobile: every still full-width, stacked. Desktop: justified.
   ============================================================ */
.gallery { display: flex; flex-direction: column; gap: var(--gap); }
.gallery .strip { flex-wrap: wrap; }
/* mobile: one still per row, natural height (no flex-basis:0 height trap) */
.gallery .strip-img { flex-grow: 1; flex-basis: 100%; }
@media (min-width: 900px) {
  /* desktop: justified row, width ∝ aspect ratio */
  .gallery .strip-img { flex-grow: var(--ar, 1.778); flex-basis: 0; }
}

/* ---- Inner project info block (credits + festivals), below gallery ---- */
.info-block {
  margin-top: clamp(32px, 5vw, 48px);
  margin-bottom: clamp(48px, 8vw, 80px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 48px) 16px;
}
.info-block.no-festivals { grid-template-columns: 1fr; }
@media (max-width: 700px) { .info-block { grid-template-columns: 1fr; } }

.project-title {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-bottom: 20px;
}
.credit-row { display: flex; gap: 16px; align-items: baseline; margin-bottom: 8px; }
.credit-label {
  font-size: clamp(13px, 1.5vw, 16px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  min-width: 70px;
  flex-shrink: 0;
}
.credit-value { font-size: clamp(15px, 1.7vw, 18px); letter-spacing: 0.04em; color: var(--text); }
.description {
  margin-top: 20px;
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 300;
  line-height: 1.8;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}
.festival-category { margin-bottom: 18px; }
.festival-category-title {
  font-size: clamp(13px, 1.5vw, 16px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.festival-item {
  font-size: clamp(15px, 1.7vw, 18px);
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 7px;
}

/* ---- Footer ---- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 32px 0 48px;
  margin-top: clamp(40px, 6vw, 80px);
  border-top: 0.5px solid var(--hairline);
}
.footer-credits { font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.footer-nav { display: flex; gap: 20px; }
.footer-nav a {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.25);
  transition: color 0.2s;
}
.footer-nav a:hover { color: rgba(255, 255, 255, 0.6); }
