/* ==========================================================================
   Baśniowy Art – Niepubliczne Przedszkole & Żłobek
   Nowoczesny CSS: @layer, natywny nesting, clamp(), :has(), container queries,
   animacje sterowane scrollem i przejścia między podstronami (View Transitions).
   ========================================================================== */

@layer reset, tokens, base, layout, components, pages, utilities;

/* Płynne przejścia między podstronami (Chrome/Edge/Safari 18+) */
@view-transition { navigation: auto; }

/* --------------------------------------------------------------------------
   Tokeny
   -------------------------------------------------------------------------- */
@layer tokens {
  :root {
    color-scheme: light;

    /* Kolory z logo */
    --red: #ef3e3a;
    --pink: #e2459c;
    --rose: #ec6381;
    --orange: #f7a93b;
    --peach: #f9ba60;
    --yellow: #ffd45c;
    --green: #4fb35a;
    --mint: #7fd3b0;
    --blue: #36b1e3;
    --violet: #8f6bd8;

    --ink: #2f2a36;
    --ink-soft: #5c5566;
    --muted: #7d7688;
    --line: #efe6dc;
    --cream: #fff8f0;
    --cream-2: #fdf0e3;
    --paper: #ffffff;

    --tint-pink: #fde8f1;
    --tint-orange: #fff0dc;
    --tint-yellow: #fff7d6;
    --tint-green: #e5f6e6;
    --tint-blue: #e2f4fc;
    --tint-violet: #efe8fb;

    /* Typografia */
    --font-display: "Baloo 2", "Nunito", system-ui, sans-serif;
    --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --step--1: clamp(0.85rem, 0.82rem + 0.15vw, 0.94rem);
    --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
    --step-1: clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem);
    --step-2: clamp(1.45rem, 1.25rem + 0.9vw, 2rem);
    --step-3: clamp(1.8rem, 1.45rem + 1.6vw, 2.8rem);
    --step-4: clamp(2.3rem, 1.7rem + 2.8vw, 4.2rem);

    /* Odstępy i kształty */
    --space-2xs: 0.375rem;
    --space-xs: 0.625rem;
    --space-s: 1rem;
    --space-m: 1.5rem;
    --space-l: clamp(2rem, 1.6rem + 2vw, 3rem);
    --space-xl: clamp(3rem, 2.2rem + 4vw, 6rem);

    --radius-s: 0.75rem;
    --radius-m: 1.25rem;
    --radius-l: 2rem;
    --radius-blob: 42% 58% 63% 37% / 41% 44% 56% 59%;

    --shadow-s: 0 2px 6px rgb(60 40 30 / 0.06), 0 1px 2px rgb(60 40 30 / 0.05);
    --shadow-m: 0 12px 30px -10px rgb(80 50 30 / 0.18), 0 4px 10px -4px rgb(80 50 30 / 0.08);
    --shadow-l: 0 30px 60px -20px rgb(80 50 30 / 0.28);

    --container: 1200px;
    --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
    --header-h: 76px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  }
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
    interpolate-size: allow-keywords;
  }
  body { min-height: 100svh; line-height: 1.65; -webkit-font-smoothing: antialiased; }
  img, picture, svg, video, iframe { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
  a { color: inherit; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  :target { scroll-margin-top: calc(var(--header-h) + 1rem); }

  @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;
    }
  }
}

/* --------------------------------------------------------------------------
   Bazowe style
   -------------------------------------------------------------------------- */
@layer base {
  body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    color: var(--ink-soft);
    background: var(--cream);
    overflow-x: clip;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
    text-wrap: balance;
  }
  h1 { font-size: var(--step-4); font-weight: 800; line-height: 1.05; }
  h2 { font-size: var(--step-3); }
  h3 { font-size: var(--step-1); }

  p { text-wrap: pretty; }
  strong { color: var(--ink); font-weight: 800; }

  a { text-decoration-thickness: 2px; text-underline-offset: 3px; }

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

  /* ikony liniowe */
  svg.i {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  :focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
    border-radius: 6px;
  }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
@layer layout {
  .container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
  }

  .section { padding-block: var(--space-xl); position: relative; }
  .section--tight { padding-block: var(--space-l); }
  .section--white { background: var(--paper); }
  .section--pink { background: var(--tint-pink); }
  .section--blue { background: var(--tint-blue); }
  .section--yellow { background: var(--tint-yellow); }

  .section-head {
    max-width: 44rem;
    margin-inline: auto;
    margin-bottom: var(--space-l);
    text-align: center;

    & p { margin-top: var(--space-s); font-size: var(--step-1); line-height: 1.55; }
    &.is-left { margin-inline: 0; text-align: left; }
  }

  .split {
    display: grid;
    gap: var(--space-l);
    align-items: center;

    /* elementy siatki nie mogą rozpychać kolumny szerzej niż ekran */
    & > * { min-width: 0; }

    @media (min-width: 900px) {
      grid-template-columns: 1fr 1fr;
      gap: var(--space-xl);
      &.is-reversed > :first-child { order: 2; }
    }
  }

  .grid {
    display: grid;
    gap: var(--space-m);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 17rem)), 1fr));
  }

  .stack > * + * { margin-top: var(--space-s); }
}

/* --------------------------------------------------------------------------
   Komponenty
   -------------------------------------------------------------------------- */
@layer components {

  /* ---------- Skip link ---------- */
  .skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 1000;
    padding: 0.75rem 1.25rem;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-s);
    font-weight: 700;
    transition: top 0.2s;
    &:focus { top: 1rem; }
  }

  /* ---------- Nagłówek ---------- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    transition: background-color 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
    view-transition-name: site-header;

    &.is-scrolled {
      background: rgb(255 255 255 / 0.86);
      backdrop-filter: saturate(1.6) blur(14px);
      -webkit-backdrop-filter: saturate(1.6) blur(14px);
      box-shadow: 0 6px 24px -12px rgb(80 50 30 / 0.25);
    }

    & .container {
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--space-m);
    }
  }

  .brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: var(--radius-s);
    & img { height: 42px; width: auto; }
    @media (min-width: 900px) { & img { height: 48px; } }
  }

  .nav-toggle {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--paper);
    box-shadow: var(--shadow-s);
    color: var(--ink);
    & svg { width: 24px; height: 24px; }
    @media (min-width: 960px) { display: none; }
  }

  /* Menu: na mobile jako popover (top layer), na desktopie zwykła lista */
  .nav {
    & ul { list-style: none; padding: 0; display: flex; gap: 0.25rem; }
    & a {
      display: block;
      padding: 0.55rem 1rem;
      border-radius: 999px;
      font-family: var(--font-display);
      font-weight: 500;
      font-size: 1.05rem;
      color: var(--ink);
      text-decoration: none;
      transition: background-color 0.2s, color 0.2s;
      &:hover { background: var(--tint-orange); }
      &[aria-current="page"] { background: var(--ink); color: #fff; }
    }
    & .nav-close, & .nav-extra { display: none; }
  }

  @media (min-width: 960px) {
    .nav[popover] {
      display: block;
      position: static;
      inset: auto;
      margin: 0;
      padding: 0;
      border: 0;
      background: none;
      overflow: visible;
      width: auto;
      height: auto;
    }
    .nav .nav-cta a { background: var(--rose); color: #fff; margin-left: 0.5rem; &:hover { background: var(--pink); } }
  }

  @media (max-width: 959.98px) {
    .nav[popover] {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100dvh;
      max-width: none;
      max-height: none;
      margin: 0;
      padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem;
      border: 0;
      background:
        radial-gradient(circle at 90% 5%, var(--tint-pink) 0 20%, transparent 21%),
        radial-gradient(circle at 5% 95%, var(--tint-blue) 0 25%, transparent 26%),
        var(--cream);
      overflow-y: auto;
      opacity: 0;
      translate: 0 -1.5rem;
      transition: opacity 0.35s var(--ease-out), translate 0.35s var(--ease-out),
        display 0.35s allow-discrete, overlay 0.35s allow-discrete;

      &:popover-open {
        opacity: 1;
        translate: 0 0;
        @starting-style { opacity: 0; translate: 0 -1.5rem; }
      }

      &::backdrop { background: transparent; }

      & ul { flex-direction: column; gap: 0.5rem; }
      & li { --i: 0; }
      & a {
        font-size: var(--step-2);
        padding: 0.8rem 1.25rem;
        border-radius: var(--radius-m);
        background: var(--paper);
        box-shadow: var(--shadow-s);
      }
      & .nav-cta a { background: var(--rose); color: #fff; }
      & a[aria-current="page"] { background: var(--ink); color: #fff; }

      & .nav-close {
        display: grid;
        place-items: center;
        position: absolute;
        top: calc((var(--header-h) - 48px) / 2);
        right: var(--gutter);
        width: 48px;
        height: 48px;
        border: 0;
        border-radius: 50%;
        background: var(--ink);
        color: #fff;
        & svg { width: 22px; height: 22px; }
      }

      & .nav-extra {
        display: grid;
        gap: 0.75rem;
        margin-top: var(--space-l);
        font-weight: 700;
        & a { font-size: var(--step-0); font-family: var(--font-body); background: none; box-shadow: none; padding: 0.25rem 0; display: flex; align-items: center; gap: 0.6rem; }
        & svg { width: 20px; height: 20px; color: var(--rose); }
      }
    }
  }

  /* blokada scrolla przy otwartym menu mobilnym */
  html:has(.nav:popover-open) { overflow: hidden; }

  /* ---------- Przyciski ---------- */
  .btn {
    --btn-bg: var(--rose);
    --btn-fg: #fff;
    --btn-shadow: #c9496a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 3.25rem;
    padding: 0.8rem 1.6rem;
    border: 0;
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    box-shadow: 0 5px 0 var(--btn-shadow);
    transition: translate 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), filter 0.2s;

    & svg { width: 1.2em; height: 1.2em; flex-shrink: 0; }

    &:hover { translate: 0 -2px; box-shadow: 0 7px 0 var(--btn-shadow); filter: saturate(1.1); }
    &:active { translate: 0 4px; box-shadow: 0 1px 0 var(--btn-shadow); }

    &.btn--orange { --btn-bg: var(--peach); --btn-fg: var(--ink); --btn-shadow: #d9953a; }
    &.btn--blue { --btn-bg: var(--blue); --btn-shadow: #1f8bb8; }
    &.btn--green { --btn-bg: var(--green); --btn-shadow: #378a40; }
    &.btn--white { --btn-bg: #fff; --btn-fg: var(--ink); --btn-shadow: #e6d9cb; }
    &.btn--ghost {
      --btn-bg: transparent;
      --btn-fg: var(--ink);
      box-shadow: inset 0 0 0 2px currentColor;
      &:hover, &:active { box-shadow: inset 0 0 0 2px currentColor; }
    }
  }

  .btn-row { display: flex; flex-wrap: wrap; gap: var(--space-s); }

  .link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--rose);
    text-decoration: none;
    & svg { width: 1.1em; height: 1.1em; transition: translate 0.2s var(--ease-out); }
    &:hover svg { translate: 4px 0; }
  }

  /* ---------- Etykieta nad nagłówkiem ---------- */
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--space-s);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--paper);
    box-shadow: var(--shadow-s);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--step--1);
    color: var(--ink);
    letter-spacing: 0.02em;
    line-height: 1.4;

    @media (max-width: 480px) { & .hide-sm { display: none; } }

    &::before {
      content: "";
      width: 0.6rem;
      height: 0.6rem;
      border-radius: 50%;
      background: conic-gradient(var(--red), var(--yellow), var(--green), var(--blue), var(--pink), var(--red));
    }
  }

  /* Podkreślenie "kredką" pod słowem */
  .scribble {
    position: relative;
    white-space: nowrap;
    color: var(--c, var(--rose));
    &::after {
      content: "";
      position: absolute;
      left: -2%;
      right: -2%;
      bottom: -0.12em;
      height: 0.32em;
      background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 14c30-8 62-11 96-9 34 2 66 6 98-2' fill='none' stroke='%23ffd45c' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
      z-index: -1;
    }
  }

  /* ---------- Fale / separatory ---------- */
  .wave {
    display: block;
    width: 100%;
    height: clamp(36px, 6vw, 80px);
    color: var(--wave, var(--paper));
    & path { fill: currentColor; }
  }
  .wave--top { margin-bottom: -1px; }
  .wave--bottom { margin-top: -1px; }

  /* ---------- Karty ---------- */
  .card {
    --accent: var(--rose);
    --tint: var(--tint-pink);
    container-type: inline-size;
    position: relative;
    padding: var(--space-m);
    border-radius: var(--radius-l);
    background: var(--paper);
    box-shadow: var(--shadow-s);
    transition: translate 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);

    &:hover { translate: 0 -6px; box-shadow: var(--shadow-m); }

    & h3 { margin-bottom: 0.5rem; }
    & p { font-size: 1rem; line-height: 1.6; }

    &.is-orange { --accent: var(--orange); --tint: var(--tint-orange); }
    &.is-yellow { --accent: #e0a800; --tint: var(--tint-yellow); }
    &.is-green { --accent: var(--green); --tint: var(--tint-green); }
    &.is-blue { --accent: var(--blue); --tint: var(--tint-blue); }
    &.is-violet { --accent: var(--violet); --tint: var(--tint-violet); }
    &.is-red { --accent: var(--red); --tint: #fde6e5; }
  }

  .card-icon {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: var(--space-s);
    border-radius: var(--radius-blob);
    background: var(--tint);
    color: var(--accent);
    transition: border-radius 0.6s var(--ease-out), rotate 0.4s var(--ease-spring);
    & svg { width: 2rem; height: 2rem; }
  }
  .card:hover .card-icon { border-radius: 50%; rotate: -8deg; }

  /* karta pozioma, gdy jest szeroka */
  @container (min-width: 30rem) {
    .card-body--row { display: grid; grid-template-columns: auto 1fr; gap: var(--space-m); align-items: start; }
    .card-body--row .card-icon { margin-bottom: 0; }
  }

  /* ---------- Zdjęcia ---------- */
  .photo {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-l);
    background: var(--cream-2);
    box-shadow: var(--shadow-m);
    & img { width: 100%; height: 100%; object-fit: cover; }
  }

  .polaroids {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    aspect-ratio: 1;
    max-width: 560px;
    margin-inline: auto;
    width: 100%;

    & figure {
      padding: 0.6rem 0.6rem 2.2rem;
      background: #fff;
      border-radius: 0.5rem;
      box-shadow: var(--shadow-m);
      transition: rotate 0.4s var(--ease-spring), scale 0.4s var(--ease-spring);
      & img { width: 100%; height: 100%; object-fit: cover; border-radius: 0.25rem; }
      &:hover { rotate: 0deg; scale: 1.04; z-index: 5; }
    }
    & figure:nth-child(1) { grid-area: 1 / 1 / 5 / 4; rotate: -6deg; z-index: 2; }
    & figure:nth-child(2) { grid-area: 2 / 4 / 6 / 7; rotate: 5deg; z-index: 1; }
    & figure:nth-child(3) { grid-area: 4 / 2 / 7 / 5; rotate: -2deg; z-index: 3; }

    &::before {
      content: "";
      position: absolute;
      inset: 8%;
      border-radius: var(--radius-blob);
      background: var(--tint-yellow);
      z-index: 0;
    }
  }

  /* ---------- Hero ---------- */
  .hero {
    position: relative;
    margin-top: calc(var(--header-h) * -1);
    padding-top: calc(var(--header-h) + var(--space-l));
    padding-bottom: var(--space-l);
    overflow: clip;
    background:
      radial-gradient(60rem 30rem at 85% 10%, var(--tint-pink), transparent 60%),
      radial-gradient(50rem 30rem at 0% 100%, var(--tint-blue), transparent 60%),
      var(--cream);

    & .container {
      display: grid;
      gap: var(--space-l);
      align-items: center;
      @media (min-width: 900px) { grid-template-columns: 1.05fr 1fr; min-height: min(78svh, 720px); }
    }

    & h1 { margin-bottom: var(--space-m); }
    & .lead { font-size: var(--step-1); line-height: 1.55; max-width: 34rem; margin-bottom: var(--space-l); }
  }

  .hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.4rem;
    margin-top: var(--space-l);
    padding: 0;
    list-style: none;
    font-weight: 700;
    font-size: var(--step--1);
    color: var(--ink);
    & li { display: flex; align-items: center; gap: 0.5rem; }
    & svg { width: 1.25rem; height: 1.25rem; color: var(--rose); }
    & a { text-decoration: none; &:hover { color: var(--rose); } }
  }

  .hero-art {
    position: relative;
    max-width: 580px;
    width: 100%;
    margin-inline: auto;
    &::before {
      content: "";
      position: absolute;
      inset: 12% 4% 2%;
      border-radius: var(--radius-blob);
      background: linear-gradient(135deg, var(--tint-yellow), var(--tint-orange));
      animation: morph 14s ease-in-out infinite alternate;
    }
    & img {
      position: relative;
      width: 100%;
      animation: float 6s ease-in-out infinite;
      filter: drop-shadow(0 20px 25px rgb(80 50 30 / 0.15));
    }
  }

  /* dekoracje w tle */
  .deco {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    color: var(--c, var(--yellow));
    animation: drift var(--d, 9s) ease-in-out infinite alternate;
    & svg { width: 100%; height: 100%; }
  }
  .hero > .container, .section > .container { position: relative; z-index: 1; }

  /* ---------- Odliczanie ---------- */
  .countdown {
    display: grid;
    gap: var(--space-m);
    align-items: center;
    padding: var(--space-m) var(--space-l);
    border-radius: var(--radius-l);
    background: var(--ink);
    color: #fff;
    box-shadow: var(--shadow-l);
    background-image:
      radial-gradient(circle at 8% 20%, rgb(255 212 92 / 0.25) 0 3rem, transparent 3.1rem),
      radial-gradient(circle at 96% 90%, rgb(226 69 156 / 0.3) 0 4rem, transparent 4.1rem);

    @media (min-width: 760px) { grid-template-columns: 1fr auto; }

    & h2 { color: #fff; font-size: var(--step-2); }
    & p { color: rgb(255 255 255 / 0.75); margin-top: 0.25rem; }
  }
  .countdown-units {
    display: flex;
    gap: 0.6rem;
    list-style: none;
    padding: 0;
    & li {
      display: grid;
      place-items: center;
      min-width: 4.6rem;
      padding: 0.7rem 0.5rem;
      border-radius: var(--radius-m);
      background: rgb(255 255 255 / 0.1);
      text-align: center;
    }
    & li:nth-child(1) b { color: var(--yellow); }
    & li:nth-child(2) b { color: var(--mint); }
    & li:nth-child(3) b { color: #7ccdf0; }
    & li:nth-child(4) b { color: #f59bc6; }
    & b { font-family: var(--font-display); font-size: var(--step-3); line-height: 1; font-variant-numeric: tabular-nums; }
    & span { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; margin-top: 0.3rem; }

    @media (max-width: 420px) {
      gap: 0.4rem;
      & li { min-width: 0; flex: 1; }
    }
  }

  /* ---------- Cytat ---------- */
  .quote {
    position: relative;
    max-width: 52rem;
    margin-inline: auto;
    text-align: center;

    & svg.quote-mark { width: 4rem; height: 4rem; margin: 0 auto var(--space-s); color: var(--rose); }
    & blockquote p {
      font-family: var(--font-display);
      font-weight: 500;
      font-size: var(--step-2);
      line-height: 1.35;
      color: var(--ink);
    }
    & figcaption {
      margin-top: var(--space-m);
      font-weight: 800;
      color: var(--rose);
      &::before { content: "— "; }
    }
  }

  /* ---------- Wezwanie do działania ---------- */
  .cta {
    position: relative;
    overflow: hidden;
    padding: var(--space-l);
    border-radius: var(--radius-l);
    background: linear-gradient(120deg, var(--rose), var(--pink) 55%, var(--violet));
    color: #fff;
    text-align: center;
    box-shadow: var(--shadow-l);

    & h2 { color: #fff; }
    & p { margin: var(--space-s) auto var(--space-m); max-width: 36rem; font-size: var(--step-1); color: rgb(255 255 255 / 0.9); }
    & .btn-row { justify-content: center; }

    &::before, &::after {
      content: "";
      position: absolute;
      border-radius: 50%;
      background: rgb(255 255 255 / 0.12);
    }
    &::before { width: 18rem; height: 18rem; top: -8rem; left: -6rem; }
    &::after { width: 12rem; height: 12rem; bottom: -5rem; right: -3rem; }
    & > * { position: relative; z-index: 1; }
  }

  /* ---------- Nagłówek podstrony ---------- */
  .page-hero {
    position: relative;
    margin-top: calc(var(--header-h) * -1);
    padding: calc(var(--header-h) + var(--space-l)) 0 var(--space-l);
    text-align: center;
    overflow: clip;
    background:
      radial-gradient(40rem 20rem at 15% 0%, var(--tint-yellow), transparent 70%),
      radial-gradient(40rem 20rem at 90% 20%, var(--tint-pink), transparent 70%),
      var(--cream);

    & h1 { font-size: var(--step-4); view-transition-name: page-title; }
    & p { max-width: 40rem; margin: var(--space-s) auto 0; font-size: var(--step-1); }
  }

  .breadcrumbs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: var(--space-s);
    padding: 0;
    list-style: none;
    font-size: var(--step--1);
    font-weight: 700;
    & li + li::before { content: "›"; margin-right: 0.5rem; color: var(--muted); }
    & a { color: var(--muted); text-decoration: none; &:hover { color: var(--rose); } }
    & [aria-current] { color: var(--rose); }
  }

  /* ---------- Lista z ikonami ---------- */
  .checklist {
    display: grid;
    gap: 0.75rem;
    padding: 0;
    list-style: none;
    & li { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start; }
    & li::before {
      content: "";
      width: 1.6rem;
      height: 1.6rem;
      margin-top: 0.1rem;
      border-radius: 50%;
      background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 62% no-repeat;
    }
  }

  /* ---------- Kafelki kontaktowe ---------- */
  .info-tile {
    display: flex;
    gap: var(--space-s);
    align-items: center;
    padding: var(--space-m);
    border-radius: var(--radius-m);
    background: var(--paper);
    box-shadow: var(--shadow-s);
    text-decoration: none;
    transition: translate 0.25s var(--ease-out), box-shadow 0.25s;
    &:is(a):hover { translate: 0 -4px; box-shadow: var(--shadow-m); }

    & .card-icon { margin: 0; width: 3.5rem; height: 3.5rem; flex-shrink: 0; & svg { width: 1.6rem; height: 1.6rem; } }
    & small { display: block; font-size: var(--step--1); color: var(--muted); font-weight: 700; }
    & strong { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); overflow-wrap: anywhere; }
  }

  /* ---------- Formularz ---------- */
  .form {
    display: grid;
    gap: var(--space-s);
    padding: var(--space-l);
    border-radius: var(--radius-l);
    background: var(--paper);
    box-shadow: var(--shadow-m);
    grid-template-columns: minmax(0, 1fr);

    @media (min-width: 640px) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      & .full { grid-column: 1 / -1; }
    }
    @media (max-width: 480px) { padding: var(--space-m); }
  }

  .field {
    display: grid;
    gap: 0.35rem;
    & label { font-weight: 800; color: var(--ink); font-size: 0.95rem; }
    & .req { color: var(--rose); }

    & :is(input, textarea, select) {
      width: 100%;
      min-height: 3.1rem;
      padding: 0.75rem 1rem;
      border: 2px solid var(--line);
      border-radius: var(--radius-s);
      background: var(--cream);
      transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
      &:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgb(54 177 227 / 0.18); }
    }
    & textarea { min-height: 9rem; resize: vertical; field-sizing: content; }

    /* walidacja dopiero po interakcji */
    & :is(input, textarea):user-invalid { border-color: var(--red); background: #fff5f5; }
    & .error { display: none; color: var(--red); font-size: 0.85rem; font-weight: 700; }
    &:has(:user-invalid) .error { display: block; }
  }

  .consent {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.9rem;
    line-height: 1.5;
    & input { width: 1.3rem; height: 1.3rem; margin-top: 0.1rem; accent-color: var(--rose); flex-shrink: 0; }
  }

  .form-status {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-s);
    font-weight: 700;
    &:empty { display: none; }
    &.is-ok { background: var(--tint-green); color: #276b30; }
    &.is-error { background: #fde6e5; color: #a3261f; }
  }

  /* ---------- Mapa (ładowana po kliknięciu – RODO) ---------- */
  .map {
    position: relative;
    height: clamp(300px, 60vw, 440px);
    border-radius: var(--radius-l);
    overflow: hidden;
    background:
      repeating-linear-gradient(45deg, transparent 0 22px, rgb(255 255 255 / 0.5) 22px 24px),
      linear-gradient(135deg, var(--tint-green), var(--tint-blue));
    box-shadow: var(--shadow-m);

    & iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
  }
  .map-consent {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    grid-template-columns: minmax(0, 26rem);
    justify-items: center;
    gap: var(--space-s);
    padding: var(--space-m);
    text-align: center;
    & .pin { width: 3.5rem; height: 3.5rem; color: var(--rose); animation: bounce 2s var(--ease-out) infinite; }
    & p { font-size: 0.9rem; }
  }

  /* ---------- Galeria ---------- */
  .filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: var(--space-l);
    padding: 0;
    list-style: none;

    & button {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      min-height: 2.9rem;
      padding: 0.5rem 1.2rem;
      border: 2px solid var(--line);
      border-radius: 999px;
      background: var(--paper);
      font-family: var(--font-display);
      font-weight: 500;
      color: var(--ink);
      transition: all 0.2s;
      &:hover { border-color: var(--peach); }
      &[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
    }
    & .count {
      min-width: 1.6rem;
      padding: 0 0.4rem;
      border-radius: 999px;
      background: var(--tint-orange);
      color: var(--ink);
      font-size: 0.8rem;
      line-height: 1.6rem;
    }
    & [aria-pressed="true"] .count { background: rgb(255 255 255 / 0.2); color: #fff; }
  }

  .gallery {
    columns: 2;
    column-gap: var(--space-xs);
    @media (min-width: 760px) { columns: 3; column-gap: var(--space-s); }
    @media (min-width: 1200px) { columns: 4; }
    padding: 0;
    list-style: none;

    & li {
      break-inside: avoid;
      margin-bottom: var(--space-xs);
      @media (min-width: 760px) { margin-bottom: var(--space-s); }
      &[hidden] { display: none; }
    }

    & a {
      position: relative;
      display: block;
      overflow: hidden;
      border-radius: var(--radius-m);
      background: var(--cream-2);
      box-shadow: var(--shadow-s);

      & img { width: 100%; transition: scale 0.6s var(--ease-out), filter 0.4s; }

      &::after {
        content: "";
        position: absolute;
        inset: 0;
        background:
          url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / 3rem no-repeat,
          linear-gradient(to top, rgb(47 42 54 / 0.55), rgb(47 42 54 / 0.1));
        opacity: 0;
        transition: opacity 0.3s;
      }
      &:hover, &:focus-visible {
        & img { scale: 1.06; }
        &::after { opacity: 1; }
      }
    }
    & .tag {
      position: absolute;
      left: 0.5rem;
      bottom: 0.5rem;
      z-index: 1;
      padding: 0.2rem 0.7rem;
      border-radius: 999px;
      background: rgb(255 255 255 / 0.92);
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--ink);
    }

    &.is-animating li:not([hidden]) { animation: pop-in 0.45s var(--ease-out) both; }
  }

  .gallery-teaser {
    display: grid;
    gap: var(--space-s);
    grid-template-columns: repeat(2, 1fr);
    padding: 0;
    list-style: none;
    @media (min-width: 760px) {
      grid-template-columns: repeat(4, 1fr);
      grid-auto-rows: 13rem;
      & li:nth-child(1) { grid-row: span 2; grid-column: span 2; }
    }
    & li { aspect-ratio: 1; @media (min-width: 760px) { aspect-ratio: auto; } }
    & a { display: block; height: 100%; border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-s); }
    & img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.6s var(--ease-out); }
    & a:hover img { scale: 1.07; }
  }

  /* ---------- Lightbox ---------- */
  .lightbox {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgb(24 20 28 / 0.94);
    color: #fff;
    overscroll-behavior: contain;
    opacity: 0;
    transition: opacity 0.3s, display 0.3s allow-discrete, overlay 0.3s allow-discrete;

    &[open] { opacity: 1; @starting-style { opacity: 0; } }
    &::backdrop { background: transparent; }

    & .lb-stage {
      position: absolute;
      inset: 4.5rem 0 5rem;
      display: grid;
      place-items: center;
      touch-action: pan-y pinch-zoom;
      user-select: none;
    }
    & img {
      max-width: min(100% - 2rem, 1400px);
      max-height: 100%;
      width: auto;
      height: auto;
      border-radius: var(--radius-s);
      box-shadow: 0 30px 80px rgb(0 0 0 / 0.5);
      view-transition-name: lightbox-img;
      transition: translate 0.25s var(--ease-out), opacity 0.25s;
    }
    & .lb-bar {
      position: absolute;
      inset: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 1rem var(--gutter);
      font-weight: 700;
    }
    & .lb-caption {
      position: absolute;
      inset: auto 0 0;
      padding: 1rem var(--gutter) 1.5rem;
      text-align: center;
      font-size: 0.95rem;
      color: rgb(255 255 255 / 0.85);
    }
    & button {
      display: grid;
      place-items: center;
      width: 3.25rem;
      height: 3.25rem;
      border: 0;
      border-radius: 50%;
      background: rgb(255 255 255 / 0.12);
      color: #fff;
      transition: background-color 0.2s;
      &:hover { background: rgb(255 255 255 / 0.25); }
      & svg { width: 1.5rem; height: 1.5rem; }
    }
    & .lb-prev, & .lb-next {
      position: absolute;
      top: 50%;
      translate: 0 -50%;
      z-index: 2;
    }
    & .lb-prev { left: var(--gutter); }
    & .lb-next { right: var(--gutter); }

    @media (max-width: 640px) {
      & .lb-prev, & .lb-next { top: auto; bottom: 1rem; translate: none; }
      & .lb-caption { padding-inline: 5rem; }
    }
  }
  html:has(.lightbox[open]) { overflow: hidden; }

  /* ---------- Stopka ---------- */
  .site-footer {
    position: relative;
    margin-top: var(--space-xl);
    background: var(--ink);
    color: rgb(255 255 255 / 0.75);
    font-size: 0.98rem;

    & .wave { position: absolute; bottom: 100%; left: 0; color: var(--ink); }
    & h2 { color: #fff; font-size: var(--step-1); margin-bottom: var(--space-s); }
    & a { color: #fff; text-decoration: none; &:hover { color: var(--yellow); } }
  }
  .footer-grid {
    display: grid;
    gap: var(--space-l);
    padding-block: var(--space-xl) var(--space-l);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  }
  .footer-brand {
    & img { width: 200px; margin-bottom: var(--space-s); padding: 0.6rem 0.9rem; background: var(--cream); border-radius: var(--radius-m); }
    & p { max-width: 22rem; }
  }
  .footer-list {
    display: grid;
    gap: 0.6rem;
    padding: 0;
    list-style: none;
    & li { display: flex; gap: 0.6rem; align-items: flex-start; }
    & svg { width: 1.2rem; height: 1.2rem; margin-top: 0.25rem; color: var(--peach); flex-shrink: 0; }
  }
  .hours {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
    & dt { font-weight: 700; color: #fff; }
    & dd { margin: 0; }
  }
  .socials {
    display: flex;
    gap: 0.6rem;
    margin-top: var(--space-m);
    padding: 0;
    list-style: none;
    & a {
      display: grid;
      place-items: center;
      width: 2.9rem;
      height: 2.9rem;
      border-radius: 50%;
      background: rgb(255 255 255 / 0.1);
      transition: background-color 0.2s, translate 0.2s var(--ease-spring);
      &:hover { background: var(--rose); color: #fff; translate: 0 -3px; }
    }
    & svg { width: 1.3rem; height: 1.3rem; }
  }
  .footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding-block: var(--space-m);
    border-top: 1px solid rgb(255 255 255 / 0.12);
    font-size: 0.88rem;
  }

  /* ---------- Pływający przycisk "Zadzwoń" (mobile) ---------- */
  .fab-call {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 90;
    display: grid;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    box-shadow: 0 10px 25px -5px rgb(79 179 90 / 0.6);
    translate: 0 8rem;
    transition: translate 0.4s var(--ease-spring);
    & svg { width: 1.6rem; height: 1.6rem; }
    &::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      border: 2px solid var(--green);
      animation: ping 2.2s var(--ease-out) infinite;
    }
    &.is-visible { translate: 0 0; }
    @media (min-width: 960px) { display: none; }
  }
  html:has(.nav:popover-open) .fab-call { translate: 0 8rem; }
}

/* --------------------------------------------------------------------------
   Style dla poszczególnych podstron
   -------------------------------------------------------------------------- */
@layer pages {
  /* Plac zabaw – ilustracja */
  .playground {
    position: relative;
    aspect-ratio: 5 / 4;
    border-radius: var(--radius-l);
    overflow: hidden;
    background: linear-gradient(#bfe8fb, #e8f7fd 60%);
    box-shadow: var(--shadow-m);
    & svg { position: absolute; inset: 0; width: 100%; height: 100%; }
    & .sun { transform-origin: 82% 20%; animation: spin 40s linear infinite; }
    & .cloud { animation: cloud 30s linear infinite; }
    & .cloud-2 { animation-duration: 45s; animation-delay: -20s; }
    & .swing { transform-origin: 27% 47.5%; animation: swing 3.5s ease-in-out infinite; }
  }

  /* Zajęcia */
  .activity-grid { --min: 16rem; }
  .activity {
    text-align: center;
    & .card-icon { margin-inline: auto; width: 5rem; height: 5rem; & svg { width: 2.5rem; height: 2.5rem; } }
  }

  .pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0;
    list-style: none;
    & li {
      padding: 0.55rem 1.1rem;
      border-radius: 999px;
      background: var(--paper);
      box-shadow: var(--shadow-s);
      font-family: var(--font-display);
      font-weight: 500;
      color: var(--ink);
    }
    & li:nth-child(5n+1) { background: var(--tint-pink); }
    & li:nth-child(5n+2) { background: var(--tint-blue); }
    & li:nth-child(5n+3) { background: var(--tint-yellow); }
    & li:nth-child(5n+4) { background: var(--tint-green); }
    & li:nth-child(5n+5) { background: var(--tint-violet); }
  }

  /* Na telefonach krótkie karty w dwóch kolumnach – mniej przewijania */
  @media (max-width: 640px) {
    .activity-grid, .team {
      --min: 9rem;
      gap: var(--space-xs);
      & .card { padding: var(--space-s) 0.75rem; border-radius: var(--radius-m); }
      & .card-icon { width: 3.5rem; height: 3.5rem; & svg { width: 1.75rem; height: 1.75rem; } }
      & h3 { font-size: 1.05rem; }
      & p { font-size: 0.88rem; line-height: 1.5; }
    }
  }

  /* Zespół */
  .team {
    --min: 15rem;
    & .card { text-align: center; padding-block: var(--space-l); }
    & .card-icon { margin-inline: auto; }
    & h3 { font-size: var(--step-0); }
  }

  .highlight {
    padding: var(--space-m) var(--space-l);
    border-left: 6px solid var(--rose);
    border-radius: 0 var(--radius-m) var(--radius-m) 0;
    background: var(--paper);
    font-family: var(--font-display);
    font-size: var(--step-1);
    font-weight: 500;
    color: var(--ink);
    box-shadow: var(--shadow-s);
  }

  /* 404 */
  .error-page {
    min-height: 70svh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: var(--space-m);
    text-align: center;
    & .big { font-family: var(--font-display); font-size: clamp(6rem, 20vw, 12rem); line-height: 1; color: var(--rose); font-weight: 700; }
  }
}

/* --------------------------------------------------------------------------
   Utility + animacje
   -------------------------------------------------------------------------- */
@layer utilities {
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
  }
  .text-center { text-align: center; }
  .mt-m { margin-top: var(--space-m); }
  .mt-l { margin-top: var(--space-l); }

  /* Pojawianie się elementów przy scrollu – CSS scroll-driven animations,
     w starszych przeglądarkach treść jest po prostu widoczna od razu. */
  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
      .reveal {
        animation: reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 90%;
      }
      .reveal-stagger > * {
        animation: reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 85%;
      }
    }
  }
}

@keyframes reveal { from { opacity: 0; translate: 0 2.5rem; scale: 0.97; } }
@keyframes float { 50% { translate: 0 -14px; rotate: -1deg; } }
@keyframes morph {
  0% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
  50% { border-radius: 63% 37% 45% 55% / 55% 38% 62% 45%; }
  100% { border-radius: 38% 62% 36% 64% / 62% 54% 46% 38%; }
}
@keyframes drift { to { translate: var(--dx, 12px) var(--dy, -18px); rotate: var(--r, 12deg); } }
@keyframes pop-in { from { opacity: 0; scale: 0.92; } }
@keyframes ping { 80%, 100% { scale: 1.6; opacity: 0; } }
@keyframes bounce { 0%, 100% { translate: 0 0; } 40% { translate: 0 -10px; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes swing { 0%, 100% { rotate: 14deg; } 50% { rotate: -14deg; } }
@keyframes cloud { from { translate: -40% 0; } to { translate: 140% 0; } }

/* Animacja zmiany podstrony */
::view-transition-old(root) { animation: 0.25s var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: 0.35s var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; translate: 0 -12px; } }
@keyframes vt-in { from { opacity: 0; translate: 0 16px; } }

@media print {
  .site-header, .site-footer, .fab-call, .nav-toggle, .deco, .wave { display: none !important; }
  body { background: #fff; }
}
