/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0f;
    --bg2: #111118;
    --bg3: #1a1a28;
    --surface: #1e1e2e;
    --text: #e0e0ee;
    --text2: #8888aa;
    --accent: #a78bfa;
    --accent2: #7c3aed;
    --teal: #5eead4;
    --gradient: linear-gradient(135deg, #a78bfa, #5eead4);
    --radius: 12px;
    --radius-sm: 8px;
    --max-w: 1100px;
    --nav-h: 64px;
}

html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; }

img { max-width: 100%; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* === Navigation === */
.nav {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(10, 10, 15, .85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,.06);
    z-index: 100;
}
.nav-inner {
    max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
    height: 100%;
    display: flex; align-items: center; justify-content: space-between;
}
.logo {
    font-size: 18px; font-weight: 700; color: var(--text);
    letter-spacing: .5px;
}
.logo-dot { color: var(--accent); margin: 0 4px; }
.logo-en { font-weight: 400; font-size: 14px; color: var(--text2); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--text2); font-size: 14px; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }

/* === Hero === */
.hero {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    padding: 120px 24px 80px;
}
.hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(124,58,237,.12) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(94,234,212,.08) 0%, transparent 60%);
    z-index: 0;
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 700px; }
.hero-badge {
    display: inline-block;
    font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--accent); background: rgba(167,139,250,.1);
    border: 1px solid rgba(167,139,250,.2);
    padding: 6px 16px; border-radius: 20px; margin-bottom: 24px;
}
.hero-title {
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 800; line-height: 1.1;
    margin-bottom: 20px;
}
.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 18px; color: var(--text2);
    margin-bottom: 36px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all .25s; border: none;
}
.btn-primary {
    background: var(--gradient); color: #0a0a0f;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,58,237,.3); opacity: 1; }
.btn-secondary {
    background: transparent; color: var(--text);
    border: 1px solid rgba(255,255,255,.15);
}
.btn-secondary:hover { border-color: var(--accent); transform: translateY(-2px); opacity: 1; }
.btn-text {
    color: var(--accent); padding: 8px 0; font-weight: 500;
    background: none; border: none;
}
.btn-text:hover { gap: 12px; opacity: 1; color: var(--teal); }

/* === Stats === */
.hero-stats {
    display: flex; gap: 32px; justify-content: center; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
    display: block;
    font-size: 32px; font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* === Sections === */
.section {
    padding: 96px 0;
}
.section-dark { background: var(--bg2); }
.section-title {
    font-size: 32px; font-weight: 700; text-align: center;
    margin-bottom: 16px;
}
.section-desc {
    text-align: center; color: var(--text2);
    max-width: 500px; margin: 0 auto 48px; font-size: 16px;
}
.section-footer { text-align: center; margin-top: 40px; }

/* === About Card === */
.about-card {
    max-width: 680px; margin: 0 auto;
    background: var(--surface); border-radius: var(--radius);
    padding: 40px; border: 1px solid rgba(255,255,255,.06);
}
.about-text {
    font-size: 16px; color: var(--text2); margin-bottom: 20px;
    line-height: 1.8;
}
.about-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.tag {
    font-size: 13px; padding: 6px 14px;
    border-radius: 20px;
    background: rgba(167,139,250,.1);
    border: 1px solid rgba(167,139,250,.15);
    color: var(--accent);
}

/* === Chronicle List === */
.chronicle-list {
    display: grid; gap: 16px;
    max-width: 680px; margin: 0 auto;
}
.chronicle-card {
    display: flex; align-items: center; gap: 20px;
    background: var(--surface); border-radius: var(--radius);
    padding: 20px 24px; border: 1px solid rgba(255,255,255,.06);
    transition: all .25s; color: var(--text);
}
.chronicle-card:hover {
    border-color: var(--accent); transform: translateX(4px); opacity: 1;
}
.chronicle-num {
    font-size: 28px; font-weight: 800; color: var(--accent2);
    min-width: 40px; opacity: .4;
}
.chronicle-info h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.chronicle-info p { font-size: 13px; color: var(--text2); }
.chronicle-meta { font-size: 12px; color: var(--text2); margin-left: auto; white-space: nowrap; }

/* === Tools Grid === */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px; max-width: 960px; margin: 0 auto;
}
.tool-card {
    background: var(--surface); border-radius: var(--radius);
    padding: 28px; border: 1px solid rgba(255,255,255,.06);
    transition: all .25s;
}
.tool-card:hover { border-color: rgba(167,139,250,.3); transform: translateY(-4px); }
.tool-icon { font-size: 28px; margin-bottom: 12px; }
.tool-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.tool-card p { font-size: 14px; color: var(--text2); line-height: 1.6; }

/* === Codex === */
.codex-list {
    max-width: 680px; margin: 0 auto;
    display: grid; gap: 20px;
}
.codex-item {
    display: flex; gap: 20px; align-items: flex-start;
    background: var(--surface); border-radius: var(--radius);
    padding: 24px; border: 1px solid rgba(255,255,255,.06);
}
.codex-num {
    font-size: 20px; font-weight: 800; color: var(--accent);
    min-width: 32px; line-height: 1.4;
}
.codex-item strong { display: block; font-size: 16px; margin-bottom: 4px; }
.codex-item p { font-size: 14px; color: var(--text2); line-height: 1.6; }

/* === Sister Sites === */
.sister-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px; max-width: 700px; margin: 0 auto;
}
.sister-card {
    display: flex; flex-direction: column; gap: 4px;
    background: var(--surface); border-radius: var(--radius);
    padding: 28px; border: 1px solid rgba(255,255,255,.06);
    transition: all .25s;
}
.sister-card:hover { border-color: var(--accent); transform: translateY(-4px); opacity: 1; }
.sister-name { font-size: 18px; font-weight: 700; }
.sister-domain { font-size: 13px; color: var(--accent); }
.sister-role { font-size: 13px; color: var(--text2); }

/* === Footer === */
.footer {
    background: var(--bg2);
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 60px 0 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px; margin-bottom: 40px;
}
.footer-logo { font-size: 16px; font-weight: 700; display: block; margin-bottom: 8px; }
.footer-brand p { font-size: 14px; color: var(--text2); }
.footer-sign { margin-top: 12px; font-size: 14px; color: var(--accent); }
.footer-links h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text2); margin-bottom: 12px; }
.footer-links a { display: block; font-size: 14px; color: var(--text2); margin-bottom: 8px; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.06);
    padding-top: 24px; text-align: center;
}
.footer-bottom p { font-size: 13px; color: var(--text2); }
.footer-motto { color: var(--accent); margin-top: 4px; font-style: italic; }

/* === Responsive === */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-toggle { display: block; }
    .nav-links.open {
        display: flex; flex-direction: column;
        position: absolute; top: var(--nav-h); left: 0; right: 0;
        background: rgba(10,10,15,.95);
        backdrop-filter: blur(16px);
        padding: 20px 24px;
        border-bottom: 1px solid rgba(255,255,255,.06);
    }
    .hero-stats { gap: 20px; }
    .tools-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero-content, .section { animation: fadeIn .6s ease-out; }