:root {
  --bg: #fdfcf7;
  --ink: #403c10;
  --ink-soft: #331d1a;
  --gutter: clamp(16px, 3.3vw, 62px);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Funnel Display Variable", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

/* <picture> jest tylko opakowaniem dla AVIF — zdjęcie zostaje tym samym elementem układu */
picture {
  display: contents;
}

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

/* ---------- focus ---------- */

/* pierścień tylko przy nawigacji klawiaturą — klik myszką go nie zostawia */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* karty leżą na zdjęciach, a rząd przycina overflow: pierścień do środka i w dwóch tonach
   (jasny border + ciemny outline), rysowany na ::after, żeby leżał nad zdjęciem */
.card__media:focus-visible {
  outline: none;
}

.card__media:focus-visible::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--bg);
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

/* ---------- nav ---------- */

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: clamp(64px, 6.9vw, 131px);
  padding-inline: clamp(20px, 8.8vw, 168px);
}

.nav__link,
.nav__right {
  font-size: clamp(13px, 1.15vw, 22px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.nav__link {
  position: relative;
  justify-self: start;
  text-transform: uppercase;
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nav__link:hover::after {
  transform: scaleX(1);
}

.nav__logo {
  justify-self: center;
}

.nav__logo img {
  height: clamp(34px, 4vw, 77px);
  width: auto;
  mix-blend-mode: multiply;
}

.nav__right {
  justify-self: end;
  display: block;
  text-transform: uppercase;
}

.artwork-preview {
  display: block;
  background-position: center;
  background-size: cover;
}
.card__media > .artwork-preview {
  height: 100%;
}

/* Exhibition selector stays usable even without JavaScript. */
.nav__browse {display:flex;align-items:center;gap:clamp(12px,2vw,32px);justify-self:start}
.nav__exhibitions {position:relative;font-size:clamp(12px,1.15vw,22px);font-weight:600;z-index:5}
.nav__exhibitions summary {cursor:pointer;list-style:none;text-transform:uppercase;white-space:nowrap}
.nav__exhibitions summary::-webkit-details-marker {display:none}
.nav__exhibitions summary::after {content:"";display:inline-block;width:.32em;height:.32em;border:solid currentColor;border-width:0 1px 1px 0;transform:translateY(-.22em) rotate(45deg);margin-left:.4em}
.nav__exhibitions[open] summary::after {transform:rotate(225deg)}
.nav__exhibitions>a {position:absolute;top:calc(100% + .4rem);left:-.65rem;min-width:100%;padding:.4rem .8rem;background:var(--bg);border:1px solid currentColor}
@media(max-width:600px){
  .nav {padding-inline:14px;grid-template-columns:1fr auto 1fr}
  .nav__browse {flex-direction:column;align-items:flex-start;gap:2px}
  .nav__browse summary,.nav__browse>.nav__link {font-size:11px;line-height:1.6}
}

/* ---------- gallery ---------- */

.gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(44px, 7vw, 134px);
  padding-top: clamp(44px, 11vw, 212px);
  padding-bottom: clamp(64px, 12vw, 220px);
}

.row {
  display: flex;
  gap: clamp(24px, 8.4vw, 160px);
  padding-inline: var(--gutter);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.row::-webkit-scrollbar {
  display: none;
}

.card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  transition: opacity 0.5s ease;
}

.gallery:has(.card:hover) .card:not(:hover) {
  opacity: 0.68;
}

.card--collage {
  width: clamp(200px, 38.9vw, 742px);
}

.card--mockup {
  width: clamp(200px, 42.9vw, 818px);
}

.card--collage .card__media {
  aspect-ratio: 742 / 1061;
}

.card--mockup .card__media {
  aspect-ratio: 818 / 1061;
}

.card__media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
}

/* drugie zdjęcie („w ramie”) przenika się z kolażem — jak na stronie produktu */
.card__media .card__hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.card__media:hover .card__hover,
.card__media:focus-within .card__hover {
  opacity: 1;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.card:hover .card__media img,
.card__media:hover img {
  transform: scale(1.03);
}

.card__meta {
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.card:hover .card__meta {
  transform: translateY(-4px);
}

.card__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: clamp(8px, 0.85vw, 16px);
}

.card__title {
  position: relative;
  align-self: flex-start;
  font-size: clamp(17px, 1.68vw, 32px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.card__title::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.card:hover .card__title::after {
  transform: scaleX(1);
}

.card__price {
  font-size: clamp(12px, 0.95vw, 18px);
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.25;
  opacity: 0.7;
  transition: opacity 0.4s ease;
}

.card:hover .card__price {
  opacity: 1;
}

.card__desc {
  font-size: clamp(12px, 0.85vw, 14px);
  font-weight: 300;
  line-height: 1.35;
  color: var(--ink-soft);
  max-width: 34ch;
  padding-bottom: 0.35em;
}

/* ---------- index (lista kolaży) ---------- */

.index-list {
  padding: clamp(56px, 12vh, 210px) var(--gutter) clamp(64px, 9vw, 160px);
}

.index-list ul {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* nazwy wchodzą kolejno przy przewijaniu (klasa .js dodawana w <head>) */
.js .index-list li {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.js .index-list li.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .index-list li {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.index-list [data-preview] {
  display: inline-block;
  text-decoration: none;
  font-family: 'Inter Variable', 'Funnel Display Variable', sans-serif;
  font-size: clamp(28px, 6.7vw, 97px);
  font-weight: 200;
  letter-spacing: -0.01em;
  line-height: 1.21;
  color: #7e7979;
  cursor: none;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), color 0.5s ease;
}

.index-list [data-preview]:hover {
  transform: translateX(10px);
  color: var(--ink);
}

.index-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 96px;
  height: 120px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 60;
  will-change: transform;
}

.index-preview.is-visible {
  opacity: 1;
}

.index-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 120px;
  object-fit: cover;
}

@media (hover: none) {
  .card__hover {
    display: none;
  }

  .index-list [data-preview] {
    cursor: auto;
  }

  .index-preview {
    display: none;
  }
}

/* ---------- product ---------- */

.product {
  padding-inline: clamp(16px, 5vw, 95px);
  padding-top: clamp(28px, 6vw, 120px);
  padding-bottom: clamp(64px, 9vw, 160px);
}

/* dwie równe kolumny: zdjęcie zajmuje ~80% szerokości z projektu */
.product__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4.2vw, 80px);
}

/* wysokość zdjęcia wynika z jego proporcji — każdy kolaż ma inną, bez przycinania */
.product__hero {
  position: relative;
  overflow: hidden;
}

.product__hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* drugie zdjęcie pokazuje się po najechaniu na zdjęcie główne */
.product__hero .product__hero-hover {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.product__hero:hover .product__hero-hover {
  opacity: 1;
}

/* na dotyku hover nie ma sensu — zostaje samo zdjęcie główne */
@media (hover: none) {
  .product__hero-hover {
    display: none;
  }
}

/* stretch z grida rozciąga panel do wysokości zdjęcia, space-between dokleja go do dołu */
.product__aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(32px, 4vw, 64px);
  padding-top: clamp(8px, 1vw, 20px);
}

.product__desc {
  margin: 0;
  max-width: 38ch;
  font-size: clamp(14px, 1.02vw, 18px);
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.product__info {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.7vw, 14px);
}

/* dolna granica 28px jest wspólna z wariantem mobilnym — przy 820px tytuł
   przechodzi w drugi zestaw reguł bez skoku (2.1vw daje z powrotem 30,24px
   dopiero od ~1333px, więc na 1440px wygląda jak dotąd) */
.product__title {
  margin: 0;
  font-size: clamp(28px, 2.1vw, 40px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.product__price {
  margin: 0;
  font-size: clamp(26px, 2.2vw, 38px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.product__size,
.product__ship {
  margin: 0;
  font-size: clamp(9px, 0.62vw, 10px);
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1.3;
  opacity: 0.5;
}

/* linie notki są osobnymi elementami, więc skrypt czyta je bez parsowania HTML */
.product__ship span {
  display: block;
}

.product__label {
  margin: 0;
  font-size: clamp(10px, 0.72vw, 12px);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
}

.product__sizes {
  display: flex;
  gap: clamp(6px, 0.5vw, 10px);
}

.size-btn {
  min-width: clamp(116px, 8.4vw, 168px);
  min-height: clamp(56px, 4.4vw, 74px);
  padding: 0.65em 1.1em;
  border: 1px solid rgba(64, 60, 16, 0.45);
  background: rgba(64, 60, 16, 0.05);
  color: var(--ink);
  font: inherit;
  line-height: 1.15;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease,
    transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.size-btn__name {
  display: block;
  font-size: clamp(16px, 1.3vw, 22px);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.size-btn__dim {
  display: block;
  margin-top: 3px;
  font-size: clamp(9px, 0.66vw, 11px);
  font-weight: 300;
  letter-spacing: 0.06em;
  opacity: 0.6;
}

.size-btn:hover {
  border-color: var(--ink);
  background: rgba(64, 60, 16, 0.14);
  transform: translateY(-2px);
}

.size-btn[aria-pressed='true'] .size-btn__dim {
  opacity: 0.8;
}

.size-btn[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.product__cta {
  display: inline-block;
  align-self: flex-start;
  margin-top: clamp(22px, 2.4vw, 40px);
  padding: 0.35em 1em;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: clamp(14px, 1.1vw, 20px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.35s ease, color 0.35s ease, transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.product__cta:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-1px);
}

/* ---------- formularz zamówienia ---------- */

/* pułapka na boty: pole widoczne dla maszyn, niewidoczne dla ludzi */
.order__hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* strzałka rozwijania <details> — przycisk sam mówi, co robi */
.order > summary {
  list-style: none;
  margin-bottom: 16px;
}

.order > summary::-webkit-details-marker {
  display: none;
}

.order__field {
  margin: 0 0 14px;
}

.order__field label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.order__field input,
.order__field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
}

.order__field input[aria-invalid='true'],
.order__field textarea[aria-invalid='true'] {
  border-color: #8a2a1a;
}

.order__error {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
  color: #8a2a1a;
}

.order__error:not([hidden]) {
  display: block;
}

.order__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0;
  font-size: 13px;
}

.order__consent input {
  margin-top: 3px;
}

.order__submit {
  display: inline-block;
  padding: 0.6em 1.9em;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.35s ease, color 0.35s ease;
}

.order__submit:hover {
  background: var(--ink);
  color: var(--bg);
}

.order__error--summary {
  margin: 0 0 14px;
  font-size: 13px;
  color: #8a2a1a;
}

/* ---------- product photos ---------- */

.product__shots {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4.2vw, 80px);
  margin-top: clamp(40px, 6.4vw, 122px);
}

.product__duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4.2vw, 80px);
}

.product__duo .shot {
  aspect-ratio: 806 / 604;
}

.shot--wide {
  aspect-ratio: 1692 / 1269;
}

.shot--tall {
  aspect-ratio: 1692 / 1086;
}

.shot {
  overflow: hidden;
}

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

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .product__top {
    grid-template-columns: 1fr;
  }

  /* mobile wg ramki "MOBILE" z Figmy: tytuł, papier, „wybierz wymiar”,
     dwa równe kafelki, cena, przycisk — opis dopiero pod spodem.
     W ramce tylko tytuł i papier wyprzedzają resztę, a reszta i tak jest
     już w tej kolejności w HTML, więc wystarczą dwie ujemne wartości.

     Ramka ma 390px, breakpoint 820px, więc --step to 0 na 390px i 1px na
     820px. Rozmiary czytają się jako „wartość z ramki + różnica × --step”,
     czyli na breakpoincie trafiają dokładnie w wartości bazowe. clamp trzyma
     0 poniżej 390px, więc małe telefony dostają stopień pisma z ramki. */
  .product__aside {
    --step: clamp(0px, calc((100vw - 390px) / 430), 1px);
    justify-content: flex-start;
    gap: clamp(28px, 8vw, 40px);
    padding-top: 0;
  }

  .product__size {
    font-size: calc(15px - var(--step) * 6); /* 15 → 9 */
  }

  /* 13 → 9: notka o dostawie jest dłuższa, więc startuje mniejszym stopniem */
  .product__ship {
    margin-top: 14px;
    font-size: calc(13px - var(--step) * 4);
  }

  .product__label {
    font-size: calc(15px - var(--step) * 5); /* 15 → 10 */
  }

  .product__price {
    font-size: calc(21px + var(--step) * 5); /* 21 → 26 */
  }

  .product__cta {
    font-size: calc(17px - var(--step) * 3); /* 17 → 14 */
  }

  .order__submit {
    width: 100%;
  }

  .product__desc {
    order: 1;
    max-width: none;
    font-size: calc(15px - var(--step)); /* 15 → 14 */
    line-height: 1.5;
  }

  .product__info {
    gap: 0;
  }

  /* 7vw daje 27,3px na 390px (jak w ramce), a od ~400px dobija do 28px,
     czyli dokładnie tyle, ile ma tytuł po drugiej stronie breakpointu */
  .product__title {
    order: -2;
    font-size: clamp(27px, 7vw, 28px);
  }

  /* papier i „wybierz wymiar” mają w ramce ten sam stopień pisma i wagę */
  .product__size,
  .product__label {
    font-weight: 300;
    letter-spacing: 0.01em;
    opacity: 1;
  }

  .product__size {
    order: -1;
    margin-top: 7px;
  }

  .product__label {
    margin-top: 28px;
    text-transform: none;
  }

  .product__sizes {
    margin-top: 10px;
    gap: 10px;
  }

  /* kafelki dzielą szerokość po równo; bazowe min-width 116px i tak się mieści */
  .size-btn {
    flex: 1 1 0;
  }

  .product__price {
    margin-top: 8px;
    font-weight: 300;
  }

  .product__cta {
    margin-top: 38px;
    padding: 0.6em 1.9em;
    border-width: 2px;
  }

  .nav__right {
    gap: 10px;
  }

  /* mobile: prace jedna pod drugą, każda na wysokość ekranu — bez przewijania w bok */
  .row {
    flex-direction: column;
    gap: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  .card {
    width: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: clamp(20px, 7vw, 48px);
  }

  .product__duo {
    grid-template-columns: 1fr;
  }

  /* indeks na telefonie: większe nazwy i luźniejszy rytm, żeby lista przewijała się ekran po ekranie */
  .index-list {
    padding-block: clamp(32px, 10vh, 96px) clamp(48px, 12vh, 120px);
  }

  .index-list ul {
    gap: clamp(16px, 5vh, 48px);
  }

  .index-list li {
    display: flex;
    align-items: center;
    min-height: 26svh;
  }

  .index-list [data-preview] {
    font-size: clamp(34px, 11vw, 64px);
  }
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid rgba(64, 60, 16, 0.14);
  padding: clamp(24px, 3.4vw, 52px) var(--gutter) clamp(32px, 4.4vw, 72px);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: clamp(6px, 1vw, 16px) clamp(18px, 3vw, 48px);
  font-size: clamp(11px, 0.8vw, 14px);
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.footer__seller,
.footer__note {
  margin: 0;
}

.footer__note {
  opacity: 0.7;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 28px);
  margin-left: auto;
}

.footer__links a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.footer__links a:hover {
  opacity: 0.65;
}

/* ---------- strony prawne ---------- */

.legal {
  padding: clamp(36px, 6vw, 96px) var(--gutter) clamp(56px, 7vw, 120px);
}

.legal__inner {
  max-width: 68ch;
  font-size: clamp(14px, 1.02vw, 17px);
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.legal h1 {
  margin: 0 0 0.5em;
  font-size: clamp(24px, 2.4vw, 42px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.legal h2 {
  margin: clamp(26px, 3vw, 44px) 0 0.45em;
  font-size: clamp(15px, 1.15vw, 20px);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.legal p,
.legal ul,
.legal ol {
  margin: 0 0 0.9em;
}

.legal ul,
.legal ol {
  padding-left: 1.2em;
}

.legal li {
  margin-bottom: 0.25em;
}

.legal a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.legal__date {
  font-size: 0.9em;
  opacity: 0.7;
}

/* na wąskim ekranie linki stopki wyrównane do lewej, jak reszta tekstu */
@media (max-width: 820px) {
  .footer__links {
    margin-left: 0;
  }
}
