/*
 * 2040 Hub — design tokens.
 * The single source of truth for color, type, spacing, radius, elevation
 * and motion. Every page loads this file first; page styles must only
 * reference these variables, never raw values.
 */

:root {
    /* ---------- Type ---------- */
    --font-sans: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Space Grotesk", "Inter", "PingFang SC", "HarmonyOS Sans SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;

    /* 1.25 modular scale */
    --fs-2xs: 0.6875rem;  /* 11 */
    --fs-xs: 0.75rem;     /* 12 */
    --fs-sm: 0.875rem;    /* 14 */
    --fs-base: 1rem;      /* 16 */
    --fs-md: 1.125rem;    /* 18 */
    --fs-lg: 1.25rem;     /* 20 */
    --fs-xl: 1.5625rem;   /* 25 */
    --fs-2xl: 1.953rem;   /* 31 */
    --fs-3xl: 2.441rem;   /* 39 */
    --fs-section: clamp(1.875rem, 1.2rem + 2.6vw, 2.75rem);
    --fs-display: clamp(3.5rem, 1.6rem + 9vw, 8rem);

    --lh-tight: 1.1;
    --lh-snug: 1.3;
    --lh-body: 1.65;
    --tracking-tight: -0.025em;
    --tracking-display: -0.045em;
    --tracking-caps: 0.14em;

    /* ---------- Spacing (4px base) ---------- */
    --s-1: 0.25rem;  /* 4 */
    --s-2: 0.5rem;   /* 8 */
    --s-3: 0.75rem;  /* 12 */
    --s-4: 1rem;     /* 16 */
    --s-5: 1.5rem;   /* 24 */
    --s-6: 2rem;     /* 32 */
    --s-7: 3rem;     /* 48 */
    --s-8: 4rem;     /* 64 */
    --s-9: 6rem;     /* 96 */
    --section-y: clamp(4.5rem, 3rem + 6vw, 7.5rem);
    --gutter: clamp(1.25rem, 0.8rem + 2vw, 2rem);
    --container: 1180px;
    --container-narrow: 860px;
    --nav-h: 68px;
    --nav-h-compact: 58px;

    /* ---------- Radius: three tiers only ---------- */
    --r-sm: 8px;
    --r-md: 14px;
    --r-pill: 999px;

    /* ---------- Motion ---------- */
    --d-fast: 120ms;
    --d-base: 200ms;
    --d-slow: 320ms;
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    /* ---------- Fixed brand hues ---------- */
    --gold: #e3c06b;
    --silver: #c3cbd6;
    --bronze: #cf9567;
}

/* ---------- Dark (default) ---------- */
:root,
[data-theme="dark"] {
    color-scheme: dark;

    --bg: #07080c;
    --surface-1: #0d0f15;
    --surface-2: #13161e;
    --surface-3: #1b1f29;
    --surface-glass: rgba(10, 12, 17, 0.72);

    --text: #eef1f6;
    --text-2: #9ba3b1;
    --text-3: #6a7282;
    --text-on-accent: #031417;

    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.13);

    --accent: #3fdcec;           /* fills, focus, the one brand hue */
    --accent-ink: #5ee3f1;       /* accent used as text */
    --accent-soft: rgba(63, 220, 236, 0.1);
    --accent-glow: rgba(63, 220, 236, 0.28);
    --violet: #8c72ff;
    --violet-soft: rgba(140, 114, 255, 0.12);

    --up: #34d399;
    --up-soft: rgba(52, 211, 153, 0.1);
    --down: #fb7185;

    --btn-primary-bg: var(--accent);
    --btn-primary-fg: var(--text-on-accent);
    --btn-primary-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 10px 30px -10px var(--accent-glow);

    --title-fade: #8ee9f3;
    --grid-line: rgba(255, 255, 255, 0.045);
    --glow-1: rgba(63, 220, 236, 0.16);
    --glow-2: rgba(140, 114, 255, 0.12);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 8px 24px -12px rgba(0, 0, 0, 0.6), 0 2px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, 0.75), 0 8px 20px -8px rgba(0, 0, 0, 0.5);

    --skeleton-base: rgba(255, 255, 255, 0.05);
    --skeleton-shine: rgba(255, 255, 255, 0.09);
    --selection: rgba(63, 220, 236, 0.28);
    --scrollbar: rgba(255, 255, 255, 0.16);
}

/* ---------- Light ---------- */
[data-theme="light"] {
    color-scheme: light;

    --bg: #f6f7f9;
    --surface-1: #ffffff;
    --surface-2: #f1f3f6;
    --surface-3: #e7eaef;
    --surface-glass: rgba(246, 247, 249, 0.78);

    --text: #0b0d12;
    --text-2: #4b5361;
    --text-3: #7a8291;
    --text-on-accent: #ffffff;

    --line: rgba(12, 18, 32, 0.08);
    --line-strong: rgba(12, 18, 32, 0.15);

    --accent: #0a97a8;
    --accent-ink: #087f8e;
    --accent-soft: rgba(10, 151, 168, 0.09);
    --accent-glow: rgba(10, 151, 168, 0.18);
    --violet: #6a4ff0;
    --violet-soft: rgba(106, 79, 240, 0.08);

    --up: #0d9a63;
    --up-soft: rgba(13, 154, 99, 0.09);
    --down: #d93a58;

    --btn-primary-bg: #0b0d12;
    --btn-primary-fg: #ffffff;
    --btn-primary-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 10px 24px -12px rgba(11, 13, 18, 0.45);

    --title-fade: #0a7f8f;
    --grid-line: rgba(12, 18, 32, 0.05);
    --glow-1: rgba(10, 151, 168, 0.1);
    --glow-2: rgba(106, 79, 240, 0.07);

    --shadow-1: 0 1px 2px rgba(12, 18, 32, 0.06);
    --shadow-2: 0 10px 24px -14px rgba(12, 18, 32, 0.18), 0 2px 6px -2px rgba(12, 18, 32, 0.06);
    --shadow-3: 0 28px 60px -24px rgba(12, 18, 32, 0.25), 0 8px 20px -10px rgba(12, 18, 32, 0.1);

    --skeleton-base: rgba(12, 18, 32, 0.05);
    --skeleton-shine: rgba(12, 18, 32, 0.09);
    --selection: rgba(10, 151, 168, 0.18);
    --scrollbar: rgba(12, 18, 32, 0.2);
}
