/*
 * Multicharts Universe — Design Tokens
 *
 * The single source of truth for the Celestial Luxury visual language.
 * Every other CSS module reads from these custom properties — never
 * hard-code a color, size, or duration outside of this file.
 *
 * Naming convention: --<category>-<role>-<modifier>
 *   color   → palette
 *   font    → type families
 *   text    → font sizes
 *   space   → vertical/horizontal rhythm
 *   radius  → border radii
 *   shadow  → elevation & glow
 *   ease    → motion curves
 *   dur     → motion durations
 *   z       → z-index scale
 *   layout  → container widths & breakpoints
 */

:root {
	/* =================================================================== */
	/* COLOR — Celestial Luxury palette                                    */
	/* =================================================================== */

	/* Backgrounds: dark cosmic gradient from void to nebula stardust */
	--color-void:         #000000;
	--color-deep-space:   #0a0a0f;
	--color-cosmic-night: #14141c;
	--color-stardust:     #1f1f2e;
	--color-nebula-dust:  #2a2a3d;

	/* Gold accent system — primary brand identity */
	--color-gold-bright:  #d4af37;  /* primary CTA, hover glow */
	--color-gold:         #b8941f;  /* default gold for borders, dividers */
	--color-gold-deep:    #8b6914;  /* shadows, depth, recessed states */
	--color-gold-glow:    rgba(212, 175, 55, 0.4);
	--color-gold-veil:    rgba(212, 175, 55, 0.08);  /* whisper backgrounds */

	/* Text */
	--color-text-primary:   #ffffff;
	--color-text-secondary: #b8b8c8;
	--color-text-muted:     #6b6b7b;
	--color-text-on-gold:   #0a0a0f;  /* for buttons with gold background */

	/* Functional — trading positive / negative semantics */
	--color-signal-up:    #2dd4bf;  /* teal-green for bullish / positive */
	--color-signal-down:  #ef4444;  /* red for bearish / negative */
	--color-warning:      #f59e0b;
	--color-info:         #60a5fa;

	/* Surfaces — translucent overlays for layered depth */
	--color-surface-1:    rgba(20, 20, 28, 0.6);   /* card on dark bg */
	--color-surface-2:    rgba(31, 31, 46, 0.8);   /* elevated card */
	--color-surface-3:    rgba(42, 42, 61, 0.95);  /* modal / drawer */

	/* Border */
	--color-border-subtle: rgba(212, 175, 55, 0.12);
	--color-border-default: rgba(212, 175, 55, 0.25);
	--color-border-strong: var(--color-gold);

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

	/* Type families.
	 * - Display: elegant serif for headlines, brand moments (Cormorant Garamond)
	 * - Body:    neutral sans for prose & UI (Inter)
	 * - Mono:    for trading data, prices, tickers (JetBrains Mono)
	 * Chinese fallbacks ensured for zh-TW + zh-CN content.
	 */
	--font-display: 'Cormorant Garamond', 'Noto Serif TC', 'Noto Serif SC', 'Songti TC', 'PingFang TC', serif;
	--font-body:    'Inter', 'Noto Sans TC', 'Noto Sans SC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
	--font-mono:    'JetBrains Mono', 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;

	/* Type scale — modular ratio 1.25 (major third) */
	--text-xs:    0.75rem;    /* 12px — captions, meta */
	--text-sm:    0.875rem;   /* 14px — secondary UI */
	--text-base:  1rem;       /* 16px — body */
	--text-lg:    1.25rem;    /* 20px — lead paragraph */
	--text-xl:    1.5rem;     /* 24px — H4 */
	--text-2xl:   2rem;       /* 32px — H3 */
	--text-3xl:   2.75rem;    /* 44px — H2 */
	--text-4xl:   3.5rem;     /* 56px — H1 */
	--text-hero:  clamp(3rem, 8vw, 6.5rem);  /* fluid hero headline */
	--text-display: clamp(4rem, 12vw, 9rem); /* extra-large display */

	/* Line heights — looser for serif display, tighter for sans body */
	--leading-tight:  1.1;
	--leading-snug:   1.25;
	--leading-normal: 1.5;
	--leading-relaxed: 1.75;
	--leading-loose:  2;

	/* Letter spacing — wider for caps/tracking, tighter for display */
	--tracking-tight:   -0.02em;
	--tracking-normal:  0;
	--tracking-wide:    0.05em;
	--tracking-wider:   0.1em;
	--tracking-widest:  0.2em;  /* for tagline caps */

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

	/* =================================================================== */
	/* SPACING — 8px rhythm                                                */
	/* =================================================================== */

	--space-2xs:  0.25rem;   /* 4px */
	--space-xs:   0.5rem;    /* 8px */
	--space-sm:   1rem;      /* 16px */
	--space-md:   1.5rem;    /* 24px */
	--space-lg:   2.5rem;    /* 40px */
	--space-xl:   4rem;      /* 64px */
	--space-2xl:  6rem;      /* 96px */
	--space-3xl:  8rem;      /* 128px */
	--space-4xl:  12rem;     /* 192px — section breathing room */

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

	--container-narrow: 720px;    /* prose */
	--container-medium: 960px;    /* mixed content */
	--container-wide:   1280px;   /* default site width */
	--container-extra:  1480px;   /* wide hero, image-led sections */
	--container-padding: clamp(1rem, 5vw, 3rem);

	/* Header height — used by hero offset and sticky calculations */
	--header-height-mobile:  64px;
	--header-height-desktop: 88px;

	/* =================================================================== */
	/* BORDER RADIUS                                                       */
	/* =================================================================== */

	--radius-xs:   2px;
	--radius-sm:   4px;
	--radius-md:   8px;
	--radius-lg:   16px;
	--radius-xl:   24px;
	--radius-pill: 9999px;
	--radius-circle: 50%;

	/* =================================================================== */
	/* SHADOWS & GLOWS                                                     */
	/* =================================================================== */

	/* Standard elevation shadows on dark backgrounds */
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
	--shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
	--shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.7);

	/* Gold glows — used for hover/focus states & celestial accents */
	--glow-gold-sm: 0 0 12px var(--color-gold-glow);
	--glow-gold-md: 0 0 24px var(--color-gold-glow);
	--glow-gold-lg: 0 0 48px var(--color-gold-glow);

	/* Specialty: gold inset border (subtle metallic edge) */
	--ring-gold: inset 0 0 0 1px var(--color-border-default);

	/* =================================================================== */
	/* MOTION                                                              */
	/* =================================================================== */

	--ease-celestial: cubic-bezier(0.4, 0, 0.2, 1);     /* default smoothness */
	--ease-orbit:     cubic-bezier(0.65, 0, 0.35, 1);   /* circular feel */
	--ease-out-soft:  cubic-bezier(0.16, 1, 0.3, 1);    /* gentle landing */
	--ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1); /* slight overshoot */

	--dur-instant: 100ms;
	--dur-fast:    200ms;
	--dur-base:    400ms;
	--dur-slow:    800ms;
	--dur-glacial: 1600ms;  /* hero entrances, background drift */

	/* =================================================================== */
	/* Z-INDEX SCALE                                                       */
	/* =================================================================== */

	--z-base:      0;
	--z-elevated:  10;
	--z-sticky:    100;
	--z-overlay:   500;
	--z-modal:     1000;
	--z-toast:     2000;
	--z-tooltip:   3000;
	--z-max:       9999;
}

/* === Reduced motion: honor user OS setting ============================== */
@media (prefers-reduced-motion: reduce) {
	:root {
		--dur-instant: 1ms;
		--dur-fast:    1ms;
		--dur-base:    1ms;
		--dur-slow:    1ms;
		--dur-glacial: 1ms;
	}
}
