/* ─────────────────────────────────────────────────────────────────────
   alva · Screening Room
   A private projection room: warm projector-black, bone type, one red.
   The house lights go down when a film plays.
   ───────────────────────────────────────────────────────────────────── */

@font-face { font-family: "Ogg Text"; src: url("/fonts/oggtext-light.otf") format("opentype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Ogg Text"; src: url("/fonts/oggtext-lightitalic.otf") format("opentype"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Ogg Text"; src: url("/fonts/oggtext-book.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: oklch(0.145 0.004 60);          /* projector black, a hair warm */
  --bg-deep: oklch(0.09 0.003 60);      /* lights-down */
  --fg: oklch(0.93 0.012 80);           /* bone */
  --dim: oklch(0.66 0.01 75);
  --faint: oklch(0.45 0.008 70);
  --line: oklch(0.93 0.012 80 / 0.1);
  --red: #ff2740;                        /* alva red */
  --tint: var(--red);                    /* per-project accent, set on <body> */

  --serif: "Ogg Text", "Iowan Old Style", "Times New Roman", serif;
  --sans: Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4.2vw, 64px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 1.4s var(--ease-io);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--red); color: #fff; }

.mono { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }

/* film grain over everything — keeps big black areas from feeling digital */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ── header ─────────────────────────────────────────────────────────── */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 28px;
  padding: 20px var(--gutter);
  transition: opacity 1.2s var(--ease-io), translate 0.6s var(--ease-out);
}
.top::before { /* soft scrim so the bar reads over any frame */
  content: ""; position: absolute; inset: 0 0 -40px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, oklch(0.1 0.003 60 / 0.7), transparent);
  transition: background-color 0.6s var(--ease-out);
}
.top::after { /* solid bar once content scrolls under it */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: oklch(0.145 0.004 60 / 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); transition: opacity 0.6s var(--ease-out);
}
.top.is-solid::after { opacity: 1; }
.top-mark img { width: 66px; height: auto; }
.top-room { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 17px; letter-spacing: 0.01em; color: var(--dim); }
.top-count { color: var(--faint); }
.top-out { color: var(--dim); transition: color 0.3s var(--ease-out); }
.top-out:hover { color: var(--fg); }

/* ── curtain (page transitions) ─────────────────────────────────────── */
.curtain { position: fixed; inset: 0; z-index: 80; background: var(--bg-deep); pointer-events: none; transform-origin: top; }

/* ── hover preview that trails the cursor over the program ──────────── */
.preview {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  width: 340px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 2px;
  clip-path: inset(50% 50% 50% 50%); opacity: 0;
  box-shadow: 0 30px 80px oklch(0 0 0 / 0.55);
}
.preview.is-tall { width: 210px; aspect-ratio: 9 / 16; }
.preview img { width: 100%; height: 100%; object-fit: cover; scale: 1.15; }

/* ══ HOME ═══════════════════════════════════════════════════════════════ */

/* hero: the featured cut running silent, full bleed */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
.hero-film { position: absolute; inset: 0; }
.hero-film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.hero-film img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, var(--bg) 0%, oklch(0.145 0.004 60 / 0.72) 28%, oklch(0.145 0.004 60 / 0.1) 62%, oklch(0.145 0.004 60 / 0.45) 100%),
    radial-gradient(120% 80% at 80% 40%, transparent 40%, oklch(0.1 0.003 60 / 0.55) 100%);
}
.hero-copy {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(36px, 7vh, 80px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px;
}
.kicker { display: flex; align-items: center; gap: 12px; color: var(--dim); margin-bottom: 18px; }
.kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); animation: rec 2.4s var(--ease-io) infinite; }
@keyframes rec { 50% { opacity: 0.25; } }
.hero-title {
  font-family: var(--serif); font-weight: 300; line-height: 0.86; letter-spacing: -0.035em;
  font-size: clamp(4.2rem, 15vw, 15.5rem);
}
.line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.line > span { display: inline-block; will-change: transform; }
.hero-title em { font-style: italic; }
.hero-meta { margin-top: 22px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 6px 22px; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; padding-bottom: 10px; }

.btn-watch {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 16px 26px 16px 18px; border-radius: 999px; background: var(--red); color: #fff;
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  transition: scale 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  box-shadow: 0 10px 40px oklch(0.64 0.24 18 / 0.35);
}
.btn-watch:hover { scale: 1.03; box-shadow: 0 14px 54px oklch(0.64 0.24 18 / 0.55); }
.btn-watch .ring { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--red); display: grid; place-items: center; }
.btn-watch svg { width: 12px; translate: 1px 0; fill: currentColor; }
.btn-ghost { color: var(--dim); transition: color 0.3s; }
.btn-ghost:hover { color: var(--fg); }

/* program index */
.program { padding: clamp(80px, 14vh, 160px) var(--gutter) clamp(60px, 10vh, 120px); }
.program-head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 24px; align-items: end;
  margin-bottom: clamp(32px, 6vh, 64px);
}
.program-head h2 { grid-column: 1 / span 7; font-family: var(--serif); font-weight: 300; font-size: clamp(2.6rem, 6.4vw, 6.5rem); line-height: 0.92; letter-spacing: -0.03em; }
.program-head h2 em { font-style: italic; color: var(--dim); }
.program-head p { grid-column: 9 / span 4; color: var(--dim); max-width: 34ch; font-size: 14px; }

.rows { list-style: none; border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); }
.row a {
  display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) 13rem 7rem 5rem; align-items: center; gap: 24px;
  padding: clamp(18px, 2.6vw, 34px) 0;
  transition: opacity 0.5s var(--ease-out);
}
.row-num { color: var(--faint); }
.row-title {
  font-family: var(--serif); font-weight: 300; font-size: clamp(2.2rem, 6.2vw, 6.2rem); line-height: 0.95; letter-spacing: -0.03em;
  transition: color 0.45s var(--ease-out), translate 0.6s var(--ease-out);
}
.row-kind, .row-cuts, .row-time { color: var(--dim); }
.row-time { text-align: right; }
.row-thumb { display: none; }
.rows:hover .row a { opacity: 0.28; }
.rows:hover .row a:hover { opacity: 1; }
.row a:hover .row-title { color: var(--tint-row, var(--fg)); font-style: italic; translate: 0.35em 0; }

/* ══ WATCH ══════════════════════════════════════════════════════════════ */
.watch { padding: 92px var(--gutter) 40px; position: relative; }
.stage { position: relative; z-index: 1; display: flex; justify-content: center; }
.screen-wrap { position: relative; width: min(100%, calc((100svh - 150px) * var(--ar))); aspect-ratio: var(--ar); }
.ambient { /* the film's own light spilling around the screen */
  position: absolute; inset: -16% -12%; z-index: 0; pointer-events: none;
  filter: blur(72px) saturate(1.6); opacity: 0.42;
  transition: opacity 1.6s var(--ease-io);
}
.ambient canvas, .ambient img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen {
  position: absolute; inset: 0; z-index: 1; background: #000; overflow: hidden; border-radius: 3px;
  box-shadow: 0 40px 120px oklch(0 0 0 / 0.6), 0 0 0 1px oklch(1 0 0 / 0.05);
}
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.cuts { position: relative; z-index: 1; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.cut {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim);
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
.cut:hover { color: var(--fg); border-color: oklch(0.93 0.012 80 / 0.35); }
.cut.is-on { color: var(--bg); background: var(--fg); border-color: var(--fg); }

.notes {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px 24px;
  margin-top: clamp(64px, 11vh, 130px); padding-top: 28px; border-top: 1px solid var(--line);
}
.notes-main { grid-column: 1 / span 7; }
.notes-kicker { color: var(--tint); margin-bottom: 18px; }
.notes-title { font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 8vw, 8.4rem); line-height: 0.9; letter-spacing: -0.035em; }
.notes-title em { font-style: italic; color: var(--dim); }
.notes-concept { margin-top: 32px; font-family: var(--serif); font-weight: 300; font-size: clamp(1.15rem, 1.6vw, 1.5rem); line-height: 1.45; max-width: 36ch; color: oklch(0.86 0.012 80); }
.notes-cut { margin-top: 18px; color: var(--dim); max-width: 46ch; }

.notes-side { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 30px; padding-top: 10px; }
.spec { display: grid; grid-template-columns: 7rem 1fr; gap: 10px 16px; }
.spec dt { color: var(--faint); }
.spec dd { color: var(--fg); }
.swatches { display: flex; height: 46px; border-radius: 2px; overflow: hidden; }
.swatches span { flex: 1; transition: flex 0.6s var(--ease-out); }
.swatches span:hover { flex: 2.2; }
.yt {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: 2px;
  transition: border-color 0.4s, background-color 0.4s;
}
.yt:hover { border-color: var(--tint); background: oklch(1 0 0 / 0.02); }
.yt b { font-family: var(--serif); font-weight: 300; font-size: 22px; letter-spacing: -0.01em; }
.yt span { color: var(--dim); }

.next { position: relative; z-index: 1; margin-top: clamp(80px, 14vh, 160px); }
.next h3 { color: var(--faint); margin-bottom: 18px; }
.next-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.next-card { display: flex; flex-direction: column; gap: 14px; }
.next-card figure { aspect-ratio: 16 / 10; overflow: hidden; background: oklch(0.18 0.004 60); border-radius: 2px; }
.next-card img { width: 100%; height: 100%; object-fit: cover; transition: scale 1.2s var(--ease-out), filter 0.8s; filter: saturate(0.75) brightness(0.85); }
.next-card:hover img { scale: 1.05; filter: none; }
.next-card b { font-family: var(--serif); font-weight: 300; font-size: 28px; letter-spacing: -0.02em; line-height: 1; }
.next-card span { color: var(--dim); }

/* house lights down while a film plays */
body.lights-down { background: var(--bg-deep); }
body.lights-down .top,
body.lights-down .cuts,
body.lights-down .notes,
body.lights-down .next,
body.lights-down .foot { opacity: 0.08; }
body.lights-down .ambient { opacity: 0.85; }
.cuts, .notes, .next, .foot { transition: opacity 1.4s var(--ease-io); }
body.lights-down .top:hover, body.lights-down .cuts:hover { opacity: 1; }

/* ── footer ─────────────────────────────────────────────────────────── */
.foot { padding: 48px var(--gutter) 28px; border-top: 1px solid var(--line); }
.foot-mark img { width: 120px; opacity: 0.85; }
.foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-top: 40px; color: var(--faint); }
.foot-links { display: flex; gap: 22px; }
.foot-links a { color: var(--dim); transition: color 0.3s; }
.foot-links a:hover { color: var(--fg); }

/* ── small screens ──────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .top { grid-template-columns: auto 1fr auto; gap: 16px; }
  .top-count { display: none; }
  .top-mark img { width: 54px; }
  .hero-copy { grid-template-columns: 1fr; }
  .hero-actions { align-items: flex-start; flex-direction: row; align-items: center; gap: 22px; }
  .program-head h2, .program-head p { grid-column: 1 / -1; }
  .program-head p { margin-top: 18px; }
  .row a { grid-template-columns: 1fr auto; grid-template-areas: "thumb thumb" "title time" "kind cuts"; gap: 10px 16px; padding: 26px 0; }
  .row-thumb { display: block; grid-area: thumb; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 2px; margin-bottom: 8px; background: oklch(0.18 0.004 60); }
  .row-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .row-num { display: none; }
  .row-title { grid-area: title; }
  .row-time { grid-area: time; align-self: end; }
  .row-kind { grid-area: kind; }
  .row-cuts { grid-area: cuts; text-align: right; }
  .rows:hover .row a { opacity: 1; }
  .notes-main, .notes-side { grid-column: 1 / -1; }
  .next-grid { grid-template-columns: 1fr; }
  .screen-wrap { width: min(100%, calc((100svh - 170px) * var(--ar))); }
  .ambient { inset: -8% -6%; }
}
@media (max-width: 520px) {
  .top { grid-template-columns: auto 1fr; }
  .top-out { display: none; }
  .top-room { justify-self: end; }
  .foot-row { flex-direction: column; }
}
@media (hover: none) { .preview { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0ms !important; }
}
