:root {
  --navy: #0c3963;
  --navy-deep: #06233e;
  --blue: #165992;
  --gold: #f9bb13;
  --gold-light: #ffd65a;
  --paper: #f5f7fa;
  --ink: #172330;
  --muted: #647180;
  --line: #dce3ea;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(4, 31, 55, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.reader-open { overflow: hidden; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
.shell { width: min(1320px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 720px;
  color: white;
  background:
    radial-gradient(circle at 82% 16%, rgba(255,255,255,.16), transparent 22%),
    linear-gradient(135deg, #082946 0%, #0e467a 58%, #1a609a 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -180px -8%;
  height: 340px;
  background: var(--paper);
  transform: rotate(-4deg);
  transform-origin: center;
}
.hero__glow {
  position: absolute;
  width: 700px;
  height: 700px;
  left: -260px;
  top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,187,19,.24), transparent 66%);
}
.hero__content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 410px) 1fr;
  align-items: center;
  gap: clamp(46px, 7vw, 110px);
  padding: 70px 0 170px;
}
.hero__cover-wrap { position: relative; width: min(100%, 300px); justify-self: end; }
.hero__cover-wrap::before {
  content: "";
  position: absolute;
  inset: 9% -8% -6% 12%;
  border-radius: 16px;
  background: rgba(3,23,40,.45);
  filter: blur(22px);
  transform: rotate(4deg);
}
.hero__cover {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1101 / 1600;
  object-fit: cover;
  border-radius: 4px 13px 13px 4px;
  box-shadow: 0 30px 70px rgba(1,18,33,.48);
  transform: perspective(1200px) rotateY(5deg) rotateZ(-1deg);
  user-select: none;
  -webkit-user-drag: none;
}
.hero__text { max-width: 720px; }
.eyebrow {
  margin: 0 0 18px;
  color: var(--gold-light);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.eyebrow--dark { color: var(--blue); }
.hero h1 {
  margin: 0;
  font-size: clamp(56px, 8vw, 118px);
  line-height: .88;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.hero h1 span { color: var(--gold); text-shadow: 0 3px 0 rgba(255,255,255,.22); }
.author { margin: 28px 0 0; font-size: clamp(20px, 2.2vw, 30px); font-weight: 750; }
.lead { max-width: 680px; margin: 22px 0 0; color: rgba(255,255,255,.78); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.65; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: white;
  background: var(--navy);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(3,31,54,.18); }
.button--primary { color: #132130; background: var(--gold); box-shadow: 0 10px 28px rgba(249,187,19,.22); }
.button--primary:hover { background: var(--gold-light); }
.button--ghost { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.button--small { min-height: 44px; padding-inline: 17px; border-radius: 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.meta > div { min-width: 120px; padding: 13px 16px; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; background: rgba(255,255,255,.07); }
.meta strong { display: block; color: var(--gold-light); font-size: 20px; }
.meta span { display: block; margin-top: 2px; color: rgba(255,255,255,.68); font-size: 12px; }

.gallery-section { position: relative; z-index: 3; padding: 28px 0 88px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 4vw, 58px); letter-spacing: -.035em; }
.gallery-tools { display: flex; gap: 10px; align-items: center; }
.search-box input { width: 145px; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; color: var(--ink); background: white; outline: none; }
.search-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(22,89,146,.12); }
.notice { padding: 16px; border-radius: 12px; background: #fff4ce; }
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}
.thumb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.thumb-card__image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 467.717 / 680.315;
  border: 1px solid rgba(14,55,88,.12);
  border-radius: 10px;
  background: white;
  box-shadow: 0 8px 24px rgba(5,38,65,.11);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.thumb-card:first-child .thumb-card__image { aspect-ratio: 1101 / 1600; }
.thumb-card__image::after {
  content: "Otwórz";
  position: absolute;
  inset: auto 10px 10px;
  display: grid;
  place-items: center;
  height: 34px;
  border-radius: 8px;
  color: white;
  background: rgba(6,35,62,.88);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  font-size: 12px;
  font-weight: 800;
}
.thumb-card img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.thumb-card__label { display: flex; align-items: center; justify-content: space-between; padding-inline: 2px; color: var(--muted); font-size: 13px; font-weight: 750; }
.thumb-card:hover .thumb-card__image, .thumb-card:focus-visible .thumb-card__image { transform: translateY(-5px); border-color: rgba(22,89,146,.44); box-shadow: 0 16px 34px rgba(5,38,65,.18); }
.thumb-card:hover .thumb-card__image::after, .thumb-card:focus-visible .thumb-card__image::after { opacity: 1; transform: none; }
.thumb-card:focus-visible { outline: 3px solid rgba(22,89,146,.24); outline-offset: 5px; border-radius: 10px; }

.footer { color: rgba(255,255,255,.72); background: var(--navy-deep); }
.footer__inner { display: flex; justify-content: space-between; gap: 30px; padding: 34px 0; font-size: 13px; }
.footer strong, .footer span { display: block; }
.footer strong { color: white; font-size: 15px; }
.footer span { margin-top: 5px; }
.footer p { max-width: 560px; margin: 0; text-align: right; line-height: 1.55; }

.reader {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  color: white;
  background: #07111a;
}
.reader[hidden] { display: none; }
.reader__topbar, .reader__bottombar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  padding: 10px 18px;
  background: rgba(5,19,31,.94);
  backdrop-filter: blur(14px);
}
.reader__topbar { border-bottom: 1px solid rgba(255,255,255,.1); }
.reader__bottombar { justify-content: center; border-top: 1px solid rgba(255,255,255,.1); }
.reader__title strong, .reader__title span { display: block; }
.reader__title strong { font-size: 14px; }
.reader__title span { margin-top: 2px; color: rgba(255,255,255,.58); font-size: 12px; }
.reader__tools { display: flex; gap: 8px; }
.icon-button, .reader__text-button {
  border: 1px solid rgba(255,255,255,.16);
  color: white;
  background: rgba(255,255,255,.07);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.icon-button:hover, .reader__text-button:hover { border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.14); }
.icon-button { min-width: 40px; height: 40px; border-radius: 9px; font-size: 23px; line-height: 1; }
.icon-button--wide { min-width: 60px; font-size: 12px; font-weight: 800; }
.reader__text-button { min-height: 38px; padding: 0 16px; border-radius: 8px; font-size: 13px; font-weight: 750; }
.reader__stage { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(circle at center, #1a2732, #090f15 68%); }
.reader__canvas {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 76px;
  overscroll-behavior: contain;
}
.reader__canvas img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 18px 60px rgba(0,0,0,.52);
  transition: width .16s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.reader__canvas.is-zoomed { align-items: flex-start; justify-content: flex-start; }
.reader__canvas.is-zoomed img { max-width: none; max-height: none; }
.reader__nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 50px;
  height: 72px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  color: white;
  background: rgba(5,19,31,.65);
  backdrop-filter: blur(8px);
  transform: translateY(-50%);
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
}
.reader__nav:hover { background: rgba(18,68,108,.88); }
.reader__nav:disabled, .reader__text-button:disabled { opacity: .28; cursor: default; }
.reader__nav--prev { left: 14px; }
.reader__nav--next { right: 14px; }
.reader__strip {
  z-index: 5;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 14px 14px;
  background: #06101a;
  border-top: 1px solid rgba(255,255,255,.09);
  scrollbar-width: thin;
}
.reader__strip[hidden] { display: none; }
.strip-thumb {
  flex: 0 0 66px;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
  background: white;
  opacity: .62;
  cursor: pointer;
}
.strip-thumb img { display: block; width: 100%; aspect-ratio: 467.717 / 680.315; object-fit: cover; }
.strip-thumb.is-active { border-color: var(--gold); opacity: 1; }

@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero::after { bottom: -230px; }
  .hero__content { grid-template-columns: minmax(180px, 290px) 1fr; gap: 38px; padding-top: 50px; }
  .hero h1 { font-size: clamp(48px, 8.6vw, 76px); }
  .lead { font-size: 16px; }
  .footer__inner { flex-direction: column; }
  .footer p { text-align: left; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1320px); }
  .hero__content { grid-template-columns: 1fr; justify-items: center; padding: 28px 0 142px; text-align: center; }
  .hero__cover-wrap { width: min(62vw, 210px); justify-self: center; }
  .hero__text { display: flex; flex-direction: column; align-items: center; }
  .hero h1 { font-size: clamp(50px, 16vw, 82px); }
  .author { margin-top: 22px; }
  .meta { justify-content: center; }
  .meta > div { min-width: 98px; padding: 10px; }
  .gallery-section { padding-top: 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .gallery-tools { width: 100%; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
  .thumb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .reader__topbar { min-height: 56px; padding: 8px 10px; }
  .reader__title strong { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .reader__tools { gap: 5px; }
  .icon-button { min-width: 36px; height: 36px; }
  .icon-button--wide { min-width: 48px; }
  .reader__canvas { padding: 12px 8px 76px; }
  .reader__nav { top: auto; bottom: 8px; width: 46px; height: 48px; transform: none; border-radius: 50%; }
  .reader__nav--prev { left: calc(50% - 62px); }
  .reader__nav--next { right: calc(50% - 62px); }
  .reader__bottombar { display: none; }
  .reader__strip { max-height: 104px; }
}

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