/* ==========================================================================
   Mags Green — strona autorska
   Paleta i styl inspirowane mroczną, „dark academia” estetyką okładek.
   ========================================================================== */

:root {
  --bg:        #10161b;   /* głębokie granatowo-grafitowe tło */
  --bg-2:      #151e26;   /* panele */
  --bg-3:      #1b2731;   /* karty */
  --ink:       #ece5d5;   /* kość słoniowa — tekst główny */
  --ink-soft:  #a9a596;   /* przygaszony tekst */
  --accent:    #c6a35c;   /* antyczne złoto */
  --accent-2:  #6f9069;   /* botaniczna zieleń */
  --line:      rgba(236, 229, 213, 0.12);
  --line-2:    rgba(236, 229, 213, 0.20);
  --shadow:    0 18px 50px rgba(0, 0, 0, 0.55);

  --display: "Cinzel", "Times New Roman", serif;
  --body:    "EB Garamond", Georgia, "Times New Roman", serif;

  --header-h: 66px;
  --wrap: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(111, 144, 105, 0.10), transparent 60%),
    radial-gradient(900px 600px at 0% 0%, rgba(198, 163, 92, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.section { padding: 92px 0; position: relative; }
section[id] { scroll-margin-top: calc(var(--header-h) + 18px); }

/* Tytuły sekcji */
.section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem);
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
.section-title::after {
  content: "";
  display: block;
  width: 64px; height: 2px;
  margin-top: 0.5rem;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-lead { color: var(--ink-soft); margin: 0; }

/* Dostępność: skip link + focus */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #14110a; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ----------------------------- Przyciski ------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 13px 26px;
  border-radius: 2px;
  background: var(--accent);
  color: #14110a;
  border: 1px solid var(--accent);
  transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn:hover {
  text-decoration: none;
  background: #d8b873;
  box-shadow: 0 8px 24px rgba(198, 163, 92, 0.25);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover { background: rgba(236, 229, 213, 0.06); color: var(--ink); box-shadow: none; }
.btn-small { padding: 10px 18px; font-size: 0.74rem; }

/* ------------------------------ Nagłówek ------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(16, 22, 27, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; color: var(--accent); }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 1.12rem; letter-spacing: 0.07em; }

.nav-list { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  padding: 6px 2px;
  transition: color .2s ease;
}
.nav-list a:hover { color: var(--ink); text-decoration: none; }
.nav-cta {
  color: var(--accent) !important;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 7px 16px !important;
}
.nav-cta:hover { border-color: var(--accent); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .25s; }

/* -------------------------------- Hero --------------------------------- */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 110px) 0 clamp(64px, 9vw, 120px); }
.hero-vines {
  position: absolute; inset: 0; width: 100%; height: 100%;
  color: var(--accent-2); opacity: 0.16; pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 56px; align-items: center;
}
.eyebrow {
  font-family: var(--display);
  text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 0.8rem; color: var(--accent); margin: 0 0 18px;
}
.hero-name {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.8rem, 1.6rem + 6vw, 5.4rem);
  line-height: 1.02; margin: 0 0 0.35em; letter-spacing: 0.01em;
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
}
.hero-motto {
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.4rem);
  font-style: italic; color: var(--ink); max-width: 30ch; margin: 0 0 32px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-newest { margin: 26px 0 0; color: var(--ink-soft); font-size: 0.98rem; }
.hero-newest a { font-style: italic; }

.hero-book { display: flex; justify-content: center; }
.hero-cover {
  position: relative; display: block; width: min(300px, 78%);
  border-radius: 4px; transition: transform .3s ease, box-shadow .3s ease;
  box-shadow: var(--shadow);
}
.hero-cover::after {
  content: ""; position: absolute; inset: -30px -30px -10px; z-index: -1;
  background: radial-gradient(closest-side, rgba(198,163,92,0.22), transparent 75%);
}
.hero-cover:hover { transform: translateY(-6px) rotate(-1deg); }

/* ------------------------------ O autorce ------------------------------ */
.section-about {
  background: rgba(20, 28, 36, 0.74);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.about-inner { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 52px; align-items: start; }

/* zdjęcie autorki */
.about-portrait {
  margin: 0; position: relative;
  border: 1px solid var(--line-2);
  border-radius: 140px 140px 8px 8px;   /* łuk u góry — klimat „portretu” */
  overflow: hidden;
  background: var(--bg-3);
  box-shadow: var(--shadow);
}
.about-portrait::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(198, 163, 92, 0.18);
}
.portrait-svg, .portrait-img {
  display: block; width: 100%; aspect-ratio: 300 / 380; object-fit: cover;
}
.portrait-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 18px 16px; text-align: center;
  font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.05em; color: var(--ink);
  background: linear-gradient(to top, rgba(13, 18, 24, 0.92), transparent);
}
.portrait-cap span { display: block; font-family: var(--body); font-style: italic; font-size: 0.82rem; color: var(--accent); letter-spacing: normal; margin-top: 2px; }
.about-text .quote-card { margin-top: 30px; }
.about-text p { color: var(--ink); }
#author-bio { font-size: 1.12rem; }
.about-facts-label { color: var(--ink-soft); margin-bottom: 8px; font-style: italic; }
.about-facts { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.about-facts li {
  font-family: var(--display); font-size: 0.78rem; letter-spacing: 0.04em;
  padding: 7px 15px; border: 1px solid var(--line-2); border-radius: 30px; color: var(--ink-soft);
}
.quote-card {
  position: relative; background: var(--bg-3); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 4px; padding: 30px 28px;
}
.quote-leaf { width: 42px; height: 42px; color: #c6cde6; margin-bottom: 12px; }
.quote-card p { font-size: 1.22rem; font-style: italic; margin: 0 0 14px; line-height: 1.55; }
.quote-sign { color: var(--accent); font-family: var(--display); font-size: 0.82rem; letter-spacing: 0.05em; }

/* ------------------------------- Książki ------------------------------- */
.series-head { margin: 56px 0 26px; }
.series-head:first-child { margin-top: 0; }
.series-name {
  font-family: var(--display); font-weight: 600; font-size: 1.5rem;
  margin: 0 0 6px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.series-status {
  font-family: var(--body); font-style: italic; font-size: 0.85rem;
  color: var(--accent-2); letter-spacing: normal;
}
.series-desc { color: var(--ink-soft); max-width: 70ch; margin: 0 0 6px; }
.series-pack { font-style: italic; font-size: 0.95rem; }

.book-grid {
  display: grid; gap: 30px;
  grid-template-columns: repeat(auto-fill, minmax(244px, 1fr));
}
.book {
  display: flex; flex-direction: column;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.book:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line-2); }

.book-cover-link { position: relative; display: block; }
.book-cover { aspect-ratio: 2 / 3; background: var(--bg); overflow: hidden; }
.cover-svg, .cover-img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* Tekst rysowany wewnątrz automatycznej okładki SVG */
.cover-author { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: 0.32em; fill: #efe8d8; opacity: 0.92; }
.cover-series { font-family: var(--body); font-size: 9.5px; letter-spacing: 0.18em; fill: #efe8d8; opacity: 0.55; }
.cover-title  { font-family: var(--display); font-weight: 700; letter-spacing: 0.02em; }

.badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent); color: #14110a;
  font-family: var(--display); font-weight: 600; font-size: 0.66rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 2px;
}
.badge-18 { left: auto; right: 12px; background: #2a323b; color: var(--ink); border: 1px solid var(--line-2); }

.book-body { display: flex; flex-direction: column; flex: 1; padding: 22px 22px 24px; }
.book-title { font-family: var(--display); font-weight: 600; font-size: 1.2rem; line-height: 1.2; margin: 0 0 6px; }
.book-meta { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; padding: 0; margin: 0 0 14px; }
.tags li {
  font-size: 0.72rem; letter-spacing: 0.03em; color: var(--accent-2);
  border: 1px solid rgba(111,144,105,0.4); border-radius: 20px; padding: 3px 11px;
}
.book-quote { font-style: italic; color: var(--ink); border-left: 2px solid var(--accent); padding-left: 12px; margin: 0 0 14px; }
.book-desc { color: var(--ink-soft); font-size: 0.96rem; margin: 0 0 20px; }
.book-body .btn { margin-top: auto; align-self: flex-start; }

.books-foot { margin-top: 56px; text-align: center; }

/* ------------------------------ Instagram ------------------------------ */
.section-insta { background: rgba(20, 28, 36, 0.74); border-top: 1px solid var(--line); text-align: center; }
.insta-inner { max-width: 600px; margin: 0 auto; }
.insta-icon { width: 46px; height: 46px; color: var(--accent); margin: 0 auto 18px; }
.section-insta .section-title::after { margin-left: auto; margin-right: auto; }
.section-insta p { color: var(--ink-soft); }
.insta-handle { font-family: var(--display); font-size: 1.3rem; color: var(--ink); margin: 6px 0 26px; }

/* -------------------------------- Stopka ------------------------------- */
.site-footer { background: var(--bg); border-top: 1px solid var(--line); padding: 46px 0; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.footer-brand { font-family: var(--display); font-weight: 600; font-size: 1.3rem; letter-spacing: 0.08em; margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.footer-links a { color: var(--ink-soft); font-size: 0.92rem; }
.footer-links a:hover { color: var(--ink); }
.footer-note { color: var(--ink-soft); font-size: 0.82rem; margin: 0; max-width: 60ch; }

/* --------------------------- Astralne tło ----------------------------- */
.sky {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; overflow: hidden;
}
.sky svg { width: 100%; height: 100%; display: block; }
@keyframes twinkle { 0%, 100% { opacity: 0.18; } 50% { opacity: 0.95; } }
.sky .twinkle { animation: twinkle 4.5s ease-in-out infinite; }

/* ---------------------- Odsłanianie przy przewijaniu ------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ------------------------------- RWD ----------------------------------- */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-book { order: -1; }
  .hero-cover { width: min(260px, 62%); }
  .about-inner { grid-template-columns: 1fr; gap: 36px; }
  .about-portrait { width: 100%; max-width: 330px; margin: 0 auto; }
}

@media (max-width: 760px) {
  body { font-size: 18px; }
  .section { padding: 70px 0; }

  .nav-toggle { display: block; }
  nav { position: static; }
  .nav-list {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(16, 22, 27, 0.98);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    max-height: 0; overflow: hidden;
    transition: max-height .3s ease;
  }
  .nav-list.open { max-height: 380px; }
  .nav-list li { border-top: 1px solid var(--line); }
  .nav-list a { display: block; padding: 14px 24px; }
  .nav-cta { margin: 10px 24px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .book, .hero-cover { transition: none; }
  .sky .twinkle { animation: none; opacity: 0.7; }
}
