/* ==========================================================================
   BASE
   Reset, tokens de tema, tipografía y estructura general (sidebar + main).
   ========================================================================== */

:root {
    /* Tema oscuro (por defecto) */
    --bg: #121214;
    --surface: #1a1a1d;
    --surface-2: #202024;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #efece7;
    --text-muted: #9c988f;
    --text-faint: #6f6c66;

    --accent: #c99779;
    --accent-strong: #e0b08c;
    --accent-soft: rgba(201, 151, 121, 0.14);
    --accent-contrast: #191512;
    --accent-glow: rgba(224, 176, 140, 0.32);

    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.30);
    --shadow-glow: 0 14px 32px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--accent-glow), 0 0 24px -6px var(--accent-glow);

    --font-display: "Fraunces", "Georgia", serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --sidebar-w: 260px;
    --content-max: 1600px;

    --transition-fast: 0.16s ease;
    --transition-base: 0.22s ease;
}

[data-theme="light"] {
    --bg: #faf8f4;
    --surface: #ffffff;
    --surface-2: #f2efe8;
    --border: rgba(28, 24, 20, 0.10);
    --border-strong: rgba(28, 24, 20, 0.20);

    --text: #201c17;
    --text-muted: #6b665d;
    --text-faint: #9a958a;

    --accent: #a8654a;
    --accent-strong: #8a5240;
    --accent-soft: rgba(168, 101, 74, 0.10);
    --accent-contrast: #ffffff;

    --shadow-sm: 0 4px 14px rgba(28, 24, 20, 0.08);
    --shadow-md: 0 10px 28px rgba(28, 24, 20, 0.10);
    --accent-glow: rgba(168, 101, 74, 0.20);
    --shadow-glow: 0 14px 32px rgba(28, 24, 20, 0.10), 0 0 0 1px var(--accent-glow), 0 0 24px -8px var(--accent-glow);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body, button, a, input, select {
    transition:
        background-color var(--transition-base),
        color var(--transition-base),
        border-color var(--transition-base);
}

button, a, .panel, .chip {
    transition:
        background-color var(--transition-base),
        color var(--transition-base),
        border-color var(--transition-base),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

a {
    color: inherit;
}

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

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text);
}

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

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

section {
    width: 100%;
    padding: 64px 0;
    border-bottom: 1px solid var(--border);
}

section:last-of-type {
    border-bottom: 0;
}

main {
    flex: 1;
    width: calc(100% - var(--sidebar-w));
    min-height: 100vh;
    margin-left: var(--sidebar-w);
    padding: 0 60px;
    position: relative;
}

.content-width {
    max-width: var(--content-max);
    margin: 0 auto;
}

.section-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 2.5rem;
    font-size: 1.75rem;
}

.section-title .section-index {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-faint);
    letter-spacing: 0.08em;
}

.section-kicker {
    display: inline-block;
    width: fit-content;
    margin-bottom: 0.85rem;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ==========================================================================
   RESPONSIVE SHELL
   ========================================================================== */

@media (max-width: 1024px) {
    main {
        width: calc(100% - 76px);
        margin-left: 76px;
        padding: 0 24px;
    }
}

@media (max-width: 768px) {
    body {
        display: block;
    }

    main {
        width: 100%;
        margin-left: 0;
        padding: 0 20px;
    }

    section {
        padding: 40px 0;
    }
}
