/* ═══════════════════════════════════════════════════════════════
   AJ ESTUDIO — Sistema de Diseño v2
   "Editorial Bordeaux" — Sofisticado, sobrio, atemporal
═══════════════════════════════════════════════════════════════ */

/* ─── 1. Reset moderno ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { min-height: 100vh; line-height: 1.6; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ─── 2. Tokens del sistema (Design Tokens) ────────────────── */
:root {
    /* — Colores extraídos del logo — */
    --color-burgundy: #9e1c36;          /* Bordó del logo — uso institucional */
    --color-burgundy-deep: #6e1226;     /* Bordó profundo — hover, énfasis */
    --color-burgundy-soft: #b83451;     /* Bordó claro — efectos sutiles */
    --color-burgundy-tint: #fdf2f4;     /* Tinte mínimo — fondos sutiles */
    
    --color-graphite: #2a2a2c;          /* Casi negro — texto principal */
    --color-graphite-mid: #5c5c5e;      /* Gris medio — texto secundario */
    --color-graphite-light: #8a8a8c;    /* Gris claro — apoyos */
    
    --color-cream: #faf8f5;             /* Crema cálida — fondo principal */
    --color-cream-deep: #f4f0e8;        /* Crema profunda — secciones alternas */
    --color-paper: #ffffff;             /* Blanco — cards, contraste */
    --color-line: #e8e4dd;              /* Línea sutil — bordes */
    --color-line-strong: #d4cdbf;       /* Línea fuerte — divisores */
    
    /* — Tipografía — */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    
    /* — Escala tipográfica (modular: 1.25) — */
    --fs-xs: 0.75rem;       /* 12px */
    --fs-sm: 0.875rem;      /* 14px */
    --fs-base: 1rem;        /* 16px */
    --fs-md: 1.125rem;      /* 18px */
    --fs-lg: 1.375rem;      /* 22px */
    --fs-xl: 1.75rem;       /* 28px */
    --fs-2xl: 2.25rem;      /* 36px */
    --fs-3xl: 3rem;         /* 48px */
    --fs-4xl: 4rem;         /* 64px */
    --fs-5xl: 5.5rem;       /* 88px */
    --fs-6xl: 8rem;         /* 128px — números heroicos */
    
    /* — Pesos — */
    --fw-light: 300;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    
    /* — Espaciado (sistema de 8) — */
    --space-1: 0.25rem;     /* 4px */
    --space-2: 0.5rem;      /* 8px */
    --space-3: 0.75rem;     /* 12px */
    --space-4: 1rem;        /* 16px */
    --space-5: 1.5rem;      /* 24px */
    --space-6: 2rem;        /* 32px */
    --space-7: 3rem;        /* 48px */
    --space-8: 4rem;        /* 64px */
    --space-9: 6rem;        /* 96px */
    --space-10: 8rem;       /* 128px */
    --space-11: 12rem;      /* 192px */
    
    /* — Layout — */
    --container-max: 1280px;
    --container-narrow: 880px;
    --container-prose: 680px;
    --header-height: 84px;
    --header-height-scrolled: 68px;
    
    /* — Transiciones — */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 200ms;
    --duration-base: 400ms;
    --duration-slow: 700ms;
    
    /* — Bordes — */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
    
    /* — Z-index — */
    --z-base: 1;
    --z-elevated: 10;
    --z-sticky: 100;
    --z-overlay: 200;
    --z-modal: 300;
}

/* ─── 3. Base global ───────────────────────────────────────── */
body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    color: var(--color-graphite);
    background-color: var(--color-cream);
    line-height: 1.7;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}

/* ─── 4. Tipografía editorial ──────────────────────────────── */
.display, h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: var(--fw-regular);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--color-graphite);
    /* Activamos el opsz variable de Fraunces para títulos */
    font-variation-settings: 'opsz' 144, 'SOFT' 50;
}

h1 { font-size: clamp(2.5rem, 5.5vw, var(--fs-5xl)); }
h2 { font-size: clamp(2rem, 4vw, var(--fs-3xl)); }
h3 { font-size: clamp(1.5rem, 2.5vw, var(--fs-2xl)); }

h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: var(--fw-semibold);
    line-height: 1.3;
    letter-spacing: -0.01em;
}
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-graphite-mid); }

p { line-height: 1.75; color: var(--color-graphite-mid); }

/* Énfasis editorial — bordó */
strong, b { font-weight: var(--fw-semibold); color: var(--color-graphite); }
em, i { font-style: italic; }

/* Eyebrow — etiqueta pequeña arriba de títulos */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--color-burgundy);
    margin-bottom: var(--space-5);
}
.eyebrow::before {
    content: '';
    width: 32px;
    height: 1px;
    background-color: var(--color-burgundy);
}

/* Lead — párrafo destacado */
.lead {
    font-size: clamp(var(--fs-md), 2vw, var(--fs-lg));
    line-height: 1.6;
    color: var(--color-graphite);
    font-weight: var(--fw-regular);
    max-width: 60ch;
}

/* Display number — números grandes editoriales */
.display-number {
    font-family: var(--font-display);
    font-weight: var(--fw-light);
    font-size: clamp(4rem, 12vw, var(--fs-6xl));
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--color-burgundy);
    font-feature-settings: 'tnum' 1;
    font-variation-settings: 'opsz' 144, 'SOFT' 100;
}

/* Mono — datos técnicos */
.mono {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    font-feature-settings: 'tnum' 1;
}

/* ─── 5. Selección de texto ────────────────────────────────── */
::selection { background-color: var(--color-burgundy); color: var(--color-paper); }
::-moz-selection { background-color: var(--color-burgundy); color: var(--color-paper); }

/* ─── 6. Scrollbar elegante ────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-cream); }
::-webkit-scrollbar-thumb { background: var(--color-line-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-graphite-light); }

/* ─── 7. Focus visible — accesibilidad ─────────────────────── */
:focus-visible {
    outline: 2px solid var(--color-burgundy);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ─── 8. Helpers utilitarios ───────────────────────────────── */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-6); }
.container-narrow { width: 100%; max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--space-6); }
.container-prose { width: 100%; max-width: var(--container-prose); margin: 0 auto; padding: 0 var(--space-6); }

.text-burgundy { color: var(--color-burgundy); }
.text-graphite { color: var(--color-graphite); }
.text-mid { color: var(--color-graphite-mid); }
.text-center { text-align: center; }
.text-balance { text-wrap: balance; }

.bg-cream { background-color: var(--color-cream); }
.bg-cream-deep { background-color: var(--color-cream-deep); }
.bg-paper { background-color: var(--color-paper); }
.bg-graphite { background-color: var(--color-graphite); color: var(--color-cream); }
.bg-burgundy { background-color: var(--color-burgundy); color: var(--color-paper); }

/* Línea editorial bordó horizontal */
.editorial-rule {
    width: 100%;
    height: 1px;
    background-color: var(--color-line);
    margin: var(--space-7) 0;
    position: relative;
}
.editorial-rule::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 64px; height: 1px;
    background-color: var(--color-burgundy);
}

/* Sección con padding generoso */
.section {
    padding: clamp(var(--space-9), 12vw, var(--space-11)) 0;
    position: relative;
}
.section-sm { padding: clamp(var(--space-8), 8vw, var(--space-9)) 0; }

/* ─── 9. Animaciones de entrada ────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideRight {
    from { opacity: 0; transform: translateX(-32px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes growLine {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }

/* Reduce motion — accesibilidad */
@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;
    }
}
