@font-face {
  font-family: "Satoshi";
  src: url("fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("fonts/Satoshi-VariableItalic.woff2") format("woff2");
  font-weight: 300 900; font-style: italic; font-display: swap;
}

:root {
  --ink: #000;
  --grey: #9a9a9a;
  --line: #e8e8e8;
  --paper: #fff;
  --edge: clamp(16px, 2vw, 28px);   /* margines strony */
  --gap: 6px;                        /* odstęp między stories */
  --story-h: clamp(420px, calc(100svh - 150px), 900px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: 14px; line-height: 1.35; font-weight: 450;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
sup { font-size: .32em; vertical-align: top; position: relative; top: .35em; margin-left: .12em; font-weight: 500; letter-spacing: 0; }

/* ——— top bar (jak na pielecka.com: przezroczysty, w trybie difference) ——— */
:root { --bar-h: 100px; --bar-x: 40px; }
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  height: var(--bar-h); padding: 0 var(--bar-x);
  color: #fcfcfc; mix-blend-mode: difference; pointer-events: none;
}
.bar a { pointer-events: auto; }
.brand { font-size: clamp(16px, 1.67vw, 22px); font-weight: 400; text-transform: uppercase; }
.tabs { display: flex; gap: 24px; }
.tabs a { color: rgba(252,252,252,.45); transition: color .2s; }
.tabs a:hover, .tabs a[aria-current="page"] { color: #fcfcfc; }
.tabs sup { font-size: .7em; top: -.1em; }

/* ——— przycisk „do wyboru miast” (kółko ze strzałką, jak na pielecka.com) ——— */
.to-top {
  position: fixed; right: var(--bar-x); bottom: 40px; z-index: 30;
  width: 38px; height: 38px; color: #fcfcfc; mix-blend-mode: difference;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.to-top.on { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 100%; height: 100%; display: block; fill: currentColor; transition: transform .3s; }
.to-top:hover svg { transform: translateY(-3px); }

[hidden] { display: none !important; }

/* ——— index (intro) — wypełnia cały pierwszy ekran ——— */
.index {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--bar-h) var(--edge) 10vh;
  margin-bottom: clamp(80px, 14vh, 180px);
  animation: rise .6s ease both;
}
.lead { margin: 0 0 clamp(18px, 3vh, 32px); color: var(--grey); }
.toc {
  margin: 0; padding: 0; list-style: none;
  font-size: clamp(40px, 7.4vw, 128px);
  line-height: .98; letter-spacing: -.045em; font-weight: 500;
}
.toc li { display: inline; }
.toc li { margin-right: .18em; }
.toc a { transition: color .25s; }
.toc:hover a { color: #d6d6d6; }
.toc:hover a:hover { color: var(--ink); }
.toc sup { color: var(--grey); }

/* ——— place ——— */
.place { scroll-margin-top: var(--bar-h); }
.place + .place { margin-top: clamp(220px, 38vh, 440px); }
.place-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 0 var(--edge); margin-bottom: clamp(40px, 8vh, 88px);
}
.place-title {
  margin: 0; font-size: clamp(40px, 7.4vw, 128px);
  line-height: .85; letter-spacing: -.045em; font-weight: 500;
}
.place-title em { font-style: italic; font-weight: 400; color: var(--grey); }
.place-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  color: var(--grey); white-space: nowrap; padding-bottom: .3em;
}

/* ——— cycle ——— */
.cycle { scroll-margin-top: 60px; }
.cycle + .cycle { margin-top: clamp(100px, 18vh, 200px); }
.cycle-bar {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 var(--edge) 14px;
}
/* ten sam rozmiar co cyferki przy miastach w indeksie (.32 × rozmiar indeksu) */
.cycle-no {
  font-size: calc(.32 * clamp(40px, 7.4vw, 128px)); line-height: 1;
  font-weight: 500; color: var(--grey); font-variant-numeric: tabular-nums;
}
.cycle-bar .ctrl { display: flex; align-items: center; gap: 10px; }
.cycle-bar .meta { color: var(--grey); margin-right: 14px; }
.cycle-bar .ctrl button { color: var(--ink); font-size: 20px; line-height: 1; padding: 4px 6px; transition: opacity .2s; }
.cycle-bar .ctrl button:not(:disabled):hover { opacity: .5; }
.cycle-bar .ctrl button:disabled { opacity: .18; cursor: default; }

.strip {
  display: flex; gap: var(--gap);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge);
  padding: 0 var(--edge);
  scrollbar-width: none; cursor: grab;
}
.strip::-webkit-scrollbar { display: none; }
.strip.dragging { cursor: grabbing; scroll-snap-type: none; }
.strip::after { content: ""; flex: 0 0 calc(var(--edge) - var(--gap)); }
.story {
  margin: 0; flex: 0 0 auto;
  height: var(--story-h); aspect-ratio: 9 / 16;
  scroll-snap-align: start; background: #f3f3f3; overflow: hidden;
}
.story img {
  width: 100%; height: 100%; object-fit: cover;
  user-select: none; -webkit-user-drag: none;
  opacity: 0; transition: opacity .6s ease;
}
.story img.in { opacity: 1; }
.strip.dragging img { pointer-events: none; }

/* ——— design CTA: inna część strony, więc w negatywie ——— */
.design {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  gap: clamp(80px, 16vh, 180px);
  margin-top: clamp(220px, 38vh, 440px);
  padding: clamp(56px, 12vh, 140px) var(--edge) 22px;
  background: var(--ink); color: var(--paper);
}
.design-cta {
  font-size: clamp(40px, 7.4vw, 128px); line-height: .95;
  letter-spacing: -.045em; font-weight: 500;
}
.design .arrow { display: inline-block; font-weight: 400; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.design-cta:hover .arrow { transform: translateX(.15em); }
.foot { color: #8c8c8c; }

/* ——— lightbox ——— */
.lightbox { position: fixed; inset: 0; z-index: 60; background: var(--paper); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox img { height: calc(100svh - 110px); width: auto; max-width: calc(100vw - 2 * var(--edge)); object-fit: contain; }
.lb-bar {
  position: absolute; left: 0; right: 0; top: 0; height: 52px; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--edge); font-variant-numeric: tabular-nums;
}
.lb-count { color: var(--grey); }
.lb-zone { position: absolute; top: 52px; bottom: 0; width: 50%; z-index: 1; }
.lb-prev { left: 0; cursor: w-resize; }
.lb-next { right: 0; cursor: e-resize; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  :root { --story-h: min(calc(100svh - 170px), 140vw); --gap: 4px; }
  :root { --bar-h: 64px; --bar-x: 16px; }
  .tabs { gap: 14px; }
  .to-top { bottom: 20px; }
  .place-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .place-meta { align-items: flex-start; padding: 0; }
  .cycle-bar .ctrl button { display: none; }
  .cycle-bar .meta { margin-right: 0; }
  .place + .place { margin-top: 200px; }
  .cycle + .cycle { margin-top: 96px; }
  .lightbox img { height: auto; max-height: calc(100svh - 110px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .index { animation: none; }
  .story img { transition: none; }
}
