/* ═══════════════════════════════════════════
   KM Smart Home — style.css
   Design system w duchu apple.com: systemowa
   czcionka sans, biel/czerń + jeden akcent (szałwia),
   pigułkowe przyciski, dużo przestrzeni, spokojny ruch.
═══════════════════════════════════════════ */
:root {
  /* Marka — jeden akcent, używany oszczędnie (CTA, linki, kropki statusu) */
  --accent: #3c7a4e;
  --accent-deep: #2e5f3d;
  --accent-pale: #eaf3ec;

  /* Neutralna skala w stylu apple.com */
  --white: #ffffff;
  --surface: #f5f5f7;   /* jasnoszare tło sekcji, dokładnie jak na apple.com */
  --surface-2: #ececee;
  --ink: #1d1d1f;       /* prawie-czarny tekst */
  --ink-muted: #6e6e73; /* drugorzędny tekst / szary apple */
  --ink-faint: #a1a1a6;
  --line: rgba(0,0,0,0.08);

  --dark: #000000;
  --dark-surface: #0e0e0f;
  --dark-line: rgba(255,255,255,0.14);
  --on-dark: #f5f5f7;
  --on-dark-muted: rgba(245,245,247,0.62);

  --radius-pill: 980px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
  --shadow-md: 0 12px 32px rgba(0,0,0,0.08);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.12);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-apple: cubic-bezier(0.28, 0.11, 0.32, 1);

  /* ── Aliasy wstecz-kompatybilne (stare nazwy z poprzedniej wersji, używane
     jeszcze w mobile.css) — mapowane na nowy, apple'owy zestaw tokenów. ── */
  --sage: var(--accent);
  --sage-light: #a9c8b3;
  --sage-pale: var(--accent-pale);
  --sage-deep: var(--accent);
  --sage-dark: var(--accent-deep);
  --cream: var(--surface);
  --ink-soft: var(--ink);
  --gold: var(--accent);
  --gold-light: var(--accent-pale);
  --border: var(--line);
  --radius-xs: var(--radius-pill);
  --radius-full: var(--radius-pill);
  --shadow-brand: var(--shadow-md);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  background: var(--white);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── SHARED SECTION HEADER ─── */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.section-heading {
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.08;
  color: var(--ink);
}
.section-heading em {
  font-style: normal;
  color: var(--ink-muted);
  font-weight: 600;
}
.section-sub {
  font-size: clamp(17px, 1.5vw, 21px);
  color: var(--ink-muted);
  font-weight: 400;
  line-height: 1.5;
}

/* ─── BUTTONS (pigułki, jak na apple.com) ─── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 28px;
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
  font-size: 16px; font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: var(--radius-pill);
  transition: background 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn-primary svg { width: 15px; height: 15px; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  text-decoration: none;
  font-size: 16px; font-weight: 500;
  transition: gap 0.25s var(--ease-out), color 0.2s;
}
.btn-ghost::after { content: '›'; font-size: 18px; line-height: 1; transition: transform 0.25s var(--ease-out); }
.btn-ghost:hover { gap: 9px; color: var(--accent-deep); }

/* ─── FADE IN ANIMATION ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.9s var(--ease-out) both; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.34s; }
.delay-5 { animation-delay: 0.44s; }

/* ─── SCROLL REVEAL ───
   Precyzyjny, krótki ruch — zgodnie z zasadą HIG "brevity and precision in
   feedback animations": bez podskoków, bez rotacji 3D na każdym elemencie. */
.reveal, .reveal-3d {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease-apple), transform 0.8s var(--ease-apple);
  will-change: transform, opacity;
}
.reveal.visible, .reveal-3d.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── 3D TILT (hover, tylko flagowe elementy) ─── */
[data-tilt] {
  transition: transform 0.35s var(--ease-out);
  transform-style: preserve-3d;
}

/* ─── FILM GRAIN — bardzo subtelna faktura ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── SCROLL PROGRESS BAR ─── */
.scroll-progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transform-origin: left;
}

/* ─── NAV — stan po przewinięciu ─── */
nav.scrolled {
  box-shadow: 0 1px 0 var(--line);
}

/* ─── MAGNETIC BUTTONS — lekkie przyciąganie kursora ─── */
[data-magnetic] { will-change: transform; }

/* ─── STRONY PRAWNE (polityka prywatności itp.) ─── */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 168px 24px 100px;
}
.legal-page h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}
.legal-page .legal-updated {
  font-size: 14px; color: var(--ink-muted); margin-bottom: 48px;
}
.legal-page h2 {
  font-size: 21px; font-weight: 600; letter-spacing: -0.01em;
  margin-top: 40px; margin-bottom: 14px;
}
.legal-page p {
  font-size: 16px; color: var(--ink-muted); line-height: 1.7; margin-bottom: 14px;
}
.legal-page ul {
  margin: 0 0 14px 20px;
  color: var(--ink-muted);
  font-size: 16px; line-height: 1.7;
}
.legal-page li { margin-bottom: 6px; }
.legal-page a { color: var(--accent); }
.legal-page strong { color: var(--ink); font-weight: 600; }
.legal-page .back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--ink-muted); text-decoration: none;
  margin-bottom: 32px;
}
.legal-page .back-link:hover { color: var(--ink); }

/* ─── Poszanowanie prefers-reduced-motion ───
   Wyłącza cały ruch (parallax, tilt, reveal) i pokazuje stan końcowy od razu. */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-3d {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .fade-up { animation: none !important; opacity: 1 !important; }
  [data-tilt] { transition: none !important; }
  .hero-badge-dot { animation: none !important; }
}
