/* ============================================================================
   Aether design tokens — STRUCTURAL.
   Spacing, type scale, radius, motion, focus, z-index, layout.
   Colors live in theme-{dark,light}.css (loaded after this file).
   Edit this file to retune the structural feel of the entire UI.
   ========================================================================= */

@import url('/lib/fonts/inter/inter.css');

:root {
    /* ── Spacing — strict 4px grid ──────────────────────────────────── */
    --space-0: 0;
    --space-px: 1px;
    --space-0_5: 0.125rem;      /* 2 — sub-grid, sparingly */
    --space-1: 0.25rem;         /* 4 */
    --space-1_5: 0.375rem;      /* 6 — sub-grid, sparingly */
    --space-2: 0.5rem;          /* 8 */
    --space-3: 0.75rem;         /* 12 */
    --space-4: 1rem;            /* 16 */
    --space-5: 1.25rem;         /* 20 */
    --space-6: 1.5rem;          /* 24 */
    --space-8: 2rem;            /* 32 */
    --space-10: 2.5rem;         /* 40 */
    --space-12: 3rem;           /* 48 */
    --space-16: 4rem;           /* 64 */
    --space-20: 5rem;           /* 80 */
    --space-24: 6rem;           /* 96 */

    /* ── Radius — Apple Spatial / visionOS scale ────────────────────
       Bumped up across the board so cards, panels, popovers, and
       buttons all read as soft + rounded by default. Pair pill buttons
       with --radius-full (see .btn in components.css). */
    --radius-sm: 6px;
    --radius-md: 10px;          /* default */
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* ── Glass surfaces — Apple Spatial / visionOS recipe ───────────
       Translucent fill + backdrop blur + inset top-edge highlight.
       Combine with --shadow-glass on the element. Fill alpha lives in
       the theme files (--glass-bg-* tokens) so dark/light tune separately.
       The blur amount is in the structural file because it's not a color. */
    --glass-blur: 28px;
    --glass-blur-strong: 40px;
    --glass-blur-subtle: 16px;
    --glass-saturate: 1.4;

    /* ── Type — families ────────────────────────────────────────────── */
    --font-ui: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    --font-body: var(--font-mono);

    /* ── Type — size scale ──────────────────────────────────────────── */
    --font-size-2xs: 0.65rem;   /* 10.4 — labels, captions */
    --font-size-xs: 0.75rem;    /* 12 — UI default small */
    --font-size-sm: 0.85rem;    /* 13.6 — UI default */
    --font-size-md: 1rem;       /* 16 — body */
    --font-size-lg: 1.2rem;     /* 19.2 — section heading */
    --font-size-xl: 1.5rem;     /* 24 — page heading */
    --font-size-2xl: 2rem;      /* 32 */
    --font-size-3xl: 3rem;      /* 48 — masthead */

    /* ── Type — weights ─────────────────────────────────────────────── */
    --weight-light: 300;
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* ── Type — line-height ─────────────────────────────────────────── */
    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;

    /* ── Type — tracking ────────────────────────────────────────────── */
    --tracking-tight: -0.01em;
    --tracking-normal: 0;
    --tracking-wide: 0.04em;
    --tracking-wider: 0.08em;
    --tracking-widest: 0.1em;

    /* ── Opacity ladder — for rgba overlays via channel vars ───────── */
    --alpha-subtle: 0.04;
    --alpha-light: 0.08;
    --alpha-medium: 0.15;
    --alpha-strong: 0.25;
    --alpha-heavy: 0.4;

    /* ── Motion — durations ─────────────────────────────────────────── */
    --duration-instant: 60ms;
    --duration-fast: 120ms;
    --duration-normal: 200ms;
    --duration-slow: 300ms;
    --duration-slower: 600ms;

    /* ── Motion — easing ────────────────────────────────────────────── */
    --easing-default: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-in: cubic-bezier(0.4, 0, 1, 1);
    --easing-out: cubic-bezier(0, 0, 0.2, 1);
    --easing-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Focus ring — depends on --accent-rgb from active theme ────── */
    --focus-ring-width: 2px;
    --focus-ring-offset: 0;
    --focus-ring-color: rgba(var(--accent-rgb), 0.5);
    --focus-ring: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);

    /* ── Z-index scale ──────────────────────────────────────────────── */
    --z-base: 1;
    --z-raised: 10;
    --z-dropdown: 100;
    --z-overlay: 1000;
    --z-modal: 5000;
    --z-popover: 10000;
    --z-tooltip: 20000;

    /* ── Layout ─────────────────────────────────────────────────────── */
    --layout-sidebar-width: 240px;
    --layout-sidebar-min: 180px;
    --layout-sidebar-max: 480px;
    --layout-header-height: 44px;
    --layout-content-max: 1200px;
}

/* ── Reduced motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    :root {
        --duration-instant: 0ms;
        --duration-fast: 0ms;
        --duration-normal: 0ms;
        --duration-slow: 0ms;
        --duration-slower: 0ms;
    }
}
