/* ═══════════════════════════════════════════════════════════════
   AJ ESTUDIO — Sistema de Diseño v3
   "Editorial Bordeaux" con Dark/Light Mode automático
═══════════════════════════════════════════════════════════════ */

/* ─── Reset ───────────────────────────────────────────────── */
*, *::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; }

/* ─── Design Tokens ───────────────────────────────────────── */
:root {
    /* — Brand (inmutables) — */
    --brand-burgundy: #9e1c36;
    --brand-burgundy-deep: #7a1529;
    --brand-burgundy-soft: #b83451;
    --brand-burgundy-glow: #d64a6a;

    /* — Light Mode (default) — */
    --color-bg: #faf8f5;
    --color-bg-alt: #f4f0e8;
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-text: #2a2a2c;
    --color-text-secondary: #5c5c5e;
    --color-text-muted: #8a8a8c;
    --color-line: #e8e4dd;
    --color-line-strong: #d4cdbf;
    --color-accent: var(--brand-burgundy);
    --color-accent-hover: var(--brand-burgundy-deep);
    --color-accent-soft: var(--brand-burgundy-soft);
    --color-accent-tint: rgba(158, 28, 54, 0.06);
    --color-overlay: rgba(42, 42, 44, 0.8);
    --color-shadow: rgba(0, 0, 0, 0.06);
    --color-shadow-strong: rgba(0, 0, 0, 0.12);
    --header-bg: rgba(250, 248, 245, 0.92);
    --header-bg-scroll: rgba(250, 248, 245, 0.98);
    --img-overlay: rgba(250, 248, 245, 0.85);

    /* — 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 — */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.125rem;
    --fs-lg: 1.375rem;
    --fs-xl: 1.75rem;
    --fs-2xl: 2.25rem;
    --fs-3xl: clamp(2.25rem, 4vw, 3rem);
    --fs-4xl: clamp(2.75rem, 5.5vw, 4rem);
    --fs-hero: clamp(3rem, 6.5vw, 5.5rem);

    /* — Pesos — */
    --fw-light: 300;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* — Espaciado — */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --space-9: 6rem;
    --space-10: 8rem;

    /* — Layout — */
    --container-max: 1280px;
    --container-narrow: 880px;
    --container-prose: 680px;
    --header-height: 80px;

    /* — 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: 3px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 16px;

    /* — Z-index — */
    --z-base: 1;
    --z-elevated: 10;
    --z-sticky: 100;
    --z-overlay: 200;
    --z-modal: 300;
}

/* ─── Dark Mode ───────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #1a1a1c;
        --color-bg-alt: #222224;
        --color-surface: #2a2a2c;
        --color-surface-elevated: #323234;
        --color-text: #f0ece6;
        --color-text-secondary: #b8b4ae;
        --color-text-muted: #8a8682;
        --color-line: #3a3a3c;
        --color-line-strong: #4a4a4c;
        --color-accent: var(--brand-burgundy-glow);
        --color-accent-hover: var(--brand-burgundy-soft);
        --color-accent-soft: var(--brand-burgundy-soft);
        --color-accent-tint: rgba(214, 74, 106, 0.1);
        --color-overlay: rgba(0, 0, 0, 0.85);
        --color-shadow: rgba(0, 0, 0, 0.2);
        --color-shadow-strong: rgba(0, 0, 0, 0.35);
        --header-bg: rgba(26, 26, 28, 0.92);
        --header-bg-scroll: rgba(26, 26, 28, 0.98);
        --img-overlay: rgba(26, 26, 28, 0.75);
    }
}

/* ─── Base ────────────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    transition: background-color var(--duration-base), color var(--duration-base);
}

/* ─── Tipografía ──────────────────────────────────────────── */
.display, h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: var(--fw-regular);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--color-text);
    font-variation-settings: 'opsz' 144, 'SOFT' 50;
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}
h2 em, h3 em { font-style: italic; color: var(--color-accent); font-weight: var(--fw-light); }
p { color: var(--color-text-secondary); margin-bottom: 1rem; }
strong { font-weight: var(--fw-semibold); color: var(--color-text); }

/* ─── Layout ──────────────────────────────────────────────── */
.container { width: 90%; max-width: var(--container-max); margin: 0 auto; }
.container--narrow { max-width: var(--container-narrow); }
.container--prose { max-width: var(--container-prose); }

.section {
    padding: var(--space-10) 0;
}
@media (max-width: 768px) {
    .section { padding: var(--space-8) 0; }
}

/* ─── Componentes de texto ────────────────────────────────── */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: var(--fw-semibold);
    color: var(--color-accent);
    margin-bottom: var(--space-5);
}
.eyebrow::before {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--color-accent);
}

.lead {
    font-size: var(--fs-md);
    line-height: 1.8;
    color: var(--color-text-secondary);
}

/* ─── Botones ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.03em;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    white-space: nowrap;
    text-decoration: none;
}
.btn-primary {
    background: var(--brand-burgundy);
    color: #ffffff;
    border-color: var(--brand-burgundy);
}
.btn-primary:hover {
    background: var(--brand-burgundy-deep);
    border-color: var(--brand-burgundy-deep);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-shadow-strong);
}
.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-line-strong);
}
.btn-secondary:hover {
    background: var(--color-text);
    color: var(--color-bg);
    transform: translateY(-2px);
}
.btn-ghost {
    background: transparent;
    color: var(--color-accent);
    border-color: transparent;
    padding-left: 0;
    padding-right: 0;
}
.btn-ghost:hover { opacity: 0.7; }
.btn-ghost::after { content: ' →'; }
.btn-whatsapp {
    background: #25D366;
    color: #ffffff;
    border-color: #25D366;
}
.btn-whatsapp:hover {
    background: #1DAF53;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}
.btn-lg { padding: 18px 36px; font-size: var(--fs-base); }
.btn-sm { padding: 10px 20px; font-size: var(--fs-xs); }

/* ─── Imagen de fondo con overlay ─────────────────────────── */
.bg-image-section {
    position: relative;
    overflow: hidden;
}
.bg-image-section__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.12;
    pointer-events: none;
}
@media (prefers-color-scheme: dark) {
    .bg-image-section__img { opacity: 0.07; }
}

/* ─── Hero Video ─────────────────────────────────────────── */
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.hero-video.is-playing {
    opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
    .hero-video { display: none; }
}

/* ─── Hero Ken Burns (cinematic zoom) ────────────────────── */
@keyframes kenBurns {
    0%   { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.12) translate(-1.5%, -1%); }
}
.hero .bg-image-section__img {
    animation: kenBurns 14s var(--ease-out) forwards;
    will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
    .hero .bg-image-section__img { animation: none; }
}

/* ─── Reveal Animations ───────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) 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; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─── Breadcrumbs ─────────────────────────────────────────── */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
}
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs__sep { opacity: 0.4; }

/* ─── Stat boxes ──────────────────────────────────────────── */
.stat { text-align: center; }
.stat__number {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-regular);
    color: var(--color-text);
    line-height: 1;
    margin-bottom: var(--space-2);
}
.stat__label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}
