@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Lora:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --map: #06282b;
  --map-deep: #041f22;
  --paper: #d9cda8;
  --paper-dark: #cfc19c;
  --ink: #25251f;
  --gold: #b8914f;
  --gold-bright: #d0a55d;
  --line: rgba(184, 145, 79, 0.72);
  --red: #b9412e;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  background-color: var(--map-deep);
  background-image:
    linear-gradient(rgba(2, 25, 28, 0.12), rgba(2, 25, 28, 0.12)),
    url("../assets/atlas-map-background.webp");
  background-position: center top;
  background-size: 1536px auto;
  background-attachment: fixed;
  font-family: Georgia, "Times New Roman", serif;
}

button, input, select, a { font: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.atlas-page {
  width: min(1370px, calc(100% - 56px));
  min-height: 100vh;
  margin-inline: auto;
  padding: 38px 0 24px;
}

.atlas-header { position: relative; }
.title-block { position: relative; padding-left: 48px; }
.target-mark {
  position: absolute; top: 39px; left: 0; width: 27px; height: 27px; border: 2px solid var(--red); border-radius: 50%;
}
.target-mark::before, .target-mark::after { position: absolute; content: ""; background: var(--red); }
.target-mark::before { top: 11px; left: -13px; width: 49px; height: 1px; }
.target-mark::after { top: -13px; left: 11px; width: 1px; height: 49px; }
.title-block h1 { margin: 0; color: var(--paper); font-size: clamp(3.3rem, 5.6vw, 5.35rem); font-weight: 400; letter-spacing: -0.035em; line-height: 0.94; }
.title-block p { margin: 11px 0 0 3px; color: var(--gold-bright); font-size: clamp(1rem, 1.45vw, 1.36rem); letter-spacing: 0.08em; }

.filters { display: grid; grid-template-columns: minmax(245px, 300px); max-width: 300px; margin-top: 28px; }
.filter-control {
  display: grid; grid-template-columns: 43px minmax(0, 1fr); align-items: center; min-height: 43px;
  border: 1px solid var(--line); background: rgba(4, 32, 35, 0.72); color: var(--gold-bright);
}
.control-icon { display: grid; height: 100%; place-items: center; border-right: 1px solid rgba(184, 145, 79, 0.45); font-size: 1rem; }
.filter-control select, .filter-control input {
  width: 100%; min-width: 0; height: 41px; padding: 0 34px 0 13px; border: 0; outline: 0;
  background: transparent; color: var(--paper); font: 700 0.7rem Arial, sans-serif; letter-spacing: 0.08em; text-transform: uppercase;
}
.filter-control input { padding-right: 12px; text-transform: none; }
.filter-control input::placeholder { color: #c1b48f; text-transform: uppercase; }
.filter-control:focus-within { outline: 1px solid var(--gold-bright); outline-offset: 2px; }

.catalog { margin-top: 24px; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; }
.system-card {
  position: relative; display: grid; grid-template-rows: auto 82px; height: auto; min-height: 0; overflow: hidden;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2); transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.system-card::before, .system-card::after {
  position: absolute; z-index: 4; width: 16px; height: 16px; content: ""; pointer-events: none;
}
.system-card::before { top: 5px; left: 5px; border-top: 1px solid var(--gold); border-left: 1px solid var(--gold); }
.system-card::after { right: 5px; bottom: 87px; border-right: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.system-card:hover { transform: translateY(-3px); border-color: var(--gold-bright); box-shadow: 0 14px 35px rgba(0, 0, 0, 0.34); }
.cover-frame { position: relative; aspect-ratio: 3 / 4; height: auto; min-height: 0; overflow: hidden; background: #07191b; }
.cover-frame::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg, transparent 68%, rgba(4, 25, 28, 0.4)); pointer-events: none; }
.card-cover { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; filter: saturate(0.72) sepia(0.12) contrast(1.04) brightness(0.84); transition: transform 420ms ease, filter 420ms ease; }
.system-card:hover .card-cover { transform: none; filter: saturate(0.92) sepia(0.06) contrast(1.04) brightness(0.92); }
.route-node { position: absolute; z-index: 3; right: 10px; bottom: 9px; width: 18px; height: 18px; border: 2px solid var(--red); border-radius: 50%; }
.route-node::after { position: absolute; top: 6px; left: 6px; width: 3px; height: 3px; border-radius: 50%; background: var(--red); content: ""; }

.card-footer { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; min-width: 0; background: var(--paper); border-top: 1px solid #675f4e; }
.card-icon { display: grid; height: 100%; place-items: center; border-right: 1px solid rgba(65, 59, 47, 0.34); font-size: 1.45rem; }
.card-copy { min-width: 0; padding: 9px 12px; }
.system-card h3 { margin: 0; overflow: hidden; color: #332e25; font-size: clamp(1.05rem, 1.55vw, 1.34rem); font-weight: 400; line-height: 1.04; text-overflow: ellipsis; white-space: nowrap; }
.card-tag { display: inline-block; margin-top: 6px; padding: 3px 7px; background: #738472; color: #ece2c7; font: 700 0.58rem Arial, sans-serif; letter-spacing: 0.07em; text-transform: uppercase; }
.system-card.is-detail { outline: 1px solid rgba(208, 165, 93, 0.72); outline-offset: -5px; }
.empty-state { margin: 70px 0; color: var(--paper); text-align: center; }

.atlas-footer { position: relative; min-height: 82px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(184, 145, 79, 0.5); text-align: center; }
.footer-ornament { color: var(--gold); font-size: 1rem; letter-spacing: 0.2em; }
.atlas-footer p { margin: 9px 0 0; color: var(--red); font: 700 0.62rem Arial, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; }
.atlas-footer a { position: absolute; right: 0; bottom: 10px; color: var(--gold); font: 700 0.58rem Arial, sans-serif; letter-spacing: 0.1em; }

@media (max-width: 980px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  body { background-size: auto 1024px; }
  .atlas-page { width: min(100% - 28px, 520px); padding-top: 25px; }
  .title-block { padding-left: 31px; }
  .target-mark { top: 20px; width: 18px; height: 18px; }
  .target-mark::before { top: 7px; left: -8px; width: 31px; }
  .target-mark::after { top: -8px; left: 7px; height: 31px; }
  .title-block h1 { font-size: clamp(2.45rem, 12vw, 4rem); }
  .filters, .catalog-grid { grid-template-columns: 1fr; }
  .atlas-footer a { position: static; display: inline-block; margin-top: 12px; }
}

/* ============================================================
   KIERUNEK 1 — ATLAS KARTOGRAFICZNY
   typografia: Cinzel (tytul) · Lora (nazwy) · IBM Plex Sans (UI)
   ============================================================ */

body { font-family: "Lora", Georgia, serif; }

/* --- naglowek --- */
.title-block h1 {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.14em !important;
  line-height: 1.06 !important;
  text-transform: uppercase;
}
.title-block p {
  font-family: "Lora", Georgia, serif;
  font-style: italic;
  letter-spacing: 0.02em !important;
}

/* --- filtry jako pigulki --- */
.filters {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  max-width: none !important;
  grid-template-columns: none !important;
}
.filter-pill {
  padding: 7px 16px;
  border: 1px solid rgba(184, 145, 79, 0.45);
  border-radius: 22px;
  background: rgba(4, 31, 34, 0.55);
  color: #a99a76;
  font: 500 0.76rem "IBM Plex Sans", sans-serif;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.filter-pill:hover { color: var(--paper); border-color: var(--gold); }
.filter-pill.is-active {
  border-color: var(--gold-bright);
  background: rgba(184, 145, 79, 0.16);
  color: var(--paper);
}
.filter-pill:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* --- karty --- */
.system-card { grid-template-rows: auto 1fr !important; }
.card-footer { align-items: stretch !important; padding-block: 2px; }
.card-copy h3 {
  margin: 0;
  font-family: "Lora", Georgia, serif;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.22;
  color: var(--ink);
}
.card-tag {
  font-family: "IBM Plex Sans", sans-serif !important;
  font-weight: 500 !important;
  letter-spacing: 0.05em !important;
}
.card-meta {
  display: block;
  margin-top: 6px;
  color: #7d3a2a;
  font: 500 0.62rem "IBM Plex Sans", sans-serif;
  letter-spacing: 0.03em;
}

/* --- stopka --- */
.atlas-footer p,
.atlas-footer a { font-family: "IBM Plex Sans", sans-serif !important; }

@media (max-width: 640px) {
  .title-block h1 { letter-spacing: 0.08em !important; }
  .filter-pill { padding: 6px 13px; font-size: 0.72rem; }
}

/* atrybut hidden musi wygrac z display:grid na karcie */
.system-card[hidden] { display: none !important; }

/* tytul i podtytul wyrownane do lewej krawedzi siatki */
.title-block { padding-left: 0 !important; }
.title-block p { margin-left: 0 !important; }

/* tytul strony glownej: Cinzel Decorative */
.title-block h1 {
  font-family: "Cinzel Decorative", Georgia, serif !important;
  letter-spacing: 0.1em !important;
  line-height: 1.18 !important;
}
@media (max-width: 640px) {
  .title-block h1 { letter-spacing: 0.05em !important; }
}
