/* ==========================================================================
   DESIGN TOKENS — Op. Dr. Alper Tuncel V5
   Atelier Noir — Dark Luxury Medical
   ========================================================================== */

:root {
    /* ── Palette: Dark ── */
    --color-dark:          #0B0A09;
    --color-dark-elevated: #141311;
    --color-dark-surface:  #1A1816;
    --color-dark-muted:    rgba(11, 10, 9, 0.6);
    --color-ink:           #1C1917;
    --color-ink-80:        rgba(28, 25, 23, 0.8);
    --color-ink-60:        rgba(28, 25, 23, 0.6);
    --color-ink-40:        rgba(28, 25, 23, 0.4);
    --color-ink-20:        rgba(28, 25, 23, 0.2);
    --color-ink-10:        rgba(28, 25, 23, 0.1);
    --color-ink-05:        rgba(28, 25, 23, 0.05);

    /* ── Palette: Light ── */
    --color-warm-white:    #F5F2EC;
    --color-cream:         #EDE9E0;
    --color-stone:         #E3DED5;
    --color-stone-dark:    #D5CFC4;

    /* ── Palette: Gold ──
       --color-gold is the brand gold used on dark backgrounds (high contrast).
       --color-gold-ink is WCAG AA-compliant gold for text on LIGHT backgrounds
       (contrast ratio 5.02:1 against white — passes AA for normal text). */
    --color-gold:          #B8956A;
    --color-gold-light:    #D4B88C;
    --color-gold-dark:     #9A7B55;
    --color-gold-ink:      #7A5F30; /* For light-theme text — 5:1 on white */
    --color-gold-highlight:#E8D9B8;
    --color-gold-subtle:   rgba(184, 149, 106, 0.10);
    --color-gold-glow:     rgba(184, 149, 106, 0.04);
    --gradient-gold:       linear-gradient(135deg, #B8956A, #D4B88C);
    --gradient-gold-text:  linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
    --gradient-gold-foil:  linear-gradient(105deg, #9A7B55 0%, #B8956A 25%, #E8D9B8 50%, #D4B88C 75%, #9A7B55 100%);
    --gradient-gold-metallic: linear-gradient(135deg, #8B6F47, #B8956A, #D4B88C, #E8D9B8, #D4B88C, #B8956A, #8B6F47);

    /* ── Palette: White ──
       Opacity tokens bumped for readability — subdued labels were too dim on dark bg.
       Previous 0.18 / 0.38 / 0.58 → now 0.42 / 0.55 / 0.72 (WCAG AA compliant). */
    --color-white:         #FFFFFF;
    --color-white-80:      rgba(255, 255, 255, 0.88);
    --color-white-60:      rgba(255, 255, 255, 0.72);
    --color-white-40:      rgba(255, 255, 255, 0.55);
    --color-white-20:      rgba(255, 255, 255, 0.42);
    --color-white-10:      rgba(255, 255, 255, 0.12);
    --color-white-05:      rgba(255, 255, 255, 0.06);

    /* ── Palette: Semantic ── */
    --color-success:       #3D9970;
    --color-error:         #C0392B;
    --color-green-wa:      #25D366;

    /* ── Glass ── */
    --glass-dark:   rgba(11, 10, 9, 0.85);
    --glass-light:  rgba(255, 255, 255, 0.65);
    --glass-blur:   blur(24px) saturate(1.3);

    /* ── Typography ──
       Expanded font stacks with robust fallbacks. Arabic cascade for RTL. */
    --font-display:  'Cormorant Garamond', 'EB Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body:     'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, system-ui, sans-serif;
    --font-arabic:        'Noto Naskh Arabic', 'Amiri', 'Segoe UI', Tahoma, sans-serif;
    --font-arabic-display:'Noto Kufi Arabic', 'Noto Naskh Arabic', 'Amiri', Georgia, serif;
    --font-mono:     'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

    /* Fluid typography via clamp() — scales between 375px and 1440px viewports.
       min = mobile size, max = desktop size, preferred = linear interpolation. */
    --text-xs:    0.75rem;                                      /* 12px — fixed */
    --text-sm:    0.875rem;                                     /* 14px — fixed */
    --text-base:  clamp(0.9375rem, 0.87rem + 0.28vw, 1.0625rem); /* 15 → 17px */
    --text-md:    clamp(1rem,      0.92rem + 0.37vw, 1.1875rem); /* 16 → 19px */
    --text-lg:    clamp(1.0625rem, 0.94rem + 0.5vw,  1.375rem);  /* 17 → 22px */
    --text-xl:    clamp(1.1875rem, 1rem    + 0.85vw, 1.75rem);   /* 19 → 28px */
    --text-2xl:   clamp(1.3125rem, 0.99rem + 1.4vw,  2.375rem);  /* 21 → 38px */
    --text-3xl:   clamp(1.625rem,  1.09rem + 2.3vw,  3.5rem);    /* 26 → 56px */
    --text-4xl:   clamp(2rem,      1.13rem + 3.71vw, 5rem);      /* 32 → 80px */
    --text-5xl:   clamp(2.5rem,    1.32rem + 4.95vw, 6.5rem);    /* 40 → 104px */

    --weight-thin:     200;
    --weight-light:    300;
    --weight-regular:  400;
    --weight-medium:   500;
    --weight-semibold: 600;
    --weight-bold:     700;

    --leading-none:    1;
    --leading-tightest:1.05;
    --leading-tight:   1.1;
    --leading-snug:    1.25;
    --leading-normal:  1.65;
    --leading-relaxed: 1.85;
    --leading-loose:   2;

    --tracking-tightest:-0.04em;
    --tracking-tight:  -0.03em;
    --tracking-normal:  0;
    --tracking-wide:    0.08em;
    --tracking-wider:   0.14em;
    --tracking-widest:  0.2em;

    /* ── Spacing ── */
    --sp-1:   0.25rem;
    --sp-2:   0.5rem;
    --sp-3:   0.75rem;
    --sp-4:   1rem;
    --sp-5:   1.5rem;
    --sp-6:   2rem;
    --sp-8:   3rem;
    --sp-10:  4rem;
    --sp-12:  5rem;
    --sp-16:  7rem;
    --sp-20:  9rem;
    --sp-24:  12rem;

    /* ── Layout ── */
    --container-max:   1200px;
    --container-wide:  1400px;
    --container-text:  660px;
    --gutter:          2rem;

    /* ── Borders ── */
    --border-light:  1px solid rgba(255, 255, 255, 0.06);
    --border-dark:   1px solid rgba(12, 12, 12, 0.08);
    --border-gold:   1px solid var(--color-gold);
    --radius:        0;
    --radius-md:     0;
    --radius-lg:     2px;
    --radius-xl:     3px;
    --radius-full:   2px;

    /* ── Shadows ── */
    --shadow-xs:    0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-sm:    0 1px 4px rgba(0, 0, 0, 0.04);
    --shadow-md:    0 8px 32px rgba(0, 0, 0, 0.06);
    --shadow-lg:    0 24px 64px rgba(0, 0, 0, 0.1);
    --shadow-xl:    0 32px 80px rgba(0, 0, 0, 0.14);
    --shadow-gold:  0 0 80px rgba(184, 149, 106, 0.06);
    --shadow-card:  0 2px 12px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 16px 48px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.06);

    /* ── Transitions ── */
    --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
    --ease-smooth:   cubic-bezier(0.4, 0, 0.2, 1);
    --ease-dramatic: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast:    200ms;
    --dur-base:    400ms;
    --dur-slow:    700ms;
    --dur-cinematic: 1000ms;

    /* ── Z-index ── */
    --z-base:    1;
    --z-above:   10;
    --z-sticky:  50;
    --z-overlay: 100;
    --z-modal:   200;
    --z-toast:   300;
    --z-loader:  9999;
}

/* ── Responsive Spacing ──
   Typography is fluid via clamp(); only spacing + gutter needs breakpoints. */
@media (max-width: 1024px) {
    :root {
        --gutter: 1.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --sp-16:  5rem;
        --sp-20:  6rem;
        --sp-24:  7rem;
        --gutter: 1.25rem;
    }
}

@media (max-width: 428px) {
    :root {
        --sp-6:   1.5rem;
        --sp-8:   2rem;
        --sp-10:  2.5rem;
        --sp-12:  3.5rem;
        --sp-16:  3.5rem;
        --sp-20:  4rem;
        --sp-24:  4.5rem;
        --gutter: 1rem;
    }
}

/* ── Ultra-wide / 4K scaling ──
   Keep readable max sizes on very large screens. */
@media (min-width: 1920px) {
    :root {
        --container-max:  1440px;
        --container-wide: 1680px;
    }
}
