/* =============================================================================
   FILM CLOSET — filmcloset.studio
   Static one-page site. No build step.
   ============================================================================= */

/* ---------- 1. Tokens ---------- */

:root {
  --base: #0B0B0B;                    /* page and video letterbox */
  --film: #141312;                    /* raised surfaces */
  --edge: rgba(255, 255, 255, 0.14);  /* hairline borders on the inset frame */
  --ink:  #F2F0ED;                    /* primary text */
  --mute: #8E8C88;                    /* labels, metadata, secondary */
  --mark: #FF3B1F;                    /* vermilion accent — the only colour */

  --grade-tint: #0E1412;              /* cool-green cast for the photographic grade */

  --inset: 40px;                      /* inset frame offset, desktop */
  --pad: 34px;                        /* padding inside the inset frame */
  --gutter: clamp(20px, 5vw, 72px);   /* page gutter for non-bleed sections */
  --maxw: 1420px;

  /* Vertical rhythm. One idea per viewport: adjacent sections are separated
     by roughly 32-44vh of empty --base. */
  --gap: clamp(104px, 20vh, 232px);
  --gap-in: clamp(44px, 7vh, 96px);   /* divider to content */

  --font-display: "Archivo", "Arial Black", system-ui, sans-serif;
  --font-body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
  line-height: 1.68;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, p, dl, dd, figure, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

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

::selection { background: var(--mark); color: var(--base); }

/* ---------- 3. Focus ---------- */

:focus { outline: none; }

:focus-visible,
.scrub__track:focus-visible {
  outline: 1px solid var(--mark);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  background: var(--mark);
  color: var(--base);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 18px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- 4. Type primitives ---------- */

/* Utility: JetBrains Mono. Every label, eyebrow, spec, corner marker and
   metadata line. Never body copy. */
.mono,
.pill,
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-variant-ligatures: none;
}

.mono { color: var(--mute); }

.eyebrow { color: var(--mark); }

/* Display: Archivo 900, width axis expanded, tight leading, negative tracking. */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 125%;
  /* Low-level axes as well as the high-level properties: Blink will not
     interpolate `font-stretch`, but it does interpolate
     `font-variation-settings` when both sides list the same axes in the same
     order. That is what drives the hero's condensed-to-expanded load. */
  font-variation-settings: "wght" 900, "wdth" 125;
  text-transform: uppercase;
  line-height: 0.85;
  letter-spacing: -0.022em;
  color: var(--mark);
  overflow-wrap: normal;
  hyphens: none;
}

.display__line { display: block; }

/* Measured against Archivo 900 at wdth 125 with -0.022em tracking, so the type
   spans most of the frame at every width and never breaks mid-word.
   "PERFORMANCE" is 10.12em; "CASTING HAPPENS IN POST." is 18.19em. */
.display--hero { font-size: clamp(1.5rem, 0.79rem + 3.843vw, 6.4rem); }
.display--contact { font-size: clamp(2.5rem, 1.31rem + 6.94vw, 10rem); }

/* Visually hidden — real heading hierarchy without inventing visible copy. */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Section index marker — an index, not copy. */
.idx {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  white-space: nowrap;
}

/* ---------- 4b. Section divider ---------- */
/* Mono bracket label, then a 1px hairline running to the right edge of the
   content column. Registration, not decoration. */

.divider {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 28px);
  margin-bottom: var(--gap-in);
}

.divider .eyebrow { flex: 0 0 auto; }

.divider__rule {
  flex: 1 1 auto;
  min-width: 24px;
  height: 1px;
  background: var(--edge);
}

/* ---------- 4c. Crop marks ---------- */
/* Four L-shaped 1px registration ticks sitting just outside a frame of
   footage. The hero and contact panels keep the full hairline frame; anything
   that is a picture gets crop marks instead. */

.crop { position: relative; display: block; }

.crop__marks {
  position: absolute;
  inset: -11px;
  z-index: 6;
  pointer-events: none;
}

.crop__marks i {
  position: absolute;
  display: block;
  width: 16px;
  height: 16px;
}

.crop__marks i:nth-child(1) { top: 0; left: 0;  border-top: 1px solid var(--edge); border-left: 1px solid var(--edge); }
.crop__marks i:nth-child(2) { top: 0; right: 0; border-top: 1px solid var(--edge); border-right: 1px solid var(--edge); }
.crop__marks i:nth-child(3) { bottom: 0; left: 0;  border-bottom: 1px solid var(--edge); border-left: 1px solid var(--edge); }
.crop__marks i:nth-child(4) { bottom: 0; right: 0; border-bottom: 1px solid var(--edge); border-right: 1px solid var(--edge); }

/* ---------- 5. Photographic grade ---------- */
/* Applied uniformly to every still and video poster on the page:
   desaturated, slightly lifted blacks, faint cool-green cast in shadows. */

.grade {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--base);
}

.grade > img,
.grade img,
.grade iframe {
  filter: saturate(0.55) contrast(1.05);
}

.grade::before,
.grade::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

/* multiply: deepens and cools */
.grade::before {
  background: var(--grade-tint);
  mix-blend-mode: multiply;
  opacity: 0.34;
}

/* screen: lifts the blacks into the same cool green */
.grade::after {
  background: var(--grade-tint);
  mix-blend-mode: screen;
  opacity: 0.11;
}

/* ---------- 6. Pill buttons ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 11px 20px 10px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
  transition: background-color 0.28s var(--ease),
              color 0.28s var(--ease),
              border-color 0.28s var(--ease);
}

.pill:hover,
.pill:focus-visible {
  background: var(--mark);
  border-color: var(--mark);
  color: var(--base);
}

/* The only filled element on the page. */
.pill--filled {
  background: var(--mark);
  border-color: var(--mark);
  color: var(--base);
  padding: 13px 26px 12px;
}

.pill--filled:hover,
.pill--filled:focus-visible {
  background: transparent;
  border-color: var(--mark);
  color: var(--mark);
}

/* ---------- 7. The inset frame ---------- */
/* 1px border, 12px radius, fully transparent fill.
   No blur, no glass, no shadow. The border alone creates the frame. */

.frame {
  position: absolute;
  inset: var(--inset);
  z-index: 5;
  pointer-events: none;
}

.frame__border {
  position: absolute;
  inset: 0;
  border: 1px solid var(--edge);
  border-radius: 12px;
}

.frame__corner {
  position: absolute;
  pointer-events: auto;
  margin: 0;
}

.frame__corner--tl { top: var(--pad); left: var(--pad); color: var(--ink); letter-spacing: 0.22em; }
.frame__corner--tr { top: calc(var(--pad) - 12px); right: var(--pad); }
.frame__corner--bl { bottom: var(--pad); left: var(--pad); }
.frame__corner--br { bottom: var(--pad); right: var(--pad); text-align: right; }

.frame--contact .frame__corner--tl { color: var(--mute); letter-spacing: 0.12em; }

/* SCROLL cue with a 1px rule that runs downward on a slow loop */
.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.scroll-cue__rule {
  display: block;
  width: 1px;
  height: 46px;
  background: var(--edge);
  transform-origin: top;
}

.js .scroll-cue__rule { animation: scroll-rule 2.8s var(--ease) infinite; }

@keyframes scroll-rule {
  0%   { transform: scaleY(0); transform-origin: top; }
  40%  { transform: scaleY(1); transform-origin: top; }
  60%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- 8. Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--base);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Vimeo background embed, sized to cover the viewport. */
.hero__video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;              /* 16:9 */
  min-width: 177.78vh;          /* cover when the viewport is tall */
  min-height: 100vh;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

.hero__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Poster sits over the embed so the page never shows a black rectangle.
   It fades out only once the player reports playback. If the video never
   loads, the poster simply stays. */
.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The performer stands at ~28% of the frame width. Aim the cover crop there
     so portrait viewports keep her in view instead of cropping her out. */
  object-position: 27% 50%;
  z-index: 2;
  opacity: 1;
}

.js .hero__poster { transition: opacity 1.2s var(--ease); }
.js .hero.is-playing .hero__poster { opacity: 0; }

.hero__content {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: calc(var(--pad) + 96px);
  pointer-events: auto;
}

.hero__content .eyebrow { margin-bottom: 24px; }
.hero__eyebrow .idx { margin-right: clamp(12px, 1.4vw, 22px); }

.hero__lede {
  margin-top: 30px;
  max-width: 46ch;
  color: var(--ink);
  font-size: clamp(0.9375rem, 0.86rem + 0.35vw, 1.125rem);
}

/* ---------- 9. Section rhythm ---------- */

.rail,
.method,
.deliverables,
.studio,
.rights { padding: var(--gap) 0; }

.rail   { padding-top: calc(var(--gap) * 1.1); }
.rights { padding-bottom: calc(var(--gap) * 1.15); }

/* ---------- 10. Recast rail ---------- */

/* Wide, but never touching the viewport edge. */
.rail__crop { display: block; }

.rail__stage {
  position: relative;
  width: 100%;
  height: clamp(215px, 42vw, 600px);
  background: var(--base);
  touch-action: pan-y;
  cursor: ew-resize;
}

.no-js .rail__live { display: none; }

.rail__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* All four frames register pixel-for-pixel; the performer sits at the left
     third. One shared crop aim keeps her in frame at every viewport ratio. */
  object-position: 24% 42%;
  opacity: 0;
}

.rail__frame:nth-child(1) { opacity: 1; z-index: 1; }
.rail__frame:nth-child(2) { z-index: 2; }
.rail__frame:nth-child(3) { z-index: 3; }
.rail__frame:nth-child(4) { z-index: 4; }

/* Settle animates; dragging is 1:1 with the pointer. */
.js .rail__frame { transition: opacity 0.34s var(--ease); }
.js .rail__live.is-dragging .rail__frame { transition: none; }

/* Metadata line, mono, --mute, with the changing half in --mark */
.rail__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 28px;
  margin-top: 30px;
  color: var(--mute);
}

.rail__meta-fixed { color: var(--mute); }
.rail__meta-live  { color: var(--mark); }

/* Scrubber */
/* Track edges register exactly with the frame edges above it. */
.scrub { margin-top: clamp(34px, 4vw, 56px); }

.scrub__track {
  position: relative;
  height: 1px;
  background: var(--edge);
  cursor: grab;
  touch-action: none;
}

/* Generous hit area around the 1px rule */
.scrub__track::before {
  content: "";
  position: absolute;
  inset: -20px -8px;
}

.scrub__track:active { cursor: grabbing; }

.scrub__tick {
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--edge);
  transform: translateX(-0.5px);
}

/* A small vermilion square, not a circle. */
.scrub__handle {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--mark);
  border-radius: 0;
  z-index: 2;
}

.js .scrub__handle { transition: left 0.34s var(--ease); }
.js .rail__live.is-dragging .scrub__handle { transition: none; }

.scrub__labels {
  position: relative;
  height: 2.4em;
  margin-top: 18px;
}

.scrub__label {
  position: absolute;
  top: 0;
  color: var(--mute);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.28s var(--ease);
}

.scrub__label.is-on { color: var(--mark); }

.scrub__label[data-step="0"] { transform: translateX(0); }
.scrub__label[data-step="1"],
.scrub__label[data-step="2"] { transform: translateX(-50%); }
.scrub__label[data-step="3"] { transform: translateX(-100%); }

/* No-JS fallback: capture frame and first casting, side by side */
.rail__noscript {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 28px);
}

.rail__noscript-media { display: block; }
.rail__noscript-media img { width: 100%; height: auto; }
.rail__noscript figcaption { margin-top: 14px; color: var(--mute); }

/* ---------- 11. Method ---------- */

.method__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(48px, 4.4vw, 76px);
}

.method__num {
  color: var(--mark);
  margin-bottom: 16px;
}

.method__label {
  color: var(--ink);
  margin-bottom: 24px;
}

.method__media { display: block; }

.method__still {
  display: block;
  aspect-ratio: 3 / 2;
}

.method__still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Two-line mono caption under each still. */
.method__caption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 26px 0 22px;
  font-size: 10px;
  letter-spacing: 0.11em;
  color: var(--mute);
}

.method__body {
  color: var(--mute);
  max-width: 40ch;
}

/* ---------- 12. Deliverables ---------- */

.spec { border-top: 1px solid var(--edge); }

.spec__row {
  display: grid;
  grid-template-columns: minmax(96px, 200px) minmax(0, 1fr);
  gap: 12px clamp(16px, 3vw, 48px);
  align-items: baseline;
  padding: clamp(16px, 2vw, 26px) 0;
  border-bottom: 1px solid var(--edge);
}

.spec__key {
  color: var(--mute);
  padding-top: 0.35em;
}

.spec__val {
  margin: 0;
  color: var(--ink);
}

/* ---------- 13. Studio ---------- */

.studio__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(32px, 4vw, 80px);
}

.studio__prose p {
  max-width: 54ch;
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.25rem);
  line-height: 1.6;
}

.studio__prose p + p { margin-top: 1.4em; }

.studio__credits {
  color: var(--mute);
  line-height: 2.1;
}

/* ---------- 14. Rights ---------- */

/* Hairline rule above (the divider) and below (rights__rule), both spanning
   the full content column. */
.rights__body {
  max-width: 78ch;
  color: var(--mute);
}

.rights__rule {
  display: block;
  height: 1px;
  background: var(--edge);
  margin-top: clamp(30px, 3.4vw, 52px);
}

/* ---------- 15. Contact ---------- */

.contact {
  position: relative;
  min-height: 92vh;
  min-height: 92svh;
  overflow: hidden;
  background: var(--base);
}

.contact__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.contact__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Keep the work light in view when portrait viewports crop the sides. */
  object-position: 35% 50%;
}

.contact__content {
  position: absolute;
  inset: var(--pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: auto;
}

.contact__address {
  margin-top: clamp(28px, 3vw, 44px);
  color: var(--mute);
}

.contact__content p:last-child { margin-top: clamp(24px, 2.6vw, 38px); }

/* ---------- 16. Footer ---------- */

.footer {
  padding: clamp(30px, 3.4vw, 52px) 0 clamp(34px, 3.8vw, 58px);
  border-top: 1px solid var(--edge);
}

.footer__line { color: var(--mute); }

/* ---------- 17. Motion ---------- */

/* One orchestrated load. Nothing else. */

.js .hero__media { opacity: 0; }
.js .is-loaded .hero__media {
  opacity: 1;
  transition: opacity 1.2s linear;
}

.js .frame--hero .frame__border {
  clip-path: inset(46% 46% 46% 46% round 12px);
}
.js .is-loaded .frame--hero .frame__border {
  clip-path: inset(0 0 0 0 round 12px);
  transition: clip-path 0.7s var(--ease) 0.55s;
}

.js .frame--hero .frame__corner { opacity: 0; }
.js .is-loaded .frame--hero .frame__corner {
  opacity: 1;
  transition: opacity 0.6s var(--ease) 1s;
}

.js [data-load] { opacity: 0; }
.js .is-loaded [data-load] {
  opacity: 1;
  transition: opacity 0.7s var(--ease);
}
.js .is-loaded [data-load="1"] { transition-delay: 1.1s; }
.js .is-loaded [data-load="3"] { transition-delay: 1.55s; }

/* Width axis: condensed to expanded over 0.8s, after the border draws in.
   The headline also carries data-load="2", so this rule must come after the
   [data-load] block — an equal-specificity `transition` shorthand there would
   otherwise reset transition-property to `opacity` and the axis would snap.
   Opacity is folded in here for the same reason. */
.js .display--hero {
  font-stretch: 62%;
  font-variation-settings: "wght" 900, "wdth" 62;
}
.js .is-loaded .display--hero {
  font-stretch: 125%;
  font-variation-settings: "wght" 900, "wdth" 125;
  transition: font-variation-settings 0.8s var(--ease) 1.15s,
              font-stretch 0.8s var(--ease) 1.15s,
              opacity 0.7s var(--ease) 1.15s;
}

/* Scroll reveals: 12px rise and fade, staggered. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.62s var(--ease), transform 0.62s var(--ease);
}

/* ---------- 18. Responsive ---------- */

@media (max-width: 1080px) {
  .studio__grid { grid-template-columns: minmax(0, 1fr); }
  .studio__credits { border-top: 1px solid var(--edge); padding-top: 26px; }
}

/* The divider rule drops to its own full-width line once the label crowds it. */
@media (max-width: 620px) {
  .divider { flex-wrap: wrap; row-gap: 16px; }
  .divider .eyebrow { flex: 0 1 auto; }
  .divider__rule { flex: 1 0 100%; }
}

@media (max-width: 900px) {
  .method__grid { grid-template-columns: minmax(0, 1fr); gap: clamp(52px, 9vw, 76px); }
  .method__body { max-width: 52ch; }
}

@media (max-width: 760px) {
  :root {
    --inset: 16px;
    --pad: 20px;
  }

  /* Panel drops the bottom corner labels on mobile. */
  .frame--hero .frame__corner--bl,
  .frame--hero .frame__corner--br { display: none; }

  .frame__corner--tl { letter-spacing: 0.18em; }

  .hero__content { bottom: var(--pad); }

  .method__body { max-width: none; }

  .rail__noscript { grid-template-columns: minmax(0, 1fr); }

  /* Taller stage at phone widths: a tighter crop keeps the performance
     readable instead of a thin strip with the performer in one corner. */
  .rail__stage { height: clamp(240px, 62vw, 360px); }

  .crop__marks { inset: -8px; }
  .crop__marks i { width: 13px; height: 13px; }

  .contact { min-height: 88svh; }
}

@media (max-width: 480px) {
  .mono, .pill, .eyebrow, .idx { font-size: 10px; letter-spacing: 0.1em; }

  .pill { padding: 10px 15px 9px; }
  .pill--filled { padding: 13px 20px 12px; }

  .rail__meta { gap: 8px; }
  .rail__meta-fixed, .rail__meta-live { flex: 1 1 100%; }

  .scrub__labels { font-size: 9px; letter-spacing: 0.08em; }

  /* Mobile keeps the eyebrow on one line; the panel drops its corner labels
     here too, so the index goes with them. */
  .hero__eyebrow .idx { display: none; }

  .spec__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .spec__key { padding-top: 0; }
}

/* ---------- 19. Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js .scroll-cue__rule { animation: none; transform: none; }

  .js .hero__media,
  .js .is-loaded .hero__media { opacity: 1; transition: none; }

  .js .frame--hero .frame__border,
  .js .is-loaded .frame--hero .frame__border { clip-path: none; transition: none; }

  .js .frame--hero .frame__corner,
  .js .is-loaded .frame--hero .frame__corner { opacity: 1; transition: none; }

  .js .display--hero,
  .js .is-loaded .display--hero {
    font-stretch: 125%;
    font-variation-settings: "wght" 900, "wdth" 125;
    transition: none;
  }

  .js [data-load],
  .js .is-loaded [data-load] { opacity: 1; transition: none; }

  .js [data-reveal],
  .js [data-reveal].is-in { opacity: 1; transform: none; transition: none; }

  .js .hero__poster { transition: none; }
  .js .scrub__handle { transition: none; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
