/* Kęs za kęsem, system tokenów. Jedyne miejsce z wartościami hex w całym projekcie. */

:root {
  /* tła */
  --kes-mgla: #FDF7F5;
  --kes-blush: #F6E6E4;
  --kes-blush-glebszy: #EFD5D3;

  /* akcenty */
  --kes-malina: #B23A5B;
  --kes-malina-ciemna: #8E2B47;
  --kes-bronz: #A8734B;

  /* zieleń */
  --kes-szalwia: #7E9A79;
  --kes-szalwia-tekst: #4F6749; /* szałwia przyciemniona do 4.5:1 na jasnych tłach, wyłącznie pod tekst */
  --kes-pistacja: #D3E0CA;
  --kes-las: #34432F;
  --kes-las-glebszy: #232E20; /* ciemniejszy wariant lasu, pod duże płaszczyzny i stopkę */

  /* tekst */
  --kes-atrament: #3A312E;
  --kes-atrament-60: #6B5F5A;
  --kes-biel: #FFFFFF;

  /* promienie */
  --kes-radius-karta: 20px;
  --kes-radius-duzy: 28px;
  --kes-radius-pole: 12px;
  --kes-radius-pelny: 999px;
  --kes-radius-arkada: 50% 50% 14px 14px / 34% 34% 14px 14px; /* arkada, kadr portretowy */

  /* skala głębi, wszystko w tonacji różu, nigdy szarość */
  --kes-cien-1:
    0 1px 2px rgba(142, 43, 71, 0.05),
    0 2px 6px -2px rgba(142, 43, 71, 0.08);
  --kes-cien-2:
    0 2px 4px rgba(142, 43, 71, 0.05),
    0 8px 18px -8px rgba(142, 43, 71, 0.13),
    0 18px 40px -24px rgba(142, 43, 71, 0.22);
  --kes-cien-3:
    0 2px 4px rgba(142, 43, 71, 0.06),
    0 12px 28px -10px rgba(142, 43, 71, 0.17),
    0 32px 64px -32px rgba(142, 43, 71, 0.3);
  --kes-cien-4:
    0 4px 8px rgba(142, 43, 71, 0.07),
    0 20px 44px -14px rgba(142, 43, 71, 0.2),
    0 48px 88px -40px rgba(142, 43, 71, 0.34);
  --kes-cien-las: 0 24px 60px -28px rgba(35, 46, 32, 0.55);
  --kes-cien: var(--kes-cien-2);

  /* obramowania */
  --kes-kreska: rgba(58, 49, 46, 0.1);
  --kes-kreska-mocna: rgba(58, 49, 46, 0.18);
  --kes-kreska-zielona: rgba(126, 154, 121, 0.36);
  --kes-kreska-jasna: rgba(253, 247, 245, 0.18);

  /* wypełnienia półprzezroczyste */
  --kes-szklo: rgba(253, 247, 245, 0.86);

  /* tekst na ciemnym tle */
  --kes-na-lesie: rgba(253, 247, 245, 0.78);
  --kes-na-lesie-cichy: rgba(253, 247, 245, 0.62);

  /* znak kęsa jako maska CSS, wcięcie przy krawędzi, nie połowa koła */
  --kes-mask-kes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cmask id='m'%3E%3Crect width='40' height='40' fill='white'/%3E%3Ccircle cx='32' cy='8' r='8' fill='black'/%3E%3C/mask%3E%3Ccircle cx='20' cy='20' r='18' fill='black' mask='url(%23m)'/%3E%3C/svg%3E");

  /* wymiary */
  --kes-kontener: 1200px;
  --kes-sekcja: clamp(80px, 10vw, 148px);

  /* odstępy */
  --kes-space-1: 4px;
  --kes-space-2: 8px;
  --kes-space-3: 12px;
  --kes-space-4: 16px;
  --kes-space-5: 24px;
  --kes-space-6: 32px;
  --kes-space-7: 48px;
  --kes-space-8: 64px;
  --kes-space-9: 96px;

  /* typografia */
  --kes-font-display: "Prata", Georgia, "Times New Roman", serif;
  --kes-font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --kes-font-script: "Corinthia", cursive;

  --kes-h1: clamp(2.7rem, 5.6vw, 4.4rem);
  --kes-h2: clamp(2rem, 3.8vw, 2.9rem);
  --kes-h3: clamp(1.18rem, 2vw, 1.42rem);
  --kes-body: 1.0625rem;

  /* ruch */
  --kes-ease: cubic-bezier(.22, .61, .36, 1);
  --kes-ease-miekka: cubic-bezier(.33, 1, .68, 1);
  --kes-trwanie-krotkie: 200ms;
  --kes-trwanie-srednie: 420ms;
  --kes-trwanie-dlugie: 640ms;

  /* warstwy */
  --kes-z-topbar: 20;
  --kes-z-nav: 30;
  --kes-z-sticky-cta: 35;
  --kes-z-menu-mobile: 40;
  --kes-z-lightbox: 50;
}

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

html {
  scroll-behavior: smooth;
  background: var(--kes-mgla);
  -webkit-text-size-adjust: 100%;
}

@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;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--kes-mgla);
  color: var(--kes-atrament);
  font-family: var(--kes-font-body);
  font-size: var(--kes-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

main {
  flex: 1 0 auto;
}

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

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--kes-font-display);
  color: var(--kes-las);
  font-weight: 400;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--kes-h1);
  line-height: 1.06;
}

h2 {
  font-size: var(--kes-h2);
  line-height: 1.12;
}

h3 {
  font-size: var(--kes-h3);
  line-height: 1.3;
  letter-spacing: -0.014em;
}

p {
  max-width: 68ch;
  text-wrap: pretty;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

::selection {
  background: var(--kes-blush-glebszy);
  color: var(--kes-las);
}

/* ===== znak kęsa rysowany maską, jedno źródło kształtu ===== */
.kes-znak {
  display: inline-block;
  flex-shrink: 0;
  background-color: currentColor;
  mask: var(--kes-mask-kes) center / contain no-repeat;
  -webkit-mask: var(--kes-mask-kes) center / contain no-repeat;
}

/* eyebrow, opisuje funkcję sekcji nad H2 */
.kes-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--kes-space-3);
  font-family: var(--kes-font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--kes-szalwia-tekst);
  margin-bottom: var(--kes-space-4);
}

.kes-eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex-shrink: 0;
}

/* nagłówek sekcji, jeden rytm dla całej strony */
.kes-naglowek {
  max-width: 44ch;
  margin-bottom: clamp(40px, 5vw, 68px);
}

.kes-naglowek__lead {
  margin-top: var(--kes-space-4);
  color: var(--kes-atrament-60);
  font-size: 1.08rem;
  line-height: 1.65;
}

/* wariant nagłówka na ciemnym tle */
.kes-naglowek--ciemny h2 {
  color: var(--kes-mgla);
}

.kes-naglowek--ciemny .kes-eyebrow {
  color: var(--kes-pistacja);
}

.kes-naglowek--ciemny .kes-naglowek__lead {
  color: var(--kes-na-lesie);
}

/* widoczny focus wszędzie, bez wyjątków */
:focus-visible {
  outline: 2px solid var(--kes-malina);
  outline-offset: 3px;
  border-radius: 4px;
}

.kes-sekcja--las :focus-visible {
  outline-color: var(--kes-pistacja);
}

.kes-skip-link {
  position: absolute;
  left: var(--kes-space-4);
  top: -100px;
  background: var(--kes-malina);
  color: var(--kes-biel);
  padding: var(--kes-space-3) var(--kes-space-5);
  border-radius: var(--kes-radius-pole);
  font-weight: 600;
  z-index: 100;
  transition: top var(--kes-trwanie-krotkie) var(--kes-ease);
}

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

/* fade in up przy scrollu, treść widoczna domyślnie, animacja tylko przy JS */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--kes-trwanie-dlugie) var(--kes-ease-miekka),
    transform var(--kes-trwanie-dlugie) var(--kes-ease-miekka);
}

.js [data-reveal].kes-reveal--widoczny {
  opacity: 1;
  transform: none;
}

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