/* ==========================================================================
   JAKUBIEC MEDIA — base: fonty, reset, typografia bazowa, utilities
   Wymaga wcześniejszego wczytania variables.css.
   ========================================================================== */

/* Google Fonts (latin + latin-ext → polskie znaki). display=swap = brak "niewidzialnego" tekstu. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap");

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

* {
  margin: 0;
}

/* Atrybut hidden musi zawsze wygrywać. Bez tego np. `.btn[hidden]` zostaje widoczny,
   bo `.btn{display:inline-flex}` ma tę samą specyficzność co domyślne [hidden] przeglądarki
   i jest ładowany później (patrz przyciski Wstecz/Dalej w formularzu wyceny). */
[hidden] {
  display: none !important;
}

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

body {
  display: flex;
  flex-direction: column;          /* stopka zawsze na dole, nawet na pustej stronie */
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

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

/* `<picture>` musi przepuszczać wysokość do środka: w kontenerach z aspect-ratio
   (.hero__frame, .about__media itp.) obraz ma "width:100%;height:100%;object-fit:cover" —
   bez tego wysokość picture zostaje "auto" i procentowa wysokość img nie ma się do
   czego odnieść, więc <img> renderuje się w swoich naturalnych proporcjach zamiast
   wypełniać ramkę. Działa tylko tam, gdzie rodzic picture ma realną wysokość — gdy
   rodzic jest "auto", to i tak nic się nie zmienia (procent od auto = auto). */
picture {
  height: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

a {
  color: inherit;
}

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

table {
  border-collapse: collapse;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* ---------- Typografia ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-4xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-3xl); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }

h5,
h6 {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

p {
  text-wrap: pretty;
}

p + p {
  margin-top: var(--space-4);
}

strong,
b {
  font-weight: var(--fw-semibold);
}

small {
  font-size: var(--fs-sm);
}

/* Linki w treści — złote podkreślenie, które "wypełnia się" na hover */
.prose a {
  text-decoration: none;
  background-image: linear-gradient(var(--color-gold), var(--color-gold));
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--dur-base) var(--ease-out), color var(--dur-base);
}

.prose a:hover {
  background-size: 100% 100%;
  color: var(--color-black);
}

::selection {
  background: var(--color-gold);
  color: var(--color-black);
}

/* ---------- Dostępność ---------- */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--space-4);
  z-index: var(--z-modal);
  padding: var(--space-3) var(--space-5);
  background: var(--color-gold);
  color: var(--color-black);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform var(--dur-base) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

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

/* ---------- Utilities layoutu ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}

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

.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}

.section--alt {
  background: var(--color-bg-alt);
}

/* Mały napis nad nagłówkiem sekcji */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-gold-dark);
}

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

/* ---------- Scroll-reveal: stan bazowy (logikę dodaje js/main.js) ----------
   Ukrywamy TYLKO gdy JS działa (klasa .js na <html>), żeby bez JS treść była widoczna. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

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

/* Warianty kierunku (atrybut: data-reveal="left|right|scale|fade|mask") */
.js [data-reveal="left"]  { transform: translateX(calc(var(--reveal-distance) * -1)); }
.js [data-reveal="right"] { transform: translateX(var(--reveal-distance)); }
.js [data-reveal="scale"] { transform: scale(0.96); }
.js [data-reveal="fade"]  { transform: none; }

/* "mask": zdjęcie odsłaniane od góry do dołu */
.js [data-reveal="mask"] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s var(--ease-out) var(--reveal-delay, 0ms);
}

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

/* ---------- Preferencje ruchu ---------- */
@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;
  }

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