/* ==========================================================================
   kacpermajdan.com — arkusz stylów
   Kolory, kroje i odstępy są zdefiniowane w :root — zmiana tam zmienia całą stronę.
   ========================================================================== */

/* ---------- Fonty (lokalne, bez Google Fonts) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-standard-normal.woff2") format("woff2");
  font-weight: 500 900;
  font-stretch: 62% 100%;
  font-style: normal;
  font-display: swap;
  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: "Archivo";
  src: url("../fonts/archivo-latin-ext-standard-normal.woff2") format("woff2");
  font-weight: 500 900;          /* musi być identycznie jak w pliku podstawowym, inaczej przeglądarka nie łączy plików */
  font-stretch: 62% 100%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0104-0107, U+0118-0119, U+0141-0144, U+015A-015B, U+0179-017C;   /* tylko polskie litery */
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  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: "Newsreader";
  src: url("../fonts/newsreader-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0104-0107, U+0118-0119, U+0141-0144, U+015A-015B, U+0179-017C;   /* tylko polskie litery */
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
  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: "Newsreader";
  src: url("../fonts/newsreader-latin-ext-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0104-0107, U+0118-0119, U+0141-0144, U+015A-015B, U+0179-017C;   /* tylko polskie litery */
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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: "Geist";
  src: url("../fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0104-0107, U+0118-0119, U+0141-0144, U+015A-015B, U+0179-017C;   /* tylko polskie litery */
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  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: "Geist";
  src: url("../fonts/geist-latin-ext-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0104-0107, U+0118-0119, U+0141-0144, U+015A-015B, U+0179-017C;   /* tylko polskie litery */
}

/* ---------- Tokeny ---------- */
:root {
  --ink: #000;
  --text: #17191a;
  --paper: #fff;
  --graphite: #5b6265;
  --rule: #dcdfe0;
  --mist: #f1f2f2;
  --studio-hi: #d3d7d8;
  --studio-mid: #bfc4c5;
  --studio-lo: #9ba1a3;
  --error: #a1271d;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --text: "Geist", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1360px;
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(96px, 11vw, 168px);
  --header-h: clamp(68px, 6vw, 84px);

  --ease-out: cubic-bezier(.16, .84, .24, 1);
  --ease-curtain: cubic-bezier(.76, 0, .24, 1);
}

/* ---------- Baza ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--text);
  font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
  line-height: 1.65;
  font-weight: 380;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
em { font-style: italic; }
::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-family: var(--text);
  font-size: 15px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Typografia wspólna ---------- */
.display {
  font-family: var(--sans);
  font-stretch: 74%;
  font-weight: 640;
  font-size: clamp(2.5rem, 1.7rem + 3vw, 4.5rem);
  line-height: 0.96;
  letter-spacing: -0.014em;
  color: var(--ink);
}
.title-sm {
  font-family: var(--text);
  font-stretch: 100%;
  font-weight: 540;
  font-size: clamp(1.25rem, 1.15rem + 0.35vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.meta {
  font-family: var(--text);
  font-size: 15px;
  font-weight: 420;
  line-height: 1.45;
  color: var(--graphite);
}

/* link z kreską, która przesuwa się przy najechaniu */
.link {
  font-family: var(--text);
  font-weight: 540;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1.5px no-repeat;
  padding-bottom: 3px;
  transition: background-size 0.5s var(--ease-out), background-position 0s 0.5s;
}
.link:hover {
  background-size: 0% 1.5px;
  background-position: right bottom;
  transition: background-size 0.5s var(--ease-out);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  cursor: pointer;
  font-family: var(--text);
  font-weight: 540;
  font-size: 16px;
  letter-spacing: 0.005em;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.45s var(--ease-out);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  /* po najechaniu: ten sam kolor przycisku, tylko o ton jaśniejszy (bez obwódki i bez odwracania barw) */
  background: color-mix(in srgb, var(--ink) 85%, var(--paper));
  transform: translateY(101%);
  transition: transform 0.55s var(--ease-out);
}
@media (hover: hover) {
  .btn:hover::before { transform: none; }
}

/* ---------- Nagłówek (przyklejony, chowa się przy przewijaniu w dół) ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: transform 0.45s var(--ease-out), background-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  font-family: var(--text);
  font-size: clamp(1.0625rem, 0.95rem + 0.35vw, 1.25rem);
  font-weight: 520;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.brand { text-decoration: none; letter-spacing: -0.005em; }
.nav { display: flex; gap: clamp(22px, 3.2vw, 44px); }
.nav a, .brand {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) right bottom / 0% 1.5px no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.45s var(--ease-out);
}
.nav a:hover, .brand:hover, .nav a[aria-current="page"] {
  background-size: 100% 1.5px;
  background-position: left bottom;
}
main.page { padding-top: var(--header-h); }

/* ---------- Hero (okładka) ---------- */
.hero {
  --hh: max(100svh, 640px);
  --ph: min(calc(var(--hh) * 1.02), 1180px);   /* wysokość zdjęcia */
  --pw: calc(var(--ph) * 0.6647);              /* szerokość zdjęcia (proporcje 1150×1730) */
  /* nazwisko na wysokości szyi i ramion; R i M lekko chowają się za postacią.
     Krawędzie sylwetki na tej wysokości: ok. 36% i 61% szerokości zdjęcia (oś zdjęcia: 46,5%). */
  --eL: calc((0.465 - 0.362) * var(--pw));     /* od środka strony do lewej krawędzi sylwetki */
  --eR: calc((0.612 - 0.465) * var(--pw));      /* od środka strony do prawej krawędzi sylwetki */
  --mf: min(15vw, calc(0.22 * var(--ph)),
            calc((50vw - var(--eL) - var(--gutter)) / 2.82),
            calc((50vw - var(--eR) - var(--gutter)) / 2.92));
  position: relative;
  height: var(--hh);
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 76% at 50% 40%, var(--studio-hi) 0%, var(--studio-mid) 50%, var(--studio-lo) 100%);
  isolation: isolate;
}
.masthead {
  position: absolute;
  left: 0; right: 0;
  /* środek nazwiska na wysokości szyi (ok. 46% wysokości zdjęcia) */
  top: calc(var(--hh) - var(--ph) + 0.465 * var(--ph) - 0.4 * var(--mf));
  height: calc(0.8 * var(--mf));
  z-index: 1;
  display: block;
  padding: 0;
  font-family: var(--sans);
  font-stretch: 62%;
  font-weight: 860;
  font-size: var(--mf);
  line-height: 0.8;
  letter-spacing: -0.006em;
  text-transform: uppercase;
  color: var(--ink);
}
.masthead span { position: absolute; top: 0; display: block; white-space: nowrap; will-change: translate; }
.masthead span:first-child { right: calc(50% + var(--eL) - 0.1 * var(--mf)); }
.masthead span:last-child  { left: calc(50% + var(--eR) - 0.12 * var(--mf)); }
.hero-portrait {
  position: absolute;
  bottom: 0;
  left: calc(50% - 0.465 * var(--pw));
  z-index: 2;
  width: var(--pw);
  height: var(--ph);
  max-width: none;
  object-fit: contain;
  object-position: bottom center;
  pointer-events: none;
  will-change: translate;
}
.hero-cover {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  bottom: clamp(28px, 6vh, 64px);
  max-width: min(22ch, calc(50% - 0.33 * var(--pw) - var(--gutter) - 16px));
  margin: 0;
  font-family: var(--text);
  font-stretch: 100%;
  font-weight: 460;
  font-size: clamp(1.375rem, 0.95rem + 1.05vw, 2.125rem);
  line-height: 1.14;
  letter-spacing: -0.018em;
  text-wrap: balance;
  color: var(--ink);
}
.hero-cta {
  position: absolute;
  z-index: 3;
  right: var(--gutter);
  bottom: clamp(28px, 6vh, 64px);
}

/* wejście okładki: imię i nazwisko wysuwają się zza postaci, zdjęcie wyłania się */
@media (prefers-reduced-motion: no-preference) {
  .masthead span:first-child { animation: from-left 0.95s var(--ease-out) 0.05s both; }
  .masthead span:last-child  { animation: from-right 0.95s var(--ease-out) 0.05s both; }
  .hero-portrait { animation: rise 1.1s var(--ease-out) both; }
  .hero-cover { animation: fade-up 0.8s var(--ease-out) 0.45s both; }
  .hero-cta { animation: fade-up 0.8s var(--ease-out) 0.55s both; }
  .home .site-header { animation: fade 0.8s ease 0.5s both; }
}
@keyframes from-left  { from { transform: translateX(12vw); opacity: 0.01; } 30% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes from-right { from { transform: translateX(-12vw); opacity: 0.01; } 30% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(4%) scale(1.02); opacity: 0.01; } to { transform: none; opacity: 1; } }
@keyframes fade-up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* telefon i tablet pionowo: nazwisko nad zdjęciem */
@media (max-width: 860px), (orientation: portrait) and (max-width: 1180px) {
  .hero {
    --mf: min(25.5vw, 290px);
    --ph: min(68svh, 150vw, 1100px);
    height: auto;
    display: flex;
    flex-direction: column;
    padding-top: calc(var(--header-h) + 4px);
    background:
      radial-gradient(ellipse 120% 70% at 50% 72%, var(--studio-hi) 0%, var(--studio-mid) 52%, var(--studio-lo) 100%);
  }
  .masthead {
    position: relative;
    top: auto;
    height: auto;
    display: block;
    padding: 0 var(--gutter);
    line-height: 0.82;
    order: 1;
  }
  .masthead span, .masthead span:first-child, .masthead span:last-child { position: static; left: auto; right: auto; }
  .hero-cover {
    order: 2;
    position: relative;
    left: auto; bottom: auto;
    max-width: 20ch;
    margin: clamp(20px, 3vw, 36px) var(--gutter) 0;
    font-size: clamp(1.5rem, 1rem + 2.2vw, 2.5rem);
  }
  .hero-cta {
    order: 3;
    position: relative;
    right: auto; bottom: auto;
    align-self: flex-start;
    margin: clamp(20px, 3vw, 32px) var(--gutter) 0;
  }
  .hero-portrait {
    order: 4;
    position: relative;
    left: auto;
    align-self: center;
    /* górne ~17% zdjęcia jest puste, więc zachodzi pod przycisk */
    margin-top: calc(-0.1 * var(--ph));
    transform: translateX(4.5%);
  }
}
@media (max-width: 860px) and (prefers-reduced-motion: no-preference),
       (orientation: portrait) and (max-width: 1180px) and (prefers-reduced-motion: no-preference) {
  .masthead span:first-child { animation-name: from-left-m; }
  .masthead span:last-child  { animation-name: from-right-m; }
  @keyframes from-left-m  { from { transform: translateX(-8vw); opacity: 0.01; } to { transform: none; opacity: 1; } }
  @keyframes from-right-m { from { transform: translateX(8vw);  opacity: 0.01; } to { transform: none; opacity: 1; } }
}
@media (max-width: 860px) and (prefers-reduced-motion: no-preference),
       (orientation: portrait) and (max-width: 1180px) and (prefers-reduced-motion: no-preference) {
  .hero-portrait { animation-name: rise-m; }
  @keyframes rise-m { from { transform: translate(4.5%, 4%); opacity: 0.01; } to { transform: translateX(4.5%); opacity: 1; } }
}

/* ---------- Sekcje strony głównej ---------- */
.section { padding-top: var(--section); }

/* wstęp */
.standfirst { padding-top: clamp(80px, 10vw, 152px); }
.standfirst-inner { max-width: 1180px; margin-left: auto; }
.standfirst .lead {
  font-family: var(--serif);
  font-size: clamp(1.625rem, 0.9rem + 2.3vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: -0.018em;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: clamp(32px, 4vw, 56px);
  text-wrap: pretty;
}
.standfirst .lead .wd { transition: color 0.3s ease; }
.js .standfirst .lead .wd { color: #c9cdce; }
.js .standfirst .lead .wd.on { color: var(--ink); }
.standfirst .more {
  max-width: 52ch;
  margin-left: auto;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem);
  line-height: 1.6;
  color: var(--graphite);
}

/* układ: tytuł po lewej, treść po prawej */
.split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2.4vw, 32px);
  row-gap: 32px;
}
.split > .split-head { grid-column: 1 / span 4; }
.split > .split-body { grid-column: 5 / span 8; }
.split-body > p { max-width: 60ch; }
@media (max-width: 860px) {
  .split > .split-head, .split > .split-body { grid-column: 1 / -1; }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: clamp(40px, 5vw, 72px);
}

/* usługi: wielkie słowa, które „zapisują się” przy przewijaniu jak kolejne rozdziały historii
   (czarna warstwa przesuwana transformacją — płynne nawet na słabszych komputerach) */
.acts { margin: clamp(40px, 5vw, 72px) 0 0; padding: 0; list-style: none; }
.act {
  position: relative;
  padding: clamp(20px, 2.4vw, 32px) 0 clamp(36px, 4.4vw, 64px);
  border-top: 1px solid var(--rule);
}
.act-word {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin: 0 0 clamp(14px, 2vw, 28px);
  font-family: var(--sans);
  font-stretch: 62%;
  font-weight: 860;
  font-size: calc(min(100vw - 2 * var(--gutter), var(--wrap)) / 5.5);
  line-height: 0.8;
  letter-spacing: -0.006em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}
.act-ghost { display: block; }
.act-ink { display: none; }
.js .act-ghost { color: #dde0e1; }
.js .act-ink {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: translate3d(-100%, 0, 0);
  will-change: transform;
}
.js .act-ink > span {
  display: block;
  color: var(--ink);
  transform: translate3d(100%, 0, 0);
  will-change: transform;
}
.js .act:hover .act-ink, .js .act:hover .act-ink > span {
  transform: none !important;
  transition: transform 0.6s var(--ease-out);
}
.act-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2.4vw, 32px);
  align-items: baseline;
}
.act-title {
  grid-column: 1 / span 5;
  font-family: var(--text);
  font-weight: 520;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.5rem);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.act-body p {
  grid-column: 7 / span 6;
  margin: 0;
  max-width: 48ch;
  color: var(--graphite);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
}
@media (max-width: 760px) {
  .act-title, .act-body p { grid-column: 1 / -1; }
  .act-title { margin-bottom: 10px; }
}

/* przewijane role, jak napisy końcowe */
.marquee {
  margin: clamp(56px, 7vw, 104px) calc(-1 * var(--gutter)) 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-family: var(--sans);
  font-stretch: 70%;
  font-weight: 560;
  font-size: clamp(2.25rem, 1.2rem + 4.2vw, 5.5rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.marquee span::after {
  content: "";
  width: 0.2em; height: 0.2em;
  margin: 0 0.55em;
  border-radius: 50%;
  background: var(--studio-lo);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* logotypy */
.logos {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  align-items: center;
  gap: clamp(16px, 4vw, 64px);
  margin: clamp(48px, 6vw, 88px) 0 0;
  padding: clamp(28px, 3.5vw, 48px) 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}
.logos li { display: flex; align-items: center; justify-content: center; min-height: clamp(64px, 8vw, 104px); }
.logos img {
  width: auto; max-width: 100%;
  height: var(--h, 56px);
  object-fit: contain;
  opacity: 0.86;
  transition: opacity 0.4s ease, transform 0.6s var(--ease-out);
}
.logos li:hover img { opacity: 1; transform: scale(1.04); }
@media (max-width: 860px) {
  .logos--exp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logos img { height: calc(var(--h, 56px) * 0.8); }
}
@media (max-width: 520px) {
  /* uczelnie zawsze w jednej linii */
  .logos--edu img { height: calc(var(--h, 56px) * 0.62); }
}

/* doświadczenie: logotypy marek z opisem */
.brands {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 2.6vw, 44px);
  margin: clamp(56px, 7vw, 104px) 0 0;
  padding: 0;
  list-style: none;
}
.brand-item {
  position: relative;
  padding-top: clamp(26px, 3vw, 40px);
  border-top: 1px solid var(--rule);
}
.brand-item::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}
.brand-item:hover::before { transform: none; }
.brand-logos {
  display: flex;
  align-items: center;
  gap: 22px;
  height: clamp(72px, 7vw, 100px);
  margin-bottom: clamp(20px, 2.4vw, 32px);
}
.brand-logos img {
  width: auto;
  max-width: 100%;
  height: var(--h, 40px);
  object-fit: contain;
  transition: transform 0.6s var(--ease-out);
  transform-origin: left center;
}
.brand-item:hover .brand-logos img { transform: scale(1.04); }
.brand-name {
  margin: 0 0 8px;
  font-family: var(--text);
  font-weight: 560;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.25rem);
  letter-spacing: -0.012em;
  color: var(--ink);
}
.brand-text p { margin: 0; max-width: 30ch; color: var(--graphite); }
@media (max-width: 1100px) and (min-width: 861px) {
  .brands { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: clamp(40px, 5vw, 64px); }
}
@media (max-width: 860px) {
  .brands { grid-template-columns: 1fr; gap: 0; }
  .brand-item {
    display: grid;
    grid-template-columns: minmax(96px, 30%) 1fr;
    column-gap: 24px;
    align-items: center;
    padding: 24px 0;
  }
  .brand-logos { height: auto; margin: 0; flex-direction: column; align-items: flex-start; gap: 10px; }
  .brand-logos img { height: calc(var(--h, 40px) * 0.72); }
}

/* certyfikat */
.figure-cert { margin: clamp(32px, 4vw, 56px) 0 0; max-width: 460px; }
.figure-cert img { border: 1px solid var(--rule); }
.figure-cert figcaption { margin-top: 12px; }

/* miniatury projektów (strona „Projekty”) */
.feature-media { display: block; overflow: hidden; background: var(--mist); }
.feature-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}
.feature-media:hover img { transform: scale(1.035); }

/* ---------- Scena studyjna: miękkie światło za kursorem (okładka i stopka) ---------- */
.stage { position: relative; isolation: isolate; }
.spot {
  position: absolute;
  left: 50%; top: 40%;
  z-index: 0;
  width: min(110vmax, 1400px);
  aspect-ratio: 1;
  margin-left: calc(min(110vmax, 1400px) / -2);
  margin-top: calc(min(110vmax, 1400px) / -2);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.12) 45%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  will-change: transform;
}
@media (hover: none) and (prefers-reduced-motion: no-preference) {
  .spot { animation: drift 12s ease-in-out infinite alternate; }
}
@keyframes drift {
  0%   { transform: translate3d(-14%, -6%, 0); }
  100% { transform: translate3d(14%, 8%, 0); }
}

/* ---------- Kontakt i stopka: list do uzupełnienia ---------- */
.contact {
  margin-top: var(--section);
  padding-top: clamp(96px, 11vw, 176px);
  background:
    radial-gradient(ellipse 70% 90% at 50% 30%, var(--studio-hi) 0%, var(--studio-mid) 55%, var(--studio-lo) 100%);
  color: var(--ink);
  overflow: hidden;
}
.contact .wrap { position: relative; z-index: 1; }
.contact-title {
  font-family: var(--sans);
  font-stretch: 62%;
  font-weight: 860;
  font-size: min(12.4vw, 8.6rem);
  line-height: 0.96;
  letter-spacing: -0.006em;
  text-transform: uppercase;
  max-width: 15ch;
  text-wrap: balance;
}
.letter { margin-top: clamp(40px, 5vw, 72px); max-width: 1100px; }
.letter-text {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.5rem, 0.95rem + 2.1vw, 3rem);
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.slot { position: relative; display: inline-block; vertical-align: baseline; }
.slot input, .slot select {
  font: inherit;
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0 0.1em;
  margin: 0;
  min-width: 4ch;
  field-sizing: content;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.slot input { width: var(--w, 9ch); }
.slot-choice {
  font: inherit;
  font-style: italic;
  font-weight: 400;
  line-height: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0 0.95em 0 0.1em;
  cursor: pointer;
  white-space: nowrap;
}
.slot-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: max(100%, 220px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 18px 40px -14px rgba(0, 0, 0, 0.32);
  font-family: var(--text);
  font-size: 16px;
  font-style: normal;
  font-weight: 450;
  line-height: 1.3;
  letter-spacing: -0.006em;
  white-space: nowrap;
  outline: none;
}
.slot-menu[hidden] { display: none; }
.slot-menu li {
  position: relative;
  padding: 11px 16px 11px 36px;
  border-radius: 9px;
  color: var(--ink);
  cursor: pointer;
}
.slot-menu li.is-active { background: rgba(0, 0, 0, 0.06); }
.slot-menu li[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: 14px; top: 50%;
  width: 10px; height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-75%) rotate(-45deg);
}
.slot.is-open .slot-line { transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .slot-menu:not([hidden]) { animation: menu-in 0.22s var(--ease-out) both; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@supports (field-sizing: content) { .slot input { width: auto; } }
.slot input::placeholder { color: rgba(0, 0, 0, 0.42); }
.slot select { padding-right: 0.9em; cursor: pointer; }
.slot--select::after {
  content: "";
  position: absolute;
  right: 0.12em; top: 50%;
  width: 0.32em; height: 0.32em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.slot::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.08em;
  height: 2px;
  background: rgba(0, 0, 0, 0.28);
}
.slot::after { z-index: 1; }
.slot-line {
  position: absolute;
  left: 0; right: 0; bottom: 0.08em;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
  pointer-events: none;
}
.slot:focus-within .slot-line, .slot.is-filled .slot-line { transform: none; }
.letter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: clamp(32px, 4vw, 56px);
}
.btn--send { min-height: 64px; padding: 0 32px 0 34px; font-size: 18px; gap: 14px; }
.btn--send svg { width: 22px; height: 22px; flex: none; transition: transform 0.6s var(--ease-out); }
.btn--send:hover svg { transform: translate(3px, -3px); }
.btn--send.is-sending svg { animation: fly 0.9s var(--ease-out) both; }
@keyframes fly {
  0%   { transform: none; opacity: 1; }
  30%  { transform: translate(-3px, 3px); }
  70%  { transform: translate(60px, -46px) rotate(10deg); opacity: 0; }
  71%  { transform: translate(-30px, 20px); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
/* pułapka na boty (Web3Forms odrzuca zgłoszenia z zaznaczonym polem) */
.letter .hp { display: none; }

/* druga linijka listu: adres do odpowiedzi */
.letter-reply { margin-top: 0.2em; }
.slot--mail { max-width: 100%; }
.slot--mail input { max-width: 100%; min-width: 7ch; }

/* kolejność kroków: bez JS widać wszystko i działa zwykła wysyłka formularza */
.letter:not(.is-enhanced) .letter-open { display: none; }
.letter.is-enhanced:not(.is-open) .letter-reply,
.letter.is-enhanced:not(.is-open) .letter-submit,
.letter.is-open .letter-open { display: none; }

.letter-note {
  margin: 18px 0 0;
  min-height: 1.5em;
  max-width: 60ch;
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.62);
}
.letter-note.is-error { color: var(--ink); }
.letter-note a { color: inherit; text-underline-offset: 3px; }

/* błąd: czerwona linia i krótkie drgnięcie pola */
.slot.is-invalid::before, .slot.is-invalid .slot-line { background: var(--error); }
.slot.is-invalid .slot-line { transform: none; }

.btn--send:disabled { cursor: progress; }
.btn--send.is-sending svg { animation: fly 1.1s var(--ease-out) infinite; }

.letter-done:focus { outline: none; }
.letter-done .letter-text em { font-style: italic; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: no-preference) {
  .letter.is-open .letter-reply { animation: fade-up 0.6s var(--ease-out) both; }
  .letter.is-open .letter-reply .slot-line { transition-delay: 0.25s; }
  .letter.is-open .letter-submit { animation: fade-up 0.6s var(--ease-out) 0.12s both; }
  .slot.is-invalid { animation: nudge 0.45s ease; }
  .letter.is-sent .letter-body { opacity: 0; transform: translateY(-14px); transition: opacity 0.45s ease, transform 0.5s var(--ease-out); }
  .letter-done:not([hidden]) { animation: fade-up 0.7s var(--ease-out) both; }
}
@keyframes nudge {
  0%, 100% { transform: none; }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.footer-bar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: clamp(96px, 10vw, 160px);
  padding-top: 22px;
  padding-bottom: 28px;
  border-top: 1px solid rgba(0, 0, 0, 0.14);
  font-family: var(--text);
  font-size: 14px;
  color: rgba(0, 0, 0, 0.62);
}
.footer-bar nav { display: flex; gap: 24px; }
.footer-bar a { text-decoration: none; }
.footer-bar a:hover { color: var(--ink); }

/* przycisk przyciągany przez kursor */
[data-magnetic] { transition: translate 0.35s var(--ease-out), color 0.35s var(--ease-out); }


/* ---------- Strona „Projekty” ---------- */
.page-head { padding-top: clamp(56px, 8vw, 120px); padding-bottom: clamp(48px, 6vw, 96px); }
.page-title {
  font-family: var(--sans);
  font-stretch: 62%;
  font-weight: 820;
  font-size: min(clamp(4.5rem, 1.5rem + 13vw, 15rem), 24vw);
  line-height: 0.8;
  letter-spacing: -0.006em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ==========================================================================
   Strona „Projekty”: każdy projekt to scena w barwach jego własnego świata
   ========================================================================== */
:root {
  --bg-stan: radial-gradient(ellipse 80% 90% at 64% 42%, #f8f7f3 0%, #f3f1ec 55%, #e9e6e0 100%);
  --bg-helena: radial-gradient(ellipse 72% 82% at 58% 42%, #ea9a4c 0%, #d77b31 42%, #c06021 82%, #aa4e19 100%);
  --bg-royalsi: radial-gradient(ellipse 78% 88% at 62% 38%, #7d1322 0%, #4e0b15 46%, #22050a 100%);
  --bg-podcast: radial-gradient(ellipse 70% 85% at 70% 42%, #c87a83 0%, #ad5c66 38%, #87404b 72%, #6a2e38 100%);
  --pj-size: min(12.2vw, 13.5rem);
  --pj-gap: clamp(36px, 4vw, 64px);
}
/* barwy tekstu w scenach (z JS: na całej stronie naraz; bez JS: w obrębie sekcji) */
html[data-scene="neutral"], html:not(.has-scenes) .projects-page {
  --fg: #000; --fg-2: #5b6265; --line: rgba(0, 0, 0, 0.14); --accent: #5b6265;
  --bar: rgba(255, 255, 255, 0.94); --btn-fg: #fff;
}
html[data-scene="stan"], html:not(.has-scenes) [data-scene-id="stan"] {
  --fg: #1d1915; --fg-2: rgba(29, 25, 21, 0.72); --line: rgba(29, 25, 21, 0.18); --accent: #9a5520;
  --bar: rgba(241, 234, 226, 0.92); --btn-fg: #f3ece4;
}
html[data-scene="helena"], html:not(.has-scenes) [data-scene-id="helena"] {
  --fg: #140803; --fg-2: rgba(20, 8, 3, 0.86); --line: rgba(20, 8, 3, 0.26); --accent: #140803;
  --bar: rgba(214, 122, 49, 0.92); --btn-fg: #f8e4cf;
}
html[data-scene="royalsi"], html:not(.has-scenes) [data-scene-id="royalsi"] {
  --fg: #f6ece2; --fg-2: rgba(246, 236, 226, 0.74); --line: rgba(246, 236, 226, 0.22); --accent: #dcb86a;
  --bar: rgba(52, 8, 14, 0.92); --btn-fg: #3b0811;
}
html[data-scene="podcast"], html:not(.has-scenes) [data-scene-id="podcast"] {
  --fg: #fff5f5; --fg-2: rgba(255, 245, 245, 0.8); --line: rgba(255, 245, 245, 0.26); --accent: #ffd3d8;
  --bar: rgba(122, 52, 62, 0.92); --btn-fg: #6a2e38;
}
html:not(.has-scenes) .pj[data-scene-id="stan"] { background: var(--bg-stan); }
html:not(.has-scenes) .pj[data-scene-id="helena"] { background: var(--bg-helena); }
html:not(.has-scenes) .pj[data-scene-id="royalsi"] { background: var(--bg-royalsi); }
html:not(.has-scenes) .pj[data-scene-id="podcast"] { background: var(--bg-podcast); }

/* tła scen: nieruchome warstwy, przenikają się (tylko przezroczystość) */
.scenes { display: none; }
.has-scenes body { background: transparent; }
.has-scenes .scenes { display: block; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.scene-bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease 0.55s;   /* znikająca scena czeka, aż nowa ją przykryje */
}
.scene-bg[data-bg="neutral"] { background: var(--paper); opacity: 1; transition: none; }
.scene-bg[data-bg="stan"] { background: var(--bg-stan); }
.scene-bg[data-bg="helena"] { background: var(--bg-helena); }
.scene-bg[data-bg="royalsi"] { background: var(--bg-royalsi); }
.scene-bg[data-bg="podcast"] { background: var(--bg-podcast); }
html[data-scene="stan"] .scene-bg[data-bg="stan"],
html[data-scene="helena"] .scene-bg[data-bg="helena"],
html[data-scene="royalsi"] .scene-bg[data-bg="royalsi"],
html[data-scene="podcast"] .scene-bg[data-bg="podcast"] { opacity: 1; transition: opacity 0.8s ease 0s; }

.projects-page .page--projects,
.has-scenes .header-inner { color: var(--fg); transition: color 0s linear 0.35s;   /* zmiana barwy jednym ruchem w połowie przenikania tła */ }
.has-scenes .site-header.is-scrolled {
  background: var(--bar);
  box-shadow: 0 1px 0 var(--line);
  transition: transform 0.45s var(--ease-out), background-color 0.8s ease, box-shadow 0.8s ease;
}
@media (prefers-reduced-motion: no-preference) { html.has-scenes { scroll-behavior: smooth; } }

/* wstęp i spis */
.pj-intro { padding: clamp(56px, 8vw, 120px) 0 clamp(72px, 9vw, 150px); }
.pj-intro .page-title { color: var(--fg); transition: color 0s linear 0.35s;   /* zmiana barwy jednym ruchem w połowie przenikania tła */ }
.pj-lead {
  max-width: 25ch;
  margin: clamp(28px, 3vw, 44px) 0 clamp(64px, 8vw, 120px);
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.5rem);
  line-height: 1.24;
  letter-spacing: -0.01em;
}
.pj-index { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.pj-index li { border-top: 1px solid var(--line); }
.pj-index a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: clamp(16px, 1.8vw, 26px) 0;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.4s ease;
}
.pj-index-name {
  font-family: var(--sans);
  font-stretch: 62%;
  font-weight: 820;
  font-size: clamp(2.5rem, 1rem + 5.4vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.004em;
  text-transform: uppercase;
  transition: transform 0.6s var(--ease-out);
}
.pj-index-kind {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
  color: var(--fg-2);
}
.swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--sw); flex: none; }
[data-swatch="stan"] { --sw: #f0b075; }
[data-swatch="helena"] { --sw: #d77b31; }
[data-swatch="royalsi"] { --sw: #6e101d; }
[data-swatch="podcast"] { --sw: #b0606a; }
@media (hover: hover) {
  .pj-index:hover a:not(:hover) { opacity: 0.32; }
  .pj-index a:hover .pj-index-name { transform: translate3d(clamp(12px, 1.4vw, 24px), 0, 0); }
}
.pj-index a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
@media (max-width: 560px) {
  .pj-index a { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* podgląd projektu podążający za kursorem (tylko mysz) */
.pj-preview { display: none; }
@media (hover: hover) and (pointer: fine) {
  .pj-preview {
    display: block;
    position: fixed;
    left: 0; top: 0;
    z-index: 30;
    width: clamp(240px, 21vw, 340px);
    aspect-ratio: 16 / 10;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    will-change: transform;
  }
  .pj-preview.is-on { opacity: 1; }
  .pj-preview img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); transition: transform 0.8s var(--ease-out); }
  .pj-preview.is-on img { transform: none; }
}

/* scena projektu */
.pj { position: relative; isolation: isolate; padding: clamp(120px, 14vw, 230px) 0 clamp(110px, 12vw, 200px); color: var(--fg); transition: color 0s linear 0.35s;   /* zmiana barwy jednym ruchem w połowie przenikania tła */ }
.pj-kind {
  margin: 0 0 clamp(12px, 1.4vw, 22px);
  font-weight: 520;
  font-size: clamp(0.9375rem, 0.9rem + 0.25vw, 1.125rem);
  color: var(--accent);
  transition: color 0s linear 0.35s;   /* zmiana barwy jednym ruchem w połowie przenikania tła */
}
.pj-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--sans);
  font-stretch: 62%;
  font-weight: 860;
  font-size: var(--pj-size);
  line-height: 0.84;
  letter-spacing: -0.006em;
  text-transform: uppercase;
  text-wrap: balance;
}
.pj-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 2.6vw, 44px);
  align-items: start;
  margin-top: var(--pj-gap);
}
.pj-media { grid-column: 6 / -1; grid-row: 1; display: block; overflow: hidden; text-decoration: none; }
.pj-media:focus, .pj-media:focus-visible { outline: none; }   /* poza kolejnością klawiatury: przycisk obok prowadzi tam samo */
.pj-media img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 1.2s var(--ease-out); }
@media (hover: hover) { .pj-media:hover img, .js .pj-media.reveal-img.is-in:hover img { transform: scale(1.03); } }
.pj-body { grid-column: 1 / span 4; grid-row: 1; padding-top: 0; }
.pj-statement {
  margin: 0 0 clamp(28px, 3vw, 44px);
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.375rem, 1rem + 0.95vw, 1.9rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
}
.pj-credits { margin: 0 0 clamp(32px, 3.4vw, 48px); }
.pj-credit {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0 14px;
  border-top: 1px solid var(--line);
  transition: border-color 0s linear 0.35s;
}
.pj-credit:last-child { border-bottom: 1px solid var(--line); }
.pj-credit dt { font-size: 14px; line-height: 1.6; color: var(--fg-2); transition: color 0s linear 0.35s;   /* zmiana barwy jednym ruchem w połowie przenikania tła */ }
.pj-credit dd { margin: 0; font-size: 16px; line-height: 1.5; }
.pj-cta {
  --ink: var(--fg);
  --paper: var(--btn-fg);
  transition: color 0.45s var(--ease-out), background-color 0s linear 0.35s;
}

/* wycięte bohaterki scen (sylwetka, koło, korona, mikrofon): jedna zasada dla wszystkich.
   Zaczynają się pod tytułem, w tym samym odstępie co tekst obok, i nigdy go nie zasłaniają.
   Wszystkie mają tę samą wysokość, więc sceny czytają się jak jedna seria. */
:root { --cut-box: min(62svh, 600px, 42vw); }
.pj--cut .pj-media {
  grid-column: 7 / -1;
  justify-self: center;
  position: relative;
  overflow: visible;
  margin-top: 0;
}
.pj--cut .pj-media img {
  display: block;
  width: auto;
  height: var(--cut-box);
  max-width: none;
  aspect-ratio: auto;
  object-fit: contain;
}
.pj--cut .pj-media:hover img { transform: none; }
.pj-photo {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  text-align: center;
  color: var(--fg-2);
}

/* tablet */
@media (max-width: 1100px) and (min-width: 861px) {
  .pj-media { grid-column: 6 / -1; }
  .pj-body { grid-column: 1 / span 5; }
}
/* telefon i wąski tablet: jedna kolumna */
@media (max-width: 860px) {
  :root { --pj-size: 15.5vw; --pj-gap: clamp(24px, 6vw, 36px); }
  .pj { padding: clamp(96px, 20vw, 140px) 0 clamp(88px, 18vw, 120px); }
  .pj-grid { display: block; }
  .pj-body { padding-top: clamp(28px, 7vw, 44px); }
  :root { --cut-box: min(50svh, 84vw, 440px); }
  .pj--cut .pj-media { width: fit-content; margin: 0 auto; }
  .pj-credit { grid-template-columns: 6.25rem minmax(0, 1fr); }
}

/* ---------- Podstrona projektu ---------- */
.article-head { padding-top: clamp(48px, 7vw, 104px); padding-bottom: clamp(36px, 4.5vw, 64px); }
.back { display: inline-block; margin-bottom: clamp(28px, 4vw, 56px); }
.article-title {
  font-family: var(--sans);
  font-stretch: 68%;
  font-weight: 720;
  font-size: clamp(2.75rem, 1.4rem + 5.4vw, 7.25rem);
  line-height: 0.92;
  letter-spacing: -0.014em;
  max-width: 16ch;
  color: var(--ink);
}
.article-sub { margin-top: 22px; font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem); }
.article-hero { margin: 0; background: var(--mist); overflow: hidden; }
.article-hero img { width: 100%; max-height: 82svh; object-fit: cover; }
.article-body { padding-top: clamp(56px, 7vw, 112px); }
.article-body .prose { grid-column: 5 / span 7; }
.article-body .prose p { max-width: 62ch; }
.article-body .prose p:first-child {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.875rem);
  line-height: 1.34;
  letter-spacing: -0.01em;
  font-weight: 300;
  color: var(--ink);
}
@media (max-width: 860px) {
  .article-body .prose { grid-column: 1 / -1; }
}

.media-block { padding-top: clamp(64px, 8vw, 128px); }
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.media-grid--single { grid-template-columns: minmax(0, 1fr); max-width: 1040px; }
@media (max-width: 760px) { .media-grid { grid-template-columns: 1fr; } }
.media-grid figure { margin: 0; }
.media-grid figcaption { margin-top: 12px; }

/* odtwarzacz wideo / audio ładowany dopiero po kliknięciu */
.embed { position: relative; aspect-ratio: 16 / 9; background: #111; overflow: hidden; }
.embed--audio { aspect-ratio: auto; height: 352px; border-radius: 12px; background: #282828; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-play {
  position: absolute; inset: 0;
  display: block; width: 100%; height: 100%;
  padding: 0; border: 0; margin: 0;
  background: transparent;
  cursor: pointer;
  color: var(--paper);
}
.embed-play img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out), opacity 0.4s ease; }
.embed-play:hover img { transform: scale(1.03); opacity: 0.9; }
.embed-icon {
  position: absolute;
  left: 50%; top: 50%;
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  transition: transform 0.6s var(--ease-out);
}
.embed-icon::after {
  content: "";
  position: absolute;
  left: 34px; top: 27px;
  border-style: solid;
  border-width: 15px 0 15px 24px;
  border-color: transparent transparent transparent var(--ink);
}
.embed-play:hover .embed-icon { transform: scale(1.08); }
.embed--audio .embed-play {
  display: flex; align-items: center; gap: 24px;
  padding: 0 clamp(24px, 4vw, 48px);
  text-align: left;
  font-family: var(--text);
}
.embed--audio .embed-icon { position: relative; left: auto; top: auto; margin: 0; flex: none; }
.embed-label { display: block; font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem); font-weight: 560; line-height: 1.15; }
.embed-note { display: block; margin-top: 6px; font-size: 14px; color: #a9aeaf; font-weight: 420; }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin: 0; padding: 0; list-style: none; }
.gallery li { overflow: hidden; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr; } }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: clamp(88px, 9vw, 144px);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.pager a { text-decoration: none; display: block; }
.pager .title-sm { transition: transform 0.6s var(--ease-out); display: block; }
.pager .prev:hover .title-sm { transform: translateX(-8px); }
.pager .next:hover .title-sm { transform: translateX(8px); }
.pager .next { text-align: right; grid-column: 2; }
.pager .meta { display: block; margin-bottom: 8px; }
@media (max-width: 560px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; text-align: left; }
}

/* ---------- 404 ---------- */
.notfound { min-height: 60svh; display: flex; flex-direction: column; justify-content: center; padding-top: 48px; }
.notfound p { margin: 28px 0 32px; max-width: 40ch; }

/* ==========================================================================
   Animacje przy przewijaniu (działają tylko z JS i gdy system nie prosi o ograniczenie ruchu)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* łagodne wyłanianie */
  .js .reveal {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition: opacity 0.7s var(--ease-out), transform 0.8s var(--ease-out);
    transition-delay: var(--d, 0ms);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }

  /* nagłówki: słowa wysuwają się spod linii */
  .js [data-split] .w {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding: 0.14em 0.02em 0.1em;
    margin: -0.14em -0.02em -0.1em;
  }
  .js [data-split] .w > span {
    display: inline-block;
    transform: translate3d(0, 110%, 0);
    transition: transform 0.75s var(--ease-out);
    transition-delay: var(--d, 0ms);
  }
  .js [data-split].is-in .w > span { transform: none; }

  /* zdjęcia: wjeżdżają w ramce i lekko się oddalają */
  .js .reveal-img { background: transparent; }
  .js .reveal-img img {
    opacity: 0;
    transform: translate3d(0, 8%, 0) scale(1.08);
    transition: opacity 0.7s ease var(--d, 0ms), transform 1s var(--ease-out) var(--d, 0ms);
  }
  .js .reveal-img.is-in img { opacity: 1; transform: none; }
  .js .feature-media.is-in:hover img { transform: scale(1.035); }

  /* linie: rysują się od lewej */
  .js .reveal-line { position: relative; border-top-color: transparent !important; }
  .js .reveal-line::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -1px;
    height: 1px;
    background: var(--rule);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s var(--ease-out);
    transition-delay: var(--d, 0ms);
  }
  .js .reveal-line.is-in::before { transform: none; }

  /* płynne przejście między podstronami (Chrome, Safari) */
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 0.25s ease both vt-out; }
  ::view-transition-new(root) { animation: 0.4s var(--ease-out) both vt-in; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* pole i kropka po nim zawsze w jednej linii */
.letter .nobr { white-space: nowrap; }
.letter .nobr .slot--mail { white-space: normal; }

/* Projekty: ostatnia scena przechodzi prosto w stopkę */
.projects-page .contact { margin-top: 0; }

/* <picture> nie zmienia układu: obrazek zachowuje się jak bezpośrednie dziecko */
picture { display: contents; }
