/* ==========================================================================
   Baza: reset, typografia, elementy wspolne
   ========================================================================== */

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

svg:not([fill]) {
  fill: currentColor;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
dl,
dd {
  margin: 0;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-200%);
  transition: transform var(--t-fast) var(--ease);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Uklad ---------- */

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

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

.section--dark {
  background: var(--navy);
  color: var(--paper);
}

.section--mist {
  background: var(--mist);
}

/* ---------- Typografia ---------- */

.h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--grey-700);
  max-width: 34em;
  text-wrap: pretty;
}

.section--dark .lead {
  color: var(--grey-300);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(28px, 2vw + 16px, 48px);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey-500);
}

.eyebrow__num {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.eyebrow::after {
  content: "";
  flex: 0 0 48px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
  order: 1;
}

.eyebrow__label {
  order: 2;
}

.section--dark .eyebrow {
  color: var(--grey-300);
}

.section--dark .eyebrow__num {
  color: var(--paper);
}

/* ---------- Przyciski i linki ---------- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  --btn-bd: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 0 26px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.btn:hover {
  --btn-bg: var(--navy-2);
  --btn-bd: var(--navy-2);
}

.btn--light {
  --btn-bg: var(--paper);
  --btn-fg: var(--ink);
  --btn-bd: var(--paper);
}

.btn--light:hover {
  --btn-bg: transparent;
  --btn-fg: var(--paper);
  --btn-bd: var(--paper);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--line);
}

.btn--ghost:hover {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  --btn-bd: var(--ink);
}

.section--dark .btn--ghost,
.btn--ghost-light {
  --btn-fg: var(--paper);
  --btn-bd: rgba(255, 255, 255, 0.32);
}

.section--dark .btn--ghost:hover,
.btn--ghost-light:hover {
  --btn-bg: var(--paper);
  --btn-fg: var(--ink);
  --btn-bd: var(--paper);
}

.icon-arrow {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform var(--t-fast) var(--ease);
}

.btn:hover .icon-arrow,
.link-arrow:hover .icon-arrow {
  transform: translateX(4px);
}

.btn:hover .icon-arrow--down {
  transform: translateY(3px);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
  font-weight: 560;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  transition: background-size var(--t-med) var(--ease);
}

.link-arrow:hover {
  background-size: 40% 1px;
}

/* ---------- Intro z sygnetem (raz na sesje) ---------- */

.intro {
  display: none;
}

.js .intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  animation: intro-out 0.9s var(--ease-io) 1.05s forwards;
}

.js.intro-skip .intro,
.js.intro-done .intro {
  display: none;
}

.intro__sygnet {
  width: clamp(84px, 9vw, 132px);
  height: auto;
  clip-path: inset(0 100% 0 0);
  animation: sygnet-in 0.8s var(--ease-io) 0.15s forwards;
}

@keyframes sygnet-in {
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes intro-out {
  to {
    transform: translateY(-100%);
    visibility: hidden;
  }
}

/* ---------- Animacje pojawiania (wlaczane przez JS) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
  transition-delay: var(--d, 0s);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.js [data-reveal="media"] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.3s var(--ease-io);
  transition-delay: var(--d, 0s);
}

.js [data-reveal="media"].is-in {
  clip-path: inset(0 0 0 0);
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js [data-reveal],
  .js [data-reveal="media"] {
    opacity: 1;
    transform: none;
    clip-path: none;
  }
}
