:root {
    --bg: #111111;
    --surface: #1c1c1c;
    --surface-hover: #242424;
    --border: #333333;
    --text: #eeeeee;
    --muted: #999999;
    --accent: #e8693a;
    --accent-hover: #f07a4a;
    --discord: #5865F2;
    --discord-hover: #4752C4;
    --cut-size: 12px;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}
body {
    overflow-x: clip;
}
@supports not (overflow-x: clip) {
    html, body { overflow-x: hidden; }
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 var(--font-sans);
}

.sliced-wrapper {
    background: var(--border);
    clip-path: polygon(
        var(--cut-size) 0,
        100% 0,
        100% calc(100% - var(--cut-size)),
        calc(100% - var(--cut-size)) 100%,
        0 100%,
        0 var(--cut-size)
    );
    padding: 1px;
}

.sliced-inner {
    background: var(--surface);
    clip-path: polygon(
        calc(var(--cut-size) - 1px) 0,
        100% 0,
        100% calc(100% - var(--cut-size) + 1px),
        calc(var(--cut-size) - 1px) 100%,
        0 100%,
        0 calc(var(--cut-size) - 1px)
    );
    height: 100%;
    padding: 20px;
}

.space {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at 50% 0%, #1a1a2e 0%, var(--bg) 70%);
}

.space::before {
    content: '';
    position: absolute;
    inset: 0 -960px 0 0;
    background: url("../assets/layer1.png") repeat 0 0 / 960px 960px;
    image-rendering: pixelated;
    opacity: 0.15;
    will-change: transform;
    animation: space-drift 240s linear infinite;
}

@keyframes space-drift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-960px, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .space::before,
    .brand span,
    .dot.online { animation: none; }
    .reveal { transition: none; }
}

header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 64px;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(17, 17, 17, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.brand {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 1px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
    position: relative;
}

.brand span {
    color: var(--accent);
    animation: neon-pulse 3s infinite alternate;
}

@keyframes neon-pulse {
    0% { text-shadow: 0 0 4px rgba(232, 105, 58, 0.1); }
    100% { text-shadow: 0 0 12px rgba(232, 105, 58, 0.8), 0 0 20px rgba(232, 105, 58, 0.3); }
}

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

nav {
    display: flex;
    gap: 32px;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
    position: relative;
}
nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.2s ease;
    transform-origin: right;
}
nav a:hover { color: var(--text); }
nav a.active { color: var(--text); }
nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}
nav a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.header-socials {
    display: flex;
    gap: 16px;
    border-left: 1px solid var(--border);
    padding-left: 24px;
}
.social-icon {
    color: var(--muted);
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.social-icon:hover {
    color: var(--text);
    transform: translateY(-2px);
}

main { position: relative; z-index: 10; }
section { padding: 60px 24px; max-width: 1200px; margin: 0 auto; scroll-margin-top: 80px; }
.section-head { margin-bottom: 32px; }
.section-title { font-size: 28px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.5px; }
.section-desc { color: var(--muted); font-size: 15px; margin: 0; max-width: 600px; }

.hero-content {
    max-width: 680px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-big-logo {
    width: 340px;
    max-width: 100%;
    margin-bottom: 24px;
    image-rendering: pixelated;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.6));
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    border: 1px solid rgba(232, 105, 58, 0.3);
    background: rgba(232, 105, 58, 0.1);
    padding: 4px 10px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.hero-content h1 {
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 600;
    margin: 0 0 12px;
    letter-spacing: -1.5px;
    line-height: 1.1;
}
.hero-content h1 span { color: var(--accent); }

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 5px;
    color: var(--muted);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.hero-desc {
    color: #bbbbbb;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    margin-right: 6px;
}
.dot.online { background: #72d47d; box-shadow: 0 0 8px rgba(114, 212, 125, 0.6); animation: pulse-dot 2s infinite; }
.dot.offline { background: #d67272; }

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(114, 212, 125, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(114, 212, 125, 0); }
    100% { box-shadow: 0 0 0 0 rgba(114, 212, 125, 0); }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 22px;
    transition: all 0.2s;
    cursor: pointer;
}
.btn > svg { flex-shrink: 0; }
.btn:hover { background: var(--surface-hover); border-color: #555; }

.btn-primary { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 0 20px rgba(232, 105, 58, 0.3); }

.btn-secondary { background: #2a2a2a; color: #ccc; border: 1px solid #444; }
.btn-secondary:hover { background: #333; color: #fff; border-color: #555; }

.btn-discord { background: var(--discord); color: #fff; border-color: var(--discord); font-weight: 600; }
.btn-discord:hover { background: var(--discord-hover); border-color: var(--discord-hover); box-shadow: 0 0 20px rgba(88, 101, 242, 0.4); }

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.about-text p {
    color: #cccccc;
    margin: 0 0 16px;
    line-height: 1.7;
    font-size: 14px;
}

.stats-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed #444;
}
.stat-item { display: flex; flex-direction: column; gap: 4px; }
.stat-val { font-family: var(--font-mono); font-size: 20px; font-weight: 600; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { position: relative; padding-left: 24px; margin-bottom: 12px; color: #cccccc; font-size: 14px; }
.feature-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; background: var(--accent); border-radius: 1px; }

.changelog-controls { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; justify-content: center; }
.changelog-controls input, .changelog-controls select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 16px;
    min-height: 44px;
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    flex: 1;
    min-width: 200px;
}
.changelog-list-container { max-height: 500px; overflow-y: auto; padding-right: 8px; }
.changelog-status { font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); text-align: center;}

.changelog-entry {
    overflow-wrap: anywhere;
    background: #151515;
    border: 1px solid #2a2a2a;
    border-left: 2px solid var(--accent);
    padding: 16px 20px;
    margin-bottom: 16px;
    transition: border-color 0.2s, background-color 0.2s;
}
.changelog-entry:hover { border-color: #444; border-left-color: var(--accent-hover); }

.changelog-entry.is-new {
    background: rgba(232, 105, 58, 0.06);
    border-left-color: var(--accent-hover);
}
.changelog-entry.is-new:hover {
    background: rgba(232, 105, 58, 0.09);
    border-color: rgba(232, 105, 58, 0.4);
    border-left-color: var(--accent-hover);
}

.entry-header {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #d3ad83;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 8px;
}
.entry-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}
.entry-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.entry-date { color: var(--muted); }
.entry-badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--accent);
    background: rgba(232, 105, 58, 0.15);
    border: 1px solid rgba(232, 105, 58, 0.4);
    border-radius: 2px;
    text-transform: uppercase;
    line-height: 1.4;
}

.change-item { display: flex; gap: 12px; margin-bottom: 6px; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 13px; color: #cccccc; }
.change-icon { width: 16px; flex-shrink: 0; font-weight: bold; text-align: center; }
.icon-Add { color: #72d47d; } .icon-Tweak { color: #72a4d4; } .icon-Fix { color: #d4c172; } .icon-Remove { color: #d67272; }

footer { border-top: 1px solid var(--border); padding: 40px 24px calc(40px + env(safe-area-inset-bottom)); background: var(--bg); }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: center; text-align: center; flex-wrap: wrap; gap: 32px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-legal { max-width: 600px; color: #777; font-size: 12px; line-height: 1.6; margin: 0 auto; overflow-wrap: anywhere; }
.footer-legal strong { color: #999; }

@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-inner { flex-direction: column; }
    nav { display: none; }
    .header-socials { border-left: none; padding-left: 0; }

    .stats-bar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        gap: 16px 24px;
    }
    .stat-item {
        align-items: center;
        text-align: center;
    }
    .stat-discord {
        width: auto;
        margin-top: 0;
    }
    .hero-big-logo { width: 260px; }
}


@media (max-width: 900px) {
    .brand {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
    .btn {
        min-height: 44px;
    }
    .footer-links a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }
    h1, h2, h3, h4, section {
        scroll-margin-top: 80px;
    }
    #changelog-search,
    #changelog-filter {
        font-size: 16px;
    }
    .footer-links {
        gap: 4px 16px;
    }
    footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .space::before,
    .brand span,
    .dot.online,
    .wiki-article,
    .rule-header {
        animation: none !important;
    }
    .wiki-card,
    .wiki-card::before,
    .contributor,
    .shot img,
    .shot figcaption,
    .nav-link,
    .nav-link::after,
    .changelog-entry,
    .wiki-toc-link,
    .wiki-to-toc,
    .wiki-mini-bar,
    .btn,
    .reveal {
        transition: none !important;
    }
    .scrollable-inner {
        scroll-behavior: auto !important;
    }
}

@media (max-width: 900px) {
    section:not(#home), #band {
        content-visibility: auto;
        contain-intrinsic-size: 800px;
    }
}
