/* ════════════════════════════════════════════════
   DAN BRAGA ULVESTAD — DIRECTOR & WRITER
   Cinematic single-page scroll reel
   ════════════════════════════════════════════════ */

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

:root {
  /* ── Color tokens ── */
  --bg:        #0c0c0b;
  --bg-raise:  #14130f;
  --fg:        #f5f3ef;
  --fg-mid:    #b8b4ab;
  --fg-dim:    #8a8782;
  --accent:    #c9a063;
  --line:      rgba(245,243,239,0.08);

  /* ── Type ── */
  --display:   'General Sans', -apple-system, Helvetica, Arial, sans-serif;
  --body:      'General Sans', -apple-system, Helvetica, Arial, sans-serif;

  /* ── Layout ── */
  --gutter:    6vw;
  --gutter-sm: 4vw;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

/* ════════ NAV ════════ */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 44px var(--gutter) 28px;
  mix-blend-mode: difference;
}

.nav-name {
  display: block;
  line-height: 0;
}
.nav-name img {
  height: 32.5px;
  width: auto;
  display: block;
}

.nav-burger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg);
  font-family: var(--body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px;
}

.nav-burger .bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-burger .bars span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-burger[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] .bars span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ════════ FULLSCREEN OVERLAY MENU ════════ */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.menu-overlay.open { opacity: 1; visibility: visible; }

.menu-overlay a {
  font-family: var(--display);
  font-size: clamp(14px, 2.5vw, 26px);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--fg-mid);
  transition: color 0.25s ease, transform 0.25s ease;
}
.menu-overlay a:hover { color: var(--fg); transform: translateX(6px); }

/* Film/project links read as uppercase and a touch bolder than the meta links */
.menu-overlay a:not(.menu-meta) {
  text-transform: uppercase;
  font-weight: 400;
}

/* About / Contact sit apart from the film links in the complementary accent */
.menu-overlay a.menu-meta { color: var(--accent); }
.menu-overlay a.menu-meta:hover { color: var(--fg); }

/* ════════ PROGRESS RAIL ════════ */
.rail {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rail-line {
  width: 1px;
  height: 160px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.rail-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0%;
  background: var(--accent);
  transition: height 0.2s linear;
}

.rail-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  writing-mode: vertical-rl;
}

@media (max-width: 900px) {
  .rail { display: none; }
}

/* ════════ HERO ════════ */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: #000;
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.hero-media iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100dvh;
  min-width: 177.78vh;  /* ensures 16:9 video covers width when window is tall/narrow */
  min-height: 56.25vw;  /* ensures 16:9 video covers height when window is wide/short */
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(12,12,11,0.35) 0%,
    rgba(12,12,11,0.05) 35%,
    rgba(12,12,11,0.55) 80%,
    rgba(12,12,11,0.9) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 0 var(--gutter) 7vh;
}

.hero-statement {
  font-family: var(--display);
  font-size: clamp(16px, 2.64vw, 35px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 16ch;
  color: var(--fg);
}

.hero-statement .word {
  display: inline-block;
  overflow: hidden;
}

.hero-statement .word em {
  font-style: normal;
}

.hero-scroll-cue {
  position: absolute;
  bottom: 36px;
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.hero-scroll-cue .cue-line {
  width: 1px;
  height: 28px;
  background: var(--fg-dim);
  position: relative;
  overflow: hidden;
}
.hero-scroll-cue .cue-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: cueDrop 2.2s ease-in-out infinite;
}
@keyframes cueDrop {
  0%   { top: -100%; }
  50%  { top: 0%; }
  100% { top: 100%; }
}

/* ════════ FILM SECTIONS ════════ */
.film {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14vh var(--gutter);
}

.film-frame {
  position: relative;
  width: 100%;
  max-width: 1240px;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 4px;
  background: #000;
}

.film-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.film-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.45) 32%,
    rgba(0,0,0,0) 60%
  );
}

.film-caption {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: min(46%, 420px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 3.2vw;
  z-index: 5;
}

.film-eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  opacity: 0.9;
}

.film-title {
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 34px);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.film-sub {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--fg-mid);
  max-width: 38ch;
}

.film-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  border-bottom: 1px solid var(--fg-dim);
  padding-bottom: 3px;
  width: max-content;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.film-link:hover { color: var(--accent); border-color: var(--accent); }

.film-frame-link {
  position: absolute;
  inset: 0;
  z-index: 4;
}

@media (max-width: 700px) {
  /* Project info sits underneath the thumbnail instead of overlaying it */
  .film-frame {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    background: none;
    border-radius: 0;
  }
  .film-frame img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    border-radius: 4px;
  }
  .film-scrim { display: none; }
  .film-caption {
    position: relative;
    width: 100%;
    justify-content: flex-start;
    padding: 16px 2px 0;
    background: var(--bg);
    z-index: 5;
  }
  /* Keep the whole card tappable but limit the overlay link to the thumbnail */
  .film-frame-link {
    bottom: auto;
    aspect-ratio: 16/9;
  }

  /* Scale the logo down 30% on mobile */
  .nav-name img { height: 22.75px; }

  /* Lift the hero statement so it clears the "Scroll" cue */
  .hero-content { padding-bottom: 13vh; }
}

/* ════════ ABOUT ════════ */
.about {
  width: 100%;
  padding: 18vh var(--gutter) 14vh;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 8vw;
  align-items: start;
}

.about-portrait {
  position: sticky;
  top: 18vh;
  border-radius: 3px;
  overflow: hidden;
}
.about-portrait img {
  width: 100%;
  filter: brightness(0.92) saturate(0.95);
}

.about-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.about-name {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 300;
  margin-bottom: 28px;
  color: var(--fg);
}

.about-text {
  font-size: 15px;
  line-height: 1.85;
  color: var(--fg-mid);
  max-width: 56ch;
}
.about-text p { margin-bottom: 22px; }
.about-text em { color: var(--fg); font-style: italic; }

.about-credits {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.about-credits-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 18px;
}
.credit-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  line-height: 1.5;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg-mid);
}
.credit-line span:first-child { color: var(--fg-dim); }
.credit-line span:last-child { text-align: right; }

/* Linkable entries hint the hyperlink with a faint accent underline */
a.credit-line { transition: color 0.2s ease; }
a.credit-line span:first-child {
  color: var(--fg-mid);
  text-decoration: underline;
  text-decoration-color: rgba(201,160,99,0.4);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a.credit-line:hover span:first-child {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; gap: 40px; }
  .about-portrait { position: static; max-width: 280px; }
  .credit-line { flex-direction: column; gap: 3px; }
  .credit-line span:last-child { text-align: left; }
}

/* ════════ CONTACT ════════ */
.contact {
  width: 100%;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14vh var(--gutter);
}

.contact-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}

.contact-email {
  font-family: var(--display);
  font-size: clamp(11px, 2.4vw, 30px);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--fg);
  transition: color 0.25s ease;
}
.contact-email:hover { color: var(--accent); }

.contact-social {
  margin-top: 36px;
  display: flex;
  gap: 28px;
}
.contact-social a {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 0.2s ease;
}
.contact-social a:hover { color: var(--fg); }

/* ════════ FOOTER ════════ */
footer {
  padding: 32px var(--gutter) 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  border-top: 1px solid var(--line);
}

/* ════════ UTILITY: GSAP REVEAL TARGETS ════════ */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal-up, .reveal-scale { opacity: 1; transform: none; }
  .hero-scroll-cue .cue-line::after { animation: none; }
}
