/* nous-like — film. variant
   Title-card aesthetic: frame layout, large negative space, micro-mono typography.
   Every page should feel like a film frame containing a single dominant element. */

:root {
  --bg: #0a0a0b;
  --bg-2: #15151a;
  --fg: #e8e8e8;
  --fg-dim: #b0b0b0;
  --muted: #7a7a7a;
  --muted-2: #4a4a4d;
  --accent: #7afcd6;
  --border: #1f1f22;
  --border-2: #2a2a2e;

  /* Frame geometry */
  --gutter: 80px;
  --gutter-sm: 40px;
  --frame-edge: 56px;   /* distance from viewport edge where the frame lines live */

  /* Type */
  --font-sans: "DejaVu Sans", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "DejaVu Sans Mono", ui-monospace, "JetBrains Mono", "Fira Code", Menlo, monospace;
  --font-serif: "DejaVu Serif", "Source Serif Pro", "Charter", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* Site-wide lowercase convention — every page (movies, criterion-4,
     landing, per-film) renders in lowercase by default. User feedback
     2026-07-19: "update the skill so that each page (movies, etc, main
     website) are all in downcase/lowercase. ii prefer it. once you update
     the movies skill then update the text across the entire site to be
     downcase". Reverses the earlier v0.6.0 guidance (which was
     per-element-only after a single rejection of the body-wide rule).
     The user has now explicitly asked for the body-wide rule. */
  text-transform: lowercase;
}

a { color: var(--fg); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.15s ease; }
a:hover { border-bottom-color: var(--accent); color: var(--accent); }

/* ============================================================
   FRAME — the load-bearing visual element.
   Four faint vertical lines at fixed distance from viewport edges.
   These appear on every page. They define space without ornament.
   ============================================================ */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-2);
  pointer-events: none;
  z-index: 0;
}
body::before { left: var(--frame-edge); }
body::after  { right: var(--frame-edge); }

@media (max-width: 720px) {
  body::before, body::after { display: none; }
}

/* ============================================================
   CORNER MARKS — brand + nav sit at the corners of the frame.
   No top bar. No centered header.
   ============================================================ */
.site-brand {
  position: fixed;
  bottom: 32px;
  right: 80px;
  z-index: 10;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--muted-2);
  text-transform: lowercase;
}
.site-brand a { color: inherit; border-bottom: none; }
.site-brand a:hover { color: var(--accent); }

.site-nav {
  position: fixed;
  top: 32px;
  right: 80px;
  z-index: 10;
  display: flex;
  gap: 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}
.site-nav a { color: var(--muted); border-bottom: none; }
.site-nav a:hover { color: var(--fg); }

.site-search {
  position: fixed;
  top: 32px;
  left: 80px;
  z-index: 10;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.site-search a { color: var(--muted); border-bottom: none; }
.site-search a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .site-brand { right: 24px; bottom: 24px; }
  .site-nav   { right: 24px; top: 24px; gap: 20px; }
  .site-search{ left: 24px; top: 24px; }
}

/* ============================================================
   MAIN — content fills the frame. No max-width container.
   Each page arranges itself inside the gutter the frame creates.
   ============================================================ */
.site-main {
  min-height: 100vh;
  padding: var(--gutter) 80px;
  position: relative;
  z-index: 1;
}

@media (max-width: 720px) {
  .site-main { padding: 80px 24px; }
}

/* ============================================================
   TYPE — title-card hierarchy.
   Page titles are enormous (the dominant element).
   Everything else is small mono.
   ============================================================ */
h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0;
}
h1 { font-size: clamp(3rem, 9vw, 8rem); color: var(--fg); }
h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); color: var(--fg); letter-spacing: -0.02em; line-height: 1.1; }
h3 { font-size: 1.1rem; color: var(--fg-dim); letter-spacing: -0.01em; line-height: 1.3; font-weight: 500; }

p {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 1em;
  max-width: 60ch;
}

.muted { color: var(--muted); }
.dim   { color: var(--fg-dim); }
.small { font-size: 12px; }

.mono { font-family: var(--font-mono); }

/* ============================================================
   PAGE LAYOUTS — title-card patterns.
   Each page has one dominant element. The page title.
   ============================================================ */

/* LANDING — single dominant title centered vertically */
.page-landing {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
}
.page-landing .title-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--gutter) 0;
}
.page-landing h1 {
  margin-bottom: 32px;
}
.page-landing .subtitle {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.05em;
  max-width: 50ch;
}
.page-landing .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 0.15em;
  margin-top: 32px;
  text-transform: uppercase;
}
.page-landing .meta strong { color: var(--fg); font-weight: 500; }
.page-landing .footer-block {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
  padding: var(--gutter) 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.page-landing .footer-block a { color: var(--muted); border-bottom: none; }
.page-landing .footer-block a:hover { color: var(--accent); }

/* SECTION INDEX (e.g. /movies/, /criterion-4/) — title + entries */
.page-section h1 {
  margin-bottom: 16px;
}
.page-section .section-intro {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  max-width: 60ch;
  margin: 24px 0 64px;
}

/* FILM GRID — full-width horizontal cards (image left, meta right)
   Each film gets one row spanning the gutter. Image is wide 16:9 on the
   left (~55% width), title/year/director/slot sit on the right. Cards
   have hairline divider above and below — no card frame, just the line. */
.film-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 32px;
}
.film-grid > a {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.film-grid > a:first-child { border-top: 1px solid var(--border); }
/* On hover: card subtly lifts (translate-x), image scales up and brightens,
   text color lifts to fg from muted. No opacity dim — we want hover to be
   a 'wake up' effect, not a 'go to sleep' effect. */
.film-grid > a:hover {
  transform: translateX(8px);
}
.film-grid .film-hero--compact {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  position: relative;
}
.film-grid .film-hero--compact > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease, filter 0.5s ease;
  /* Image is pre-baked (PIL) with darkness + edge fade — no CSS filter needed.
     Hover brightens substantially for clear interaction feedback. */
}
.film-grid > a:hover .film-hero--compact > img {
  transform: scale(1.04);
  /* 30% interactive lift over the baked default (which now sits ~25-32
     mean brightness). User feedback 2026-07-19: previous brightness(1.65)
     was too much — the hover was washing out the image. Per spec:
     base baked image is the user's preferred "visible" default, hover adds
     a measured 30% lift. */
  filter: brightness(1.30) saturate(1.10) contrast(1.05);
}
.film-grid > a:hover .entry-meta .title { color: var(--accent); }
.film-grid .entry-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.film-grid .entry-meta .title {
  font-family: var(--font-sans);
  color: var(--fg);
  display: block;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.0;
}
.film-grid .entry-meta .meta-line {
  font-size: 13px;
  color: var(--muted);
}
.film-grid .entry-meta .slot {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
}
@media (max-width: 720px) {
  .film-grid > a {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .film-grid .entry-meta .title { font-size: 1.4rem; }
}

/* PER-FILM PAGE — title-card with hero + meta strip */
.film-page {
  display: grid;
  gap: 48px;
}
.film-page .hero {
  margin: 0;
}
.film-page .hero svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Compact photo preview — used by the /movies/ grid. No overlay, just the image,
   so the title/year from the meta strip below the card carries the info. */
.film-hero--compact {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.film-hero--compact > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Photo hero — when frontmatter sets hero_image, the poster partial renders
   the photo at the top and ALL text below it (no overlay). Matches the
   Witchboard mock exactly: clean 16:9 photo, then byline + year + huge title,
   then meta strip. The photo is full-bleed horizontally (touches the frame
   edges), and the caption is inset from the edges. */
/* Photo hero — full-bleed 16:9 image with TEXT OVERLAID. The photo + text
   sit in one card; nothing below the image until the meta-strip.
   Matches the original Witchboard mock: byline + year at top corners,
   huge serif title anchored to the mid-bottom-left of the image, brand
   mark in bottom-right corner. */

.film-hero--photo {
  position: relative;
  width: 100%;
}
.film-hero--photo .film-hero__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  margin: 0;
  position: relative;
}
.film-hero--photo .film-hero__image > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Image is pre-baked (PIL) with darkness + edge fade — no CSS filter needed
     by default. Hover brightens the photo so the user can see it better. */
  transition: filter 0.4s ease;
}
.film-hero--photo:hover .film-hero__image > img {
  /* 30% interactive lift over the baked default (which sits ~25-32 mean
     brightness). Same spec as the grid hover: base is the visible image,
     hover adds 30%. See .film-grid > a:hover comment for the rationale. */
  filter: brightness(1.30) saturate(1.10);
}
/* Overlay grid: 3 rows × 2 columns, fills the photo card.
   Top row: byline (left), year (right).
   Middle row: title, anchored to left, sits at mid-bottom of the photo.
   Bottom row: criterion (left, optional), brand (right). */
.film-hero--photo .film-hero__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr 1fr;
  padding: 5.5% 7%;
  color: #f3f3f3;
  pointer-events: none;
  /* Light veil only at top + bottom edges where text sits. The center is
     fully clear so the photo shows through. Keep this subtle — the photo
     is the point of the page. */
  background:
    /* Very light veil at top + bottom edges where text sits. With the
       brighter baked images (~25-32 mean brightness), we don't need much
       veil — just enough to keep corner-byline/year readable. Center stays
       fully clear so the subject is unobstructed. */
    background:
    linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0) 10%),
    linear-gradient(180deg, rgba(0,0,0,0) 85%, rgba(0,0,0,0.25) 100%);
}
.film-hero__top {
  grid-row: 1;
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.film-hero__top-left { grid-column: 1; }
.film-hero__top-right { grid-column: 2; text-align: right; }

.film-hero__middle {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;   /* pushes title to bottom of middle row */
  padding-bottom: 4%;
}
.film-hero__bottom {
  grid-row: 3;
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

/* Text styles for the overlay */
.film-hero__byline {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.film-hero__label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(243,243,243,0.55);
  text-transform: uppercase;
}
.film-hero__directorname {
  font-family: var(--font-sans);
  font-size: 16px;
  letter-spacing: 0.02em;
  color: #f3f3f3;
  font-weight: 500;
}
.film-hero__year {
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.18em;
  color: rgba(243,243,243,0.85);
  margin: 0;
}
.film-hero__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1.0;
  margin: 0;
  letter-spacing: -0.02em;
  color: #f8f8f8;
  text-shadow: 0 2px 18px rgba(0,0,0,0.6);
  align-self: flex-start;
  max-width: 60%;
}
.film-hero__criterion {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.film-hero__brand {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: lowercase;
  color: rgba(243,243,243,0.40);
  margin: 0;
  align-self: flex-end;
}
@media (max-width: 720px) {
  .film-hero--photo .film-hero__overlay { padding: 6%; }
  .film-hero__title { font-size: clamp(2.2rem, 11vw, 4rem); max-width: 80%; }
  .film-hero__year { font-size: 18px; }
  .film-hero__byline { font-size: 11px; }
  .film-hero__directorname { font-size: 13px; }
}
.film-page .meta-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 32px 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.film-page .meta-strip dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.film-page .meta-strip dd {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg);
  margin: 0;
}
.film-page .body-content {
  max-width: 70ch;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--fg-dim);
  line-height: 1.7;
}
.film-page .body-content h1,
.film-page .body-content h2,
.film-page .body-content h3 {
  font-family: var(--font-sans);
  color: var(--fg);
  margin: 1.5em 0 0.5em;
}
.film-page .body-content h1 { font-size: 2rem; }
.film-page .body-content h2 { font-size: 1.4rem; }
.film-page .body-content h3 { font-size: 1rem; font-weight: 500; color: var(--fg-dim); }
.film-page .body-content p {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  max-width: none;
  margin: 0 0 1em;
}
.film-page .body-content a { color: var(--accent); border-bottom-color: transparent; }
.film-page .body-content a:hover { border-bottom-color: var(--accent); }
.film-page .body-content ul { padding-left: 1.2em; }
.film-page .body-content li { margin-bottom: 0.4em; }

.film-page .slot {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.02em;
  padding: 24px 0;
  border-top: 1px solid var(--accent);
}
.film-page .slot-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted-2);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.film-page .sources {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.film-page .sources h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.film-page .sources ul { list-style: none; padding: 0; margin: 0; }
.film-page .sources li { margin-bottom: 6px; word-break: break-all; }

/* ============================================================
   CRITERION-4 SPINE — emphasized list of criterion-4 films
   ============================================================ */
.spine-list {
  list-style: none;
  padding: 0;
  margin: 32px 0;
}
.spine-list li {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  align-items: baseline;
}
.spine-list li:last-child { border-bottom: 0; }
.spine-list .year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
}
.spine-list .title {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.spine-list .slot {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-top: 8px;
  font-style: normal;
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-mount {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.spacer-l { height: 64px; }
.spacer-xl { height: 120px; }

::selection {
  background: var(--accent);
  color: var(--bg);
}