/* ============================================================
   POSENTIA - The Screening Room
   Dark hero (lights off), light lavender/sky theme after scroll.
   Fonts: Anton (display caps) · Instrument Serif (italic accents)
          · Archivo (body/UI) · ui-monospace (credits/meta)
   ============================================================ */

:root {
  --canvas:   #F7F7FD;   /* lavender-tinted white */
  --surface:  #FFFFFF;   /* raised panels          */
  --ink:      #1E1B2E;   /* deep indigo text       */
  --dim:      #6B6883;   /* muted violet gray      */
  --faint:    #A5A3BD;   /* whisper text           */
  --line:     #E4E3F2;   /* lavender hairlines     */
  --accent:   #8E7BFA;   /* light purple           */
  --sky:      #56BDF9;   /* sky blue               */

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-serif:   'Instrument Serif', Georgia, serif;
  --font-body:    'Archivo', 'Helvetica Neue', sans-serif;
  --font-mono:    ui-monospace, 'Cascadia Mono', 'Consolas', monospace;

  --pad: clamp(20px, 4vw, 64px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img, video { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

/* ---------- paper grain + soft atmosphere wash ---------- */
.grain {
  position: fixed; inset: -100px; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.03;
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 25% { transform: translate(-40px,30px); }
  50% { transform: translate(30px,-50px); } 75% { transform: translate(-30px,-20px); }
  100% { transform: translate(0,0); }
}
.vignette {
  position: fixed; inset: 0; z-index: 89; pointer-events: none;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(142,123,250,0.07), transparent 55%),
    radial-gradient(ellipse at 95% 100%, rgba(86,189,249,0.07), transparent 55%);
}

/* ---------------------- typography ------------------------ */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0.01em;
}
.serif-it { font-family: var(--font-serif); font-style: italic; text-transform: none; letter-spacing: 0; }
.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ------------------------- nav ---------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: background 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(255,255,255,0.86); backdrop-filter: blur(12px); border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 26px; height: 26px; }
.brand-word { font-family: var(--font-display); font-size: 19px; letter-spacing: 0.24em; text-transform: uppercase; }
.brand-word em { font-style: normal; color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 32px); }
.nav-link { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); transition: color 0.25s; }
.nav-link:hover { color: var(--ink); }
.nav-cta {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; background: linear-gradient(100deg, var(--accent), var(--sky));
  padding: 10px 16px;
  transition: filter 0.25s, transform 0.25s;
}
.nav-cta:hover { filter: brightness(1.08) saturate(1.1); transform: translateY(-1px); }

/* ---------------------- hero: the wall --------------------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  cursor: none;              /* the beam IS the cursor on desktop */
}
.hero.touch { cursor: auto; }

.wall, .wall-lit {
  position: absolute; inset: 0;
  display: grid;
  gap: 6px;
  padding: 6px;
  grid-template-columns: repeat(var(--wall-cols, 8), 1fr);
  grid-auto-rows: 1fr;
  grid-auto-flow: dense;
}
.wall-tile { position: relative; overflow: hidden; background: #ECEBF7; }
.wall-tile.tall { grid-row: span 2; }
.wall-tile img, .wall-tile video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}

/* lit layer: full colour, revealed only inside the beam mask */
.wall-lit {
  z-index: 2;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle var(--beam-r, 260px) at var(--beam-x, 50%) var(--beam-y, 42%),
      #000 0%, #000 52%, transparent 100%);
          mask-image: radial-gradient(circle var(--beam-r, 260px) at var(--beam-x, 50%) var(--beam-y, 42%),
      #000 0%, #000 52%, transparent 100%);
}

/* tiny beam core dot (desktop custom cursor) */
.beam-dot {
  position: absolute; z-index: 6; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 14px 3px rgba(142,123,250,0.55);
  transform: translate(-50%, -50%);
  left: var(--beam-x, 50%); top: var(--beam-y, 42%);
  pointer-events: none;
}
.hero.touch .beam-dot { display: none; }

/* headline block floats over the wall */
.hero-copy {
  position: relative; z-index: 5;
  height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 var(--pad) clamp(26px, 5.5vh, 56px);
  pointer-events: none;
}
@keyframes blink { 50% { opacity: 0.15; } }
.hero h1 {
  font-size: clamp(30px, 4.6vw, 64px);
  max-width: 720px;
}
.hero-hint { margin-top: 16px; }
.hero-hint span { color: var(--faint); }

/* ------------- dark hero (the screening room) -------------- */
/* The landing view stays lights-off; the light theme begins after scroll. */
.hero { background: #0E0D15; }
.hero .wall-tile { background: #090812; }
.hero .wall .wall-tile img,
.hero .wall .wall-tile video { filter: grayscale(0.85) brightness(0.34) contrast(1.05); }
.hero .wall-lit .wall-tile img, .hero .wall-lit .wall-tile video { filter: brightness(1.03) contrast(1.02); }
.beam-glow {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(circle calc(var(--beam-r, 260px) * 1.35) at var(--beam-x, 50%) var(--beam-y, 42%),
      rgba(142,123,250,0.17) 0%, rgba(86,189,249,0.07) 45%, transparent 70%);
  mix-blend-mode: screen;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0,0,0,0.42) 100%);
}
.hero-copy { z-index: 5; }
.hero h1 { color: #F7F6FF; text-shadow: 0 2px 40px rgba(0,0,0,0.7), 0 1px 10px rgba(0,0,0,0.5); }
.hero h1 .amber { color: #A493FF; }
.hero-hint span { color: rgba(247,246,255,0.42); }
/* nav over the dark hero: light text until the page scrolls */
.nav:not(.scrolled) .brand-word { color: #F7F6FF; }
.nav:not(.scrolled) .brand svg circle:nth-of-type(2) { stroke: #F7F6FF; }
.nav:not(.scrolled) .nav-link { color: #BCB7D8; }
.nav:not(.scrolled) .nav-link:hover { color: #FFFFFF; }

/* ---------------------- section shell ---------------------- */
.section { padding: clamp(56px, 9vh, 104px) var(--pad); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: clamp(24px, 4vh, 44px); flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(34px, 5vw, 68px); }
.sec-head h2 .amber { color: var(--accent); }
.sec-head .mono { padding-bottom: 8px; }

/* ------------------- cinema rails -------------------------- */
.rail-block { border-top: 1px solid var(--line); padding: clamp(18px, 3vh, 28px) 0; }
.rail-block:last-child { border-bottom: 1px solid var(--line); }
.rail-head {
  display: flex; align-items: baseline; gap: clamp(10px, 2vw, 22px);
  margin-bottom: 14px;
}
.rail-idx { color: var(--faint); }
.rail-name { font-size: clamp(20px, 2.6vw, 34px); white-space: nowrap; }
.rail-spacer { flex: 1; }
.rail-count { color: var(--sky); white-space: nowrap; }
.rail-btn {
  width: 32px; height: 32px; flex: 0 0 auto; align-self: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 14px; cursor: pointer; display: grid; place-items: center;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.rail-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.rail {
  display: flex; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  cursor: grab;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent 100%);
          mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 36px), transparent 100%);
}
.rail::-webkit-scrollbar { display: none; }
.rail.dragging { cursor: grabbing; scroll-snap-type: none; }
.rail.dragging .tile img { pointer-events: none; }

.rail .tile { flex: 0 0 auto; height: clamp(190px, 30vh, 270px); scroll-snap-align: start; }

.tile {
  position: relative; overflow: hidden; cursor: pointer;
  background: #ECEBF7;
}
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s, filter 0.4s, opacity 0.4s; }
.tile img { filter: grayscale(0.45) brightness(1.06) contrast(0.94); opacity: 0.85; }
.tile:hover img { filter: none; opacity: 1; transform: scale(1.04); }
.tile-label {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; opacity: 0;
  text-shadow: 0 1px 8px rgba(30,27,46,0.9);
  transition: opacity 0.3s;
}
.tile:hover .tile-label { opacity: 1; }
.tile-play {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  width: 8px; height: 8px; border-radius: 50%; background: var(--sky);
  opacity: 0; transition: opacity 0.3s;
}
.tile:hover .tile-play { opacity: 1; animation: blink 1.6s steps(1) infinite; }

/* ----------------------- about strip ----------------------- */
.about { border-top: 1px solid var(--line); background: var(--surface); }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 60px); }
.about-cell .mono { color: var(--sky); margin-bottom: 12px; display: block; }
.about-cell h3 { font-size: clamp(20px, 2.4vw, 30px); }

/* ------------------------- contact ------------------------- */
.contact { text-align: center; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.contact .mono { color: var(--accent); }
.contact h2 { font-size: clamp(40px, 7vw, 104px); margin: 18px 0 10px; }
.contact-lede {
  font-family: var(--font-serif); font-style: italic;
  color: var(--dim); font-size: clamp(16px, 2vw, 19px);
  max-width: 460px; margin: 6px auto 34px;
}

/* booking form */
.book { max-width: 520px; margin: 0 auto; text-align: left; }
.book-field { display: block; margin-bottom: 18px; }
.book-field .mono { display: block; margin-bottom: 7px; color: var(--faint); }
.book-field input {
  width: 100%;
  font-family: var(--font-body); font-size: 16px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 0;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.book-field input::placeholder { color: var(--faint); }
.book-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(142,123,250,0.14); }
.book-actions { display: flex; gap: 10px; margin-top: 24px; }
.book-btn {
  flex: 1;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 14px 16px; text-align: center; cursor: pointer;
  border: 1px solid transparent; border-radius: 0;
  transition: filter 0.25s, background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
}
.book-btn.primary { color: #fff; background: linear-gradient(100deg, var(--accent), var(--sky)); }
.book-btn.primary:hover { filter: brightness(1.08) saturate(1.1); transform: translateY(-1px); }
.book-btn.ghost { color: var(--ink); background: var(--surface); border-color: var(--line); }
.book-btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

.contact-note { margin-top: 30px; color: var(--faint); }
.contact-note a { color: var(--dim); border-bottom: 1px solid var(--line); transition: color 0.25s, border-color 0.25s; }
.contact-note a:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dim); background: var(--surface); border: 1px solid var(--line);
  padding: 4px 9px; margin-left: 8px; cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ------------------ footer billing block ------------------- */
.footer { border-top: 1px solid var(--line); padding: 46px var(--pad) 60px; text-align: center; background: var(--surface); }
.billing {
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--dim);
  letter-spacing: 0.06em;
  font-size: clamp(11px, 1.6vw, 15px);
  transform: scaleY(1.6);
  line-height: 1.7;
  max-width: 900px; margin: 0 auto 30px;
}
.billing b { color: var(--ink); font-weight: 400; }
.footer .mono a:hover { color: var(--accent); }

/* ----------------------- lightbox -------------------------- */
.lb {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(247,247,253,0.97);
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column;
}
.lb.open { display: flex; }
.lb-stage { position: relative; max-width: min(92vw, 1100px); max-height: 74vh; }
.lb-stage video { max-width: 100%; max-height: 74vh; box-shadow: 0 30px 100px rgba(30,27,46,0.3); }
/* curtain bars that slide open on start */
.lb-bar { position: absolute; left: 0; right: 0; height: 50%; background: var(--canvas); z-index: 3; transition: transform 0.55s cubic-bezier(0.7, 0, 0.2, 1); }
.lb-bar.top { top: 0; transform-origin: top; }
.lb-bar.bot { bottom: 0; transform-origin: bottom; }
.lb.playing .lb-bar.top { transform: translateY(-101%); }
.lb.playing .lb-bar.bot { transform: translateY(101%); }
.lb-meta { margin-top: 18px; display: flex; gap: 22px; align-items: center; }
.lb-title { font-family: var(--font-display); text-transform: uppercase; font-size: 18px; letter-spacing: 0.05em; }
.lb-x {
  position: fixed; top: 22px; right: 26px; z-index: 101;
  width: 46px; height: 46px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 19px; cursor: pointer; display: grid; place-items: center;
  transition: background 0.25s, color 0.25s;
}
.lb-x:hover { background: var(--accent); color: #fff; }
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 101;
  width: 46px; height: 46px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 17px; cursor: pointer; display: grid; place-items: center;
  transition: background 0.25s, color 0.25s;
}
.lb-nav:hover { background: var(--accent); color: #fff; }
.lb-nav.prev { left: 22px; } .lb-nav.next { right: 22px; }

/* --------------------- scroll reveals ---------------------- */
.rv { opacity: 0; transform: translateY(26px); transition: opacity 0.7s, transform 0.7s; }
.rv.in { opacity: 1; transform: none; }

/* ------------------------- mobile -------------------------- */
@media (max-width: 760px) {
  .nav-link.hide-m { display: none; }
  .hero { cursor: auto; }
  .wall, .wall-lit { --wall-cols: 3; }
  .hero h1 { font-size: clamp(30px, 8.5vw, 42px); }
  .rail-head { flex-wrap: wrap; }
  .rail-btn { display: none; }
  .rail .tile { height: 190px; }
  .about-grid { grid-template-columns: 1fr; }
  .book-actions { flex-direction: column; }
  .lb-nav { display: none; }
}
