/* ============================================================
   ATA DALA PRODUCTION — «ANAMORPHOT» (dark, cinematic, red accent)
   pages/home.css — HOME ONLY. Load AFTER layout.css.
   Ported from the anamorphot reference: full-screen cinemascope
   hero that crops to 2.39:1 on scroll, a bottom-left "Selected
   work" list that swaps the backing frame, word-lit manifest,
   editing-cut reveals. Tokens only — no #hex, no px type, no raw
   durations.
   ============================================================ */

/* ============================================================
   SCREENING PROGRESS — a strip of film through the projector.
   --sp-p is set by home.js on scroll. Without JS it is hidden.
   ============================================================ */

.sprog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: calc(var(--z-header) + 1);
  pointer-events: none;
  background: transparent;
}
.sprog__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left;
  transform: scaleX(var(--sp-p, 0));
  background: var(--c-accent);
}
.no-js .sprog { display: none; }

/* ============================================================
   SHARED SECTION HEAD — eyebrow + heading + right-aligned link
   ============================================================ */

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-9);
}
.head__lead { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.head__title { font-size: var(--fs-h2); max-width: 20ch; }
.head__link { white-space: nowrap; }

/* ============================================================
   1 · HERO — the anamorphot.
   0s: a 100svh full-bleed frame. Scroll 0 -> ~70vh: the letterbox
   bars close (scaleY, driven by app.js --lb-p on [data-letterbox]),
   the frame crops to 2.39:1 and the <img> eases 1.12 -> 1. The
   intro headline fades as it crops; the Selected-work list and the
   meta line settle onto the cinemascope frame.
   ============================================================ */

.hero {
  position: relative;
  width: 100%;
  height: 200svh;               /* scroll runway for the crop + hold */
}

.hero__stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: var(--c-letterbox);
}

.hero__frame {
  position: absolute;
  inset: 0;
  z-index: var(--z-frame);
  background: var(--g-frame);
}

/* The image breathes: eases from 1.12 -> 1 as the frame crops, plus
   a ±8px pointer parallax fed into --hx/--hy by home.js. */
.hero__frame .xf__img {
  transform:
    translate3d(calc(var(--hx, 0) * 8px), calc(var(--hy, 0) * 8px), 0)
    scale(calc(1.12 - 0.12 * var(--lb-p, 0)));
  transform-origin: 50% 42%;
  will-change: transform;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: var(--z-scrim);
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--c-scrim-soft) 0%, transparent 26%, transparent 52%, var(--c-scrim) 100%),
    linear-gradient(90deg, var(--c-scrim) 2%, transparent 60%);
}

/* --- Content column: headline up top, Selected-work list at the
       bottom. Flex space-between keeps them apart on tall screens and
       simply stacks them (never overlapping) on short ones. --- */

.hero__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: clamp(var(--sp-11), 22svh, 30svh);
  z-index: calc(var(--z-letterbox) + 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-6);
  pointer-events: none;
}
.hero__content > * { pointer-events: auto; }

/* Intro headline — fades as the frame crops to cinemascope */
.hero__head {
  width: min(100%, 44rem);
  max-width: 100%;
  padding-inline: var(--gutter);
  opacity: calc(1 - var(--lb-p, 0) * 1.4);
  transform: translateY(calc(var(--lb-p, 0) * var(--sp-6) * -1));
  transition: opacity var(--d-fast) var(--e-linear);
}
.hero__eyebrow { color: var(--c-text); margin-bottom: var(--sp-5); }
.hero__eyebrow::before { background: var(--c-accent); }

.hero__line {
  font-size: var(--fs-h1);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tr-h1);
  line-height: var(--lh-h1);
  color: var(--c-text);
  text-wrap: balance;
}
.hero__accent { color: var(--c-accent); }

/* Девиз бренда под заголовком: имя студии с эмблемой 1937 — и смысл,
   который за ней стоит. Ставится между заголовком и подзаголовком. */
.hero__motto {
  /* Одна текстовая строка, а не flex: тогда перенос идёт по словам и
     тире остаётся при имени студии, а не открывает вторую строку. */
  margin-top: var(--sp-5);
  max-width: 48ch;
  font-size: clamp(0.8125rem, 0.7rem + 0.35vw, 0.9375rem);
  line-height: 1.55;
  color: var(--c-text);
  text-wrap: pretty;
}

.hero__motto-brand {
  font-weight: var(--fw-semi);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 0.35em;
}

.hero__motto-year { color: var(--c-accent); }

/* Тире-разделитель рисуем стилями, чтобы текст в данных оставался чистым */
.hero__motto-text::before {
  content: "— ";
  color: var(--c-muted);
}

.hero__motto-text { color: var(--c-muted); }

.hero__sub {
  margin-top: var(--sp-5);
  max-width: 42ch;
  color: var(--c-text);
  font-size: var(--fs-lead);
  line-height: 1.45;
}

/* --- Selected-work list: hugs the bottom-left, lands on the bar --- */

.hero__panel {
  width: min(100%, 40rem);
  padding: 0 var(--gutter) var(--sp-9);
  transform: translateY(calc(var(--lb-p, 0) * var(--sp-6)));
}
.hero__kicker { margin-bottom: var(--sp-5); color: var(--c-muted); }

.hero__list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  list-style: none;
}
.hero__link {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding-block: var(--sp-1);
  color: var(--c-muted);
  transition: color var(--d-fast) var(--e-ease);
}
.hero__name {
  font-size: var(--fs-title);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tr-title);
  line-height: 1.2;
}
.hero__state {
  color: var(--c-line-strong);
  opacity: 0;
  transform: translateX(calc(var(--sp-2) * -1));
  transition: opacity var(--d-fast) var(--e-ease),
              transform var(--d-fast) var(--e-out),
              color var(--d-fast) var(--e-ease);
}
.hero__row.is-active .hero__link { color: var(--c-text); }
.hero__row.is-active .hero__state {
  opacity: 1;
  transform: none;
  color: var(--c-accent-ink);
}
.hero__link:hover { color: var(--c-text); }
.hero__link:focus-visible { outline-offset: var(--sp-1); }

.hero__meter {
  position: relative;
  width: min(100%, 22rem);
  height: 2px;
  margin-top: var(--sp-6);
  background: var(--c-line);
  overflow: hidden;
}
.hero__meter-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left;
  transform: scaleX(var(--meter, 0.25));
  background: var(--c-accent);
  transition: transform var(--d-cut) var(--e-cut);
}

/* --- Meta line of the active frame: fades in once cropped --- */

.hero__meta {
  position: absolute;
  right: var(--gutter);
  bottom: var(--sp-7);
  z-index: calc(var(--z-letterbox) + 1);
  max-width: min(100%, 30rem);
  text-align: right;
  opacity: calc((var(--lb-p, 0) - 0.55) / 0.45);
}

@media (max-width: 900px) {
  .hero__meta { display: none; }
}
@media (max-width: 560px) {
  .hero { height: 180svh; }
  .hero__head { width: 100%; }
  .hero__sub { display: none; }
  .hero__panel { width: 100%; padding-bottom: var(--sp-7); }
  .hero__link { flex-direction: column; align-items: flex-start; gap: var(--sp-1); }
  .hero__meter { width: 100%; }
}

/* Reduced motion: the bars are pinned closed (--lb-p forced to 1 by
   app.js). Collapse the runway to a single static cinemascope screen
   and keep the intro headline visible — the frame swap on hover
   stays, it isn't motion. */
@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero__stage { position: static; height: 100svh; }
  .hero__head { opacity: 1; transform: none; }
  .hero__meta { opacity: 1; }
  .hero__frame .xf__img { transform: none; }
}

/* ============================================================
   2 · TICKER — festival & partner pedigree.
   Base component lives in layout.css; nothing to add here beyond a
   top hairline breathing room handled by the section stack.
   ============================================================ */

/* ============================================================
   3 · MANIFEST — the tagline lit word by word, then the about prose.
   ============================================================ */

.mani { background: var(--c-bg); }
.mani__eyebrow { margin-bottom: var(--sp-8); }

.mani__statement {
  font-size: var(--fs-h1);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tr-h1);
  line-height: 1.1;
  max-width: 20ch;
  margin-bottom: var(--sp-9);
}
/* Start no dimmer than 0.55 (= 5.4:1 on --c-bg): every word stays
   readable even before it lights. */
.mani__word {
  opacity: 0.5;
  transition: opacity var(--d-cut) var(--e-out);
}
.mani__word.is-lit { opacity: 1; }

.mani__prose {
  padding-top: var(--sp-7);
  border-top: var(--border);
  max-width: var(--measure-wide);
}
.mani__prose p { color: var(--c-muted); max-width: var(--measure); }
.mani__prose p:first-child { color: var(--c-text); }

/* ============================================================
   4 · SERVICES — a bordered 4-column snapshot, red top rule on hover
   ============================================================ */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: var(--border);
  border-left: var(--border);
  list-style: none;
}
.svc {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-7) var(--sp-6);
  border-right: var(--border);
  border-bottom: var(--border);
  background: var(--c-surface);
  transition: background var(--d-fast) var(--e-ease);
}
.svc__num { color: var(--c-accent-ink); }
.svc__title { font-size: var(--fs-h3); }
.svc__desc { font-size: var(--fs-body); line-height: 1.5; }
.svc::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 2px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--d-cut) var(--e-cut);
}
.svc:hover { background: var(--c-surface-2); }
.svc:hover::after { transform: scaleX(1); }

@media (max-width: 900px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .svc-grid { grid-template-columns: 1fr; } }

/* ============================================================
   5 · WHY KAZAKHSTAN — reasons list + a full-width still strip
   ============================================================ */

.why__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--sp-10);
  align-items: start;
}
.why__lead { position: sticky; top: calc(var(--header-h) + var(--sp-6)); }
.why__title { margin: var(--sp-4) 0 var(--sp-5); max-width: 15ch; }
.why__blurb { margin-bottom: var(--sp-6); }
.why__cta { align-self: start; }

.why__reasons { list-style: none; border-top: var(--border); }
.why-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-5);
  padding-block: var(--sp-6);
  border-bottom: var(--border);
}
.why-item__mark {
  font-size: var(--fs-h2);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tr-h2);
  color: var(--c-accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.why-item__title { font-size: var(--fs-h3); margin-bottom: var(--sp-2); }
.why-item__desc { font-size: var(--fs-body); line-height: 1.5; }

.why__strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  margin-top: var(--sp-9);
}
.why-shot { margin: 0; }
.why-shot__frame { border: var(--border); }
.why-shot__frame > img {
  filter: grayscale(1) brightness(0.82);
  transition: filter var(--d-slow) var(--e-out), transform var(--d-slow) var(--e-out);
}
.why-shot:hover .why-shot__frame > img { filter: grayscale(0) brightness(1); transform: scale(1.03); }
.why-shot__cap {
  margin-top: var(--sp-3);
  color: var(--c-muted);
}

@media (max-width: 820px) {
  .why__inner { grid-template-columns: 1fr; gap: var(--sp-8); }
  .why__lead { position: static; }
}
@media (max-width: 560px) {
  .why__strip { grid-template-columns: 1fr; }
}

/* ============================================================
   6 · SELECTED WORK — the catalogue. Feature cards carry a real
   cover; coverless films become typographic plates.
   ============================================================ */

.work-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--grid-gap);
}
.work-card { grid-column: span 2; display: flex; }
.work-card--feature { grid-column: span 3; }

.work-card__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--c-surface);
  border: var(--border);
  transition: border-color var(--d-fast) var(--e-ease),
              transform var(--d-cut) var(--e-out);
}
.work-card__link:hover {
  border-color: var(--c-accent);
  transform: translateY(-3px);
}

.work-card__media { position: relative; border-bottom: var(--border); }
.work-card__media > img {
  filter: grayscale(0.3) contrast(1.02);
  transition: transform var(--d-slow) var(--e-out), filter var(--d-slow) var(--e-out);
}
.work-card__link:hover .work-card__media > img { transform: scale(1.04); filter: grayscale(0) contrast(1); }
.work-card__badge { position: absolute; top: var(--sp-3); left: var(--sp-3); z-index: var(--z-scrim); }

/* Typographic plate for coverless films */
.work-card__media--type {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--sp-4);
  aspect-ratio: var(--ar-wide);
  padding: var(--sp-6);
  background: linear-gradient(150deg, var(--c-surface-2), var(--c-bg));
}
.work-card__plate-year { color: var(--c-muted); }
.work-card__plate-title {
  font-size: clamp(1.6rem, 1rem + 2.4vw, 2.6rem);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tr-h2);
  line-height: 1;
  color: var(--c-text);
  text-wrap: balance;
}
.work-card__media--type .work-card__badge { position: static; align-self: flex-start; margin-top: var(--sp-2); }

.work-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-6);
  flex: 1 1 auto;
}
.work-card__kicker { color: var(--c-muted); }
.work-card__dot { margin-inline: 0.5em; color: var(--c-accent); }
.work-card__title { font-size: var(--fs-h3); transition: color var(--d-fast) var(--e-ease); }
.work-card__link:hover .work-card__title { color: var(--c-accent-ink); }
.work-card__line {
  color: var(--c-muted);
  font-size: var(--fs-body);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.work-card--feature .work-card__line { -webkit-line-clamp: 4; }
.work-card__cta {
  margin-top: auto;
  color: var(--c-accent-ink);
}
.work-card__cta span { display: inline-block; transition: transform var(--d-fast) var(--e-out); }
.work-card__link:hover .work-card__cta span { transform: translateX(4px); }

@media (max-width: 900px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .work-card, .work-card--feature { grid-column: span 1; }
}
@media (max-width: 560px) {
  .work-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   7 · TRUST — partner & festival plates on a sunk strip
   ============================================================ */

.trust { background: var(--c-surface); border-block: var(--border); }
.trust__eyebrow { justify-content: center; display: flex; margin-bottom: var(--sp-7); }
.trust__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-4);
  list-style: none;
}
.trust__item { display: inline-flex; }
.trust__stamp {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-3) var(--sp-6);
  border: var(--bw) solid var(--c-line-strong);
  font-size: var(--fs-small);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--c-muted);
  transition: color var(--d-fast) var(--e-ease),
              border-color var(--d-fast) var(--e-ease),
              background var(--d-fast) var(--e-ease);
}
.trust__item:hover .trust__stamp {
  color: var(--c-text);
  border-color: var(--c-accent);
  background: var(--c-accent-ghost);
}

/* ============================================================
   8 · BEHIND THE SCENES — horizontal reel (base .reel in layout.css)
   ============================================================ */

.bts__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  flex-wrap: wrap;
  margin-bottom: var(--sp-8);
}
.bts__nav { display: flex; gap: var(--sp-3); }
.bts__reel { padding-block: var(--sp-2); }

.bts-slide { display: flex; flex-direction: column; gap: var(--sp-4); margin: 0; height: 100%; }
.bts-slide__frame { position: relative; border: var(--border); }
.bts-slide__frame > img {
  filter: grayscale(1) contrast(1.05);
  transition: filter var(--d-slow) var(--e-out), transform var(--d-slow) var(--e-out);
}
.bts-slide:hover .bts-slide__frame > img { filter: grayscale(0) contrast(1); transform: scale(1.03); }
.bts-slide__no {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-scrim);
  padding: var(--sp-1) var(--sp-3);
  background: var(--c-accent);
  color: var(--on-accent);
  font-weight: var(--fw-semi);
  letter-spacing: var(--tr-label);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}
/* letterbox shutter at the bottom of each frame, retracts on hover */
.bts-slide__frame::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: var(--sp-2);
  background: var(--c-letterbox);
  transform-origin: bottom;
  transition: transform var(--d-cut) var(--e-cut);
  z-index: var(--z-scrim);
}
.bts-slide:hover .bts-slide__frame::after { transform: scaleY(0); }
.bts-slide__cap { color: var(--c-muted); }

.bts__foot { margin-top: var(--sp-8); }

@media (max-width: 560px) {
  .bts__nav { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   9 · CTA — the one place a large red accent leads
   ============================================================ */

.cta { padding-bottom: var(--sp-11); }
.cta__eyebrow { margin-bottom: var(--sp-6); }

/* The container the address is sized against — see contact.css: a
   viewport-based size overshoots this column and splits the address. */
.cta > .container { container-type: inline-size; }

.cta__mail {
  display: inline-block;
  /* 8.2cqw keeps "arslanfilm13@gmail.com" (11.55em wide) on one line at any width */
  font-size: min(var(--fs-mail), 8.2cqw);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tr-display);
  line-height: var(--lh-display);
  color: var(--c-accent);
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  transition: opacity var(--d-fast) var(--e-ease);
}
.cta__mail:hover { opacity: 0.72; }
.cta__blurb { margin-top: var(--sp-8); }
.cta__row { margin-top: var(--sp-8); }
