:root {
  color-scheme: light;
  --ink: #181714;
  --muted: #6f6b62;
  --line: #d9d4ca;
  --paper: #fffdfa;
  --brand: #e65f2b;
  --brand-dark: #b83d14;
  --brand-surface: #f5f2ec;
  --shadow: 0 20px 60px rgba(33, 28, 20, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--brand-surface); color: var(--ink); font-size: 1rem; line-height: 1.6; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 20; padding: .75rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }

.site-header { min-height: 5.25rem; padding: 0 clamp(1.25rem, 4vw, 4rem); display: flex; align-items: center; gap: 2rem; border-bottom: 1px solid var(--line); background: rgba(255,253,250,.92); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); }
.wordmark { display: flex; align-items: center; gap: .75rem; text-decoration: none; margin-right: auto; line-height: 1.1; }
.wordmark-mark { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: white; font: 800 1.25rem/1 Georgia, serif; }
.wordmark-logo { width: auto; height: 2.75rem; max-width: 10rem; object-fit: contain; }
.wordmark strong, .wordmark small { display: block; }
.wordmark strong { font-size: 1rem; letter-spacing: -.02em; }
.wordmark small { margin-top: .25rem; color: var(--muted); font-size: .75rem; }
.main-nav { display: flex; gap: 1.5rem; }
.main-nav a { padding: .5rem 0; text-decoration: none; color: var(--muted); font-size: .9rem; }
.main-nav a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--brand); }
.admin-entry { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); font-size: .86rem; font-weight: 750; text-decoration: none; }
.admin-entry:hover { border-color: var(--brand); color: var(--brand-dark); }
.search-toggle { display: flex; align-items: center; gap: .4rem; padding: .55rem .9rem; background: transparent; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; }
.search-toggle:hover { border-color: var(--ink); }

main { min-height: 70vh; }
.library-intro, .catalog, .publication-detail, .not-found, .install-page { width: min(1180px, calc(100% - 2.5rem)); margin-inline: auto; }
.library-intro { display: flex; justify-content: space-between; align-items: end; gap: 2rem; padding: clamp(3rem, 7vw, 7rem) 0 3rem; }
.library-intro h1, .detail-copy h1 { margin: .1rem 0 1rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 6vw, 5.75rem); line-height: .98; letter-spacing: -.05em; }
.library-intro > div > p:last-child { max-width: 42rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.25rem); }
.eyebrow { margin: 0 0 .5rem; color: var(--brand-dark); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.issue-count { margin: 0; min-width: 9rem; padding-left: 1.5rem; border-left: 1px solid var(--line); }
.issue-count strong, .issue-count span { display: block; }
.issue-count strong { font: 700 3.5rem/1 Georgia, serif; }
.issue-count span { color: var(--muted); }

.search-panel { width: min(1180px, calc(100% - 2.5rem)); margin: -1rem auto 3rem; padding: 1.25rem; background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; box-shadow: var(--shadow); }
.search-panel label { display: block; margin-bottom: .5rem; font-weight: 700; }
.search-field { display: flex; align-items: center; gap: .65rem; border-bottom: 2px solid var(--ink); }
.search-field input { flex: 1; min-width: 0; padding: .8rem 0; border: 0; background: transparent; font-size: 1.1rem; outline: 0; }
.search-field button { border: 0; background: transparent; color: var(--brand-dark); cursor: pointer; }

.latest-showcase {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 5vw, 5rem) clamp(1.25rem, 4vw, 4rem) clamp(3.5rem, 7vw, 7rem);
  color: #fff;
  background:
    radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 18%), rgba(230,95,43,.28), transparent 28rem),
    linear-gradient(145deg, #25211d 0%, #0f0e0c 60%, #191510 100%);
  isolation: isolate;
}

.latest-showcase::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .22;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 3rem 3rem;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

.latest-heading {
  width: min(1440px, 100%);
  margin: 0 auto clamp(2rem, 4vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
}

.latest-heading h2 { margin: 0; font: 700 clamp(2.4rem, 5vw, 5rem)/.95 Georgia, serif; letter-spacing: -.045em; }
.latest-heading > p { margin: 0 0 .4rem; color: #bdb6aa; font-size: .88rem; }

.latest-grid {
  width: min(1440px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.6vw, 3rem);
  perspective: 1200px;
}

.latest-card {
  min-width: 0;
  opacity: 0;
  animation: cover-arrive .72s cubic-bezier(.2,.75,.22,1) forwards;
  animation-delay: calc(var(--card-index) * 55ms);
}

.latest-card a { display: block; color: inherit; text-decoration: none; }

.latest-cover-wrap {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lift: 0px;
  position: relative;
  display: block;
  aspect-ratio: .707 / 1;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(var(--lift));
  transform-style: preserve-3d;
  transform-origin: 50% 80%;
  transition: transform 180ms ease, filter 180ms ease;
  filter: drop-shadow(0 1.5rem 1.3rem rgba(0,0,0,.36));
  will-change: transform;
}

.latest-cover-wrap img { width: 100%; height: 100%; object-fit: contain; background: #fff; border-radius: 2px; }
.latest-card:hover .latest-cover-wrap { filter: drop-shadow(0 2.2rem 1.7rem rgba(0,0,0,.56)); }

.cover-glare {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 30%), rgba(255,255,255,.48), rgba(255,255,255,.08) 18%, transparent 48%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  transform: translateZ(2px);
}

.latest-card:hover .cover-glare { opacity: .72; }
.cover-edge { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.28); box-shadow: inset -8px 0 14px rgba(0,0,0,.16); pointer-events: none; transform: translateZ(3px); }
.latest-meta { display: block; padding-top: 1rem; }
.latest-meta small, .latest-meta strong, .latest-meta > span { display: block; }
.latest-meta small { color: #e89877; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.latest-meta strong { margin-top: .25rem; font: 700 clamp(1.1rem, 1.8vw, 1.55rem)/1.08 Georgia, serif; }
.latest-meta > span { margin-top: .3rem; color: #aaa397; font-size: .82rem; }

@keyframes cover-arrive {
  from { opacity: 0; transform: translateY(2.5rem) rotateY(-8deg); }
  to { opacity: 1; transform: translateY(0) rotateY(0); }
}

.featured { display: grid; grid-template-columns: minmax(240px, .75fr) minmax(300px, 1.25fr); align-items: center; min-height: 36rem; background: #1c1b18; color: white; overflow: hidden; }
.featured-cover { align-self: stretch; display: grid; place-items: end center; padding: 3rem 2rem 0; background: radial-gradient(circle at 50% 30%, #645d50, #272521 60%); }
.featured-cover img { max-height: 31rem; width: auto; box-shadow: 0 2rem 5rem rgba(0,0,0,.45); }
.featured-copy { padding: clamp(2rem, 7vw, 7rem); }
.featured-copy h2 { margin: .1rem 0 0; font: 700 clamp(3rem, 7vw, 6.7rem)/.88 Georgia, serif; letter-spacing: -.055em; }
.featured-copy > p:not(.eyebrow):not(.issue-label) { max-width: 34rem; color: #cfcbc3; }
.issue-label { margin: .8rem 0 2rem; color: #efab8f; font-weight: 700; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 2rem; min-height: 3.25rem; margin-top: 1.5rem; padding: .75rem 1.25rem; border: 0; border-radius: .25rem; background: var(--brand); color: white; font-weight: 800; text-decoration: none; cursor: pointer; }
.primary-button:hover { background: var(--brand-dark); }
.primary-button:disabled { opacity: .55; cursor: not-allowed; }
.publication-facts { display: flex; gap: 2rem; margin: 2rem 0 0; }
.publication-facts div { padding-left: 1rem; border-left: 1px solid currentColor; }
.publication-facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .65; }
.publication-facts dd { margin: .15rem 0 0; font-weight: 800; }

.catalog { padding: clamp(4rem, 8vw, 7rem) 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.section-heading h2 { margin: 0; font: 700 clamp(2rem, 4vw, 3.6rem)/1 Georgia, serif; letter-spacing: -.04em; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.filters button { padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 99px; background: transparent; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: white; }
.publication-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); }
.publication-card { min-width: 0; }
.card-cover { display: grid; place-items: end center; aspect-ratio: 4 / 5; padding: 1.5rem 1.5rem 0; background: #ddd6ca; overflow: hidden; text-decoration: none; }
.card-cover img { max-height: 100%; width: auto; box-shadow: 0 1.2rem 3rem rgba(40,34,25,.22); transition: transform .25s ease; }
.publication-card:hover .card-cover img { transform: translateY(-.4rem); }
.card-copy { padding-top: 1rem; }
.card-copy p, .card-copy span { margin: 0; color: var(--muted); font-size: .82rem; }
.card-copy h3 { margin: .15rem 0 .35rem; font: 700 1.45rem/1.15 Georgia, serif; }
.card-copy h3 a { text-decoration: none; }
.cover-placeholder { width: min(88%, 20rem); height: 92%; padding: 2rem; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, #99592c, #41291b); color: white; box-shadow: 0 1.2rem 3rem rgba(40,34,25,.22); }
.cover-placeholder span { font: 700 clamp(1.7rem, 4vw, 3rem)/1 Georgia, serif; }
.cover-placeholder small { font-weight: 700; }
.cover-placeholder--technologie { background: linear-gradient(145deg, #1e6673, #132e3a); }
.cover-placeholder--inspiracje { background: linear-gradient(145deg, #b34433, #551e20); }
.empty-state { padding: 3rem; background: var(--paper); text-align: center; color: var(--muted); }

.publication-detail { padding: 3rem 0 6rem; }
.back-link { display: inline-block; margin-bottom: 2rem; color: var(--muted); text-decoration: none; }
.detail-layout { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(320px, 1.3fr); gap: clamp(2rem, 8vw, 7rem); align-items: center; }
.detail-cover { min-height: 34rem; padding: 2.5rem 2rem 0; display: grid; place-items: end center; background: #dcd6cb; }
.detail-cover img { max-height: 33rem; width: auto; box-shadow: var(--shadow); }
.detail-copy > p:not(.eyebrow) { max-width: 38rem; color: var(--muted); font-size: 1.1rem; }
.not-found { padding: 8rem 0; text-align: center; }
.not-found h1 { margin: 0; font: 700 clamp(2.5rem, 7vw, 5rem)/1 Georgia, serif; }
.not-found p:not(.eyebrow) { color: var(--muted); }

.install-page { padding: clamp(3rem, 7vw, 7rem) 0; }
.install-heading { max-width: 46rem; margin-bottom: 2.5rem; }
.install-heading h1 { margin: 0; font: 700 clamp(2.5rem, 6vw, 5rem)/1 Georgia, serif; letter-spacing: -.045em; }
.install-heading > p:last-child { color: var(--muted); font-size: 1.1rem; }
.requirements-card { padding: clamp(1.25rem, 4vw, 2.5rem); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.requirements-summary { display: flex; justify-content: space-between; gap: 1rem; margin: -1px -1px 2rem; padding: 1rem 1.25rem; border-left: 4px solid; }
.requirements-summary--success { border-color: #23814d; background: #eaf7ef; color: #155a34; }
.requirements-summary--warning { border-color: #c57a18; background: #fff5e5; color: #744408; }
.requirements-summary span { color: inherit; opacity: .8; }
.requirements-card table { width: 100%; border-collapse: collapse; }
.requirements-card th, .requirements-card td { padding: 1rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
.requirements-card thead th { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.check-status { display: inline-block; padding: .25rem .6rem; border-radius: 99px; font-size: .82rem; font-weight: 800; }
.check-status--ok { background: #eaf7ef; color: #155a34; }
.check-status--error { background: #fff0ea; color: #9d2f11; }

.site-footer { display: flex; justify-content: space-between; gap: 3rem; padding: 3rem clamp(1.25rem, 4vw, 4rem); border-top: 1px solid var(--line); background: var(--paper); }
.site-footer p { max-width: 38rem; margin: .5rem 0 0; color: var(--muted); font-size: .88rem; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 65%, white); outline-offset: 3px; }

@media (max-width: 760px) {
  .site-header { min-height: 4.5rem; gap: .75rem; }
  .wordmark small, .main-nav { display: none; }
  .search-toggle span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .admin-entry span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .admin-entry { min-width: 2.65rem; justify-content: center; padding-inline: .65rem; }
  .library-intro { display: block; padding-top: 3.5rem; }
  .issue-count { margin-top: 2rem; padding: 1rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .featured { grid-template-columns: 1fr; }
  .featured-cover { min-height: 25rem; }
  .featured-cover img { max-height: 23rem; }
  .featured-copy { padding: 2.5rem 1.25rem 3.5rem; }
  .section-heading { display: block; }
  .filters { justify-content: flex-start; margin-top: 1.5rem; }
  .publication-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-cover { min-height: 27rem; }
  .site-footer { display: block; }
  .requirements-summary { display: block; }
  .requirements-summary span { display: block; margin-top: .25rem; }
  .requirements-card { overflow-x: auto; }
  .latest-showcase { padding-inline: 0; }
  .latest-heading { padding-inline: 1.25rem; align-items: start; }
  .latest-heading > p { display: none; }
  .latest-grid { display: flex; gap: 1rem; padding: .5rem 1.25rem 2rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
  .latest-card { flex: 0 0 min(66vw, 16rem); scroll-snap-align: center; }
}

@media (max-width: 420px) {
  .publication-grid { grid-template-columns: 1fr; }
  .card-cover { aspect-ratio: 5 / 6; }
}

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