/* Ciemnia — Sznurek i powiększenie (projekt 01D) */

@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/instrument-serif-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: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/instrument-serif-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap;
  src: url(/fonts/instrument-serif-italic-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: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap;
  src: url(/fonts/instrument-serif-italic-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/jetbrains-mono-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: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/jetbrains-mono-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #140707;
  --fg: #ff8a7e;
  --red-op: 0.92;
  --paper: #f3eee6;
  --peg: #c9b8a0;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  /* Both states must list the same functions in the same order, or the browser can't animate between them */
  --undeveloped: grayscale(1) contrast(0.06);
  --developed: grayscale(1) contrast(1.08);
  --develop-curve: cubic-bezier(.37, 0, .63, 1);
  /* Tempo wywoływania: jedna odbitka na sznurku, w powiększeniu, odstęp między kolejnymi (czyta go site.js) */
  --develop-time: 10s;
  --develop-zoom-time: 6s;
  --develop-stagger: 1500ms;
}
:root.is-lit { --bg: #ece8e1; --fg: #1a1414; --red-op: 0; }

*, *::before, *::after { box-sizing: border-box; }
html { background: #0d0505; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: background-color 1.2s ease, color 1.2s ease;
}
a { color: inherit; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.upper { text-transform: uppercase; }

/* Czerwone światło ciemni: multiply nad całą stroną */
.safelight {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: #ff2414;
  mix-blend-mode: multiply;
  pointer-events: none;
  opacity: var(--red-op);
  transition: opacity 1.2s ease;
}

.ctl {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.ctl--solid { border: 0; background: var(--fg); color: var(--bg); }
.ctl:focus-visible, .print:focus-visible, .site-header a:focus-visible, .site-footer a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Nagłówek */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 28px 4%;
}
.site-name { text-decoration: none; font-family: var(--serif); font-size: 28px; letter-spacing: 0; }
.site-nav { display: flex; flex-wrap: wrap; gap: 24px; text-transform: uppercase; }
.site-nav a { text-underline-offset: 4px; }
.site-nav a:not([aria-current]) { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* Hero */
.hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 24px 4% 0;
}
.hero h1 {
  margin: 0;
  max-width: 900px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.5rem, 11vw, 8rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
}
.hero p { margin: 0; max-width: 300px; text-transform: uppercase; font-size: 12px; line-height: 1.7; }

/* Sznurki z odbitkami */
.line { position: relative; z-index: 2; margin-top: 64px; padding: 0 4%; --sag: 0.4deg; }
.line:nth-child(even) { --sag: -0.3deg; }
.line__cord {
  position: absolute;
  left: 0;
  right: 0;
  top: 16px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
  transform: rotate(var(--sag));
}
.line__prints { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 32px 20px; }

.print {
  display: block;
  flex: 0 1 var(--w, 220px);
  min-width: 0;
  margin-top: var(--drop, 0px);
  padding: 0;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
  transform: rotate(var(--rot, 0deg));
  transform-origin: 50% 0;
  transition: transform 0.5s ease;
}
.print:hover { transform: translateY(8px) rotate(0deg); }

/* Rytm z projektu: 8 odbitek na dwóch sznurkach, potem wzór się powtarza */
.line:nth-child(odd) .print:nth-child(1) { --rot: -3deg; --drop: 0px; --w: 220px; }
.line:nth-child(odd) .print:nth-child(2) { --rot: 2deg; --drop: 24px; --w: 240px; }
.line:nth-child(odd) .print:nth-child(3) { --rot: -1.5deg; --drop: 6px; --w: 230px; }
.line:nth-child(odd) .print:nth-child(4) { --rot: 3deg; --drop: 30px; --w: 190px; }
.line:nth-child(even) .print:nth-child(1) { --rot: -2deg; --drop: 12px; --w: 300px; }
.line:nth-child(even) .print:nth-child(2) { --rot: 2.5deg; --drop: 0px; --w: 210px; }
.line:nth-child(even) .print:nth-child(3) { --rot: -1deg; --drop: 26px; --w: 200px; }
.line:nth-child(even) .print:nth-child(4) { --rot: 1.5deg; --drop: 8px; --w: 290px; }

.peg {
  display: block;
  position: relative;
  z-index: 2;
  width: 12px;
  height: 30px;
  margin: 0 auto -9px;
  background: var(--peg);
  border-radius: 3px;
}
.print__paper { display: block; background: var(--paper); padding: 9px 9px 30px; box-shadow: 0 28px 44px rgba(0, 0, 0, 0.55); }
.print__paper img {
  display: block;
  width: 100%;
  height: auto;
  filter: var(--developed);
  transition: filter var(--develop-time) var(--develop-curve);
}
/* Wywoływanie działa tylko z JS; bez niego zdjęcia są od razu widoczne */
.js .print:not(.is-developed) .print__paper img { filter: var(--undeveloped); }
/* Odbitka z włączonym „Zachowaj kolor”: wywołuje się do oryginału */
.is-color { --developed: grayscale(0) contrast(1); }
.print__label { display: block; margin-top: 10px; text-transform: uppercase; font-size: 11px; }
.lines { counter-reset: odbitka; }
.print { counter-increment: odbitka; }
.print__label::before { content: counter(odbitka, decimal-leading-zero) ' · '; }

.empty { position: relative; z-index: 2; padding: 64px 4% 0; text-transform: uppercase; }

/* Strona tekstowa (O mnie) */
.page { position: relative; z-index: 2; max-width: 720px; padding: 24px 4% 0; }
.page h1 { margin: 0 0 32px; font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 8vw, 6rem); line-height: 0.9; }
.page__body { font-size: 15px; line-height: 1.7; letter-spacing: 0.01em; }

/* Stopka */
.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 90px 4% 40px;
  text-transform: uppercase;
}
.site-footer__contact { display: flex; flex-wrap: wrap; gap: 8px; }

/* Powiększenie */
.zoom {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background-color: var(--bg);
  color: var(--fg);
  overflow: auto;
}
.zoom::backdrop { background: var(--bg); }
.zoom__inner {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 56px;
  padding: 60px 6%;
}
.zoom__print { position: relative; flex: 0 1 560px; min-width: 0; }
.zoom__print .peg { position: absolute; top: -14px; width: 14px; height: 34px; margin: 0; }
.zoom__print .peg:first-child { left: 18%; }
.zoom__print .peg:nth-child(2) { right: 18%; }
.zoom__paper { background: var(--paper); padding: 18px 18px 56px; box-shadow: 0 50px 80px rgba(0, 0, 0, 0.6); }
.zoom__paper img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 820px;
  object-fit: contain;
  filter: var(--developed);
}
.zoom__paper img.is-fresh { filter: var(--undeveloped); transition: none; }
.zoom__paper img.is-developing { transition: filter var(--develop-zoom-time) var(--develop-curve); }
.zoom__meta { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; gap: 22px; }
.zoom__meta h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 6vw, 5rem); line-height: 0.9; }
.zoom__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid currentColor;
  text-transform: uppercase;
  font-size: 12px;
}
.zoom__facts dd { margin: 0; }
.zoom__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.zoom .safelight { position: fixed; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .js .print:not(.is-developed) .print__paper img, .zoom__paper img.is-fresh { filter: var(--developed); }
}
