/* ==========================================================================
   Kostka 3D — Ireneusz Wasilewski
   Custom styles (design tokens, components, animations)
   Tailwind (Play CDN) handles utility classes; this file holds the system.
   ========================================================================== */

:root {
  --ink: #15171c;
  --graphite: #1b1e24;
  --graphite-800: #23272e;
  --stone-50: #f8f7f4;
  --stone-100: #f0eee9;
  --stone-200: #e4e1da;
  --muted: #565b63;
  --accent: #b45309;       /* gliniana miedź / clay */
  --accent-600: #92400e;
  --accent-tint: #fbefdd;
  --white: #ffffff;

  --container: 75rem;      /* 1200px */
  --radius: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem; /* offset for sticky header on anchor jumps */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 1.0625rem;          /* 17px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: "Archivo", system-ui, sans-serif;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--accent);
  border-radius: 6px;
}

/* ----------------------------- Layout ------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: var(--accent);
  display: inline-block;
}

.h-display {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.h-section {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 700;
}
.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--muted);
  line-height: 1.6;
  max-width: 46ch;
}
.text-muted { color: var(--muted); }
.measure { max-width: 65ch; }

/* ----------------------------- Buttons ----------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.85rem 1.6rem;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  border-radius: 12px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  will-change: transform;
}
.btn svg { width: 1.15rem; height: 1.15rem; flex: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-600); transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(180, 83, 9, 0.55); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--stone-200); }
.btn-ghost:hover { border-color: var(--ink); background: var(--ink); color: #fff; transform: translateY(-2px); }

.btn-whatsapp { background: #25d366; color: #0a3a20; }
.btn-whatsapp:hover { background: #1ebe5a; transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(37, 211, 102, 0.6); }

.btn-block { width: 100%; }

/* ----------------------------- Cards ------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px -28px rgba(21, 23, 28, 0.35);
  border-color: var(--stone-200);
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: var(--accent-tint);
  color: var(--accent-600);
}
.icon-badge svg { width: 1.5rem; height: 1.5rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--stone-200);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
}
.chip svg { width: 1.05rem; height: 1.05rem; color: var(--accent); }

/* ------------------------- Paver placeholder ----------------------------- */
/* Elegant, on-theme placeholder shown until real realization photos are added */
.paver {
  position: relative;
  background-color: var(--stone-100);
  background-image: url("../assets/paver.svg");
  background-size: 104px 57px;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
}
.paver::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(27, 30, 36, 0.04), rgba(180, 83, 9, 0.06));
}
.paver-label {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.paver-label svg { width: 0.95rem; height: 0.95rem; color: var(--accent); }

/* Scena 3D kostki Behaton (hero) */
.paver3d {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 25%, #ffffff 0%, #efede8 70%, #e7e4dd 100%);
  cursor: grab;
  touch-action: pan-y;
}
.paver3d canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.paver3d-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* Wideo obracającej się kostki (hero) */
.paver-video-stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}
.paver-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* Aspect ratio helpers */
.ratio-43 { aspect-ratio: 4 / 3; }
.ratio-11 { aspect-ratio: 1 / 1; }
.ratio-169 { aspect-ratio: 16 / 9; }
.ratio-34 { aspect-ratio: 3 / 4; }

/* ----------------------------- Header ------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--stone-200);
  box-shadow: 0 8px 30px -22px rgba(21, 23, 28, 0.4);
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; font-family: "Archivo", sans-serif; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 0.95rem; letter-spacing: 0.02em;
}
.brand-mark span { color: var(--accent); }
.brand-mark-icon { width: 1.9rem; height: 1.9rem; display: block; }

.nav-link {
  position: relative;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  padding: 0.4rem 0;
  transition: color 0.2s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-link:hover { color: var(--accent-600); }
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--ink); }

/* Mobile menu */
.mobile-menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}
.mobile-menu.is-open { grid-template-rows: 1fr; }
.mobile-menu > div { overflow: hidden; }

.burger span { transition: transform 0.3s var(--ease), opacity 0.2s var(--ease); }
.burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ----------------------------- Sections ---------------------------------- */
.section-dark { background: var(--graphite); color: #fff; }
.section-dark h1, .section-dark h2, .section-dark h3 { color: #fff; }
.section-stone { background: var(--stone-50); }

.bg-paver-faint {
  background-color: var(--graphite);
  background-image: url("../assets/paver.svg");
  background-size: 128px 70px;
  background-blend-mode: soft-light;
}

/* Process timeline */
.step-num {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  width: 2.5rem; height: 2.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--ink); color: #fff;
}

/* Stat */
.stat-num {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

/* Form */
.field-label { font-weight: 600; font-size: 0.92rem; color: var(--ink); margin-bottom: 0.4rem; display: block; }
.field {
  width: 100%;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--stone-200);
  border-radius: 12px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field::placeholder { color: #9aa0a6; }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
textarea.field { min-height: 8rem; resize: vertical; }

/* Footer */
.footer-link { color: rgba(255,255,255,0.72); transition: color 0.2s var(--ease); }
.footer-link:hover { color: #fff; }

/* ----------------------------- Animations -------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.float-slow { animation: floatY 6s ease-in-out infinite; }

.link-arrow { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--accent-600); }
.link-arrow svg { width: 1.05rem; height: 1.05rem; transition: transform 0.25s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------------------- Reduced motion (accessibility) ------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .float-slow { animation: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
