/* ============================================
   EKO-ŻAR — Base Styles (Reset + Typography)
   ============================================ */

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--bg-dark);
    overflow-x: hidden;
    margin: 0;
}

/* Scroll targets offset for sticky header */
[id] {
    scroll-margin-top: calc(var(--header-height) + var(--top-bar-height) + 20px);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    line-height: 1.2;
    color: var(--text-dark);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }

p { margin-bottom: var(--space-md); }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    padding-left: var(--space-xl);
    margin-bottom: var(--space-md);
}

/* --- Utility classes --- */
.text-accent { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-muted { color: var(--text-dark-muted); }
.text-light { color: var(--text-light); }
.text-center { text-align: center; }

.section-label {
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
    display: block;
}

.section-title {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-extrabold);
    margin-bottom: var(--space-lg);
    line-height: 1.15;
}

.section-subtitle {
    font-size: var(--fs-md);
    color: var(--text-dark-muted);
    max-width: 600px;
    line-height: 1.7;
}

.section-subtitle.centered {
    margin-left: auto;
    margin-right: auto;
}

/* Animate on scroll — progressive enhancement
   Animacje aktywne TYLKO gdy JS załadowany (body.js-ready).
   Bez JS treść jest widoczna normalnie. */
body.js-ready .animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
body.js-ready .animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Content fade — progressive enhancement */
.main {
    opacity: 1;
}
body.js-ready .main {
    opacity: 0;
    transition: opacity 0.4s ease;
}
body.js-ready.page-loaded .main {
    opacity: 1;
}

/* --- Responsive Typography --- */
@media (max-width: 768px) {
    h1 { font-size: var(--fs-2xl); }
    h2 { font-size: var(--fs-xl); }
    h3 { font-size: var(--fs-lg); }
    .section-title { font-size: var(--fs-2xl); }
}

/* Atrybut hidden musi wygrywać z klasami ustawiającymi display
   (np. flex w przycisku podglądu produktu). */
[hidden] {
    display: none !important;
}
