/* ECLIPSE FILM FESTIVAL · BERGEN 26
   Cinematic poster aesthetic. Deep bordeaux ground, warm cream type, amber accent.
   Films treated with sepia + bordeaux multiply to feel like one programme. */

:root {
  --bordeaux: #3a141c;
  --bordeaux-2: #5a1d2a;
  --cream: #f1e6cd;
  --cream-2: #d8c89c;
  --amber: #e89742;
  --ink: #0a0606;
  --mute: #95705a;

  --serif: "Playfair Display", "Times New Roman", serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(20px, 4vw, 64px);
  --rule: 1px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bordeaux);
  color: var(--cream);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  font-size: 16px;
  line-height: 1.55;
}

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

.mono {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.mute { color: var(--mute); }
.amber { color: var(--amber); font-style: italic; }


/* --- shared image treatment (every film still tinted to bordeaux mood) --- */
.still {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}
.still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05) saturate(0.7) sepia(0.15);
  display: block;
}
.still::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bordeaux);
  mix-blend-mode: multiply;
  opacity: 0.18;
  pointer-events: none;
}
.still::before {
  /* subtle inner vignette */
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 80px rgba(10,6,6,0.5);
  pointer-events: none;
  z-index: 2;
}


/* =====================================================================
   HERO
===================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(14px) contrast(1.1) saturate(0.55) sepia(0.2);
  transform: scale(1.08);
}
.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(58,20,28,0.55) 0%, rgba(58,20,28,0.95) 60%, var(--bordeaux) 100%),
    linear-gradient(to bottom, rgba(10,6,6,0.55), rgba(58,20,28,0.85));
}

.topbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 22px 0 0;
  gap: 20px;
}
.topbar__col { display: flex; gap: 10px; align-items: baseline; }
.topbar__col--c { justify-content: center; }
.topbar__col--r { justify-content: flex-end; }
.arrow { color: var(--amber); }

.badge {
  position: absolute;
  top: 110px;
  right: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--amber);
  color: var(--amber);
  transform: rotate(-5deg);
  z-index: 5;
}
.badge .mono { font-size: 9px; letter-spacing: 0.18em; }
.badge__num {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0;
  line-height: 1;
  margin-top: 2px;
}

.hero__inner {
  margin-top: auto;
  margin-bottom: auto;
  padding: 60px 0 40px;
}
.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-style: normal;
  font-size: clamp(56px, 11vw, 200px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--cream);
}
.hero__title .line {
  display: block;
  visibility: hidden;
  /* line clipping mask supplied by SplitText `mask: "lines"` */
}
.hero__title em {
  font-style: italic;
  font-weight: 900;
}

.hero__rule {
  margin: 32px 0 14px;
  height: 1px;
  background: var(--amber);
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
}

.hero__caption {
  color: var(--cream-2);
  letter-spacing: 0.25em;
  font-size: 11px;
  opacity: 0;
}

.hero__scroll {
  padding: 18px 0 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--cream-2);
  font-size: 10px;
}
.hero__scroll-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--cream-2), transparent);
  opacity: 0.5;
}


/* =====================================================================
   35MM STRIP · HORIZONTAL PINNED
===================================================================== */
.strip {
  position: relative;
  padding-top: 120px;
  background: var(--bordeaux);
}
.strip__intro {
  padding: 0 var(--gutter) 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1000px;
}
.strip__intro .mono { margin: 0; }
.strip__heading {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.strip__heading em {
  font-style: italic;
  font-weight: 700;
  color: var(--cream);
}

.strip__pin {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.strip__rail {
  position: relative;
  width: 100%;
  height: 78vh;
  background: var(--ink);
  display: flex;
  flex-direction: column;
}

/* sprocket holes — repeating-linear-gradient gives even square punches */
.strip__sprockets {
  flex: 0 0 36px;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 22px,
      var(--cream) 22px,
      var(--cream) 38px,
      transparent 38px,
      transparent 60px
    );
  position: relative;
}
.strip__sprockets::before {
  /* overlay narrow rectangles to look like real punched holes (rounded a bit) */
  content: "";
  position: absolute;
  inset: 10px 0;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 22px,
      var(--ink) 22px,
      var(--ink) 38px,
      transparent 38px,
      transparent 60px
    );
  filter: blur(0.4px);
}

.strip__track {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: stretch;
  padding: 22px;
  will-change: transform;
}

.film {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  background: transparent;
  border-left: 1px dashed rgba(241,230,205,0.12);
  border-right: 1px dashed rgba(241,230,205,0.12);
  padding: 0 14px;
  transition: none;
}
.film:first-child { border-left: none; }
.film:last-child { border-right: none; }

.film .still {
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid transparent;
  transition: border-color 0.6s ease, transform 0.6s ease;
}
.film__meta {
  padding: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.film__meta .mono { margin: 0; font-size: 10px; }
.film__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
.film__title em { font-style: italic; }


/* =====================================================================
   SELECTION
===================================================================== */
.selection {
  padding: 160px var(--gutter) 140px;
  background: var(--bordeaux);
}
.selection__head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 80px;
  max-width: 1100px;
}
.selection__heading {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 96px);
  line-height: 1.0;
  letter-spacing: -0.015em;
}
.selection__heading em { font-style: italic; font-weight: 700; }
.slash { color: var(--amber); font-style: normal; margin: 0 0.25em; }

.selection__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px 60px;
  max-width: 1400px;
  margin: 0 auto;
}
.feature {
  display: flex;
  flex-direction: column;
}
.feature__still {
  width: 100%;
  aspect-ratio: 5 / 7;
  /* clip-path masked in by JS */
  clip-path: inset(0 0 100% 0);
}
.feature--a .feature__still { aspect-ratio: 5 / 7; }
.feature--b .feature__still { aspect-ratio: 5 / 6; margin-top: 60px; }
.feature--c .feature__still { aspect-ratio: 5 / 6; }
.feature--d .feature__still { aspect-ratio: 5 / 7; margin-top: 80px; }

.feature__rule {
  margin: 22px 0 16px;
  width: 60px;
  height: 1px;
  background: var(--amber);
  transform-origin: left center;
  transform: scaleX(0);
}
.feature__title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.005em;
  opacity: 0;
}
.feature__title em { font-style: italic; }
.feature__credit {
  margin: 0 0 14px;
  color: var(--cream-2);
  font-size: 10px;
  opacity: 0;
}
.feature__synopsis {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: var(--cream-2);
  max-width: 36ch;
  opacity: 0;
}


/* =====================================================================
   VOICES
===================================================================== */
.voices {
  padding: 140px var(--gutter) 0;
  background: var(--bordeaux);
}
.voices__head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 80px;
  max-width: 1100px;
}
.voices__heading {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 96px);
  line-height: 1.0;
  letter-spacing: -0.015em;
}
.voices__heading em { font-style: italic; font-weight: 700; }

.voices__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px 50px;
  max-width: 1400px;
  margin: 0 auto 140px;
}
.voice {
  display: flex;
  flex-direction: column;
}
.voice__portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  margin-bottom: 22px;
  clip-path: inset(0 0 100% 0);
}
.voice__name {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.005em;
  opacity: 0;
}
.voice__role {
  margin: 0 0 18px;
  color: var(--cream-2);
  font-size: 10px;
  opacity: 0;
}
.voice__quote {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
  color: var(--cream);
  max-width: 32ch;
  opacity: 0;
}
.voice__quote em { font-style: italic; }


/* MARQUEE */
.marquee {
  overflow: hidden;
  border-top: 1px solid rgba(241,230,205,0.15);
  border-bottom: 1px solid rgba(241,230,205,0.15);
  padding: 28px 0;
  background: var(--bordeaux-2);
  width: 100vw;
  margin-left: calc(var(--gutter) * -1);
}
.marquee__track {
  display: inline-flex;
  white-space: nowrap;
  gap: 0;
  will-change: transform;
}
.marquee__item {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  padding: 0 28px;
  letter-spacing: -0.01em;
}
.marquee__item em { font-style: italic; }


/* =====================================================================
   FOOTER
===================================================================== */
.foot {
  background: var(--ink);
  color: var(--cream);
  padding: 140px var(--gutter) 60px;
}
.foot__inner { max-width: 1400px; margin: 0 auto; }
.foot__heading {
  margin: 18px 0 80px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 120px);
  line-height: 1.0;
  letter-spacing: -0.015em;
  max-width: 16ch;
}
.foot__heading em { font-style: italic; font-weight: 700; }

.foot__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 80px;
}
.foot__col { display: flex; flex-direction: column; gap: 12px; }
.foot__big {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.foot__list {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--cream-2);
}
.foot__rule {
  height: 1px;
  background: rgba(241,230,205,0.2);
  margin-bottom: 24px;
}
.foot__credit {
  margin: 0;
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.18em;
}


/* =====================================================================
   GRAIN (CSS film grain via SVG noise data URI) — sits on top.
===================================================================== */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.90  0 0 0 0 0.80  0 0 0 0.85 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}


/* =====================================================================
   RESPONSIVE
===================================================================== */
@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr 1fr; gap: 8px; row-gap: 4px; }
  .topbar__col--c { grid-column: 1 / -1; justify-content: flex-start; order: 3; }
  .badge { top: auto; bottom: 24px; right: var(--gutter); }

  .selection__grid { grid-template-columns: 1fr; gap: 60px; }
  .feature--b .feature__still,
  .feature--d .feature__still { margin-top: 0; }

  .voices__grid { grid-template-columns: 1fr; gap: 60px; }

  .foot__cols { grid-template-columns: 1fr; gap: 40px; }

  /* drop the horizontal pinned strip → stack vertically */
  .strip__pin {
    height: auto;
  }
  .strip__rail {
    height: auto;
  }
  .strip__track {
    flex-direction: column;
    padding: 14px;
    gap: 28px;
  }
  .film {
    flex: 0 0 auto;
    border: none;
    padding: 0;
  }

  .marquee { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title .line { visibility: visible; }
  .hero__rule { transform: scaleX(1); }
  .hero__caption,
  .feature__title,
  .feature__credit,
  .feature__synopsis,
  .voice__name,
  .voice__role,
  .voice__quote { opacity: 1; }
  .feature__rule { transform: scaleX(1); }
  .feature__still,
  .voice__portrait { clip-path: inset(0 0 0 0); }
}
