/* Base CSS - Variables, Reset, Typography */

:root {
    /* Color Palette - Midnight Blue & Platinum */
    --color-bg-primary: #020410;
    /* Deepest Midnight Blue */
    --color-bg-secondary: #051025;
    /* Rich Navy */

    /* Text */
    --color-text-primary: #E1E1E5;
    /* Cool Platinum White */
    --color-text-secondary: #A0A5B5;
    /* Muted Blue-Grey */
    --color-text-muted: #6B7280;
    /* Dark Slate */

    /* Accents */
    --color-accent: #2997ff;
    --color-blue: #2997ff;
    /* Vivid Electric Blue */
    --color-accent-glow: rgba(41, 151, 255, 0.5);
    --color-platinum: #E1E1E5;
    /* Silver/Platinum Highlight */
    --color-gold: #D4AF37;
    /* Subtle Gold Reflection */
    --color-text: var(--color-text-primary);
    --color-border: rgba(225, 225, 229, 0.15);

    /* Glassmorphism System */
    --glass-bg: rgba(10, 20, 40, 0.4);
    /* Tinted Blue Glass */
    --glass-bg-hover: rgba(20, 30, 60, 0.5);
    --glass-border: rgba(225, 225, 229, 0.15);
    /* Platinum Border */
    --glass-border-highlight: rgba(225, 225, 229, 0.4);
    /* Brighter Shine */
    --glass-shadow: 0 8px 32px 0 rgba(0, 5, 20, 0.5);
    --backdrop-blur: blur(20px);

    /* Gradients */
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(41, 151, 255, 0.15), transparent 60%);
    --gradient-metallic: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.4) 100%);

    /* Typography */
    /* System fonts stack that mimics Apple's San Francisco */
    --font-heading: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Spacing Scale */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    /* Layout */
    --container-width: 1200px;
    --header-height: 70px;

    /* Radius */
    --radius-sm: 12px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-pill: 9999px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-medium: 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-normal: var(--transition-medium);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 768px) {
    :root {
        --space-xl: 4rem;
        --space-lg: 2.5rem;
        --space-md: 1.5rem;
    }
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
    overflow-x: clip; /* clip (not hidden) avoids creating a scroll context — safer on iOS Safari */
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: clip; /* clip (not hidden) avoids creating a scroll context — safer on iOS Safari */
    -webkit-font-smoothing: antialiased;
}

/* Liquid Alloy - Intense Flow (Fast Intro -> Slow Loop)
   Moved to ::before to fix mobile Safari background-attachment issues */
body::before {
    content: "";
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    pointer-events: none;
    
    background: linear-gradient(300deg,
            #020410,
            /* Deep Navy */
            #0a1a3f,
            /* Mid Blue */
            #1c4e8c,
            /* Electric/Metallic Blue */
            #051025,
            /* Midnight */
            #020410
            /* Loop */
        );
    background-size: 100% 100%;
    transform: translate3d(-3%, -2%, 0) scale(1.04);
}

body.ambient-motion::before {
    will-change: transform;
    animation: liquidAlloy 24s ease-in-out infinite alternate;
}

@keyframes liquidAlloy {
    0% {
        transform: translate3d(-3%, -2%, 0) scale(1.04);
    }

    50% {
        transform: translate3d(3%, 2%, 0) scale(1.08);
    }

    100% {
        transform: translate3d(-1%, 3%, 0) scale(1.05);
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-text-primary);
    line-height: 1.1;
    margin-bottom: var(--space-sm);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    /* Subtle depth */
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 3rem;
    letter-spacing: -0.025em;
}

h3 {
    font-size: 2rem;
}

p {
    margin-bottom: var(--space-sm);
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    font-weight: 400;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
    border-radius: var(--radius-md);
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-xxl { margin-top: calc(var(--space-xl) * 1.5); }

/* Focus States for Accessibility */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1000000;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--color-text-primary);
    color: var(--color-bg-primary);
    font-weight: 700;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
