/* ==========================================================================
   base.css — reset, typografia bazowa, pomocniki układu, przyciski
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg,
iframe {
  max-width: 100%;
  display: block;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-variation-settings: var(--display-settings);
  font-weight: 600;
  line-height: var(--lh-head);
  letter-spacing: var(--ls-display);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
  font-weight: 500;
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

::selection {
  background: var(--ochre-500);
  color: var(--ink-900);
}

/* ------------------------------------------------------------- układ ---- */

.container {
  width: min(100% - 2 * var(--sp-5), var(--container));
  margin-inline: auto;
}

.container-narrow {
  width: min(100% - 2 * var(--sp-5), var(--container-narrow));
  margin-inline: auto;
}

.section {
  padding-block: var(--sp-9);
  position: relative;
}

.section--tight {
  padding-block: var(--sp-8);
}

/* Pełna szerokość okna, treść nadal w kontenerze. */
.bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  position: relative;
}

.stack > * + * {
  margin-top: var(--sp-4);
}

/* ------------------------------------------- sygnatura: ślady toczenia --- */
/* Koncentryczne okręgi wychodzące z dołu kadru, jak ślad palca na ściance
   kubka toczonego na kole. Wraca jako przerywnik między sekcjami i jako
   faktura w rogach kart. Używana klasa: .throw-rings */

.throw-rings {
  height: 92px;
  width: 100%;
  background-image: repeating-radial-gradient(
    circle at 50% 100%,
    transparent 0 calc(var(--ring-gap) - var(--ring-w)),
    var(--ring-ink) calc(var(--ring-gap) - var(--ring-w)) var(--ring-gap)
  );
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  pointer-events: none;
}

.throw-rings--invert {
  --ring-ink: var(--ring-ink-invert);
}

.throw-rings--sm {
  height: 56px;
}

/* ------------------------------------------- sygnatura: odcisk w glinie -- */
/* Etykieta sekcji jako stempel wciśnięty w wilgotną glinę. Używana klasa:
   .stamp-label */

.stamp-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--ls-stamp);
  text-transform: uppercase;
  color: var(--ochre-700);
  background: rgba(201, 154, 91, 0.16);
  border-radius: var(--r-pill);
  padding: 0.38em 0.9em 0.34em;
  box-shadow: var(--sh-stamp);
}

.stamp-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex: none;
  opacity: 0.85;
}

.stamp-label--invert {
  color: var(--ochre-400);
  background: rgba(220, 183, 130, 0.14);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.22), inset 0 -1px 0 rgba(248, 241, 227, 0.12);
}

/* ------------------------------------------------------------ nagłówki -- */

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 44ch;
}

.section-head p {
  font-size: var(--fs-lead);
  color: var(--text-soft);
  max-width: 54ch;
}

.section-head--invert p {
  color: var(--text-invert-soft);
}

.lead {
  font-size: var(--fs-lead);
  color: var(--text-soft);
  max-width: 62ch;
}

/* ----------------------------------------------------------- przyciski -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 50px;
  padding: 0.85em 1.5em;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ochre-500);
  color: var(--ink-900);
  border-color: var(--ochre-500);
}

.btn-primary:hover {
  background: var(--ochre-400);
  border-color: var(--ochre-400);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: rgba(58, 42, 26, 0.07);
  border-color: var(--clay-500);
}

.btn-ghost-invert {
  background: transparent;
  color: var(--text-invert);
  border-color: var(--line-invert);
}

.btn-ghost-invert:hover {
  background: rgba(248, 241, 227, 0.12);
  border-color: rgba(248, 241, 227, 0.5);
}

.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.6;
  cursor: progress;
  pointer-events: none;
}

/* --------------------------------------------------------- dostępność --- */

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -200px;
  z-index: 200;
  background: var(--cream-50);
  color: var(--clay-700);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
  font-weight: 700;
  transition: top var(--dur-1) var(--ease);
}

.skip-link:focus {
  top: var(--sp-4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------- odsłona -- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
