/* ---------- Custom fonts ---------- */
@font-face {
  font-family: "TC Phantasmagoria";
  src: local("TC Phantasmagoria"),
       url("assets/fonts/TC-Phantasmagoria-y3kr7e.otf") format("opentype");
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --color-background: #0d0d0c;
  --color-surface: #161614;
  --color-text: #ece8e1;
  --color-text-muted: #8f8a82;
  --color-accent: #c9a96e;
  --color-line: rgba(236, 232, 225, 0.12);

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-title: "TC Phantasmagoria", var(--font-display);
  --font-body: "Inter", system-ui, sans-serif;

  --container-width: 1200px;
  --container-narrow-width: 720px;
  --page-gutter: clamp(20px, 5vw, 64px);
  --transition-slow: 900ms cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Paper texture layers: generated SVG noise tiles, no image downloads.
     Each baseFrequency x tile size is a whole number so the tiles repeat without seams. */
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.93 0 0 0 0 0.91 0 0 0 0 0.87 0.22 0 0 0 -0.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --paper-fibers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.005 0.12' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.93 0 0 0 0 0.9 0 0 0 0 0.84 -0.5 0 0 0 0.04'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --paper-specks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.8 0 0 0 0 0.74 0 0 0 0 0.62 6 0 0 0 -4.3'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --paper-texture: var(--paper-grain), var(--paper-specks), var(--paper-fibers);
  --paper-texture-size: 220px 220px, 360px 360px, 400px 400px;
  --paper-tone-light: rgba(236, 232, 225, 0.025);
  --paper-tone-dark: rgba(0, 0, 0, 0.35);
  --paper-stain-color: rgba(150, 112, 64, 0.06);
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  position: relative;
  min-height: 100vh;
  background-color: var(--color-background);
  /* Seamless tonal variation, faint stains and a coffee ring, kept below the banner and title card */
  background-image:
    radial-gradient(ellipse 22vw 16vw at 86% 62%, var(--paper-stain-color), transparent 70%),
    radial-gradient(circle at 12% 86%, transparent 0 58px, var(--paper-stain-color) 61px 64px, transparent 68px),
    radial-gradient(ellipse 30vw 12vw at 30% 96%, var(--paper-stain-color), transparent 70%),
    radial-gradient(ellipse 45vw 30vw at 20% 60%, var(--paper-tone-light), transparent 70%),
    radial-gradient(ellipse 40vw 35vw at 75% 82%, var(--paper-tone-light), transparent 70%),
    radial-gradient(ellipse 35vw 25vw at 55% 70%, var(--paper-tone-dark), transparent 70%);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain, fibers and flecks laid over the page. Images are lifted above it (see "Paper texture" at the end). */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-image: var(--paper-texture);
  background-size: var(--paper-texture-size);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- Shared ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

.container--narrow { max-width: calc(var(--container-narrow-width) + var(--page-gutter) * 2); }

.section { padding: clamp(80px, 14vw, 180px) 0; }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 28px;
}

.lead {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.45;
  font-weight: 400;
}

.button {
  display: inline-block;
  padding: 14px 30px;
  font: 500 0.72rem/1 var(--font-body);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-background);
  background: var(--color-text);
  border: 1px solid var(--color-text);
  cursor: pointer;
  transition: background 250ms ease, color 250ms ease;
}

.button:hover { background: transparent; color: var(--color-text); }

.button--ghost { background: transparent; color: var(--color-text); border-color: var(--color-line); }
.button--ghost:hover { border-color: var(--color-text); }

/* Missing-image placeholder (shown until you add your files) */
.is-missing {
  position: relative;
  background: repeating-linear-gradient(45deg, #1a1a18 0 12px, #151513 12px 24px);
}

.is-missing::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.is-missing img { visibility: hidden; }

/* ---------- Banner ---------- */
.film-banner {
  --banner-gutter: clamp(16px, 4vw, 64px);
  /* Inner left/right padding of the title card */
  --title-card-padding-inline: clamp(16px, 2vw, 28px);
  /* Width of the centered content column the title card aligns to */
  --banner-content-width: min(100%, 1680px, calc((100vh - 182px) * 16 / 9 + var(--banner-gutter) * 2));
  position: relative;
  width: 100%;
  margin-bottom: clamp(60px, 7vw, 100px);
}

.film-banner__frame {
  position: relative;
  width: 100%;
  /* Leaves room below the banner so the overlapping title card stays on screen */
  height: min(56.25vw, calc(100vh - 94px));
  min-height: 280px;
  overflow: hidden;
  background: var(--color-surface);
}

.film-banner__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1600ms ease;
}

.film-banner__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-banner__slide.is-active { opacity: 1; }

.film-banner__indicators {
  position: absolute;
  right: 24px;
  bottom: 22px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.film-banner__indicator {
  width: 28px;
  height: 2px;
  padding: 0;
  border: none;
  background: rgba(236, 232, 225, 0.35);
  cursor: pointer;
  transition: background 300ms ease;
}

.film-banner__indicator.is-active { background: var(--color-text); }

.film-banner__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.15);
  border: 1.5px solid rgba(236, 232, 225, 0.85);
  border-radius: 50%;
  cursor: pointer;
  transition: background 250ms ease, transform 250ms ease;
}

.film-banner__play svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.film-banner__play:hover { background: rgba(0, 0, 0, 0.4); transform: translate(-50%, -50%) scale(1.06); }

.film-banner__title-card {
  position: absolute;
  left: calc((100% - var(--banner-content-width)) / 2 + var(--banner-gutter));
  bottom: 0;
  transform: translateY(30%);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px var(--title-card-padding-inline) 0;
  background: var(--color-background);
  z-index: 3;
}

.film-banner__title {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 1;
}

.film-banner__taglines {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 0.9em;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}

.film-banner__trailer-link {
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--color-accent);
  background: none;
  border: none;
  cursor: pointer;
}

.film-banner__trailer-link:hover { text-decoration: underline; }

/* ---------- About ---------- */
.about { padding-top: clamp(40px, 6vw, 80px); }

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(40px, 8vw, 120px);
  align-items: start;
}

.about__poster {
  justify-self: center;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
}

.about__poster.is-missing { aspect-ratio: 2 / 3; }
.about__poster img { width: 100%; height: auto; }

.about__heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  line-height: 1.1;
  margin-bottom: 28px;
}

.about__meta {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.about__meta span { margin: 0 6px; color: var(--color-text-muted); }

.about__synopsis {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 44px;
  max-width: 560px;
}

/* ---------- Credits ---------- */
.credits { display: grid; gap: 16px; max-width: 560px; }

.credits > div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
}

.credits dt {
  padding-top: 0.35em;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.credits dd { font-family: var(--font-display); font-size: 1.1rem; }

/* ---------- Contact ---------- */
.section--contact { text-align: center; border-top: 1px solid var(--color-line); }

.contact-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  border-bottom: 1px solid var(--color-accent);
  padding-bottom: 4px;
  transition: color 250ms ease;
}

.contact-link:hover { color: var(--color-accent); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px var(--page-gutter);
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---------- Lightbox / Trailer modal ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 7, 0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms ease;
}

.lightbox.is-open { opacity: 1; pointer-events: auto; }

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  padding: 16px;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 2.4rem;
  font-weight: 300;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 200ms ease;
}

.lightbox__close:hover { opacity: 1; }

.trailer-frame {
  width: min(90vw, 1280px);
  aspect-ratio: 16 / 9;
}

.trailer-frame iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .film-banner__frame { height: 56.25vw; }
  .film-banner__play { width: 52px; height: 52px; }
  .film-banner__title-card { position: relative; left: 0; transform: none; margin: -32px 0 0 var(--banner-gutter); width: fit-content; flex-wrap: wrap; }
  .film-banner { margin-bottom: 20px; }
  .about__grid { grid-template-columns: 1fr; }
  .about__poster { max-width: 320px; }
}

@media (max-width: 560px) {
  .film-banner__indicators { right: 12px; bottom: 12px; }
  .credits > div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- 404 page ---------- */
.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
  text-align: center;
}

.not-found .contact-link { margin-top: 12px; display: inline-block; }

/* ---------- Paper texture ---------- */
/* Keep the banner stills and poster clean by lifting them above the page texture */
.film-banner__frame { z-index: 60; }
.about__poster { position: relative; z-index: 60; }

/* Letterpress ink wear texture */
:root {
  /* Tiny ink voids for the letterpress title: mostly opaque, with small worn patches */
  --ink-wear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.5 0 0 0 2.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}

/* The title card overlaps the banner, so it sits above it and carries its own copy of the texture */
.film-banner__title-card { z-index: 61; }
.film-banner__title-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--paper-texture);
  background-size: var(--paper-texture-size);
}

/* ---------- Letterpress title ---------- */
/* Softer edges, a faint recess shadow on the top edge and worn ink patches,
   so the title reads as pressed into the paper rather than printed on screen */
.film-banner__title {
  color: rgba(236, 232, 225, 0.9);
  text-shadow:
    0 -1px 1px rgba(0, 0, 0, 0.75),
    0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 1px rgba(236, 232, 225, 0.35);
  filter: blur(0.35px);
  -webkit-mask-image: var(--ink-wear);
  mask-image: var(--ink-wear);
  -webkit-mask-size: 200px 200px;
  mask-size: 200px 200px;
}
