@font-face {
  font-family: "Bungee Shade";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/bungee-shade-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Bungee Shade";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/bungee-shade-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Limelight";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/limelight-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Limelight";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/limelight-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Josefin Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/josefin-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Josefin Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/josefin-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #171716;
  --paper: #ebdec9;
}

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

html,
body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Josefin Sans", sans-serif;
}

html,
body,
main {
  overflow-x: clip;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: none;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  padding-right: max(clamp(1.25rem, 3vw, 2.5rem), env(safe-area-inset-right));
  padding-left: max(clamp(1.25rem, 3vw, 2.5rem), env(safe-area-inset-left));
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  background: var(--paper);
}

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

.hero__media::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, rgb(235 222 201 / 0.28), transparent 31%);
}

.hero__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: none;
  background: var(--paper);
}

.hero__title-card {
  position: relative;
  z-index: 1;
  width: min(80vw, 86rem);
  margin-inline: auto;
  padding-top: clamp(1rem, 2vh, 2rem);
  text-align: center;
  animation: fade-rise 800ms ease-out both;
}

.hero__kicker {
  margin: 0 0 clamp(0.8rem, 1.5vw, 1.4rem);
  font-family: "Josefin Sans", sans-serif;
  font-size: clamp(0.72rem, 1vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Bungee Shade", "Limelight", serif;
  font-size: clamp(3rem, 6.6vw, 7.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

h1::before,
h1::after {
  display: block;
  width: 100%;
  height: 1px;
  content: "";
  background: var(--ink);
}

h1::before {
  margin-bottom: clamp(0.75rem, 1.3vw, 1.25rem);
}

h1::after {
  margin-top: clamp(0.65rem, 1.1vw, 1rem);
}

.hero__tagline {
  margin: clamp(0.85rem, 1.4vw, 1.3rem) 0 0;
  font-size: clamp(0.82rem, 1.15vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
}

@media (max-width: 860px) {
  .hero {
    padding: clamp(1.25rem, 5vw, 2rem) 1rem 1.25rem;
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    grid-template-rows: auto minmax(0, 1fr);
  }

  .hero__media {
    position: relative;
    z-index: 0;
    width: 100vw;
    max-width: 100vw;
    /* pas 16:9 przy 100vw bywa wyższy niż ekran w landscape
       (np. 844x390 -> 475px) i wychodził poza sekcję; w portrait
       (375 -> 211px) limit się nie załącza */
    max-height: 58svh;
    margin-inline: calc(50% - 50vw);
    align-self: center;
    aspect-ratio: 16 / 9;
    grid-row: 2;
  }

  .hero__media::after {
    display: none;
  }

  .hero__video {
    object-fit: contain;
    object-position: center;
    transform: none;
  }

  .hero__title-card {
    width: min(100%, 42rem);
    padding-top: 1rem;
    grid-row: 1;
  }

  h1 {
    font-size: clamp(1.5rem, 7.2vw, 3.2rem);
    letter-spacing: -0.02em;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title-card {
    animation: none;
  }
}

.scene {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  padding-right: max(clamp(1.25rem, 3vw, 2.5rem), env(safe-area-inset-right));
  padding-left: max(clamp(1.25rem, 3vw, 2.5rem), env(safe-area-inset-left));
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  background: var(--paper);
}

.scene__heading {
  position: relative;
  z-index: 3;
  width: min(80rem, 84vw);
  margin-inline: auto;
  text-align: center;
  pointer-events: none;
}

.scene__heading > p,
.contact__copy > p:first-child {
  margin: 0 0 0.5rem;
  font-size: clamp(0.7rem, 0.9vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.scene h2,
.scroll-scrub h2,
.contact__copy h2 {
  margin: 0;
  font-family: "Limelight", serif;
  font-size: clamp(3rem, 7vw, 8rem);
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
}

.scene__media {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: var(--paper);
}

.scene__media video,
.scene__final {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--paper);
}

.scene__final {
  z-index: 1;
  opacity: 0;
  transition: opacity 160ms linear;
}

.scene[data-state="complete"] .scene__final {
  opacity: 1;
}

.scene__labels {
  position: relative;
  z-index: 3;
  display: grid;
  width: min(76rem, 88vw);
  margin: 0 auto;
  padding: 0;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.75rem, 2vw, 2rem);
  list-style: none;
  grid-row: 3;
  align-self: end;
}

.scene__labels li {
  padding: 0.85rem 1rem;
  border-top: 2px solid var(--ink);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  font-family: "Limelight", serif;
  font-size: clamp(0.9rem, 1.45vw, 1.35rem);
  text-align: center;
  text-transform: uppercase;
}

.scene__labels span {
  display: block;
  margin-bottom: 0.25rem;
  font-family: "Josefin Sans", sans-serif;
  font-size: 0.65em;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.iris {
  --iris-hole: 0px;
  position: relative;
  z-index: 30;
  height: 0;
  background: transparent;
  pointer-events: none;
}

/* Czarna plansza z okrągłym otworem - klasyczny iris-out/iris-in,
   nie rosnąca kropka. JS domyka otwór do zera dokładnie na styku sekcji.
   Otwór to kółko z gigantycznym box-shadow zamiast radial-gradient mask:
   maska była przeliczana i przemalowywana na całym ekranie w każdej klatce,
   co dławiło scroll. Teraz zmienia się tylko rozmiar jednego elementu,
   a tło to płaski kolor. */
.iris__disc {
  position: fixed;
  z-index: 40;
  top: 56%;
  left: 50%;
  width: var(--iris-hole);
  height: var(--iris-hole);
  border-radius: 50%;
  box-shadow: 0 0 0 100vmax #080808;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
}

.iris.is-active .iris__disc {
  visibility: visible;
}

.scroll-scrub {
  --ss-ink: var(--ink);
  --ss-muted: #54504a;
  --ss-bg: var(--paper);
  --ss-accent: #507d3a;
  --ss-object-position: center;
  --ss-mobile-position: center;
  height: 500svh;
}

.scroll-scrub__stage {
  background: var(--paper);
}

.scroll-scrub__layer {
  opacity: 1;
}

.scroll-scrub__poster,
.showreel__canvas,
.showreel__reduced {
  background: var(--paper);
}

.showreel__canvas {
  z-index: 1;
}

.showreel__reduced {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene__heading--scrub {
  position: absolute;
  top: clamp(1.5rem, 5vh, 4rem);
  right: 0;
  left: 0;
}

.showreel__labels {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: clamp(3rem, 8vh, 6rem);
  left: 0;
  display: flex;
  width: min(68rem, 88vw);
  margin-inline: auto;
  justify-content: center;
  pointer-events: none;
}

.showreel__labels span {
  position: absolute;
  padding: 0.7rem 1rem;
  border: 2px solid var(--ink);
  color: var(--paper);
  background: var(--ink);
  font-family: "Limelight", serif;
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 180ms linear, transform 180ms ease-out;
}

.showreel__labels .is-active {
  opacity: 1;
  transform: none;
}

.showreel__hint {
  position: absolute;
  z-index: 4;
  right: 1.25rem;
  bottom: 1rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scene--contact {
  display: block;
  padding: 0;
}

.contact__copy {
  position: absolute;
  z-index: 3;
  top: 20%;
  right: 50%;
  width: min(58rem, 68vw);
  text-align: center;
  transform: translateX(50%);
}

.contact__copy > p:not(:first-child) {
  margin: 1.25rem 0 1.5rem;
  font-size: clamp(0.95rem, 1.35vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.contact__copy a {
  display: inline-block;
  padding: 0.9rem 1.35rem 0.75rem;
  border: 2px solid var(--ink);
  color: var(--paper);
  background: var(--ink);
  font-family: "Limelight", serif;
  font-size: clamp(0.95rem, 1.4vw, 1.25rem);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease, background 160ms ease;
}

.contact__copy a:hover,
.contact__copy a:focus-visible {
  color: var(--ink);
  background: var(--paper);
}

.contact__copy a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

@media (max-width: 860px) {
  .scene {
    padding: 1.5rem 1rem;
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .scene__heading {
    width: min(100%, 42rem);
    margin-bottom: 1rem;
  }

  .scene h2,
  .scroll-scrub h2,
  .contact__copy h2 {
    font-size: clamp(2.5rem, 11vw, 5rem);
  }

  .scene__media {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    max-height: 48svh;
    margin-inline: calc(50% - 50vw);
    align-self: center;
    aspect-ratio: 16 / 9;
  }

  .scene__media video,
  .scene__final {
    object-fit: contain;
  }

  .scene__labels {
    width: 100%;
    gap: 0.4rem;
  }

  .scene__labels li {
    padding: 0.65rem 0.35rem;
    font-size: clamp(0.68rem, 3.1vw, 0.9rem);
  }

  .scroll-scrub {
    height: 460svh;
  }

  .scroll-scrub__poster,
  .showreel__reduced {
    object-fit: contain;
  }

  .scene__heading--scrub {
    top: 1.25rem;
  }

  .showreel__labels {
    bottom: 4.5rem;
  }

  .showreel__labels span {
    font-size: 0.9rem;
  }

  .showreel__hint {
    right: 0;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    left: 0;
    text-align: center;
  }

  .scene--contact {
    display: grid;
    min-height: 100svh;
    padding: 1.5rem 1rem;
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .scene--contact .scene__media {
    grid-row: 2;
  }

  .contact__copy {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    padding-top: 1rem;
    grid-row: 1;
    transform: none;
  }
}

/* ============================================================
   ULTRAWIDE (21:9 i szersze)
   Wszystkie assety (wideo, postery, klatki scrubu) są 16:9.
   Rozciąganie ich coverem na 2.39:1 ucinało ~24% kadru w pionie
   (na hero widać było tylko środkowy pas). Zamiast tego kadrujemy
   świadomie: kadr 16:9 na pełną wysokość, wyśrodkowany, a boczne
   marginesy zostają papierem z włosową ramką - jak plansza filmowa.
   ============================================================ */
@media (min-aspect-ratio: 1.9 / 1) and (min-width: 861px) {
  :root {
    /* szerokość kadru 16:9 przy pełnej wysokości ekranu */
    --stage-w: min(100vw, calc(100svh * 16 / 9));
    --stage-gutter: calc((100vw - var(--stage-w)) / 2);
  }

  .hero__video,
  .scene__media video,
  .scene__final,
  .scroll-scrub__poster,
  .showreel__reduced {
    object-fit: contain;
    object-position: center;
  }

  /* włosowe linie na krawędziach kadru - ta sama typografia kreski
     co h1::before / .scene__labels li */
  .hero__media::before,
  .scene__media::before,
  .scroll-scrub__stage::after {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: var(--stage-w);
    margin-inline: auto;
    content: "";
    border-right: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
    border-left: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
    pointer-events: none;
  }

  .hero__media::after {
    background: linear-gradient(180deg, rgb(235 222 201 / 0.28), transparent 22%);
  }

  /* treść trzyma się kadru, nie krawędzi 3440px */
  .hero__title-card,
  .scene__heading,
  .contact__copy {
    width: min(80rem, calc(var(--stage-w) - 6rem));
  }

  .scene__labels,
  .showreel__labels {
    width: min(76rem, calc(var(--stage-w) - 6rem));
  }

  .showreel__hint {
    right: calc(var(--stage-gutter) + 1.25rem);
  }

  /* pasek postępu trzyma się kadru, nie ciągnie się przez papierowe marginesy */
  .scroll-scrub__progress {
    right: var(--stage-gutter);
    left: var(--stage-gutter);
  }
}

@media (prefers-reduced-motion: reduce) {
  .iris {
    height: 4px;
    background: var(--ink);
  }

  .iris__disc {
    display: none !important;
  }

  .scene__media video,
  .scroll-scrub__poster,
  .showreel__canvas,
  .showreel__hint,
  .scroll-scrub__progress {
    display: none;
  }

  .scene__final,
  .showreel__reduced {
    display: block;
    opacity: 1;
  }

  .scroll-scrub {
    height: auto;
  }

  .scroll-scrub__stage {
    position: relative;
    min-height: 100svh;
  }
}

/* ============================================================
   BEZ JAVASCRIPTU
   Wideo mają źródła w data-src, a statyczne podmianki (.scene__final,
   .showreel__reduced) są domyślnie ukryte - bez JS strona pokazywała
   pustą kanwę przez ~4500 px sekcji "Wybrane realizacje". Klasę no-js
   zdejmuje pierwsza linia app.js, więc reguły łapią zarówno wyłączony
   JavaScript, jak i zablokowany/niewczytany plik skryptu.
   Stan docelowy ten sam co przy prefers-reduced-motion: statyczne kadry.
   ============================================================ */
.no-js .iris {
  height: 4px;
  background: var(--ink);
}

.no-js .iris__disc {
  display: none !important;
}

.no-js .scene__media video,
.no-js .scroll-scrub__poster,
.no-js .showreel__canvas,
.no-js .showreel__hint,
.no-js .scroll-scrub__progress {
  display: none;
}

.no-js .scene__final,
.no-js .showreel__reduced {
  display: block;
  opacity: 1;
}

.no-js .scroll-scrub {
  height: auto;
}

.no-js .scroll-scrub__stage {
  position: relative;
  min-height: 100svh;
}

/* Bez JS pasek postępu i podpowiedź o przewijaniu znikają, ale etykiety zostają.
   Domyślnie widoczna jest tylko pierwsza (JS przełącza resztę), więc statyczny
   kadr byłby zawsze podpisany "Film animowany". Pokazujemy wszystkie trzy jako
   zwykłą listę zakresu prac. */
.no-js .showreel__labels span {
  opacity: 1;
}
