/* ===========================================
   BAJKI BRACI — paleta akwarelowa
   granat nocnego nieba + złoto gwiazd + ciepłe drewno
   =========================================== */
:root {
  --navy-deep: #1a2344;
  --navy: #2a3564;
  --navy-soft: #3d4a7d;
  --gold: #d4a84b;
  --gold-warm: #e0b968;
  --gold-pale: #f4e3b8;
  --wood-dark: #5a3e2b;
  --wood: #8b6239;
  --wood-light: #c19875;
  --cream: #faf4e8;
  --cream-warm: #f5ead2;
  --paper: #fdf9ef;
  --ink: #2d2416;
  --star: #ffd76b;

  --shadow-soft: 0 10px 40px -15px rgba(26, 35, 68, 0.25);
  --shadow-card: 0 20px 60px -20px rgba(90, 62, 43, 0.35), 0 8px 20px -10px rgba(26, 35, 68, 0.2);
  --shadow-card-hover: 0 35px 80px -25px rgba(90, 62, 43, 0.5), 0 15px 30px -15px rgba(26, 35, 68, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Lora', Georgia, serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  overflow-x: hidden;

  /* bardzo subtelna papierowa tekstura — bez kolorowych plam które by się zderzały z hero */
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ===========================================
   NAGŁÓWEK — nocne niebo z gwiazdami
   =========================================== */
.hero {
  position: relative;
  padding: 4rem 1.5rem 14rem;
  background:
    /* bardzo delikatny szum — tylko do ukrycia banding, niewidoczny gołym okiem */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E"),
    /* główny gradient — noc przez lawendowo-perłowe tony do dokładnego koloru papieru */
    linear-gradient(180deg,
      var(--navy-deep) 0%,
      var(--navy-deep) 22%,
      #2e3866 38%,
      #4a5284 52%,
      #7782a8 63%,
      #a5aec8 72%,
      #c8cde0 80%,
      #e0dfd0 87%,
      var(--paper) 95%,
      var(--paper) 100%);
  background-blend-mode: soft-light, normal;
  overflow: hidden;
  text-align: center;
  color: var(--cream);
}

/* rozsypane gwiazdki w tle hero */
.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.stars::before,
.stars::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, var(--star), transparent),
    radial-gradient(1px 1px at 40% 70%, var(--gold-warm), transparent),
    radial-gradient(2px 2px at 60% 20%, var(--star), transparent),
    radial-gradient(1px 1px at 80% 50%, var(--gold-pale), transparent),
    radial-gradient(1.5px 1.5px at 15% 80%, var(--star), transparent),
    radial-gradient(1px 1px at 90% 15%, var(--gold-warm), transparent),
    radial-gradient(1.5px 1.5px at 35% 10%, var(--gold-pale), transparent),
    radial-gradient(1px 1px at 70% 85%, var(--star), transparent),
    radial-gradient(2px 2px at 50% 45%, var(--gold-warm), transparent),
    radial-gradient(1px 1px at 25% 55%, var(--star), transparent);
  background-size: 100% 100%;
  animation: twinkle 6s ease-in-out infinite;
}
.stars::after {
  animation-delay: 3s;
  background-image:
    radial-gradient(1px 1px at 10% 40%, var(--gold-pale), transparent),
    radial-gradient(1.5px 1.5px at 55% 75%, var(--star), transparent),
    radial-gradient(1px 1px at 85% 35%, var(--gold-warm), transparent),
    radial-gradient(2px 2px at 30% 25%, var(--star), transparent),
    radial-gradient(1px 1px at 65% 60%, var(--gold-pale), transparent),
    radial-gradient(1.5px 1.5px at 95% 75%, var(--star), transparent);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.5; }
}

/* księżyc w rogu */
.moon {
  position: absolute;
  top: 3rem;
  right: 8%;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-pale), var(--gold-warm) 60%, var(--gold) 100%);
  box-shadow: 0 0 40px rgba(212, 168, 75, 0.4), inset -8px -8px 20px rgba(90, 62, 43, 0.2);
  opacity: 0.85;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

.hero-logo {
  width: clamp(95px, 11vw, 140px);
  height: auto;
  display: block;
  margin: 0 auto 1.25rem;
  /* wielowarstwowy blask — bliska aura + daleki glow — żeby logo "świeciło" w tle nocnego nieba */
  filter:
    drop-shadow(0 0 8px rgba(255, 215, 107, 0.5))
    drop-shadow(0 0 25px rgba(212, 168, 75, 0.4))
    drop-shadow(0 0 50px rgba(212, 168, 75, 0.25))
    drop-shadow(0 8px 20px rgba(0, 0, 0, 0.2));
  animation: logoFloat 7s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.hero-ornament {
  font-family: 'Caveat', cursive;
  color: var(--gold-warm);
  font-size: 1.3rem;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.hero h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--cream);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero h1 em {
  font-style: italic;
  color: var(--gold-warm);
  font-weight: 500;
}

.hero-subtitle {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  color: var(--gold-pale);
  margin-bottom: 2rem;
  font-weight: 500;
}

.hero-lead {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--cream);
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ozdobny separator */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem auto;
  color: var(--gold-warm);
}
.divider::before,
.divider::after {
  content: '';
  height: 1px;
  width: 60px;
  background: linear-gradient(90deg, transparent, var(--gold-warm), transparent);
}
.divider-star {
  font-size: 1rem;
  opacity: 0.7;
}

/* ===========================================
   SEKCJA KATALOGU
   =========================================== */
.catalog {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.section-label {
  text-align: center;
  font-family: 'Caveat', cursive;
  color: var(--wood);
  font-size: 1.3rem;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.section-title {
  text-align: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--navy-deep);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.section-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3.5rem;
  color: var(--wood-dark);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* tag serii */
.series-header {
  margin: 3rem 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.series-header:first-child { margin-top: 0; }

.series-header h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-style: italic;
  font-size: 1.6rem;
  color: var(--navy);
  white-space: nowrap;
}

.series-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--wood-light), transparent);
}

/* siatka */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem 2rem;
}

/* ===========================================
   KARTA KSIĄŻECZKI
   =========================================== */
.book {
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.book:hover {
  transform: translateY(-6px);
}

/* okładka — stylizowana na książkę z grzbietem */
.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 4px 8px 8px 4px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.4s ease;
  margin-bottom: 1.25rem;
  cursor: pointer;
}

.book:hover .cover {
  box-shadow: var(--shadow-card-hover);
}

/* grzbiet książki po lewej */
.cover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,0.25), rgba(0,0,0,0.05) 60%, transparent);
  z-index: 3;
  pointer-events: none;
}

/* winieta */
.cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.15));
  z-index: 2;
  pointer-events: none;
}

.cover-inner {
  position: absolute;
  inset: 0;
  padding: 1.5rem 1.25rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}

.cover-top,
.cover-bottom {
  font-family: 'Caveat', cursive;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

.cover-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.cover-title em {
  font-style: italic;
  font-weight: 500;
  display: block;
  font-size: 1.1rem;
  margin-top: 0.35rem;
  opacity: 0.85;
}

.cover-ornament {
  font-size: 1.3rem;
  opacity: 0.7;
  margin: 0.5rem 0;
}

/* okładka-obraz: wypełnia całą kartę */
.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* warianty okładek — każda seria/książka ma swój klimat */
.cover.c-bezpieczne { background: linear-gradient(160deg, #2d5a3d, #4a7c59 60%, #3d6b4a); color: var(--cream); }
.cover.c-dbam      { background: linear-gradient(160deg, #6b3d4a, #9a5869 60%, #7d4757); color: var(--cream); }
.cover.c-emocje    { background: linear-gradient(160deg, #3d4a7d, #5a6aa3 60%, #4a5894); color: var(--cream); }
.cover.c-rodz1     { background: linear-gradient(160deg, #a85a3d, #c47a4e 60%, #b06a42); color: var(--cream); }
.cover.c-rodz2     { background: linear-gradient(160deg, #8b4a2d, #a86342 60%, #945638); color: var(--cream); }
.cover.c-samodz    { background: linear-gradient(160deg, #7d5d2a, #a88340 60%, #8d6d32); color: var(--cream); }
.cover.c-cialo     { background: linear-gradient(160deg, #5a7d6a, #7a9a88 60%, #6a8a78); color: var(--cream); }
.cover.c-koniec    { background: linear-gradient(160deg, #4a3d5a, #6a5a7d 60%, #584a6a); color: var(--cream); }
.cover.c-rozwod    { background: linear-gradient(160deg, #3d5a6b, #5a7a8b 60%, #4a6a7d); color: var(--cream); }
.cover.c-zlosc     { background: linear-gradient(160deg, #8b2d3d, #a8455a 60%, #943847); color: var(--cream); }
.cover.c-leon      { background: linear-gradient(160deg, #3d3d3d, #5a4a3d 60%, #4a3d2d); color: var(--cream); }

/* meta pod okładką */
.meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-family: 'Caveat', cursive;
  font-size: 1.05rem;
  color: var(--wood);
}

.meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.book h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--navy-deep);
  margin-bottom: 0.6rem;
  letter-spacing: -0.005em;
}

.book h2 em {
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  display: block;
  color: var(--navy-soft);
  margin-top: 0.15rem;
}

.book p {
  color: var(--wood-dark);
  font-size: 0.97rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex: 1;
}

/* stopka karty */
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--wood-light);
}

.price {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--navy-deep);
  letter-spacing: -0.01em;
}

.price small {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--wood);
  margin-left: 0.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  background: var(--navy-deep);
  color: var(--gold-pale);
  text-decoration: none;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 75, 0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.btn:hover {
  background: var(--navy);
  color: var(--star);
  transform: translateX(2px);
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-arrow {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* ===========================================
   STOPKA
   =========================================== */
footer {
  background: var(--navy-deep);
  color: var(--cream);
  padding: 3rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent,
    var(--gold-warm) 20%,
    var(--gold) 50%,
    var(--gold-warm) 80%,
    transparent);
}

.footer-logo {
  width: 70px;
  height: auto;
  display: block;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 0 15px rgba(212, 168, 75, 0.3));
  opacity: 0.95;
}

.footer-brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--gold-warm);
  margin-bottom: 0.3rem;
}

.footer-brand em {
  font-style: italic;
  font-weight: 500;
  color: var(--cream);
  font-size: 1.3rem;
  display: block;
}

.footer-motto {
  font-family: 'Caveat', cursive;
  color: var(--gold-pale);
  font-size: 1.15rem;
  margin: 1rem 0 1.5rem;
  opacity: 0.9;
}

.footer-small {
  font-size: 0.85rem;
  color: var(--cream);
  opacity: 0.6;
}

/* ===========================================
   RESPONSYWNOŚĆ
   =========================================== */
@media (max-width: 640px) {
  .hero { padding: 3rem 1.25rem 4rem; }
  .moon { width: 50px; height: 50px; top: 2rem; right: 1.5rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2rem 1.25rem; }
  .card-foot { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .price { text-align: center; }
  .btn { justify-content: center; }
}

/* wejście sekcji */
@media (prefers-reduced-motion: no-preference) {
  .book {
    animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .book:nth-child(1) { animation-delay: 0.05s; }
  .book:nth-child(2) { animation-delay: 0.12s; }
  .book:nth-child(3) { animation-delay: 0.19s; }
  .book:nth-child(4) { animation-delay: 0.26s; }
  .book:nth-child(5) { animation-delay: 0.33s; }
  .book:nth-child(6) { animation-delay: 0.4s; }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
}