/* ================================================
   CHRISTOPHER HUDSON — CINEMATOGRAPHY PORTFOLIO
   ================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #000;
  color: #fff;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: #fff; text-decoration: none; }
a:hover { opacity: 0.7; }
img { display: block; max-width: 100%; height: auto; }

/* =================================================
   PRELOADER — the landing film downloads behind this
   ================================================= */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #000;
  display: grid;
  place-items: center;
  transition: opacity 1s cubic-bezier(0.22, 0.61, 0.36, 1),
              filter 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.preloader[hidden] { display: none; }

.preloader.is-done {
  opacity: 0;
  filter: blur(5px);
  pointer-events: none;
}

.preloader-inner {
  text-align: center;
  animation: pl-rise 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes pl-rise {
  from { opacity: 0; transform: translateY(10px); }
}

.preloader-name {
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-bottom: 30px;
  opacity: 0.92;
}

.preloader-track {
  position: relative;
  width: min(250px, 46vw);
  height: 1px;
  margin: 0 auto;
  background: rgba(255,255,255,0.16);
  overflow: hidden;
}

.preloader-fill {
  position: absolute;
  inset: 0;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* a light travelling along the track while it works */
.preloader-track::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 45%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: pl-sweep 1.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.preloader.is-full .preloader-track::after { opacity: 0; }

@keyframes pl-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(255%); }
}

.preloader-pct {
  margin-top: 16px;
  font-size: 0.5rem;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.42);
  font-variant-numeric: tabular-nums;
  transition: color 0.5s;
}
.preloader-pct::after { content: '%'; }
.preloader.is-full .preloader-pct { color: rgba(255,255,255,0.8); }

/* --- Enter: shown only when the browser won't start the film by itself --- */
.preloader-pct { transition: color 0.5s, opacity 0.5s; }
.preloader.needs-enter .preloader-pct { opacity: 0; }
.preloader.needs-enter { cursor: pointer; }

.preloader-enter {
  display: block;
  margin: -6px auto 0;          /* takes the percentage's place */
  padding: 10px 16px;
  background: none;
  border: 0;
  color: #fff;
  font: inherit;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.preloader-enter[hidden] { display: none; }
.preloader.enter-in .preloader-enter { opacity: 1; transform: none; }

.preloader-enter-label {
  position: relative;
  display: inline-block;
  font-size: 0.56rem;
  font-weight: 300;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  padding-bottom: 5px;
  /* the tracking adds space after the last letter; balance it */
  margin-right: -0.34em;
}
/* a hairline draws beneath on hover, echoing the loading bar */
.preloader-enter-label::after {
  content: '';
  position: absolute;
  left: 0; right: 0.34em; bottom: 0;
  height: 1px;
  background: #fff;
  transform: scaleX(0.25);
  opacity: 0.5;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s;
}
.preloader-enter:hover .preloader-enter-label::after,
.preloader-enter:focus-visible .preloader-enter-label::after {
  transform: scaleX(1);
  opacity: 1;
}
.preloader-enter:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .preloader-enter { transition: none; }
  .preloader-inner { animation: none; }
  .preloader-track::after { animation: none; opacity: 0; }
  .preloader-fill { transition: none; }
}

/* --- Typography --- */
.caps {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 400;
}

.caps-lg {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.8rem;
  font-weight: 400;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 40px;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
  pointer-events: none;
}

.nav a, .nav span { pointer-events: auto; }

.nav-logo {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.nav-links a:hover,
.nav-links a.active { opacity: 1; }

/* --- Landing Hero --- */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1.78 / 1;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.hero video,
.hero .hero-motion,
.hero .hero-fallback {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The still sits over the film rather than replacing it, so if the film
   recovers it can simply be lifted away again. */
.hero .hero-fallback {
  display: none;
  z-index: 1;
}

.hero.fallback-active .hero-fallback { display: block; }

/* Low Power Mode route: the film shown as an animated image */
.hero .hero-motion[hidden] { display: none; }
.hero.motion-img video { visibility: hidden; }

/* --- Project Grid --- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
}

.grid-tile {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  background: #111;
}

.grid-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.grid-tile .tile-hover {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s;
}

.grid-tile:hover .tile-hover { opacity: 1; }
.grid-tile:hover .tile-poster { opacity: 0; }

/* Tiles without a preview film crossfade through stills over the poster */
.grid-tile .tile-still {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.grid-tile .tile-still.is-on { opacity: 1; }
.grid-tile.tile--stills:hover .tile-poster { opacity: 1; }

/* Touch screens have no hover: previews play as they scroll into view,
   so show them while they're actually playing. */
@media (hover: none) {
  .grid-tile.is-live .tile-hover { opacity: 1; }
  .grid-tile.is-live .tile-poster { opacity: 0; }
}

.grid-tile .tile-title {
  position: absolute;
  bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.4s;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* Left-column tiles: title aligned right */
.grid-tile:nth-child(odd) .tile-title {
  right: 20px;
  text-align: right;
}

/* Right-column tiles: title aligned left */
.grid-tile:nth-child(even) .tile-title {
  left: 20px;
  text-align: left;
}

.grid-tile .tile-subtitle {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  opacity: 0.7;
  margin-top: 2px;
}

.grid-tile:hover .tile-title { opacity: 1; }

/* --- Project Page --- */
.project-hero {
  position: relative;
  width: 100%;
  cursor: pointer;
  background: #111;
}

.project-hero img {
  width: 100%;
  display: block;
}

.project-hero .play-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60px; height: 60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.project-hero:hover .play-icon { opacity: 0.8; }

.project-info {
  padding: 40px 40px 20px;
}

.project-title {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 400;
  margin-bottom: 16px;
}

.project-subtitle {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  opacity: 0.6;
  margin-top: 4px;
}

.project-credits {
  padding: 0 40px 40px;
}

.project-credits p {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  font-weight: 300;
  opacity: 0.55;
  line-height: 1.8;
}

/* =================================================
   FESTIVAL FILM PAGE — a narrative short that isn't
   public yet. No play button: the lead still drifts
   very slowly, and the synopsis + awards take the
   film's place.
   ================================================= */
.festival-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #0b0b0b;
}
.festival-hero img {
  width: 100%;
  display: block;
  transform-origin: 58% 45%;
  animation: festival-drift 26s ease-in-out infinite alternate;
}
@keyframes festival-drift {
  from { transform: scale(1); }
  to   { transform: scale(1.045); }
}

.festival-head {
  padding: 46px 40px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 22px;
}
.festival-head .project-title {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.24em;
  font-weight: 400;
}
.festival-meta {
  display: flex;
  gap: 12px;
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.5;
}
.festival-meta span + span::before {
  content: '';
  display: inline-block;
  width: 14px; height: 1px;
  background: currentColor;
  vertical-align: middle;
  margin-right: 12px;
  opacity: 0.6;
}
.festival-status {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}
.festival-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: festival-pulse 2.6s ease-in-out infinite;
}
@keyframes festival-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.festival-synopsis {
  padding: 28px 40px 0;
  max-width: calc(56ch + 80px);
  font-size: 0.82rem;
  line-height: 1.85;
  font-weight: 300;
  letter-spacing: 0.01em;
  opacity: 0.85;
}

.festival-awards {
  padding: 46px 40px 52px;
  max-width: 920px;
}
.festival-awards-label {
  font-size: 0.54rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 400;
  opacity: 0.42;
  margin-bottom: 14px;
}
.festival-awards ul {
  list-style: none;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.award {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.award-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.42;
}
.award-result em { font-style: normal; letter-spacing: 0.14em; opacity: 0.8; }
.award.is-win .award-result { opacity: 1; }
.award-body { display: flex; flex-direction: column; gap: 3px; }
.award-name { font-size: 0.76rem; letter-spacing: 0.02em; line-height: 1.5; }
.award:not(.is-win) .award-name { opacity: 0.78; }
.award-org { font-size: 0.64rem; letter-spacing: 0.03em; opacity: 0.55; }
.award-who { font-size: 0.6rem; letter-spacing: 0.03em; opacity: 0.36; }

@media (prefers-reduced-motion: reduce) {
  .festival-hero img, .festival-dot { animation: none; }
}

/* --- Stills Grid --- */
.stills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
}

.stills-grid img {
  width: 100%;
  height: auto;
  display: block;
  background: #111;
}

/* --- Prev / Next Navigation --- */
.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 40px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 4px;
}

.project-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.6rem;
  font-weight: 400;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.project-nav a:hover { opacity: 1; }

.project-nav .nav-arrow {
  font-size: 1.2rem;
  line-height: 1;
}

/* --- Showreel Page --- */
.showreel-choices {
  display: flex;
  margin-top: 80px;
  height: calc(100vh - 80px);
}

.showreel-choice {
  width: 50%;
  flex: 0 0 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.showreel-choice + .showreel-choice {
  border-left: 1px solid rgba(255,255,255,0.08);
}

.showreel-choice .showreel-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
  z-index: 1;
}

.showreel-choice.is-hovered .showreel-bg {
  opacity: 0.4;
}

.showreel-choice span {
  position: relative;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.8rem;
  font-weight: 300;
  opacity: 0.45;
  transition: opacity 0.4s;
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}

.showreel-choice.is-hovered span { opacity: 1; }

/* --- Jaeger Multi-Film --- */
.multi-film-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 4px;
  margin-top: 80px;
}

.film-thumb {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111;
}

.film-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s, filter 0.4s;
}

.film-thumb:hover img {
  transform: scale(1.03);
}

.film-thumb .film-label {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.65rem;
  font-weight: 400;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
  opacity: 0;
  transition: opacity 0.3s;
}

.film-thumb:hover .film-label { opacity: 1; }

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-inner {
  position: relative;
  width: 85vw;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
}

.lightbox-inner iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s;
  font-family: inherit;
  padding: 8px;
}

.lightbox-close:hover { opacity: 1; }

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 40px 20px 30px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.4;
}

.footer-links a { opacity: 1; transition: opacity 0.3s; }
.footer-links a:hover { opacity: 0.7; }

.footer .ig-icon {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.footer .ig-icon:hover { opacity: 0.8; }

/* --- About Page --- */
.about-content {
  max-width: 600px;
  margin: 120px auto 60px;
  text-align: center;
  padding: 0 20px;
}

.about-content h2 {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 400;
  margin-bottom: 6px;
}

.about-content p {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-bottom: 4px;
  font-weight: 300;
}

.about-content .section-gap {
  margin-top: 30px;
}

.about-content a.underline {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-photo {
  max-width: 280px;
  margin: 50px auto 30px;
}

.about-bio {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  line-height: 1.9;
  opacity: 0.7;
  font-weight: 300;
  max-width: 520px;
  margin: 0 auto 4px;
}

.about-ig {
  text-align: center;
  margin-bottom: 60px;
}

/* Portrait on the left, bio and contact on the right */
.about-layout {
  max-width: 900px;
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  padding: 130px 40px 70px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.about-figure {
  margin: 0;
}

.about-figure img {
  width: 100%;
  height: auto;
  display: block;
  animation: about-in 1.4s ease both;
}

@keyframes about-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.about-layout .about-content {
  max-width: 520px;
  margin: 0;
  padding: 0;
  text-align: left;
}

.about-layout .about-bio { margin: 0 0 4px; }

.about-layout .about-ig {
  text-align: left;
  margin: 34px 0 0;
}

@media (max-width: 768px) {
  .about-layout {
    min-height: 0;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 44px;
    padding: 110px 20px 60px;
  }
  .about-figure { width: 200px; }
  .about-layout .about-content { text-align: center; }
  .about-layout .about-bio { margin: 0 auto 4px; }
  .about-layout .about-ig { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .about-figure img { animation: none; }
}

/* Text only (no portrait): one centred column */
.about-layout--text {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}
.about-layout--text .about-content { text-align: center; }
.about-layout--text .about-bio { margin: 0 auto 4px; }
.about-layout--text .about-ig { text-align: center; }

/* --- Lazy Loading --- */
.lazy-img {
  opacity: 0;
  transition: opacity 0.4s;
}

.lazy-img.loaded { opacity: 1; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* --- Mobile --- */
@media (max-width: 768px) {
  .nav { padding: 20px 20px; }
  .nav-logo { font-size: 0.6rem; letter-spacing: 0.15em; }
  .nav-links a { font-size: 0.55rem; }
  .nav-links { gap: 16px; }

  .grid { grid-template-columns: 1fr; }
  .stills-grid { grid-template-columns: 1fr; }

  .festival-head { padding: 28px 20px 0; }
  .festival-synopsis { padding: 20px 20px 0; font-size: 0.8rem; }
  .festival-awards { padding: 34px 20px 36px; }
  .award { grid-template-columns: 78px 1fr; gap: 14px; }

  .multi-film-thumbs { grid-template-columns: 1fr; }

  .showreel-choices {
    flex-direction: column;
    height: calc(100vh - 70px);
    margin-top: 70px;
  }

  .showreel-choice {
    width: 100%;
    flex: 0 0 50%;
  }

  .showreel-choice + .showreel-choice {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
  }

  .project-info { padding: 24px 20px 12px; }
  .project-credits { padding: 0 20px 24px; }
  .project-nav { padding: 20px; }

  .lightbox-inner { width: 95vw; }
  .lightbox-close { top: -32px; font-size: 1.2rem; }

  .grid-tile .tile-title,
  .grid-tile:nth-child(odd) .tile-title,
  .grid-tile:nth-child(even) .tile-title {
    opacity: 1;
    font-size: 0.55rem;
    bottom: 10px;
    left: 12px;
    right: auto;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .about-content { margin-top: 90px; }
}
