:root {
    --bg: #1a1a1a;
    --fg: #e8e8e8;
    --muted: #9a9a9a;
    --accent: #ff6600;
    --code-bg: #242424;
    --border: #333333;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
}

.layout {
    display: flex;
    max-width: 1100px;
    margin: 0 auto;
}

/* Índice lateral */
.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: 240px;
    flex-shrink: 0;
    height: 100vh;
    padding: 3rem 1.5rem;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.sidebar-title {
    display: block;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 1rem;
}

#guide-search {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--fg);
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.2s ease-in-out;
}

#guide-search::placeholder {
    color: var(--muted);
}

#guide-search:focus {
    outline: none;
    border-color: var(--accent);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    transition: color 0.2s ease-in-out, background 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.sidebar nav a:hover {
    color: var(--accent);
    background: rgba(255, 102, 0, 0.08);
    transform: translateX(4px);
}

.sidebar nav a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Contenido */
main {
    flex: 1;
    min-width: 0;
    padding: 4rem 2.5rem 4rem;
}

.hero {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 2.8rem;
    margin: 0 0 0.75rem;
    color: var(--accent);
}

.tagline {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 0;
}

section {
    margin: 3rem 0;
    scroll-margin-top: 1.5rem;
    animation: fade-in 0.4s ease-out both;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--fg);
    margin: 2rem 0 0.75rem;
}

p, li {
    color: var(--fg);
}

ul, ol {
    padding-left: 1.5rem;
}

li {
    margin: 0.5rem 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #ffb066;
    text-decoration: underline;
}

code {
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88em;
    background: var(--code-bg);
    border: 1px solid var(--border);
    padding: 0.12em 0.4em;
    border-radius: 4px;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1rem 0;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.83rem;
    line-height: 1.65;
    color: #d7d7d7;
}

footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 860px) {
    .layout {
        flex-direction: column;
    }
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1.5rem;
    }
    .sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    main {
        padding: 2rem 1.5rem;
    }
}
