/* ===== ROOT VARIABLES ===== */
:root {
    --bg-base: #020608;
    --bg-panel: rgba(5, 14, 22, 0.6);
    --bg-card: rgba(6, 14, 20, 0.65);

    --neon-green: #00E676;
    --dark-green: #0A5A30;

    --neon-cyan: #00D4FF;
    --dark-cyan: #004A58;

    --neon-purple: #BD93F9;
    --dark-purple: #3D2B6B;

    --neon-amber: #FFB86C;
    --dark-amber: #5C3A00;

    --neon-blue: #79B8FF;
    --dark-blue: #1A3A5C;

    --text-bright: #EDF2F7;
    --text-body: #8B9DA8;
    --text-muted: #455A65;
    --neon-yellow: #F5DF4D;

    --font-code: 'Fira Code', Consolas, Monaco, monospace;
    --font-body: 'Fira Code', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-body);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Neutral blue-toned grid background */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image:
        linear-gradient(rgba(79, 172, 254, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 172, 254, 0.022) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
}

/* Scanline overlay */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: repeating-linear-gradient(
        0deg, rgba(0,0,0,0.08), rgba(0,0,0,0.08) 1px, transparent 1px, transparent 2px
    );
    pointer-events: none;
    z-index: 999;
    opacity: 0.45;
}

.vignette {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, transparent 40%, rgba(1, 3, 5, 0.88) 100%);
    pointer-events: none;
    z-index: -1;
}

/* Ambient color orbs */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(130px);
    pointer-events: none;
    z-index: -1;
}
.orb-1 { width: 480px; height: 480px; background: #00E676; top: -120px; left: -120px; opacity: 0.04; }
.orb-2 { width: 420px; height: 420px; background: #BD93F9; top: 25%; right: -160px; opacity: 0.05; }
.orb-3 { width: 360px; height: 360px; background: #00D4FF; bottom: 5%; left: 15%; opacity: 0.04; }

h1, h2, h3, h4 {
    font-family: var(--font-code);
    color: var(--text-bright);
    font-weight: 600;
    letter-spacing: 1px;
}

a { color: var(--neon-cyan); text-decoration: none; transition: all 0.3s ease; }
a:hover { color: var(--text-bright); text-shadow: 0 0 10px rgba(0,212,255,0.5); }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-size: 1.55rem;
    margin-bottom: 40px;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 14px;
}
.section-title .prefix { color: var(--neon-green); font-family: var(--font-code); font-weight: 300; }
.section-title .tag    { color: var(--text-muted); font-size: 0.95rem; font-weight: 300; }
.section-title::after  { content: ''; flex-grow: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0.07), transparent); }

/* ===== BUTTONS ===== */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 30px;
    font-family: var(--font-code);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bg-base);
    background: var(--neon-green);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.btn:hover {
    background: var(--text-bright);
    box-shadow: 0 0 25px rgba(0,230,118,0.35);
    transform: translateY(-2px);
    color: var(--bg-base);
}
.btn-secondary {
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid rgba(0,212,255,0.38);
    clip-path: none;
}
.btn-secondary:hover {
    background: rgba(0,212,255,0.08);
    color: var(--text-bright);
    box-shadow: 0 0 15px rgba(0,212,255,0.18);
    text-shadow: none;
}
.btn-icon { margin-right: 8px; }

.cursor {
    display: inline-block; width: 12px; height: 1.1em;
    background-color: var(--neon-green); vertical-align: text-bottom;
    animation: blink 1s step-end infinite; margin-left: 5px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ===== NAV HEADER ===== */
header.nav-header {
    padding: 22px 0;
    border-bottom: 1px solid rgba(255,255,255,0.055);
    background: linear-gradient(180deg, rgba(2, 6, 8, 0.95) 0%, transparent 100%);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container { display: flex; justify-content: space-between; align-items: center; }

.logo {
    font-family: var(--font-code);
    font-size: 1.35rem;
    color: var(--neon-green);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 10px rgba(0,230,118,0.3);
}
.logo:hover { color: var(--neon-green); text-shadow: 0 0 18px rgba(0,230,118,0.55); }

.clash-icon {
    width: 28px; height: 28px;
    stroke: var(--neon-green);
    filter: drop-shadow(0 0 5px rgba(0,230,118,0.5));
    animation: iconPulse 2.5s infinite;
}

.nav-links { display: flex; gap: 30px; list-style: none; font-size: 0.88rem; }
.nav-links li a { color: var(--text-muted); position: relative; transition: color 0.3s; }
.nav-links li a:hover { color: var(--neon-cyan); text-shadow: none; }
.nav-links li a::after {
    content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 1px;
    background: var(--neon-cyan); transition: width 0.3s ease;
}
.nav-links li a:hover::after { width: 100%; }
.nav-links li a.active { color: var(--neon-cyan); }
.nav-links li a.active::after { width: 100%; }

/* ===== LANG SWITCHER ===== */
.lang-switcher { position: relative; display: inline-block; }

.lang-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.03);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 6px 10px 6px 9px;
    font-family: var(--font-code);
    font-size: 0.78rem;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.25s, color 0.25s, box-shadow 0.25s;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.lang-trigger:hover,
.lang-switcher.open .lang-trigger {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0,212,255,0.1);
}
.lang-icon { flex-shrink: 0; opacity: 0.6; transition: opacity 0.25s; }
.lang-trigger:hover .lang-icon,
.lang-switcher.open .lang-trigger .lang-icon { opacity: 1; }

.lang-arrow {
    font-size: 0.68rem;
    opacity: 0.45;
    transition: transform 0.25s, opacity 0.25s;
    margin-left: 1px;
}
.lang-trigger:hover .lang-arrow,
.lang-switcher.open .lang-trigger .lang-arrow { opacity: 1; }
.lang-switcher.open .lang-trigger .lang-arrow { transform: rotate(180deg); }

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 176px;
    background: rgba(3, 10, 18, 0.97);
    border: 1px solid rgba(0,212,255,0.18);
    border-top: 2px solid rgba(0,212,255,0.4);
    border-radius: 0 0 2px 2px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1001;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.65), 0 0 24px rgba(0,212,255,0.05);
}
.lang-switcher.open .lang-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Upward-opening variant (for footer) */
.lang-switcher--up .lang-dropdown {
    top: auto;
    bottom: calc(100% + 8px);
    border-top: 1px solid rgba(0,212,255,0.18);
    border-bottom: 2px solid rgba(0,212,255,0.4);
    border-radius: 2px 2px 0 0;
    transform: translateY(6px);
}
.lang-switcher--up.open .lang-dropdown { transform: translateY(0); }

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--text-muted);
    font-family: var(--font-code);
    font-size: 0.74rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    letter-spacing: 0.02em;
}
.lang-option:last-child { border-bottom: none; }
.lang-option:hover { background: rgba(0,212,255,0.07); color: var(--text-bright); }
.lang-option.active { color: var(--neon-cyan); background: rgba(0,212,255,0.05); }

.lang-code {
    font-size: 0.66rem;
    color: var(--neon-cyan);
    opacity: 0.5;
    min-width: 40px;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.lang-option.active .lang-code,
.lang-option:hover .lang-code { opacity: 1; }

.lang-indicator {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px var(--neon-cyan);
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.lang-option.active .lang-indicator { opacity: 1; }

/* ===== FOOTER ===== */
footer {
    border-top: 1px solid rgba(255,255,255,0.048);
    padding: 60px 0 40px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col h4 {
    color: var(--text-bright);
    margin-bottom: 20px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: var(--text-muted); font-size: 0.86rem; }
.footer-col ul li a:hover { color: var(--neon-cyan); padding-left: 5px; text-shadow: none; }

.copyright {
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-code);
    font-size: 0.76rem;
    border-top: 1px solid rgba(255,255,255,0.038);
    padding-top: 20px;
}

/* ===== ANIMATIONS ===== */
@keyframes iconPulse {
    0%, 100% { opacity: 0.5; filter: drop-shadow(0 0 3px rgba(0,230,118,0.3)); }
    50%       { opacity: 1;   filter: drop-shadow(0 0 8px rgba(0,230,118,0.65)); }
}

.glitch-text { position: relative; display: inline-block; }
.glitch-text:hover::before, .glitch-text:hover::after {
    content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}
.glitch-text:hover::before { left: 2px; text-shadow: -1px 0 rgba(255,0,0,0.65); animation: ga1 0.2s infinite linear alternate-reverse; }
.glitch-text:hover::after  { left: -2px; text-shadow: -1px 0 rgba(0,100,255,0.65); animation: ga2 0.3s infinite linear alternate-reverse; }
@keyframes ga1 { 0% { clip-path: inset(20% 0 80% 0); } 100% { clip-path: inset(80% 0 20% 0); } }
@keyframes ga2 { 0% { clip-path: inset(10% 0 60% 0); } 100% { clip-path: inset(30% 0 40% 0); } }

/* ===== NAV HEADER RIGHT (lang + hamburger) ===== */
.nav-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== HAMBURGER TOGGLE ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 2px;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.25s, box-shadow 0.25s;
    flex-shrink: 0;
}
.nav-toggle:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0,212,255,0.1);
}
.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--text-muted);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.25s;
}
.nav-toggle:hover .nav-toggle-bar { background: var(--neon-cyan); }

/* Hamburger → X animation */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ===== MOBILE OVERLAY ===== */
.nav-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nav-mobile-overlay.open {
    display: block;
    opacity: 1;
}

/* ===== MOBILE DRAWER ===== */
.nav-mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(300px, 85vw);
    height: 100dvh;
    background: rgba(2, 7, 12, 0.98);
    border-left: 1px solid rgba(0,212,255,0.15);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.nav-mobile-drawer.open {
    transform: translateX(0);
}

/* Prevent body scroll while drawer is open */
body.nav-drawer-open { overflow: hidden; }

.nav-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.055);
    flex-shrink: 0;
}
.nav-mobile-title {
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--neon-cyan);
    letter-spacing: 0.1em;
    opacity: 0.7;
}
.nav-mobile-close {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 2px;
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
    line-height: 1;
}
.nav-mobile-close:hover {
    border-color: rgba(255,100,100,0.4);
    color: rgba(255,100,100,0.8);
}

.nav-mobile-links {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    flex-shrink: 0;
}
.nav-mobile-links a {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.035);
    transition: color 0.2s, background 0.2s, padding-left 0.2s;
    display: block;
    position: relative;
}
.nav-mobile-links a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--neon-cyan);
    opacity: 0;
    transition: opacity 0.2s;
}
.nav-mobile-links a:hover,
.nav-mobile-links a.active {
    color: var(--neon-cyan);
    background: rgba(0,212,255,0.04);
    padding-left: 26px;
    text-shadow: none;
}
.nav-mobile-links a:hover::before,
.nav-mobile-links a.active::before { opacity: 1; }

.nav-mobile-lang {
    margin-top: auto;
    padding: 16px 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.055);
    flex-shrink: 0;
}
.nav-mobile-lang-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
.nav-mobile-lang-label svg { opacity: 0.5; flex-shrink: 0; }
.nav-mobile-lang-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mobile-lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: none;
    border: 1px solid transparent;
    border-radius: 2px;
    color: var(--text-muted);
    font-family: var(--font-code);
    font-size: 0.76rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    letter-spacing: 0.02em;
}
.mobile-lang-option:hover {
    background: rgba(0,212,255,0.06);
    color: var(--text-bright);
    border-color: rgba(0,212,255,0.12);
}
.mobile-lang-option.active {
    color: var(--neon-cyan);
    border-color: rgba(0,212,255,0.2);
    background: rgba(0,212,255,0.04);
}
.mobile-lang-option .lang-code {
    font-size: 0.66rem;
    color: var(--neon-cyan);
    opacity: 0.5;
    min-width: 40px;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.mobile-lang-option.active .lang-code,
.mobile-lang-option:hover .lang-code { opacity: 1; }

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
}
