/* ==========================================================
   P.A. Dziennik – strona autorska
   Spis: 1 Zmienne · 2 Baza · 3 Nawigacja · 4 Hero · 5 Książki
         6 O mnie · 7 Newsletter · 8 Social · 9 Kontakt · 10 Footer
         11 Animacje · 12 Responsywność
   ========================================================== */

/* ---------- 1. ZMIENNE (tu zmienisz kolory i fonty) ---------- */
:root {
  --ink: #0a0809;          /* czerń strony */
  --ink-2: #110c0e;        /* czerń nieco jaśniejsza (panele) */
  --plum: #1a0c14;         /* głęboka śliwka (kontakt) */
  --bone: #e9e4dc;         /* złamana biel */
  --bone-dim: #a9a29a;     /* przygaszony tekst na ciemnym */
  --gold: #c4a46a;         /* złoty akcent */
  --gold-soft: rgba(196, 164, 106, .38);

  --font-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1280px;
  --pad: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 2. BAZA ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
section[id] { scroll-margin-top: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.h-section {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 104px);
  line-height: 1;
  letter-spacing: -.015em;
}
.h-section--dark { font-size: clamp(32px, 4.4vw, 58px); line-height: 1.12; letter-spacing: -.01em; }

/* Przyciski */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 30px;
  font: 500 15px/1 var(--font-body);
  letter-spacing: .03em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: #d8bd86; }
.btn--ghost { border-color: rgba(233, 228, 220, .5); color: var(--bone); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--full { width: 100%; }

/* ---------- 3. NAWIGACJA ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top, 0px)) var(--pad) 18px;
  transition: background-color .4s var(--ease), padding .4s var(--ease);
}
.nav.is-scrolled {
  background: rgba(10, 8, 9, .88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: 12px;
  border-bottom: 1px solid rgba(233, 228, 220, .08);
}
.nav__brand {
  font-family: var(--font-display); font-size: 21px; letter-spacing: .01em;
  text-decoration: none; position: relative; z-index: 2;
}
.nav__menu { display: flex; gap: clamp(20px, 3vw, 40px); }
.nav__menu a {
  font-size: 14px; letter-spacing: .03em; text-decoration: none; color: var(--bone);
  padding-block: 6px; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat;
  transition: background-size .4s var(--ease), color .3s;
}
.nav__menu a:hover { background-size: 100% 1px; color: #fff; }
.nav__toggle { display: none; }

/* ---------- 4. HERO ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end; overflow: hidden;
  background: var(--ink);
}
.hero__media { position: absolute; top: 0; bottom: 0; right: 0; width: 64%; }
.hero__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 38%);
          mask-image: linear-gradient(to right, transparent 0, #000 38%);
  will-change: transform;
}
.hero__media::after { /* przyciemnienie dołu pod tekst */
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(to top, var(--ink), transparent);
  pointer-events: none;
}
.hero__content {
  position: relative; z-index: 2; width: 100%; max-width: var(--wrap);
  margin-inline: auto; padding: 140px var(--pad) clamp(48px, 9vh, 104px);
}
.hero__name {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(60px, 10.4vw, 190px);
  line-height: .9; letter-spacing: -.03em;
  margin-bottom: clamp(24px, 4vh, 48px);
}
.hero__line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__line > span { display: block; }
.hero__line--2 { padding-left: .55em; }
.hero__slogan {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(24px, 2.7vw, 40px); line-height: 1.2; max-width: 22ch;
}
.hero__sub { margin-top: 12px; color: var(--bone-dim); font-size: 16px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

/* ---------- 5. KSIĄŻKI ---------- */
.books { background: var(--ink); }
.books__intro { padding-top: clamp(88px, 13vw, 180px); display: grid; gap: 20px; }
.books__lead { max-width: 46ch; color: var(--bone-dim); font-size: 18px; }
.books__series { margin-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(56px, 9vw, 120px); display: flex; justify-content: center; }
.books__series img {
  width: 100%; max-width: 1020px;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 68%, transparent 100%);
          mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 68%, transparent 100%);
}

.book {
  background: var(--bg); color: var(--fg);
  padding-block: clamp(80px, 12vw, 168px);
}
.book--navy     { --bg: #0a1424; --fg: #e6ebf1; --muted: #9db0c3; --accent: #c3ced9; --btn-bg: #dfe6ee; --btn-fg: #0a1424; }
.book--oxblood  { --bg: #1d070b; --fg: #f0e3df; --muted: #bb9c96; --accent: #d29a78; --btn-bg: #d29a78; --btn-fg: #1d070b; }
.book--rose     { --bg: #e9b8c3; --fg: #33091b; --muted: #6a2c42; --accent: #9c1238; --btn-bg: #33091b; --btn-fg: #f9e6eb; }

.book__inner {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(40px, 8vw, 120px); row-gap: 48px;
}
.book--flip .book__cover { grid-column: 2; grid-row: 1; }
.book--flip .book__text { grid-column: 1; grid-row: 1; }

.book__cover { position: relative; width: 100%; max-width: 470px; justify-self: center; }
.book__cover img {
  width: 100%;
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .75), 0 18px 30px -18px rgba(0, 0, 0, .6);
  transition: transform .8s var(--ease);
}
.book--rose .book__cover img { box-shadow: 0 50px 80px -30px rgba(80, 10, 40, .55), 0 18px 30px -18px rgba(80, 10, 40, .4); }
.book__cover::after { /* delikatny połysk przy grzbiecie */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,.2) 0, rgba(255,255,255,.04) 2.4%, transparent 5%);
}
.book__cover:hover img { transform: translateY(-6px); }

.book__text { max-width: 560px; }
.book__kind { color: var(--accent); font-size: 15px; letter-spacing: .03em; margin-bottom: 14px; }
.book__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(52px, 7.6vw, 112px); line-height: .95; letter-spacing: -.02em;
}
.book__title--caps { letter-spacing: .01em; }
.book__subtitle { font-family: var(--font-display); font-style: italic; font-size: clamp(20px, 2vw, 26px); margin-top: 10px; color: var(--accent); }
.book__desc { margin-top: 28px; max-width: 54ch; font-size: 17.5px; }
.book__desc p + p { margin-top: 1em; }
.book__desc .book__hook { font-family: var(--font-display); font-style: italic; font-size: 1.25em; line-height: 1.35; color: var(--accent); margin-top: 1.2em; }
.book__tropes-title { margin-top: 32px; margin-bottom: 12px; font: 500 14px/1 var(--font-body); color: var(--muted); letter-spacing: .03em; }
.tropes { display: flex; flex-wrap: wrap; gap: 8px; }
.tropes li { font-size: 14px; line-height: 1; padding: 10px 14px; border: 1px solid currentColor; border-color: color-mix(in srgb, var(--fg) 32%, transparent); }
.book__warn { margin-top: 22px; font-size: 13.5px; color: var(--muted); }
.book__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px 32px; margin-top: 36px; }
.btn--book { background: var(--btn-bg); color: var(--btn-fg); }
.btn--book:hover { background: var(--fg); color: var(--bg); }
.book__shops { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; color: var(--muted); }
.book__shops a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; text-decoration-thickness: 1px; transition: text-decoration-color .3s; }
.book__shops a:hover { text-decoration-color: var(--fg); }

.book__art { grid-column: 1 / -1; margin-top: clamp(24px, 4vw, 64px); }
.book__art img { width: 100%; max-width: 760px; margin-inline: auto; box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .75); }

.book__art--portrait img { max-width: 480px; }

.book__art--illu img { mix-blend-mode: multiply; box-shadow: none; max-width: 420px; }

/* ---------- 6. O MNIE ---------- */
.about { background: var(--bone); color: #1a1214; padding-block: clamp(80px, 12vw, 168px); }
.about__inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(40px, 8vw, 120px); row-gap: 48px; align-items: center; }
.about__photo img { width: 100%; max-width: 560px; margin-inline: auto; filter: drop-shadow(0 28px 36px rgba(40, 20, 20, .28)); }
.about__text { max-width: 580px; }
.about__text p { margin-top: 22px; font-size: 18px; }
.about__text .h-section { margin-bottom: 34px; }
.about__sign { width: min(320px, 70%); margin-top: 36px; margin-left: -6px; }

/* ---------- 7. NEWSLETTER ---------- */
.news { background: var(--ink); padding-block: clamp(88px, 13vw, 176px); }
.news__inner { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: clamp(40px, 8vw, 112px); row-gap: 56px; align-items: center; }
.news__lead { margin-top: 26px; max-width: 44ch; font-size: 18px; color: var(--bone-dim); }
.news__list { margin-top: 30px; display: grid; gap: 12px; }
.news__list li { position: relative; padding-left: 36px; }
.news__list li::before { content: ""; position: absolute; left: 0; top: .85em; width: 20px; height: 1px; background: var(--gold); }
.news__formwrap { border: 1px solid var(--gold-soft); background: var(--ink-2); padding: clamp(28px, 4vw, 52px); }
.field { margin-bottom: 26px; }
.field label { display: block; font-size: 14px; color: var(--bone-dim); letter-spacing: .03em; margin-bottom: 4px; }
.field input {
  width: 100%; padding: 12px 0; font: 400 18px/1.3 var(--font-body); color: var(--bone);
  background: transparent; border: 0; border-bottom: 1px solid rgba(233, 228, 220, .35); border-radius: 0;
  transition: border-color .3s;
}
.field input:focus { outline: none; border-bottom-color: var(--gold); }
.field input[aria-invalid="true"] { border-bottom-color: #d9776b; }
.field__error { margin-top: 8px; font-size: 14px; color: #e59a90; }
.news__embed { display: block; width: 100%; border: 0; }
.news__fine { margin-top: 18px; font-size: 13px; line-height: 1.55; color: var(--bone-dim); }
.news__thanks { padding-block: 12px; }
.news__thanks-title { font-family: var(--font-display); font-size: clamp(32px, 4vw, 48px); line-height: 1.1; margin-bottom: 12px; }

/* ---------- 8. SOCIAL ---------- */
.social { background: var(--ink-2); padding-block: clamp(80px, 11vw, 150px); border-top: 1px solid rgba(233, 228, 220, .07); }
.social__list { margin-top: clamp(36px, 5vw, 64px); border-bottom: 1px solid rgba(233, 228, 220, .18); }
.social__list li { border-top: 1px solid rgba(233, 228, 220, .18); }
.social__list a { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-block: clamp(20px, 3vw, 34px); text-decoration: none; transition: padding-left .5s var(--ease), color .3s; }
.social__name { font-family: var(--font-display); font-size: clamp(36px, 6.4vw, 92px); line-height: 1; letter-spacing: -.015em; }
.social__meta { color: var(--bone-dim); font-size: 15px; white-space: nowrap; transition: color .3s; }
.social__list a:hover { padding-left: 14px; color: var(--gold); }
.social__list a:hover .social__meta { color: var(--gold); }

/* ---------- 9. KONTAKT ---------- */
.contact { background: var(--plum); padding-block: clamp(88px, 12vw, 164px); }
.contact__lead { margin-top: 22px; color: var(--bone-dim); font-size: 18px; max-width: 46ch; }
.contact__mail {
  display: inline-block; margin-top: clamp(28px, 4vw, 52px);
  font-family: var(--font-display); font-style: italic; font-size: clamp(14px, 5.5vw, 70px); line-height: 1.15; white-space: nowrap; max-width: 100%;
  text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: .22em;
  transition: color .3s;
}
.contact__mail:hover { color: var(--gold); }

/* ---------- 10. FOOTER ---------- */
.footer { background: var(--ink); padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; }
.footer__logo { width: 84px; opacity: .85; }
.footer__copy, .footer__links { font-size: 13px; color: var(--bone-dim); }
.footer__links a { text-decoration: none; }
.footer__links a:hover { color: var(--gold); }

/* ---------- 11. ANIMACJE ---------- */
.js [data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Wejście hero: jedno, spokojne */
.js .hero__line > span { transform: translateY(105%); animation: rise 1.3s var(--ease) forwards; }
.js .hero__line--2 > span { animation-delay: .14s; }
.js .hero__slogan, .js .hero__sub, .js .hero__actions { opacity: 0; animation: fade 1.1s var(--ease) forwards; }
.js .hero__slogan { animation-delay: .7s; }
.js .hero__sub { animation-delay: .85s; }
.js .hero__actions { animation-delay: 1s; }
.js .hero__media img { opacity: 0; animation: fade 1.8s ease .1s forwards; }
@keyframes rise { to { transform: none; } }
@keyframes fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal], .js .hero__line > span, .js .hero__slogan, .js .hero__sub, .js .hero__actions, .js .hero__media img {
    opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important;
  }
  .book__cover img, .social__list a { transition: none; }
}

/* ---------- 12. RESPONSYWNOŚĆ ---------- */
@media (max-width: 1099px) {
}

@media (max-width: 819px) {
  body { font-size: 16.5px; }

  /* nawigacja – menu pełnoekranowe */
  .nav__toggle {
    display: block; position: relative; z-index: 2; width: 44px; height: 44px; margin-right: -10px;
    background: none; border: 0; cursor: pointer;
  }
  .nav__toggle span { position: absolute; left: 10px; right: 10px; height: 1px; background: var(--bone); transition: transform .4s var(--ease), top .4s var(--ease); }
  .nav__toggle span:nth-child(1) { top: 18px; }
  .nav__toggle span:nth-child(2) { top: 26px; }
  .nav__toggle[aria-expanded="true"] span:nth-child(1) { top: 22px; transform: rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { top: 22px; transform: rotate(-45deg); }
  .nav__menu {
    position: fixed; inset: 0; z-index: 1; background: var(--ink);
    flex-direction: column; justify-content: center; gap: 8px; padding: 80px var(--pad);
    opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s;
  }
  .nav__menu a { font-family: var(--font-display); font-size: 40px; line-height: 1.25; background: none; }
  .nav.is-open .nav__menu { opacity: 1; visibility: visible; }
  .nav.is-open { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: transparent; }

  /* hero – zdjęcie w tle, tekst na dole */
  .hero__media { width: 100%; }
  .hero__media img { object-position: 50% 12%; -webkit-mask-image: none; mask-image: none; }
  .hero__media::after { height: 62%; background: linear-gradient(to top, var(--ink) 18%, transparent); }
  .hero__content { padding-top: 120px; }
  .hero__name { font-size: clamp(60px, 19vw, 120px); }
  .hero__actions .btn { flex: 1 1 100%; }

  /* książki i sekcje dwukolumnowe */
  .book__inner, .about__inner, .news__inner { grid-template-columns: minmax(0, 1fr); }
  .book--flip .book__cover, .book--flip .book__text { grid-column: auto; grid-row: auto; }
  .book__cover { max-width: min(78vw, 400px); }
  .book__actions .btn { width: 100%; }
  .about__photo img { max-width: min(86vw, 440px); }
  .social__meta { display: none; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}
