/* ============================================================
   Videos / Films page — Nicko Trenchev Studio

   Design plan
   -----------
   Subject : the studio's films. The page's single job is to make the work feel
             cinematic and get the visitor to press play.
   Palette : inherited from home-test.css (#0a0a0a ground, white ink). The
             footage is the only colour on the page — chrome stays monochrome,
             matching the "the work is the interface" rule of the rest of the site.
   Type    : Inter 800/900 uppercase for display (existing wordmark voice),
             Bodoni Moda italic for the couple/venue line — the same pairing the
             home grid captions already use.
   Layout  : an oversized VIDEOS wordmark, one full-bleed featured film, then a
             calm three-column grid of film cards.
   Signature element : the featured film's title is set huge and straddles the
             bottom edge of the hero frame in `mix-blend-mode: difference`, so it
             inverts against the footage instead of sitting on a scrim. This is
             the page's one memorable moment, and it reuses the blend-mode
             chrome language already established by .h-logo / .h-chrome-label.

   Loads AFTER home-test.css, which owns the tokens, the fixed chrome and the
   MENU / CONTACT overlays. Only what is specific to this page lives here.
   ============================================================ */

:root {
  /* Page-specific tiers, expressed as tokens so nothing is hardcoded below. */
  --v-ink-dim: rgba(255, 255, 255, 0.56);
  --v-ink-faint: rgba(255, 255, 255, 0.34);
  --v-frame: #131313;          /* placeholder ground behind a loading frame */
  --v-gap: 8px;                /* grid gutter — tight, like the home grid */
  --v-edge: 24px;              /* page side margin */
  --v-radius: 0px;             /* the site is hard-edged; kept as a token anyway */
  --v-ease: cubic-bezier(0.2, 0, 0.2, 1);
}

/* Lenis smooth scroll: it drives scrolling via transform on <html>, and needs
   the native behaviour switched off to avoid fighting it. */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

body.v-page { background: var(--h-bg); }

/* ============================================================
   PAGE HEAD — oversized VIDEOS wordmark, right-aligned under MENU
   ============================================================ */
.v-head {
  padding: 26px var(--v-edge) 0;
  /* clears the fixed vertical MENU label that lives in the same corner */
  padding-right: calc(var(--v-edge) + 46px);
  display: flex;
  justify-content: flex-end;
}
.v-title {
  font-family: var(--h-sans);
  font-weight: 900;
  font-size: clamp(44px, 8.6vw, 132px);
  line-height: 0.82;
  letter-spacing: -0.03em;
  color: var(--h-ink);
  mix-blend-mode: difference;
  margin: 0;
}

/* ============================================================
   FEATURED FILM — full-bleed frame with the title straddling its base
   ============================================================ */
.v-featured {
  position: relative;
  margin: 14px var(--v-edge) 0;
}
.v-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  /* Cap the height so the oversized title below still lands inside the first
     screen — the overlap IS the composition, so it must not need a scroll to
     be seen. On wide viewports this makes the frame a true cinema letterbox
     (the poster crops via object-fit), which is the intended look. */
  max-height: 46vh;
  overflow: hidden;
  background: var(--v-frame);
}
.v-frame img,
.v-frame video,
.v-frame iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}
/* The oversized title overlaps the frame's lower edge. `difference` inverts it
   against whatever the footage is doing behind it — the page's one flourish. */
.v-featured-title {
  position: relative;
  /* The overlap is set in `em`, so it stays proportional at whatever size the
     fit-to-width measurement lands on. */
  margin: -0.40em 0 0;
  font-family: var(--h-sans);
  font-weight: 900;
  /* Starting value only — VideosApp.jsx measures the text and overrides this
     inline so one line spans the frame exactly, whatever the film is called.
     Kept as a clamp so there is no flash of the wrong size before JS runs. */
  font-size: clamp(34px, 7.4vw, 116px);
  line-height: 0.86;
  letter-spacing: -0.035em;
  color: var(--h-ink);
  mix-blend-mode: difference;
  pointer-events: none;
  white-space: nowrap;
}
.v-featured-meta {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-top: 10px;
  padding-bottom: 6px;
}
.v-featured-meta .sub {
  font-family: var(--h-serif);
  font-style: italic;
  font-size: clamp(14px, 1.5vw, 20px);
  color: var(--v-ink-dim);
}
.v-featured-meta .tag {
  font-family: var(--h-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--v-ink-faint);
}

/* ============================================================
   PLAY CONTROLS
   Big circular button on the hero, small square badge on each card —
   both are real <button>s with visible focus.
   ============================================================ */
.v-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--h-ink);
}
.v-play .disc {
  width: clamp(56px, 7vw, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  place-items: center;
  transition: transform 420ms var(--v-ease), background-color 420ms var(--v-ease);
}
.v-play .disc svg { width: 34%; height: 34%; fill: #0a0a0a; margin-left: 8%; }
.v-play:hover .disc { transform: scale(1.09); background: #fff; }
.v-play:focus-visible { outline: 2px solid #fff; outline-offset: -6px; }

/* small badge, top-left of a card (matches the reference layout) */
.v-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 30px;
  height: 26px;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 10, 0.62);
  backdrop-filter: blur(4px);
  border: 0;
  cursor: pointer;
  pointer-events: none;                 /* the whole card is the click target */
  transition: background-color 300ms var(--v-ease);
}
.v-badge svg { width: 10px; height: 12px; fill: #fff; }
.v-card:hover .v-badge { background: rgba(255, 255, 255, 0.92); }
.v-card:hover .v-badge svg { fill: #0a0a0a; }

.v-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  font-family: var(--h-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}

/* ============================================================
   FILM GRID
   ============================================================ */
.v-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px var(--v-gap);
  margin: 30px var(--v-edge) 0;
}
.v-card {
  position: relative;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.v-card .shot {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--v-frame);
}
.v-card .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1100ms var(--v-ease), filter 620ms var(--v-ease);
}
.v-card:hover .shot img { transform: scale(1.05); }
.v-card .shot .noposter {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--v-ink-faint);
}
/* Name over subtitle, matching the stacked .cap .who treatment on the home grid.
   Side by side, the subtitle ran into the next column across the 8px gutter. */
.v-card .label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 12px;
}
.v-card .label .name {
  font-family: var(--h-sans);
  font-weight: 700;
  font-size: clamp(13px, 1.15vw, 17px);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--h-ink);
  transition: color 300ms var(--v-ease);
}
.v-card .label .sub {
  font-family: var(--h-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--v-ink-faint);
}
.v-card:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* ============================================================
   FOOT — "VIEW MORE FILMS" + spacer under the fixed CONTACT chrome
   ============================================================ */
.v-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  /* clears the fixed vertical CONTACT label in the bottom-right corner */
  margin: 26px calc(var(--v-edge) + 46px) 0 var(--v-edge);
}
.v-more {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--h-sans);
  font-weight: 800;
  font-size: clamp(13px, 1.2vw, 17px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--v-ink-dim);
  text-decoration: none;
  transition: color 320ms var(--v-ease), gap 320ms var(--v-ease);
}
.v-more:hover { color: var(--h-ink); gap: 22px; }
.v-more svg { width: 44px; height: 10px; }
.v-more svg path { stroke: currentColor; stroke-width: 2; fill: none; }
.v-page-foot { height: 14vh; }

/* Loading / empty states ------------------------------------------------- */
.v-skeleton { background: var(--v-frame); position: relative; overflow: hidden; }
.v-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045), transparent);
  animation: vShimmer 1500ms infinite;
}
@keyframes vShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.v-empty {
  margin: 40px var(--v-edge) 0;
  padding: 70px 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}
.v-empty h2 {
  font-family: var(--h-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 46px);
  margin: 0 0 12px;
}
.v-empty p { font-size: 14px; color: var(--v-ink-dim); letter-spacing: 0.02em; }

/* ============================================================
   LIGHTBOX — a real <dialog>, so Escape and focus handling are free
   ============================================================ */
.v-lightbox {
  border: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background: rgba(6, 6, 6, 0.97);
  color: var(--h-ink);
}
.v-lightbox::backdrop { background: rgba(6, 6, 6, 0.92); }
.v-lightbox-inner {
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(20px, 6vh, 80px) clamp(16px, 5vw, 90px);
}
.v-lightbox .stage { width: 100%; max-width: 1500px; }
.v-lightbox .stage-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.v-lightbox .stage-frame video,
.v-lightbox .stage-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
.v-lightbox .stage-cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
}
.v-lightbox .stage-cap .name {
  font-family: var(--h-sans);
  font-weight: 800;
  font-size: clamp(16px, 2vw, 26px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.v-lightbox .stage-cap .sub {
  font-family: var(--h-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--v-ink-dim);
}
.v-lightbox .lb-close {
  position: fixed;
  top: 26px;
  right: 26px;
  writing-mode: vertical-rl;
  font-family: var(--h-sans);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.04em;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  transition: opacity 200ms;
}
.v-lightbox .lb-close:hover { opacity: 0.6; }
/* No-source fallback: a film row saved before its video was attached. */
.v-lightbox .stage-frame .nosrc {
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--v-ink-faint);
}

/* ============================================================
   SCROLL REVEAL — one orchestrated entrance per section.
   Elements start shifted, and `.in` (set by IntersectionObserver) settles them.
   Only transform/opacity animate, so this stays off the layout path.
   ============================================================ */
.v-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 820ms var(--v-ease), transform 820ms var(--v-ease);
  transition-delay: var(--v-delay, 0ms);
}
.v-reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .v-frame { aspect-ratio: 16 / 9; }
}
@media (max-width: 820px) {
  .v-grid { grid-template-columns: repeat(2, 1fr); gap: 22px var(--v-gap); }
}
@media (max-width: 520px) {
  :root { --v-edge: 14px; }
  /* the phone chrome in home-test.css drops to 18px insets and a 58px logo band */
  .v-head { padding: 92px var(--v-edge) 0; padding-right: calc(var(--v-edge) + 30px); }
  .v-title { font-size: 15vw; }
  .v-frame { aspect-ratio: 4 / 3; max-height: none; }
  /* Wrap rather than shrink: the headline keeps its presence over 2–3 lines
     instead of collapsing to a thin single line (see useFitText's opt-out). */
  .v-featured-title { font-size: 11.6vw; margin-top: -0.24em; white-space: normal; text-wrap: balance; }
  .v-featured-meta { flex-direction: column; gap: 4px; }
  .v-grid { grid-template-columns: 1fr; gap: 24px 0; }
  .v-foot { margin-right: calc(var(--v-edge) + 30px); justify-content: flex-start; }
  .v-page-foot { height: 16vh; }
  .v-lightbox .lb-close { top: 58px; right: 18px; font-size: 18px; }
}

/* ============================================================
   REDUCED MOTION — reveals resolve instantly, hovers stop moving.
   (Lenis is also not started at all in this mode; see VideosApp.jsx.)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .v-reveal { opacity: 1; transform: none; transition: none; }
  .v-card .shot img,
  .v-play .disc,
  .v-more { transition: none; }
  .v-card:hover .shot img { transform: none; }
  .v-play:hover .disc { transform: none; }
  .v-skeleton::after { animation: none; }
}
