/* EVOS FILM home: the two sides of the company.
   Loaded after site.css on index.html only.

   Top of the page: a full-screen split, Production | Distribution, divided
   on a diagonal (after Olha's mockup). Each half is a link to its section
   below. Hovering a half gives it more room and pushes its photo in a
   little. On phones the halves stack.

   Only transform, opacity and flex-grow are animated. */

html { scroll-behavior: smooth; }

.home {
  --night: #0e1117;
  --line: rgba(255, 255, 255, 0.82);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Header over the split ---------- */

.home .site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  color: #fff;
  background: linear-gradient(to bottom, rgba(10, 12, 16, 0.55), rgba(10, 12, 16, 0));
}
.home .site-header .wrap { align-items: center; max-width: none; }
.logo { display: block; line-height: 0; }
.logo img { width: clamp(6.5rem, 11vw, 9rem); height: auto; }
.home .site-nav a { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35); }
.home :focus-visible { outline-color: #fff; }

/* ---------- The split ---------- */

.split {
  position: relative;
  display: flex;
  height: 100vh;
  height: 100svh;
  min-height: 36rem;
  overflow: hidden;
  background: var(--night);
  color: #fff;
  isolation: isolate;
}
.panel {
  position: relative;
  flex: 1 1 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: flex-grow 0.9s var(--ease);
}
.panel:hover, .panel:focus-visible { flex-grow: 1.28; }
.panel:focus-visible { outline: none; }

/* The diagonal: the right half overlaps the left and is cut on a slant. */
.panel--distribution {
  margin-left: -9vw;
  clip-path: polygon(9vw 0, 100% 0, 100% 100%, 0 100%);
}

.panel-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  transition: transform 1.6s var(--ease);
  will-change: transform;
}
.panel:hover .panel-bg, .panel:focus-visible .panel-bg { transform: scale(1.11); }
.panel--production .panel-bg {
  background-image: url("../podil.jpg");
  background-position: 45% 50%;
}
.panel--distribution .panel-bg {
  background-image: url("../ukrajina-cinema/poster-wall.jpg");
  filter: blur(1.5px) brightness(0.36) saturate(0.8);
}
/* Legibility: darken toward the text side and the bottom. */
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.panel--production::after {
  background:
    linear-gradient(90deg, rgba(10, 12, 16, 0.62) 0%, rgba(10, 12, 16, 0.25) 55%, rgba(10, 12, 16, 0.05) 100%),
    linear-gradient(to top, rgba(10, 12, 16, 0.55), rgba(10, 12, 16, 0) 45%);
}
.panel--distribution::after {
  background: linear-gradient(90deg, rgba(10, 12, 16, 0.6) 9vw, rgba(10, 12, 16, 0.25) 75%, rgba(10, 12, 16, 0.1) 100%);
}

.panel-body {
  position: relative;
  z-index: 2;
  padding-inline: max(6vw, 1.5rem) 2rem;
  padding-top: 4rem;
}
.panel--distribution .panel-body { padding-left: calc(9vw + max(3vw, 1.5rem)); }

.panel-title {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(1.9rem, 3.9vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0;
}
.panel-rule {
  display: block;
  width: 2.75rem;
  height: 1px;
  background: var(--line);
  margin: 1.4rem 0 1.2rem;
  transform-origin: left;
  transition: transform 0.9s var(--ease);
}
.panel:hover .panel-rule, .panel:focus-visible .panel-rule { transform: scaleX(2); }
.panel-sub {
  font-size: clamp(0.72rem, 1.05vw, 0.85rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0;
  max-width: 34ch;
}
.panel-arrow {
  display: grid;
  place-items: center;
  width: clamp(3.5rem, 5vw, 4.4rem);
  aspect-ratio: 1;
  margin-top: clamp(1.75rem, 4vh, 2.75rem);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
.panel-arrow svg { transition: transform 0.6s var(--ease); }
.panel:hover .panel-arrow, .panel:focus-visible .panel-arrow { background: #fff; color: var(--night); }
.panel:hover .panel-arrow svg, .panel:focus-visible .panel-arrow svg { transform: translateX(3px); }

/* Entrance: the halves slide in from their own sides, then the type rises. */
@keyframes split-in-left  { from { transform: translateX(-4%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes split-in-right { from { transform: translateX(4%);  opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes split-rise     { from { transform: translateY(1.25rem); opacity: 0; } to { transform: none; opacity: 1; } }
.panel--production   { animation: split-in-left 1.1s var(--ease) backwards; }
.panel--distribution { animation: split-in-right 1.1s var(--ease) 0.08s backwards; }
.panel-body > * { animation: split-rise 1s var(--ease) backwards; }
.panel--production .panel-body > :nth-child(1)   { animation-delay: 0.35s; }
.panel--production .panel-body > :nth-child(2)   { animation-delay: 0.45s; }
.panel--production .panel-body > :nth-child(3)   { animation-delay: 0.5s; }
.panel--production .panel-body > :nth-child(4)   { animation-delay: 0.6s; }
.panel--distribution .panel-body > :nth-child(1) { animation-delay: 0.45s; }
.panel--distribution .panel-body > :nth-child(2) { animation-delay: 0.55s; }
.panel--distribution .panel-body > :nth-child(3) { animation-delay: 0.6s; }
.panel--distribution .panel-body > :nth-child(4) { animation-delay: 0.7s; }

/* Phones and narrow tablets: stack the halves, keep a slanted seam. */
@media (max-width: 47.99rem) {
  .split { flex-direction: column; min-height: 40rem; }
  .panel { align-items: flex-end; }
  .panel:hover, .panel:focus-visible { flex-grow: 1; }
  .panel--distribution {
    margin-left: 0;
    margin-top: -7vh;
    clip-path: polygon(0 7vh, 100% 0, 100% 100%, 0 100%);
  }
  .panel--distribution::after { background: linear-gradient(to top, rgba(10, 12, 16, 0.65), rgba(10, 12, 16, 0.2)); }
  .panel-body { padding: 0 6rem 2rem 1.5rem; }  /* right side kept clear for the arrow */
  .panel--distribution .panel-body { padding-left: 1.5rem; padding-bottom: 2.25rem; }
  .panel-sub { line-height: 1.7; }
  .panel--production .panel-body { padding-bottom: calc(7vh + 1.75rem); }
  .panel-rule { margin: 0.9rem 0 0.8rem; }
  .panel-arrow { position: absolute; right: 1.5rem; bottom: 0; margin: 0; }
  .panel--production .panel-arrow { bottom: calc(7vh + 1.5rem); }
  .panel--distribution .panel-arrow { bottom: 2rem; }
  .panel-sub { max-width: 26ch; }
}

/* ---------- Section intros ---------- */

.side-intro { padding-block: var(--space) clamp(2rem, 5vw, 3.5rem); }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.side-intro h2 {
  font-size: clamp(2.4rem, 6vw, 4.25rem);
  margin-bottom: 1.5rem;
}
.side-intro .lede {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.4;
  max-width: 40ch;
}

.subsection-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: clamp(3rem, 7vw, 4.5rem) 0 1.25rem;
}

/* A poster-sized tile for projects that have no poster yet. */
.poster-tile {
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 3;
  padding: 0.75rem;
  background: #1c2230;
  color: #efe9d8;
  font-family: var(--serif);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}
.film .original {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--muted);
  margin: -0.4rem 0 0.9rem;
}

/* ---------- Distribution: Ukrajina Cinema ---------- */

.distribution {
  background: var(--night);
  color: #ece9e1;
  --muted: #a7acb8;           /* 7.9:1 on the night ground */
  --rule: rgba(255, 255, 255, 0.14);
  --focus: #ffd800;
  padding-bottom: var(--space);
}
.distribution :focus-visible { outline-color: var(--focus); }
.uc-logo { display: block; width: clamp(10rem, 20vw, 14rem); height: auto; }
.distribution .lede { color: #f4f1ea; }

.uc-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem clamp(2rem, 6vw, 4.5rem);
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}
.uc-figures strong {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 3.75rem);
  line-height: 1;
  color: #fff;
}
.uc-figures span { color: var(--muted); font-size: 0.95rem; }

.uc-films {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr));
  gap: 3rem clamp(1.25rem, 3vw, 2.25rem);
}
.uc-film { display: flex; flex-direction: column; }

/* All posters sit in the same 4:5 frame. Posters of another shape are shown
   whole (never cropped), over a blurred, darkened copy of themselves. */
.uc-poster {
  position: relative;
  aspect-ratio: 4 / 5;
  margin: 0 0 1.1rem;
  overflow: hidden;
  background: #1a1e27;
}
.uc-poster-bg {
  position: absolute;
  inset: -12%;
  background-position: center;
  background-size: cover;
  filter: blur(22px) brightness(0.45);
}
.uc-poster img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.9s var(--ease);
}
.uc-film:hover .uc-poster img { transform: scale(1.03); }

.uc-film h3 { font-size: clamp(1.35rem, 2.2vw, 1.6rem); margin-bottom: 0.2rem; }
.uc-film .original { font-family: var(--serif); font-size: 1.05rem; color: var(--muted); margin-bottom: 0.6rem; }
.uc-meta { font-size: 0.85rem; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 0.7rem; }
.uc-meta span + span::before { content: " · "; }
.uc-film p:last-child { font-size: 0.97rem; line-height: 1.55; }

/* Cards fade up as they scroll in (scroll-linked where supported). */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .uc-film {
      animation: split-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 22%;
    }
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
