/* ============================================
   CSS Variables - Design Tokens
   Ossatura — Un autoritratto senza specchi

   Palette: Bone, Ivory, Warm Grays
   Theme: Bare, Naked, Essential
   ============================================ */

:root {
    /* === Color Palette — Bone & Ivory === */

    /* Primary Colors */
    --color-black: #1a1917;
    --color-white: #ffffff;
    --color-accent: #8B7355; /* Warm Sepia - Aged Bone */
    --color-accent-dark: #6B5344;
    --color-accent-light: #A8937A;

    /* Bone Tones - Light Theme Primary */
    --bone-50: #FDFCFB;
    --bone-100: #FAF8F5;
    --bone-200: #F5F2ED;
    --bone-300: #EBE6DE;
    --bone-400: #DED6CA;
    --bone-500: #C9BBA8;
    --bone-600: #A8937A;
    --bone-700: #8B7355;
    --bone-800: #6B5344;
    --bone-900: #4A3A2E;

    /* Grays - Warm undertone */
    --gray-950: #1a1917;
    --gray-900: #2a2825;
    --gray-850: #3a3733;
    --gray-800: #4a4641;
    --gray-700: #5a5550;
    --gray-600: #6a655f;
    --gray-500: #8a847d;
    --gray-400: #aaa49c;
    --gray-300: #cac4bb;
    --gray-200: #e0dbd4;
    --gray-100: #f0ece7;
    --gray-50: #faf8f5;

    /* === Typography === */

    /* Font Families */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Crimson Pro', Georgia, serif;
    --font-ui: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Font Sizes - Fluid Typography */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
    --text-3xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);
    --text-4xl: clamp(2.5rem, 1.75rem + 3.75vw, 4rem);
    --text-5xl: clamp(3rem, 2rem + 5vw, 5.5rem);

    /* Font Weights */
    --weight-light: 300;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;
    --leading-loose: 1.8;

    /* Letter Spacing */
    --tracking-tighter: -0.03em;
    --tracking-tight: -0.015em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;

    /* === Spacing === */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* === Layout === */
    --container-max: 1200px;
    --content-max: 720px;
    --sidebar-width: 320px;

    /* === Borders === */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* === Shadows — Subtle, warm === */
    --shadow-sm: 0 1px 2px rgba(74, 58, 46, 0.06);
    --shadow-md: 0 4px 6px rgba(74, 58, 46, 0.08);
    --shadow-lg: 0 10px 20px rgba(74, 58, 46, 0.1);
    --shadow-xl: 0 20px 40px rgba(74, 58, 46, 0.12);
    --shadow-glow: 0 0 30px rgba(139, 115, 85, 0.2);

    /* === Transitions === */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
    --duration-slower: 800ms;

    /* === Z-Index Scale === */
    --z-base: 0;
    --z-above: 10;
    --z-nav: 100;
    --z-overlay: 200;
    --z-modal: 300;
    --z-top: 999;

    /* === Theme Variables (Light by Default — Bone theme) === */
    --bg-primary: var(--bone-100);
    --bg-secondary: var(--bone-50);
    --bg-tertiary: var(--bone-200);

    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-700);
    --text-tertiary: var(--gray-600);
    --text-muted: var(--gray-500);

    --border-color: var(--bone-400);
    --border-subtle: var(--bone-300);

    /* Font Size Multiplier (for accessibility) */
    --font-scale: 1;
}

/* === Dark Theme === */
[data-theme="dark"] {
    --bg-primary: var(--gray-900);
    --bg-secondary: var(--gray-850);
    --bg-tertiary: var(--gray-800);

    --text-primary: var(--bone-100);
    --text-secondary: var(--bone-300);
    --text-tertiary: var(--bone-400);
    --text-muted: var(--gray-500);

    --border-color: var(--gray-700);
    --border-subtle: var(--gray-800);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* === Font Size Adjustments === */
[data-font-size="small"] {
    --font-scale: 0.9;
}

[data-font-size="large"] {
    --font-scale: 1.1;
}

[data-font-size="x-large"] {
    --font-scale: 1.2;
}
