/* zigstory — styl strony z opowiadaniami.
   Paleta i typografia odtworzone z oryginalnego projektu „Zigfi's Creations”. */

:root {
  --night: #07050d;
  --night-2: #0d0819;
  --night-3: #130c1e;
  --violet: #160d2b;
  --violet-soft: #28134b;
  --violet-line: #423074;
  --ink: #f4efe6;
  --muted: #bdb5b7;
  --gold: #d6a86a;
  --gold-bright: #f0c889;
  --ice: #a7c8e8;
  --warn: #e2867a;
  --line: #d6a86a57;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  /* Szerokość kolumny tekstu w rem, nie w ch — inaczej serif i sans
     dawałyby różne szerokości i nagłówek nie trzymałby linii z treścią. */
  --measure: 42rem;
  --wrap: 1180px;
  --radius: 18px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Delikatna mgła nocy w tle — nieruchoma, nie przeszkadza w czytaniu. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 12% -8%, #10081f 0%, transparent 62%),
    radial-gradient(900px 560px at 92% 4%, var(--violet) 0%, transparent 58%),
    radial-gradient(1200px 800px at 50% 108%, #0d0c1d 0%, transparent 60%),
    var(--night);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

::selection { background: var(--violet-soft); color: var(--ink); }

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

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--violet-soft);
  color: var(--ink);
  border-radius: 8px;
}

/* ---------- typografia ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: .7rem;
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--line);
}

.lead {
  font-size: 1.16rem;
  color: var(--muted);
  max-width: 56ch;
  margin: 1.4rem 0 0;
}

/* ---------- nagłówek ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--night) 78%, transparent);
  border-bottom: 1px solid #d6a86a1f;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .95rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--serif);
  font-size: 1.06rem;
  color: var(--ink);
  letter-spacing: .01em;
}
.brand:hover { color: var(--ink); }
.brand__mark { color: var(--gold); font-size: .95rem; }

.nav {
  display: flex;
  gap: 1.9rem;
  font-size: .84rem;
  letter-spacing: .05em;
}
.nav a { color: #f4efe6b8; }
.nav a:hover { color: var(--gold-bright); }

@media (max-width: 760px) {
  .nav { display: none; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: min(94vh, 900px);
  display: flex;
  align-items: flex-end;
  padding: 7rem 0 3.5rem;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .55;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #07050dcc 0%, #07050d40 35%, #07050ded 88%, var(--night) 100%),
    linear-gradient(90deg, #07050dd9 0%, transparent 62%);
}

.hero__inner { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.1rem);
  max-width: 15ch;
}
.hero h1 .accent {
  display: block;
  color: var(--gold);
  font-style: italic;
}

.hero .lead { font-size: 1.22rem; max-width: 52ch; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .82rem 1.6rem;
  border-radius: 999px;
  font-size: .92rem;
  letter-spacing: .02em;
  border: 1px solid transparent;
  transition: background .22s ease, color .22s ease, border-color .22s ease, transform .22s ease;
}
.button span { transition: transform .22s ease; }
.button:hover span { transform: translateX(5px); }

.button--primary {
  background: var(--gold);
  color: #100b06;
  font-weight: 500;
}
.button--primary:hover { background: var(--gold-bright); color: #100b06; }

.button--quiet {
  color: #f4efe6c2;
  border-color: var(--line);
}
.button--quiet:hover { color: var(--ink); border-color: var(--gold); }

.scroll-cue {
  margin-top: 3.2rem;
  font-size: .72rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #f4efe680;
  display: flex;
  align-items: center;
  gap: .7rem;
}
.scroll-cue::after {
  content: "";
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ---------- sekcje ---------- */

.section { padding: 6.5rem 0; }
.section--tight { padding: 4.5rem 0; }
.section__head { max-width: 60ch; margin-bottom: 3.4rem; }
.section__head h2 { font-size: clamp(2rem, 4.2vw, 3rem); }

.rule {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 0;
}

/* ---------- karty opowiadań ---------- */

.stories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 2.2rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff08, #ffffff02);
  border: 1px solid #d6a86a24;
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .28s ease, transform .28s ease, box-shadow .28s ease;
}
.card:hover {
  border-color: var(--line);
  transform: translateY(-4px);
  box-shadow: 0 24px 60px -30px #000, 0 0 0 1px #d6a86a1a;
}

.card__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--night-2);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .86;
  transition: transform .6s cubic-bezier(.2, .7, .3, 1), opacity .35s ease;
}
.card:hover .card__media img { transform: scale(1.045); opacity: 1; }

.card__body {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: 1.7rem 1.6rem 1.9rem;
  flex: 1;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
}

.card__num {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--gold);
  line-height: 1;
}

.pill {
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ice);
  border: 1px solid #a7c8e83d;
  border-radius: 999px;
  padding: .28rem .7rem;
}

.pill--adult {
  color: var(--warn);
  border-color: #e2867a5c;
  background: #e2867a14;
  font-weight: 500;
}

.card__genre {
  margin: 0;
  font-size: .74rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #bdb5b7c4;
}

.card__title { font-size: 1.62rem; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--gold-bright); }

.card__lead {
  margin: 0;
  color: var(--muted);
  font-size: .97rem;
}

.link-arrow {
  margin-top: auto;
  padding-top: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .87rem;
  letter-spacing: .04em;
}
.link-arrow span { transition: transform .22s ease; }
.link-arrow:hover span { transform: translate(4px, 4px); }

/* ---------- wyróżniony fragment ---------- */

.featured {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3.5rem;
  align-items: center;
}
@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; gap: 2.4rem; }
}

.featured__media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #d6a86a24;
}
.featured__media img { width: 100%; }

.featured h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }

.quote {
  margin: 2rem 0 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--line);
  font-family: var(--serif);
  font-size: 1.18rem;
  font-style: italic;
  color: #f4efe6d9;
}
.quote cite {
  display: block;
  margin-top: .9rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- listy numerowane (światy / postacie) ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.6rem;
}

.tile { border-top: 1px solid #d6a86a2e; padding-top: 1.5rem; }
.tile__num {
  font-family: var(--serif);
  font-size: .95rem;
  color: var(--gold);
  letter-spacing: .1em;
}
.tile h3 { font-size: 1.32rem; margin: .7rem 0 .6rem; }
.tile p { margin: 0; color: var(--muted); font-size: .97rem; }

.tiles--people .tile {
  border-top: 0;
  border-left: 1px solid #a7c8e830;
  padding: .2rem 0 .2rem 1.4rem;
}
.tiles--people h3 { color: var(--ice); font-style: italic; }

/* ---------- o autorze ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 22ch) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
@media (max-width: 780px) {
  .about { grid-template-columns: 1fr; gap: 1.5rem; }
}
.about h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.about__body p { color: var(--muted); max-width: var(--measure); }
.about__body p:first-child { color: #f4efe6cc; font-size: 1.08rem; }

/* ---------- strona opowiadania ---------- */

.story-hero {
  position: relative;
  padding: 5.5rem 0 0;
}
.story-hero__media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #d6a86a26;
  max-height: 62vh;
}
.story-hero__media img {
  width: 100%;
  max-height: 62vh;
  object-fit: cover;
  opacity: .82;
}
.story-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #07050d40, #07050dd6);
}

.story-head {
  padding: 3rem 0 1rem;
  max-width: var(--measure);
  margin-inline: auto;
}
.story-head h1 { font-size: clamp(2.3rem, 6vw, 4rem); }
.story-head .lead { font-size: 1.14rem; }

.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.8rem;
  font-size: .76rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #bdb5b7b5;
}
.story-meta .dot { color: var(--line); }

/* ---------- bramka wieku ----------
   Działa bez JavaScriptu: ukryty checkbox przełączany etykietą.
   Treść pozostaje ukryta, dopóki czytelnik nie potwierdzi pełnoletności. */

.gate__key {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.gate__panel {
  max-width: var(--measure);
  margin: 3rem auto 0;
  padding: 2.4rem 2.2rem;
  border: 1px solid #e2867a4d;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #e2867a0f, #ffffff03);
  text-align: center;
}

.gate__mark {
  display: inline-block;
  margin: 0 0 1.1rem;
  padding: .35rem 1rem;
  border: 1px solid #e2867a66;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--warn);
}

.gate__panel h2 { font-size: 1.75rem; margin-bottom: .9rem; }
.gate__panel p { color: var(--muted); margin: 0 auto; max-width: 46ch; }

.gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  justify-content: center;
  margin-top: 2rem;
}
.gate__actions .button { cursor: pointer; }

.gate__key:not(:checked) ~ .prose { display: none; }
.gate__key:checked ~ .gate__panel { display: none; }

.eyebrow--adult { color: var(--warn); margin: 1.6rem 0 0; }
.eyebrow--adult::before { background: #e2867a5c; }

/* Sam tekst opowiadania — najważniejsza część strony.
   Siatka trzyma tekst w wąskiej, czytelnej kolumnie,
   a ilustracjom pozwala rozlać się szerzej. */
.prose {
  display: grid;
  grid-template-columns: 1fr min(var(--measure), 100%) 1fr;
  margin: 3rem 0 0;
  font-family: var(--serif);
  font-size: 1.19rem;
  line-height: 1.85;
  color: #f4efe6e6;
}
.prose > * { grid-column: 2; }
.prose > p { margin: 0 0 1.5rem; }
.prose > p:first-of-type::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: .82;
  padding: .06em .12em 0 0;
  color: var(--gold);
}
.prose h2 {
  font-size: 1.8rem;
  margin: 3rem 0 1.1rem;
}
.prose h3 { font-size: 1.4rem; margin: 2.4rem 0 .9rem; }
.prose blockquote {
  margin: 2.4rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--line);
  font-style: italic;
  color: #f4efe6cc;
}
.prose blockquote cite {
  display: block;
  margin-top: .8rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}
.prose hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 3rem 0;
}
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.5rem; }
.prose li { margin-bottom: .5rem; }
.prose code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-size: .86em;
  background: #ffffff0f;
  padding: .12em .4em;
  border-radius: 5px;
}
.prose pre {
  background: #ffffff0a;
  border: 1px solid #d6a86a1f;
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-size: .92rem;
}
.prose pre code { background: none; padding: 0; }

/* Ilustracje wewnątrz opowiadania mogą wychodzić poza kolumnę tekstu. */
.figure {
  grid-column: 1 / -1;
  justify-self: center;
  margin: 2.8rem 0;
  width: min(100%, calc(var(--measure) + 14rem));
}
.figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid #d6a86a24;
}
.figure figcaption {
  margin-top: .85rem;
  font-family: var(--sans);
  font-size: .82rem;
  color: #bdb5b7bf;
  letter-spacing: .02em;
}

.story-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  max-width: var(--measure);
  margin: 4.5rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid #d6a86a24;
}

/* ---------- stopka ---------- */

.site-footer {
  padding: 4rem 0 3.5rem;
  border-top: 1px solid #d6a86a1f;
  margin-top: 4rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer p { margin: 0; color: #bdb5b7a6; font-size: .86rem; }

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