/* Ecce Pictures. One sheet for every page. */

/* Jost (SIL Open Font License, fonts/OFL.txt): the open twin of Futura, served to every device
   so the site looks the same everywhere. One weight; the range stops browsers faking others. */
@font-face {
  font-family: "Jost";
  src: url("/fonts/jost-500-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #ebe7df;
  --quiet: rgba(235, 231, 223, 0.5);
  --pad: clamp(16px, 3vw, 48px);
  --gap: clamp(10px, 1.2vw, 20px);
  /* the five posters' width:height ratios, added up (0.7075 + 0.6667 × 3 + 0.707) */
  --wall-ratio: 3.415;
  color-scheme: only dark;
}

* { box-sizing: border-box; margin: 0; }

html { background: var(--ink); -webkit-text-size-adjust: 100%; }

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--paper);
  font: 500 13px/1.6 "Jost", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* The logo. One file, img/logo.png: swap it and every page follows. */
.logo { display: block; width: fit-content; margin: 0 auto; }
/* A24 scale: the letters about 24px tall on a computer, 18px on a phone (the image is mostly glow). */
.logo img { height: 40px; width: auto; }
@media (max-width: 899px) { .logo img { height: 30px; } }

header { padding: clamp(12px, 3svh, 32px) var(--pad) 0; }

/* Film pages: the back arrow on the left, the logo in the middle. */
.film header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
}
.film header .logo { grid-column: 2; }
.back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -10px;
  color: var(--quiet);
  transition: color 0.2s ease;
}
.back:hover { color: var(--paper); }
.back svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The wall: all five posters side by side, as big as the screen allows. */
.home main {
  flex: 1;
  display: flex;
  align-items: center;
}

.wall {
  display: flex;
  justify-content: center;
  gap: var(--gap);
  width: 100%;
  padding: clamp(16px, 4svh, 48px) var(--pad);
  list-style: none;
}

.wall img {
  height: min(
    calc(100svh - 300px),
    calc((100vw - 2 * var(--pad) - 4 * var(--gap)) / var(--wall-ratio))
  );
  width: auto;
  transition: opacity 0.4s ease;
}

@media (hover: hover) {
  .wall:has(a:hover) a:not(:hover) img { opacity: 0.3; }
}

/* On a phone the wall becomes a row you swipe, the next poster peeking in. */
@media (max-width: 899px) {
  .wall {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--pad);
    scrollbar-width: none;
  }
  .wall::-webkit-scrollbar { display: none; }
  .wall li { flex: none; scroll-snap-align: start; }
  .wall img { height: min(64svh, 112vw); }
}

/* A film page: the poster, then everything to watch. */
.film main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(20px, 5svh, 56px) var(--pad);
}

.film main.solo {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 14px;
}

.poster img { width: 100%; height: auto; }
.solo .poster { width: min(100%, 520px); }
@media (min-width: 900px) {
  .film main:not(.solo) .poster { position: sticky; top: 32px; }
}

.watch { display: grid; gap: clamp(24px, 4svh, 40px); }

/* Year and format: one quiet line, for anyone who doesn't know the film. */
.facts {
  color: var(--quiet);
  letter-spacing: 0.04em;
}
.watch .facts { margin-bottom: calc(-1 * clamp(8px, 2svh, 20px)); }

.label {
  margin-top: 10px;
  color: var(--quiet);
  letter-spacing: 0.04em;
}

.imdb {
  justify-self: start;
  padding: 10px 0;
  color: var(--quiet);
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}
.imdb:hover { color: var(--paper); }
.solo .imdb { justify-self: center; }

/* Trailers: YouTube's still until someone presses play, then the player. */
.yt {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: #111;
  cursor: pointer;
  overflow: hidden;
}
.yt img { width: 100%; height: 100%; object-fit: cover; }
/* The play button: a dark disc, so it reads on any still. */
.yt::before,
.yt::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
}
.yt::before {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background 0.2s ease;
}
.yt:hover::before { background: rgba(0, 0, 0, 0.75); }
.yt::after {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 23px;
  border-color: transparent transparent transparent var(--paper);
  translate: 4px 0;
}

.stills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  list-style: none;
  padding: 0;
}
.stills img { width: 100%; height: auto; }

@media (max-width: 899px) {
  .film main { grid-template-columns: minmax(0, 1fr); }
  .stills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

footer {
  padding: 24px var(--pad) max(24px, env(safe-area-inset-bottom));
  color: var(--quiet);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.03em;
}
footer a { transition: color 0.2s ease; }
footer a:hover { color: var(--paper); }

.social {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}
.social svg { width: 18px; height: 18px; fill: currentColor; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
