/* =====================================================
   DEEP SELF: Design Tokens
   Single source of truth for all design decisions
   ===================================================== */

:root {
    /* ===== COLORS ===== */
    --black: #0A0A0A;
    --charcoal: #161616;
    --white: #FFFFFF;
    --cream: #F5F2EB;
    --grey: #9A9A9A;
    --grey-dark: #2A2A2A;
    --green: #00F5A0;
    --green-dim: rgba(0, 245, 160, 0.15);
    --gold: #B8956E;
    --gold-dim: rgba(184, 149, 110, 0.2);
    --red: #FF4444;
    --pink: #F472B6;
    --rose: #FB7185;
    --violet: #A78BFA;

    /* Semantic aliases */
    --color-bg: var(--black);
    --color-bg-elevated: var(--charcoal);
    --color-text: var(--cream);
    --color-text-muted: var(--grey);
    --color-accent: var(--green);
    --color-accent-secondary: var(--gold);
    --color-border: var(--grey-dark);
    --color-error: var(--red);
    --accent-dim: rgba(0, 245, 160, 0.08);

    /* ===== TYPOGRAPHY ===== */

    /* Font - Space Grotesk only (no serifs, no italics) */
    --font-family: 'Space Grotesk', sans-serif;
    /* Deprecated aliases - all point to Space Grotesk */
    --font-sans: var(--font-family);
    --font-serif: var(--font-family);
    --font-mono: var(--font-family);

    /* Scale (fluid) */
    --text-display: clamp(3.5rem, 10vw, 6rem);
    --text-h1: clamp(2.25rem, 5vw, 3rem);
    --text-h2: clamp(1.75rem, 4vw, 2.25rem);
    --text-h3: clamp(1.25rem, 2.5vw, 1.5rem);
    --text-body-lg: clamp(1.125rem, 2vw, 1.25rem);
    --text-body: clamp(1rem, 1.5vw, 1.125rem);
    --text-sm: 0.875rem;
    --text-xs: 0.75rem;
    --text-micro: 0.625rem;

    /* Prose-specific (for long-form reading) */
    --text-prose: clamp(1.0625rem, 1.2vw + 0.5rem, 1.1875rem);
    --text-prose-lg: clamp(1.125rem, 1.5vw + 0.5rem, 1.375rem);

    /* Line heights */
    --line-height-tight: 1.1;
    --line-height-heading: 1.2;
    --line-height-base: 1.6;
    --line-height-prose: 1.8;
    --line-height-relaxed: 2.0;

    /* Letter spacing */
    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.1em;
    --letter-spacing-caps: 0.15em;

    /* ===== SPACING ===== */
    --spacing-xs: 0.5rem;    /* 8px */
    --spacing-sm: 1rem;      /* 16px */
    --spacing-md: 2rem;      /* 32px */
    --spacing-lg: 4rem;      /* 64px */
    --spacing-xl: 6rem;      /* 96px */
    --spacing-xxl: 12rem;    /* 192px */

    /* Fluid section spacing */
    --spacing-section: clamp(3rem, 8vw, 6rem);

    /* ===== LAYOUT ===== */

    /* Max widths */
    --max-width: 1200px;
    --max-width-narrow: 700px;      /* Marketing page sections */
    --max-width-text: 700px;        /* Body text columns */

    /* Prose widths (for long-form reading - ~65 chars per line) */
    --width-prose: 40rem;           /* ~640px - optimal reading at 18px */
    --width-prose-wide: 48rem;      /* ~768px - headers, intros, callouts */
    --width-prose-container: 58rem; /* ~928px - full container with sidenotes */
    --width-sidenote: 14rem;        /* ~224px - margin notes */
    --width-prose-min: 17.5rem;     /* ~280px - mobile floor */

    /* Content areas */
    --width-content: 72rem;         /* ~1152px - cards/grids */
    --width-full: 90rem;            /* ~1440px - max container */

    /* Header — computed: nav-link (11px × 1.8 lh + 16px padding = 35.8px) + site-header padding (32px) = 67.8px */
    --header-height: 4.25rem;

    /* Page margins (consistent across site) */
    --margin-page: clamp(1rem, 5vw, 3rem);
    --left-offset: clamp(3rem, 8vw, 8rem);

    /* ===== ANIMATION ===== */
    /* 150ms: hover highlights, button presses, focus rings */
    --transition-fast: 150ms cubic-bezier(0.25, 0.1, 0.25, 1);
    /* 300ms: card reveals, colour shifts, menu items */
    --transition-medium: 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
    /* 700ms: page-level transitions, dramatic scroll reveals */
    --transition-slow: 700ms cubic-bezier(0.25, 0.1, 0.25, 1);

    /* ===== SHADOWS ===== */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 0, 0, 0.2);
    --shadow-glow-green: 0 0 40px rgba(0, 245, 160, 0.2);
    --shadow-glow-gold: 0 0 40px rgba(184, 149, 110, 0.2);

    /* ===== BORDERS ===== */
    --border-subtle: 1px solid var(--grey-dark);
    --border-accent: 1px solid rgba(0, 245, 160, 0.4);
    --border-accent-gold: 1px solid rgba(184, 149, 110, 0.4);

    /* ===== Z-INDEX SCALE ===== */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-header: 1000;
    --z-modal: 2000;
    --z-toast: 3000;
    --z-max: 9999;
}

/* ===== RESPONSIVE TOKENS ===== */
/* Mobile: < 640px */
@media (max-width: 640px) {
    :root {
        --left-offset: var(--margin-page);
        --spacing-section: clamp(2rem, 6vw, 4rem);
    }
}

/* Tablet: 640px - 1024px */
/* min raised to 3rem (48px) to match the desktop clamp floor — prevents content jump at 641px boundary */
@media (min-width: 641px) and (max-width: 1024px) {
    :root {
        --left-offset: clamp(3rem, 6vw, 5rem);
    }
}

/* Mobile header is smaller (padding: 0.75rem, logo: 20px → 44px) */
@media (max-width: 767px) {
    :root {
        --header-height: 2.75rem;
    }
}
