/* ═══════════════════════════════════════════════════════════════════════════
   BASE — Reset, tipografía, espaciado, diseño de tokens semánticos
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tokens semánticos de color y estilo (override en themes) */
:root {
    /* Colores semánticos */
    --color-bg-page: #2c2416;
    --color-bg-panel: #1a1208;
    --color-surface-1: #3d2b1f;
    --color-surface-2: #5c4033;
    --color-text-main: #f4e8c1;
    --color-text-muted: #ede0a8;
    --color-border: #b8860b;
    --color-border-light: #d4a017;
    --color-accent: #8b2500;
    --color-accent-strong: #c0392b;
    --color-success: #2d6a2d;
    --color-danger: #7a1a1a;
    --color-overlay: rgba(244, 232, 193, 0.07);

    /* Tipografía */
    --font-display: "IM Fell English", serif;
    --font-body: "Crimson Text", Georgia, serif;
    --font-mono: "Courier New", monospace;
    --font-size-base: 18px;
    --font-weight-normal: 400;
    --font-weight-bold: 600;

    /* Espaciado */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;

    /* Border radius */
    --radius-xs: 3px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.8);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--color-bg-page);
    color: var(--color-text-main);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Tipografía heading */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: 1.2;
}

/* Links */
a {
    color: var(--color-border-light);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.7;
}

/* Inputs */
input,
select,
textarea {
    font-family: inherit;
}

input[type="checkbox"],
input[type="radio"] {
    cursor: pointer;
}

/* Scroll bars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-surface-2);
    border-radius: var(--radius-xs);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-light);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes flicker {
    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 4px orange);
    }
    50% {
        filter: brightness(1.3) drop-shadow(0 0 8px #ff6600);
    }
}
