/* =========================
   GLOBAL
========================= */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --header-height: 92px;
}

body {
    font-family: "Segoe UI", sans-serif;
    transition: background 0.3s, color 0.3s;
    padding-top: var(--header-height);
    min-height: 100%;
}

/* =========================
   THEMES
========================= */

body.theme-light {
    background:
        radial-gradient(circle at 20% 20%, rgba(120,160,255,0.08), transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(180,120,255,0.08), transparent 45%),
        #ffffff;
    color: #111;
    min-height: 100vh;
}

body.theme-dark {
    background:
        radial-gradient(circle at 20% 20%, rgba(90,120,255,0.15), transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(160,90,255,0.15), transparent 45%),
        #0f1115;
    color: #e6e6e6;
    min-height: 100vh;
}

/* =========================
   HEADER
========================= */

.wiki-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
}

body.theme-light .wiki-header {
    background: rgba(255,255,255,0.85);
    border-bottom: 1px solid #eee;
}

body.theme-dark .wiki-header {
    background: rgba(15,17,21,0.85);
    border-bottom: 1px solid #2a2f3a;
}

.wiki-header-left {
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
}

/* LOGO */

.wiki-logo img {
    height: 55px;
    border-radius: 12px;
    padding: 4px;
    background: white;
    border: 1px solid #e6e6e6;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

body.theme-dark .wiki-logo img {
    background: #1b1f2a;
    border: 1px solid #2a2f3a;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
}

/* =========================
   MAIN NAV (DESKTOP)
========================= */

.wiki-main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 40px;
}

.wiki-main-nav a {
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    opacity: 0.7;
    transition: 0.2s ease;
}

.wiki-main-nav a:hover {
    opacity: 1;
}

.wiki-main-nav a.active {
    opacity: 1;
    position: relative;
}

.wiki-main-nav a.active::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #7a8cff, #b77aff);
}

/* =========================
   HEADER RIGHT
========================= */

.wiki-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* =========================
   BURGER
========================= */

.burger {
    display: none;
    width: 30px;
    height: 22px;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
}

.burger span {
    position: absolute;
    width: 100%;
    height: 3px;
    background: currentColor;
    left: 0;
    transition: all 0.3s ease;
}

.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 9px; }
.burger span:nth-child(3) { top: 18px; }

.burger.open span:nth-child(1) {
    transform: rotate(45deg);
    top: 9px;
}
.burger.open span:nth-child(2) {
    opacity: 0;
}
.burger.open span:nth-child(3) {
    transform: rotate(-45deg);
    top: 9px;
}

body.theme-light .burger span { background: #111; }
body.theme-dark .burger span { background: #fff; }

/* =========================
   OVERLAY
========================= */

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1400;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* =========================
   BACK TO TOP
========================= */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 20px;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s ease;
    z-index: 999;
}

body.theme-light .back-to-top {
    background: #111;
    color: white;
}

body.theme-dark .back-to-top {
    background: white;
    color: #111;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {

    .wiki-main-nav {
        position: fixed;
        right: 0;
        top: 100px;
        height: calc(100vh - 100px);
        width: 280px;

        transform: translateX(100%);
        transition: transform 0.3s ease;

        display: flex;
        flex-direction: column;
        padding: 40px 30px;
        gap: 25px;

        z-index: 950;
    }

    body.theme-light .wiki-main-nav { background: white; }
    body.theme-dark .wiki-main-nav { background: #14171d; }

    .wiki-main-nav.open {
        transform: translateX(0);
    }

    .burger {
        display: block;
    }
}

.brand-title {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1;
}

/* Dark theme */
body.theme-dark .brand-title {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(100, 150, 255, 0.4);
}

/* Light theme */
body.theme-light .brand-title {
    color: #1a1a1a;
    text-shadow: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}