/* =========================
   Gan Engine Handbook v2
========================= */

:root{

    --bg:#0b1120;
    --surface:#111827;
    --surface-2:#1f2937;

    --border:#2b3648;

    --text:#f8fafc;
    --muted:#94a3b8;

    --primary:#3b82f6;
    --primary-hover:#2563eb;

    --radius:16px;

}

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

html{
    scroll-behavior:smooth;
}

body{

    font-family:'Inter',sans-serif;

    background:var(--bg);
    color:var(--text);

    min-height:100vh;

}

/* ================================= */

.layout{

    display:grid;

    grid-template-columns:
        280px
        minmax(0,1fr)
        260px;

    min-height:100vh;

}

/* ================================= */
/* Sidebar */
/* ================================= */

.sidebar{

    position:sticky;
    top:0;

    height:100vh;

    padding:30px;

    background:rgba(17,24,39,.9);

    backdrop-filter:blur(18px);

    border-right:1px solid var(--border);

    overflow:auto;

}

.logo{

    display:flex;

    gap:14px;

    align-items:center;

    margin-bottom:30px;

}

.logo-icon{

    width:50px;
    height:50px;

    display:grid;
    place-items:center;

    border-radius:14px;

    background:linear-gradient(
        135deg,
        #2563eb,
        #06b6d4
    );

    font-size:24px;

}

.logo h2{

    font-size:20px;

}

.logo p{

    color:var(--muted);

    font-size:13px;

}

.sidebar-search{

    margin-bottom:25px;

}

.sidebar-search input{

    width:100%;

    padding:12px 15px;

    border-radius:12px;

    border:none;

    background:var(--surface-2);

    color:white;

    outline:none;

}

/* ================================= */
/* Sidebar links */
/* ================================= */

#sidebar{

    display:flex;

    flex-direction:column;

    gap:6px;

}

#sidebar a{

    color:var(--muted);

    text-decoration:none;

    padding:10px 14px;

    border-radius:10px;

    transition:.25s;

    font-size:15px;

}

#sidebar a:hover{

    background:var(--surface-2);

    color:white;

}

#sidebar a.active{

    background:var(--primary);

    color:white;

}

/* ================================= */
/* Main */
/* ================================= */

.content-wrapper{

    padding:50px 80px;

}

.topbar{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:45px;

}

.breadcrumb{

    color:var(--muted);

    font-size:14px;

}

.topbar a{

    color:white;

    text-decoration:none;

    background:var(--surface-2);

    padding:10px 18px;

    border-radius:10px;

    transition:.25s;

}

.topbar a:hover{

    background:var(--primary);

}

/* ================================= */
/* Markdown */
/* ================================= */

#content{

    max-width:850px;

}

#content h1{

    font-size:48px;

    margin-bottom:20px;

}

#content h2{

    margin-top:55px;

    margin-bottom:18px;

    font-size:34px;

}

#content h3{

    margin-top:35px;

    margin-bottom:12px;

}

#content p{

    color:#d6d9e0;

    line-height:1.9;

    margin-bottom:18px;

}

#content ul{

    margin-left:20px;

    margin-bottom:20px;

}

#content li{

    margin-bottom:10px;

}

#content a{

    color:#60a5fa;

}

#content hr{

    border:none;

    border-top:1px solid var(--border);

    margin:40px 0;

}

/* ================================= */
/* Code */
/* ================================= */

pre{

    margin:25px 0;

    border-radius:14px;

    overflow:hidden;

    border:1px solid var(--border);

}

code{

    font-family:Consolas,monospace;

}

/* ================================= */
/* Tables */
/* ================================= */

table{

    width:100%;

    border-collapse:collapse;

    margin:25px 0;

}

th,
td{

    border:1px solid var(--border);

    padding:12px;

}

th{

    background:var(--surface-2);

}

/* ================================= */
/* TOC */
/* ================================= */

.toc{

    position:sticky;

    top:0;

    height:100vh;

    padding:40px 30px;

    border-left:1px solid var(--border);

    overflow:auto;

}

.toc h4{

    margin-bottom:18px;

    color:white;

}

#toc{

    display:flex;

    flex-direction:column;

    gap:10px;

}

#toc a{

    color:var(--muted);

    text-decoration:none;

    font-size:14px;

}

#toc a:hover{

    color:white;

}

/* ================================= */
/* Mobile */
/* ================================= */

@media(max-width:1200px){

    .layout{

        grid-template-columns:
            260px
            1fr;

    }

    .toc{

        display:none;

    }

}

@media(max-width:900px){

    .layout{

        grid-template-columns:1fr;

    }

    .sidebar{

        position:relative;

        height:auto;

    }

    .content-wrapper{

        padding:30px;

    }

}

/* Smooth page transitions */

#content{

    transition:.35s;

}

/* Beautiful images */

#content img{

    width:100%;

    border-radius:16px;

    margin:30px 0;

    border:1px solid var(--border);

}

/* Blockquotes */

blockquote{

    border-left:4px solid var(--primary);

    background:#111827;

    padding:18px 22px;

    margin:25px 0;

    border-radius:10px;

}

/* Inline code */

p code,
li code{

    background:#1f2937;

    padding:3px 8px;

    border-radius:6px;

    color:#60a5fa;

}

pre{
    position:relative;
}

.copy-btn{

    position:absolute;

    top:12px;

    right:12px;

    border:none;

    background:#2563eb;

    color:white;

    padding:6px 12px;

    border-radius:8px;

    cursor:pointer;

    font-size:13px;

    transition:.2s;

}

.copy-btn:hover{

    background:#1d4ed8;

}