@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');

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


:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-code: #0d1117;
    --bg-hover: rgba(255, 255, 255, 0.05);

    --sidebar-bg: #050505;
    --sidebar-border: rgba(255, 255, 255, 0.08);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-code: #e1e1e6;

    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.8);
}

body {
    font-family: 'Manrope', serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "ss02", "cv01", "cv02";
}

#app {
    display: flex;
    min-height: 100vh;
    position: relative;
}

#app::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: radial-gradient(ellipse at top left, rgba(131, 3, 27, 0.1) 0%, transparent 50%),
                radial-gradient(ellipse at bottom right, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.sidebar nav {
    padding: 0 1.5rem 2rem;
}

.sidebar h2 {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.sidebar h2:first-child {
    margin-top: 0;
}

.sidebar ul {
    list-style: none;
}
.sidebar li {
    cursor: pointer;
    padding: 0.625rem 0.5rem;
    margin: 0;
    border-radius: 0.375rem;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.15s ease;
    font-size: 0.9375rem;
    font-weight: 400;
    position: relative;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

.sidebar li:hover {
    color: rgba(255, 255, 255, 0.95);
}

.sidebar li.active {
    color: var(--text-primary);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.08);
}

.content {
    flex: 1;
    margin-left: 280px;
    padding: 4rem 5rem;
    max-width: 70vw;
    width: 100%;
    position: relative;
    z-index: 1;
}

section {
    margin-bottom: 5rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    position: relative;
    padding-left: 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: -0.5px;
    margin-top: 1.5rem;
    padding-left: 2rem;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body::-webkit-scrollbar {
    display: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}


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

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: #ffffff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    font-weight: 400;
}

pre[class*="language-"] {
    background: #1e1e1e !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0 !important;
    overflow: hidden;
    margin: 2rem 0;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

pre[class*="language-"]::before {
    content: attr(data-language);
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 0.5rem;
    font-family: 'Manrope', sans-serif;
    z-index: 1;
}

pre[class*="language-"] code {
    display: block;
    padding: 1.5rem !important;
    font-family: "JetBrains Mono", "SF Mono", Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    font-weight: 400;
    overflow-x: auto;
}

.line-numbers .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 1.5rem;
    font-size: 0.875rem;
    left: 0;
    width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    user-select: none;
}

.line-numbers .line-numbers-rows > span {
    display: block;
    counter-increment: linenumber;
    color: rgba(255, 255, 255, 0.3);
}

.line-numbers .line-numbers-rows > span:before {
    content: counter(linenumber);
    display: block;
    padding-right: 0.8em;
    text-align: right;
}

pre[class*="language-"].line-numbers {
    padding-left: 0.8em !important;
}

pre[class*="language-"].line-numbers code {
    padding-left: 3.8em !important;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6a9955;
}

.token.punctuation {
    color: #d4d4d4;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #b5cea8;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #ce9178;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #d4d4d4;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #c586c0;
}

.token.function,
.token.class-name {
    color: #dcdcaa;
}

.token.regex,
.token.important,
.token.variable {
    color: #d16969;
}

p code, li code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.4rem;
    border-radius: 0.375rem;
    font-size: 0.85em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
    font-family: "JetBrains Mono", "SF Mono", Monaco, Consolas, monospace;
    color: #e06c75;
}

.toggle-btn {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1001;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

section {
    transition: transform 0.3s ease;
}

section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(to bottom, rgba(131, 3, 27, 0.3), rgba(124, 58, 237, 0.3));
    transition: all 0.3s ease;
    opacity: 0;
    border-radius: 0.25rem;
}

section:hover {
    transform: translateX(4px);
}

section:hover::before {
    opacity: 1;
    width: 3px;
}

.toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.toggle-container span {
    user-select: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 0.5rem;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-secondary);
    border-radius: 24px;
    transition: background-color .2s ease;
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: var(--bg-code);
    border-radius: 50%;
    transition: transform .2s ease;
}

.switch-slider::before {
    background-color: #ffffff;
}

.toggle-switch input:checked + .switch-slider {
    background-color: #500203;
}

.toggle-switch input:checked + .switch-slider::before {
    transform: translateX(26px);
}

.toggle-container .label-text {
    margin-left: 0.25rem;
}


@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .logo {
        padding-left: 6rem;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .content {
        margin-left: 0;
        padding: 2rem 1.5rem;
        max-width: 500vw;
    }

    .toggle-btn {
        display: block;
    }

    h1 {
        font-size: 2.25rem;
    }

    section {
        padding-left: 1rem;
    }

    pre[class*="language-"] {
        border-radius: 0.5rem;
        font-size: 0.8rem;
    }
}

html {
    scroll-behavior: smooth;
}

section:target {
    scroll-margin-top: 2rem;
}

section:target h1 {
    animation: pulse 1s ease;
}

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

a {
    color: #4dabf7;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #054681;
    transition: width 0.3s ease;
}

.content > * {
    animation: slideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.content > *:nth-child(1) { animation-delay: 0.1s; }
.content > *:nth-child(2) { animation-delay: 0.2s; }
.content > *:nth-child(3) { animation-delay: 0.3s; }
.content > *:nth-child(4) { animation-delay: 0.4s; }
.content > *:nth-child(5) { animation-delay: 0.5s; }
.content > *:nth-child(6) { animation-delay: 0.6s; }
.content > *:nth-child(7) { animation-delay: 0.7s; }
.content > *:nth-child(8) { animation-delay: 0.8s; }
.content > *:nth-child(9) { animation-delay: 0.9s; }
.content > *:nth-child(10) { animation-delay: 1s; }

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

pre[class*="language-"] .copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Manrope', sans-serif;
}

pre[class*="language-"] .copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}