/* ============================================================
   SM Piękna — Design tokens (warm/residential)
   Spacing · Radii · Elevation · Motion · Typography scale
   Loaded after theme dynamic tokens, before component styles.
   ============================================================ */

:root {
    /* Spacing scale (4px base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 56px;
    --space-10: 72px;
    --space-11: 96px;
    --space-12: 128px;

    /* Radii scale — bardziej miękkie zaokrąglenia (warm/residential) */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    /* Elevation — ciepły ton cienia (brąz) zamiast szarości */
    --shadow-xs: 0 1px 2px rgba(74, 52, 30, 0.05);
    --shadow-sm: 0 2px 6px rgba(74, 52, 30, 0.06), 0 1px 2px rgba(74, 52, 30, 0.04);
    --shadow-md: 0 8px 20px rgba(74, 52, 30, 0.08), 0 2px 6px rgba(74, 52, 30, 0.05);
    --shadow-lg: 0 24px 48px rgba(74, 52, 30, 0.12), 0 4px 12px rgba(74, 52, 30, 0.06);
    --shadow-xl: 0 36px 72px rgba(74, 52, 30, 0.16), 0 8px 24px rgba(74, 52, 30, 0.08);

    /* Motion */
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 150ms;
    --duration: 250ms;
    --duration-slow: 400ms;

    /* Typography scale (fluid) */
    --fs-xs: clamp(11.5px, 0.7vw + 0.6rem, 13px);
    --fs-sm: clamp(13px, 0.4vw + 0.7rem, 14.5px);
    --fs-base: clamp(15px, 0.3vw + 0.85rem, 16.5px);
    --fs-lg: clamp(17px, 0.5vw + 0.9rem, 19px);
    --fs-xl: clamp(20px, 0.8vw + 1rem, 24px);
    --fs-2xl: clamp(24px, 1.5vw + 1rem, 32px);
    --fs-3xl: clamp(32px, 2.4vw + 1rem, 44px);
    --fs-display: clamp(40px, 4.6vw + 1rem, 76px);

    /* Surfaces (warm overlays na bg) */
    --surface-warm-1: color-mix(in srgb, var(--bg-warm) 55%, var(--bg) 45%);
    --surface-warm-2: var(--bg-warm);
    --surface-accent-tint: color-mix(in srgb, var(--accent) 8%, var(--bg-card) 92%);
    --surface-primary-tint: color-mix(in srgb, var(--primary) 6%, var(--bg-card) 94%);
}

/* ============================================================
   Typography refinements (Fraunces + Inter)
   ============================================================ */
body {
    font-family: var(--sans);
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif);
    font-weight: 500;
    letter-spacing: -0.015em;
    /* Fraunces opsz: większe rozmiary -> wyższe opsz dla bardziej delikatnych form */
    font-variation-settings: "opsz" 80;
    color: var(--ink);
}

h1 {
    font-size: var(--fs-display);
    line-height: 1.04;
    letter-spacing: -0.025em;
    font-variation-settings: "opsz" 144;
}

h2 {
    font-size: var(--fs-3xl);
    line-height: 1.12;
    letter-spacing: -0.02em;
    font-variation-settings: "opsz" 90;
}

h3 {
    font-size: var(--fs-xl);
    line-height: 1.25;
    font-variation-settings: "opsz" 36;
}

h4 {
    font-size: var(--fs-lg);
    line-height: 1.3;
    font-variation-settings: "opsz" 24;
}

h1 em, h2 em, h3 em {
    font-style: italic;
    color: var(--accent);
    font-weight: 400;
}

p {
    text-wrap: pretty;
    line-height: 1.6;
}

::selection {
    background: color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--ink);
}

/* ============================================================
   Focus ring — spójny dla całego serwisu
   ============================================================ */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
