*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #080808;
  --off-black: #0f0f0f;
  --charcoal: #1a1a1a;
  --smoke: #2a2a2a;
  --grey: #888;
  --light-grey: #bbb;
  --white: #f0ede8;
  --accent: #c8a96e;
  --accent-dim: rgba(200, 169, 110, 0.15);
  --nav-height: 80px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: 'Cormorant Garamond', serif;
  overflow-x: hidden;
  cursor: none;
}

/* GRAIN */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.08;
  pointer-events: none;
  z-index: 9998;
  animation: grain 0.5s steps(1) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0,0); }
  10% { transform: translate(-2%,-3%); }
  20% { transform: translate(3%,1%); }
  30% { transform: translate(-1%,4%); }
  40% { transform: translate(4%,-2%); }
  50% { transform: translate(-3%,3%); }
  60% { transform: translate(2%,-4%); }
  70% { transform: translate(-4%,1%); }
  80% { transform: translate(1%,3%); }
  90% { transform: translate(3%,-1%); }
}

/* CURSOR */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
  mix-blend-mode: difference;
}
.cursor.hovering { width: 40px; height: 40px; opacity: 0.4; }

@media (hover: none) and (pointer: coarse) {
  .cursor { display: none !important; }
  body, a, button, .project-card { cursor: auto !important; }
}

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
  background: linear-gradient(to bottom, rgba(8,8,8,0.92) 0%, transparent 100%);
  height: var(--nav-height);
}

.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.12em;
  color: var(--white);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after { width: 100%; }

.nav-about-link {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  text-decoration: none;
  border: 1px solid var(--smoke);
  padding: 8px 16px;
  transition: all 0.3s ease;
}
.nav-about-link:hover { border-color: var(--accent); color: var(--accent); }

/* HERO */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video-wrap iframe,
.hero-video-wrap video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 56.25vw; /* 16:9 aspect ratio */
  min-height: 100vh;
  min-width: 177.77vh; /* 16:9 aspect ratio */
  object-fit: cover;
}

.hero-bg-demo {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,8,8,0.1) 0%,
    rgba(8,8,8,0.0) 30%,
    rgba(8,8,8,0.3) 65%,
    rgba(8,8,8,0.92) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 48px 56px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.hero-role {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.3s forwards;
}

.hero-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(64px, 10vw, 128px);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--white);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.9s 0.5s forwards;
}

.hero-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--light-grey);
  margin-top: 12px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.7s forwards;
}

.hero-scroll-hint {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--grey);
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeIn 1s 1s forwards;
}

.hero-scroll-hint::before {
  content: '';
  display: block;
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: scrollLine 2s 1.5s ease-in-out infinite;
}

@keyframes scrollLine {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* PAGE HEADER (no-hero pages) */
.page-header {
  padding: 140px 48px 48px;
  border-bottom: 1px solid var(--charcoal);
}

.page-header-role {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeUp 0.7s 0.2s forwards;
  transform: translateY(16px);
}

.page-header-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(56px, 9vw, 112px);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--white);
  opacity: 0;
  animation: fadeUp 0.8s 0.35s forwards;
  transform: translateY(24px);
}

.page-header-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--light-grey);
  margin-top: 14px;
  max-width: 560px;
  opacity: 0;
  animation: fadeUp 0.7s 0.5s forwards;
  transform: translateY(16px);
}

/* FILTER BAR */
.filter-section {
  position: sticky;
  top: 0; /* Overlays into the nav area on large screens */
  z-index: 101; /* Above the nav bar */
  background: transparent;
  padding: 28px 48px; /* Match nav padding */
  pointer-events: none; /* Let clicks pass through the empty space */
}

.filter-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px; /* Elegant spacing between pills */
  pointer-events: none;
}

.filter-btn {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  background: none;
  border: none;
  padding: 8px 16px;
  cursor: none;
  white-space: nowrap;
  position: relative;
  transition: color 0.3s ease;
  pointer-events: auto; /* Re-enable clicks for the buttons */
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.filter-btn:hover { color: var(--white); }
.filter-btn.active { color: var(--accent); }
.filter-btn.active::after { width: calc(100% - 48px); }

.filter-count {
  font-size: 8px;
  vertical-align: super;
  margin-left: 4px;
  opacity: 0.5;
}

/* PROJECTS GRID */
.projects-section {
  padding: 64px 48px 120px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
}

.project-card {
  position: relative;
  overflow: hidden;
  background: var(--charcoal);
  cursor: none;
  display: flex;
  flex-direction: column;
}

.project-card.hidden { display: none; }

/* VIEW TRANSITIONS API - Tiles resize and slide into place */
::view-transition-group(*) {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

/* Default editorial layout (repeating 12-item mosaic) */
.projects-grid:not(.filtered) .project-card:nth-child(12n+1) { grid-column: span 8; }
.projects-grid:not(.filtered) .project-card:nth-child(12n+2) { grid-column: span 4; }
.projects-grid:not(.filtered) .project-card:nth-child(12n+3) { grid-column: span 4; }
.projects-grid:not(.filtered) .project-card:nth-child(12n+4) { grid-column: span 4; }
.projects-grid:not(.filtered) .project-card:nth-child(12n+5) { grid-column: span 4; }
.projects-grid:not(.filtered) .project-card:nth-child(12n+6) { grid-column: span 6; }
.projects-grid:not(.filtered) .project-card:nth-child(12n+7) { grid-column: span 6; }
.projects-grid:not(.filtered) .project-card:nth-child(12n+8) { grid-column: span 12; }
.projects-grid:not(.filtered) .project-card:nth-child(12n+9) { grid-column: span 5; }
.projects-grid:not(.filtered) .project-card:nth-child(12n+10) { grid-column: span 7; }
.projects-grid:not(.filtered) .project-card:nth-child(12n+11) { grid-column: span 8; }
.projects-grid:not(.filtered) .project-card:nth-child(12n) { grid-column: span 4; }

/* Filtered: clean 4-col grid */
.projects-grid.filtered .project-card { grid-column: span 4; }

.project-thumb-demo {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
  transition: transform 0.7s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.5s ease;
  filter: brightness(0.7) saturate(0.85);
  position: relative;
  overflow: hidden;
}

.project-thumb-demo::before {
  content: '';
  position: absolute;
  inset: 0;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  flex: 1;
  min-height: 0;
  transition: transform 0.7s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.5s ease;
  filter: brightness(0.7) saturate(0.85);
  position: relative;
  z-index: 0;
}

.project-video {
  position: absolute;
  /* Zoom video to fill frame and crop out hardcoded letterboxes */
  top: -30%;
  left: -30%;
  width: 160%;
  height: 160%;
  border: none;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.5s ease;
  filter: brightness(0.7) saturate(0.85);
  z-index: 1;
}

.project-card:hover .project-thumb-demo,
.project-card:hover img,
.project-card:hover .project-video {
  transform: scale(1.04);
  filter: brightness(0.88) saturate(1.05);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,8,8,0.92) 0%, rgba(8,8,8,0.1) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  z-index: 2;
}

.project-card:hover .project-overlay { opacity: 1; }

@media (max-width: 900px) {
  .project-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(8,8,8,0.95) 0%, rgba(8,8,8,0.4) 70%, transparent 100%);
    padding: 16px;
  }
  .project-title {
    font-size: 20px;
  }
  .project-client {
    font-size: 12px;
  }
}

.project-category-tag {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.project-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(20px, 3vw, 32px);
  letter-spacing: 0.06em;
  color: var(--white);
  line-height: 1;
}

.project-client {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--light-grey);
  margin-top: 4px;
}

/* EMPTY STATE */
.empty-state {
  display: none;
  grid-column: span 12;
  text-align: center;
  padding: 80px 0;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--grey);
}
.projects-grid.no-results .empty-state { display: block; }

/* FOOTER */
footer {
  border-top: 1px solid var(--charcoal);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.15em;
  color: var(--grey);
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  text-decoration: none;
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--accent); }

/* ANIMATIONS */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  to { opacity: 1; }
}

.page-fade {
  opacity: 0;
  animation: fadeIn 0.6s 0.05s ease forwards;
}

/* RESPONSIVE */

/* Medium screens: filter bar sits in normal flow, no floating */
@media (max-width: 1600px) and (min-width: 601px) {
  .filter-section {
    position: static;
    padding: 16px 0;
    background: var(--black);
    border-bottom: 1px solid var(--charcoal);
    pointer-events: auto;
  }
  .filter-inner {
    pointer-events: auto;
    justify-content: center;
    overflow-x: auto;
    padding: 0 24px;
    gap: 8px;
    scrollbar-width: none;
  }
  .filter-inner::-webkit-scrollbar { display: none; }
}

@media (max-width: 900px) {
  :root { --nav-height: 60px; }
  nav { 
    padding: 0 24px; /* Let height be controlled by var */
    background: var(--black); 
  }
  .nav-logo { font-size: 18px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 9px; }
  .nav-about-link { padding: 6px 12px; }

  .hero-content { padding: 0 24px 40px; }
  .page-header { padding: 100px 24px 32px; }

  /* Filter bar already handled by the 1100px breakpoint above */
  .filter-section { 
    justify-content: flex-start;
  }
  .filter-inner {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0 24px;
    gap: 8px;
    scrollbar-width: none;
  }
  .filter-inner::-webkit-scrollbar { display: none; }
  .filter-btn {
    padding: 6px 12px;
    font-size: 9px;
  }
  .filter-btn.active::after { width: 100%; }

  .projects-section { padding: 24px 24px 80px; }
  .project-card,
  .projects-grid:not(.filtered) .project-card:nth-child(n),
  .projects-grid.filtered .project-card { grid-column: span 12; }
  footer { padding: 32px 24px; flex-direction: column; gap: 20px; text-align: center; }
}

@media (max-width: 600px) {
  :root { --nav-height: 100px; } /* home page column nav height */

  /* ── HOME PAGE NAV: column layout ── */
  nav {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--charcoal);
  }
  .nav-logo { font-size: 16px; }
  .nav-links { gap: 8px; justify-content: center; flex-wrap: nowrap; }
  .nav-links a { font-size: 8px; letter-spacing: 0.15em; }
  /* Flatten the "About" pill into a plain text link */
  .nav-about-link {
    border: none;
    padding: 0;
    font-size: 8px;
    letter-spacing: 0.15em;
    color: var(--grey);
  }
  .nav-about-link:hover { border: none; color: var(--white); }

  /* ── PROJECT PAGE NAV: compact single row ── */
  /* Shows only ← Director (back link) on the left and About on the right */
  nav:has(.pd-back) {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    gap: 0;
  }
  nav:has(.pd-back) .nav-links { gap: 0; }
  /* Hide Director / Colorist / Cinematographer — keep only About (last item) */
  nav:has(.pd-back) .nav-links li:not(:last-child) { display: none; }

  /* ── PROJECT PAGE: push video below the 60px compact nav ── */
  .pd-hero { margin-top: 60px; }

  /* ── FILTER BAR ── */
  .filter-section {
    top: var(--nav-height);
    background: var(--black);
    border-bottom: 1px solid var(--charcoal);
    pointer-events: auto;
    padding: 10px 0;
  }
  .filter-inner {
    pointer-events: auto;
    scroll-snap-type: x mandatory;
    box-shadow: inset -48px 0 24px var(--black);
    padding: 0 24px;
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .filter-inner::-webkit-scrollbar { display: none; }
  .filter-btn {
    scroll-snap-align: start;
    flex-shrink: 0;
    font-size: 9px;
    padding: 6px 12px;
  }
  /* Active pill: filled chip */
  .filter-btn.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-radius: 2px;
  }
  .filter-btn.active::after { display: none; }

  /* ── PROJECT CARDS ── */
  .project-card img,
  .project-thumb-demo { aspect-ratio: 3 / 2; }

  /* ── STILLS GRID: single column on mobile ── */
  .pd-stills-grid { grid-template-columns: 1fr !important; }

  /* ── HERO ── */
  /* Height follows 16:9 ratio so video fills width with no cropping.
     margin-top pushes the hero below the fixed nav so none of it is covered. */
  .hero { height: 56.25vw; margin-top: var(--nav-height); }
  .hero-video-wrap iframe,
  .hero-video-wrap video {
    width: 100%;
    height: 100%;
    min-width: unset;
    min-height: unset;
    top: 0;
    left: 0;
    transform: none;
  }
  .hero-tagline { font-size: 15px; }
  .hero-content { padding: 0 20px 28px; }

  /* ── PAGE HEADER ── */
  .page-header { padding: 112px 24px 24px; }
  .page-header-title { font-size: clamp(44px, 14vw, 80px); }
}

/* ── COLOR INQUIRY CTA ── */
.cta-section {
  padding: 80px 64px;
  border-top: 1px solid var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-eyebrow {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.cta-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(32px, 4vw, 56px);
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}
.cta-btn {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  border: 1px solid var(--smoke);
  padding: 14px 28px;
  transition: border-color 0.3s, color 0.3s;
  white-space: nowrap;
}
.cta-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── NEXT PROJECT ── */
.pd-next {
  border-top: 1px solid var(--charcoal);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: background 0.3s;
}

.pd-next:hover {
  background: var(--off-black);
}

.pd-next-label {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 6px;
}

.pd-next-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 0.06em;
  color: var(--white);
  transition: color 0.3s;
}

.pd-next:hover .pd-next-title {
  color: var(--accent);
}

.pd-next-arrow {
  font-size: 28px;
  color: var(--grey);
  transition: transform 0.3s, color 0.3s;
}

.pd-next:hover .pd-next-arrow {
  transform: translateX(6px);
  color: var(--accent);
}

@media (max-width: 900px) {
  .pd-next {
    padding: 32px 24px;
  }
}

