/* ================================================================
   MATZ GLOBAL ESPAÑA - Base styles
   Reset, variables, tipografía y utilidades
   ================================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colores - Paleta oscura premium con dorado */
    --bg-primary: #050816;
    --bg-secondary: #0a0e27;
    --bg-tertiary: #0f1535;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);

    --gold: #fbbf24;
    --gold-light: #fcd34d;
    --gold-dark: #d4af37;
    --gold-deep: #b8860b;

    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --border-gold: rgba(251, 191, 36, 0.3);

    /* Gradients */
    --grad-gold: linear-gradient(135deg, #fbbf24 0%, #d4af37 100%);
    --grad-gold-soft: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
    --grad-dark: linear-gradient(180deg, #050816 0%, #0a0e27 100%);
    --grad-card: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);

    /* Sombras */
    --shadow-gold: 0 10px 40px -10px rgba(251, 191, 36, 0.4);
    --shadow-gold-strong: 0 20px 60px -15px rgba(251, 191, 36, 0.5);
    --shadow-card: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-card-hover: 0 20px 60px -15px rgba(0, 0, 0, 0.7);

    /* Tipografía */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --container-max: 1280px;
    --section-pad: clamp(4rem, 8vw, 7rem);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: hidden;
    font-size: 16px;
}

img, svg {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s var(--ease);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
}

ul, ol {
    list-style: none;
}

/* Tipografía */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-secondary);
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Utilidades */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.text-gold {
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}

/* Selección */
::selection {
    background: var(--gold);
    color: var(--bg-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-dark), var(--gold-deep));
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loader */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}

.loader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loader-text {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulseText 1.5s ease-in-out infinite;
}

.loader-bar {
    width: 120px;
    height: 2px;
    background: var(--border);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.loader-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-gold);
    transform: translateX(-100%);
    animation: loaderSlide 1.5s ease-in-out infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes loaderSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Accesibilidad: reduce 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;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}
