/* ═══════════════════════════════════════════════════════════
   El Couzina — Base (Reset, typography, utilities)
   ═══════════════════════════════════════════════════════════ */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, picture, video, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol { list-style: none; }

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

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

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

/* ─── Typography ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: var(--leading-tight);
    color: var(--text);
    letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-6xl); }
h2 { font-size: var(--text-5xl); }
h3 { font-size: var(--text-4xl); }
h4 { font-size: var(--text-3xl); }
h5 { font-size: var(--text-2xl); }
h6 { font-size: var(--text-xl); }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

/* ─── Containers ─────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-sm { max-width: var(--container-md); }
.container-xs { max-width: var(--container-sm); }
.container-narrow { max-width: 720px; }

@media (min-width: 1024px) {
    .container { padding: 0 var(--space-10); }
}

/* ─── Sections ───────────────────────────────────────── */
.section {
    padding: var(--space-16) 0;
}

@media (min-width: 768px) {
    .section { padding: var(--space-24) 0; }
}

.section-sm { padding: var(--space-12) 0; }
.section-lg { padding: var(--space-32) 0; }

.section-alt { background: var(--bg-alt); }
.section-dark {
    background: var(--bg-dark);
    color: var(--text-on-dark);
}
.section-dark h1, .section-dark h2, .section-dark h3,
.section-dark h4, .section-dark h5, .section-dark h6 {
    color: var(--text-on-dark);
}

/* ─── Section headers ────────────────────────────────── */
.section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--space-12);
}

.section-eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--primary);
    margin-bottom: var(--space-3);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--text-5xl);
    font-weight: 600;
    line-height: var(--leading-tight);
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* ─── Decorative divider ─────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin: var(--space-6) auto;
    max-width: 200px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-strong);
}

.divider-icon {
    color: var(--accent);
    font-size: var(--text-lg);
}

/* ─── Utility classes ────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Skip to content (WCAG 2.4.1) */
.skip-link {
    position: absolute;
    top: -50px;
    left: var(--space-4);
    z-index: calc(var(--z-toast) + 1);
    padding: var(--space-3) var(--space-5);
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
    text-decoration: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
    top: var(--space-3);
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }

.font-accent { font-family: var(--font-accent); }
.font-display { font-family: var(--font-display); }

.uppercase { text-transform: uppercase; letter-spacing: var(--tracking-wide); }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ─── Scroll reveal animation ─────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

/* Stagger children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.32s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.40s; }

.reveal-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Toast ──────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius);
    font-weight: 500;
    color: white;
    z-index: var(--z-toast);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-lg);
    max-width: 360px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { background: var(--secondary); }
.toast-error { background: #D32F2F; }

/* ─── Focus visible ──────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ─── Selection ──────────────────────────────────────── */
::selection {
    background: var(--primary);
    color: white;
}
