@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

:root {
    --bg: #0d0b11;
    --bg-alt: #130f18;
    --panel: #1a1520;
    --panel-border: #2b2333;
    --text: #efe8f5;
    --muted: #9d94ab;
    --subtle: #6f6780;
    --border: #2b2333;
    --code-bg: #120e17;
    --btn: #221b2a;
    --btn-hover: #2c2338;
    --accent: #e895c8;
    --accent-2: #b9a3e3;
    --note-bg: rgba(232, 149, 200, 0.06);
}

* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
}

body {
    margin: 0;
    background: radial-gradient(ellipse at top, #1a1224 0%, var(--bg) 60%);
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

nav {
    width: 280px;
    background: rgba(19, 15, 24, 0.7);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border);
    padding: 30px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    animation: slideIn 0.6s ease forwards;
}

nav h2 {
    margin: 24px 0 12px 0;
    color: var(--subtle);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 11px;
    font-weight: 600;
}

nav h2:first-child {
    margin-top: 0;
    font-size: 20px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

nav a {
    display: block;
    color: var(--muted);
    text-decoration: none;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 4px;
}

nav a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--accent);
    background: rgba(232, 149, 200, 0.07);
    padding-left: 16px;
}

nav a:hover::before {
    width: 4px;
}

main {
    flex: 1;
    padding: 60px;
    max-width: 900px;
    animation: fadeUp 0.8s ease forwards;
}

section {
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }
section:nth-child(6) { animation-delay: 0.6s; }
section:nth-child(7) { animation-delay: 0.7s; }
section:nth-child(8) { animation-delay: 0.8s; }

h1, h2, h3 {
    color: var(--text);
    margin-top: 50px;
}

h1 {
    margin-top: 0;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
}

h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: 2px;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--accent-2);
}

p {
    color: var(--muted);
    line-height: 1.7;
    font-size: 15px;
    margin-bottom: 15px;
}

strong {
    color: var(--accent);
    font-weight: 600;
}

ul, ol {
    margin-left: 20px;
    color: var(--muted);
    padding: 0;
}

li {
    margin: 10px 0;
    line-height: 1.6;
    font-size: 15px;
}

li::marker {
    color: var(--subtle);
}

code {
    background: var(--code-bg);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    color: #e6d9f2;
    border: 1px solid var(--border);
}

.code-block {
    position: relative;
    margin-top: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
}

pre {
    background: var(--code-bg);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    border: 1px solid var(--border);
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

pre code {
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    color: #e6d9f2;
}

.copy-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: var(--btn);
    color: var(--muted);
    border: 1px solid var(--panel-border);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.copy-btn:hover {
    background: var(--btn-hover);
    border-color: var(--accent);
    color: var(--accent);
}

a {
    color: var(--accent-2);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.note {
    background: var(--note-bg);
    border: 1px solid var(--panel-border);
    border-left: 4px solid var(--accent);
    padding: 16px 20px;
    margin-top: 25px;
    margin-bottom: 25px;
    color: var(--muted);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    nav {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }

    nav h2 {
        width: 100%;
    }

    nav a {
        flex: 1;
        min-width: 120px;
    }

    main {
        padding: 40px 20px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 22px;
    }
}