:root {
    --bg-color: #fdfbfb;
    --text-main: #333333;
    --text-muted: #555555;
    --accent-primary: #e34f26; /* HTML5 Orange */
    --accent-secondary: #f06529;
    --border-color: #eaeaea;
    --sidebar-bg: #ffffff;
    --sidebar-width: 280px;
    --code-bg: #282c34;
    --code-text: #abb2bf;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    margin-bottom: 2rem;
}

.sidebar-logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.sidebar-logo span {
    color: var(--accent-primary);
}

.back-to-library {
    display: inline-block;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    background: #f1f2f6;
    font-weight: 600;
}

.back-to-library:hover {
    background: #e4e5e9;
    color: var(--text-main);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-category {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin: 1.5rem 0 0.5rem 0;
}

.sidebar-subnav {
    list-style: none;
    margin-left: 0.5rem;
}

.sidebar-subnav a {
    display: block;
    padding: 0.4rem 0.8rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 4px;
    transition: background 0.2s;
    margin-bottom: 0.2rem;
}

.sidebar-subnav a:hover {
    background: #f5f5f5;
}

.sidebar-subnav a.active {
    background: #ffeee8;
    color: var(--accent-primary);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 4rem;
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    color: #111;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    color: #222;
}

p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
    color: #444;
}

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

li {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    line-height: 1.5;
}

code {
    font-family: 'Courier New', Courier, monospace;
    background: #f1f2f6;
    color: #e84118;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Navigation Buttons */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.nav-btn {
    padding: 0.8rem 1.5rem;
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}


/* Accessibility Focus Outlines */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid var(--accent-primary, #2980b9);
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-primary, #2980b9);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.2s;
    text-decoration: none;
    font-weight: bold;
}
.skip-link:focus {
    top: 0;
}
