/* ==========================================================================
   KD Max Trener - Precision Workshop & CAD Stylesheet
   ========================================================================== */

/* --- 1. Podstawowe ustawienia i płynne przewijanie --- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* Kompensacja przyklejonego paska nawigacji */
}

/* --- 2. Siatka blueprint CAD i znaczniki podziałki liniałowej --- */
.cad-grid {
  background-size: 24px 24px;
  background-image: 
    linear-gradient(to right, rgba(116, 119, 122, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(116, 119, 122, 0.07) 1px, transparent 1px);
}

.ruler-ticks {
  background-image: repeating-linear-gradient(90deg, #74777a 0, #74777a 1px, transparent 1px, transparent 12px);
}

/* --- 3. Cienie techniczne i wyniesienie modułów CAD --- */
.technical-shadow {
  box-shadow: 0 1px 3px rgba(27, 30, 32, 0.06), 0 1px 2px rgba(27, 30, 32, 0.04);
}

.elevated-module {
  box-shadow: 0 8px 24px -4px rgba(27, 30, 32, 0.08), 0 2px 6px -1px rgba(27, 30, 32, 0.04);
}

/* --- 4. Subtelne animacje pojawiania się (Intersection Observer) --- */
.fade-in-section {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Poszanowanie preferencji użytkownika odnośnie ruchu (Accessibility) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .fade-in-section {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* --- 5. Efekt sticky header po przewinięciu --- */
header.header-scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px -2px rgba(27, 30, 32, 0.08);
  border-bottom-color: rgba(196, 199, 201, 0.8);
}

/* --- 6. Mobilne menu drawer --- */
#mobile-menu {
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

#mobile-menu.menu-closed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

#mobile-menu.menu-open {
  max-height: 480px;
  opacity: 1;
  pointer-events: auto;
}

/* --- 7. Drobne usprawnienia typograficzne i focus accessibility --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #7f552f;
  outline-offset: 2px;
}
