/* ============================================================
   LINK SISTEMI – DESIGN TOKENS
   Apple-grade light-first design language
   ============================================================ */

:root {
    /* ── BRAND ──────────────────────────────────────────────── */
    --brand: #2563EB;
    --brand-rgb: 37, 99, 235;
    --brand-light: #60A5FA;
    --brand-dark: #1D4ED8;
    --brand-glow: rgba(37, 99, 235, 0.18);

    /* ── NEUTRAL RAMP ──────────────────────────────────────── */
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F7;
    --gray-200: #E8E8ED;
    --gray-300: #D2D2D7;
    --gray-400: #AEAEB2;
    --gray-500: #8E8E93;
    --gray-600: #636366;
    --gray-700: #48484A;
    --gray-800: #3A3A3C;
    --gray-900: #1D1D1F;
    --gray-950: #0A0A0A;

    /* ── SEMANTICS ─────────────────────────────────────────── */
    --success: #34C759;
    --success-rgb: 52, 199, 89;
    --warning: #FF9F0A;
    --warning-rgb: 255, 159, 10;
    --danger: #FF3B30;
    --danger-rgb: 255, 59, 48;
    --info: #5AC8FA;
    --info-rgb: 90, 200, 250;

    /* ── LIGHT SURFACES (DEFAULT) ──────────────────────────── */
    --surface-0: var(--gray-100);
    --surface-1: #FFFFFF;
    --surface-2: #FFFFFF;
    --surface-3: var(--gray-50);
    --surface-border: var(--gray-200);
    --surface-border-strong: var(--gray-300);

    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);

    /* ── TYPOGRAPHY ────────────────────────────────────────── */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, monospace;

    --text-display: clamp(2.5rem, 5vw, 3.75rem);
    --text-h1: 1.75rem;
    --text-h2: 1.25rem;
    --text-h3: 1rem;
    --text-body: 0.9375rem;
    --text-sm: 0.8125rem;
    --text-xs: 0.75rem;

    --font-regular: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-black: 800;

    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.04em;

    /* ── SPACING (4px base) ────────────────────────────────── */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-24: 96px;
    --space-32: 128px;

    /* ── RADIUS ────────────────────────────────────────────── */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* ── SHADOW (Apple-style) ──────────────────────────────── */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.10);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);
    --shadow-brand: 0 4px 20px rgba(var(--brand-rgb), 0.25);

    /* ── TRANSITIONS ───────────────────────────────────────── */
    --ease-default: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --duration-micro: 200ms;
    --duration-normal: 350ms;
    --duration-section: 600ms;
    --duration-stagger: 100ms;

    --transition-fast: all 200ms var(--ease-default);
    --transition-normal: all 350ms var(--ease-out);
}

/* ── REDUCED MOTION ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── GLOBAL RESET ──────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: var(--leading-normal);
}

a {
    text-decoration: none;
    color: inherit;
}

/* ── TYPOGRAPHY UTILITIES ──────────────────────────────────── */
.text-display {
    font-size: var(--text-display);
    font-weight: var(--font-black);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

.text-h1 {
    font-size: var(--text-h1);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

.text-h2 {
    font-size: var(--text-h2);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
}

.text-h3 {
    font-size: var(--text-h3);
    font-weight: var(--font-semibold);
}

.text-body {
    font-size: var(--text-body);
    font-weight: var(--font-regular);
    line-height: var(--leading-relaxed);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-brand {
    color: var(--brand);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.font-medium {
    font-weight: var(--font-medium);
}

.font-semibold {
    font-weight: var(--font-semibold);
}

.font-bold {
    font-weight: var(--font-bold);
}

.font-black {
    font-weight: var(--font-black);
}

.text-gradient {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── SPACING ───────────────────────────────────────────────── */
.mt-1 {
    margin-top: var(--space-1);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-3 {
    margin-top: var(--space-3);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

/* ── LAYOUT ────────────────────────────────────────────────── */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}