:root {
    --bg: #090b10;
    --bg-soft: #10141d;
    --bg-card: rgba(18, 24, 36, 0.78);
    --bg-card-strong: rgba(23, 31, 47, 0.96);
    --text: #edf2ff;
    --muted: #9aa9c1;
    --line: rgba(148, 163, 184, 0.18);
    --accent: #7dd3fc;
    --accent-2: #c084fc;
    --accent-3: #86efac;
    --warning: #facc15;
    --danger: #fb7185;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --radius: 22px;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --sans:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    background:
        radial-gradient(
            circle at 10% 0%,
            rgba(125, 211, 252, 0.2),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 8%,
            rgba(192, 132, 252, 0.16),
            transparent 34%
        ),
        linear-gradient(135deg, #070910 0%, #101421 52%, #070910 100%);
    min-height: 100vh;
}

body.light {
    --bg: #f8fafc;
    --bg-soft: #eef2ff;
    --bg-card: rgba(255, 255, 255, 0.78);
    --bg-card-strong: rgba(255, 255, 255, 0.96);
    --text: #101827;
    --muted: #526174;
    --line: rgba(15, 23, 42, 0.14);
    --shadow: 0 24px 80px rgba(51, 65, 85, 0.18);
    background:
        radial-gradient(
            circle at 10% 0%,
            rgba(14, 165, 233, 0.16),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 8%,
            rgba(168, 85, 247, 0.14),
            transparent 34%
        ),
        linear-gradient(135deg, #f8fafc 0%, #eef2ff 55%, #ffffff 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: rgba(9, 11, 16, 0.66);
    border-bottom: 1px solid var(--line);
}

body.light .topbar {
    background: rgba(248, 250, 252, 0.72);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #020617;
    font-family: var(--mono);
    font-weight: 900;
    box-shadow: 0 12px 40px rgba(125, 211, 252, 0.2);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 0.92rem;
}

.nav-links a:hover {
    color: var(--text);
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn,
button {
    border: 1px solid var(--line);
    background: var(--bg-card);
    color: var(--text);
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease;
}

.btn:hover,
button:hover {
    transform: translateY(-1px);
    border-color: rgba(125, 211, 252, 0.55);
    background: var(--bg-card-strong);
}

.hero {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 28px;
    padding: 62px 0 38px;
    align-items: stretch;
}

.hero-card,
.panel,
.resource-card,
.wiki-card,
.snippet-card,
.tool-card,
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-card {
    padding: 34px;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -70px;
    bottom: -90px;
    background: radial-gradient(
        circle,
        rgba(125, 211, 252, 0.22),
        transparent 70%
    );
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pulse {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-3);
    box-shadow: 0 0 0 0 rgba(134, 239, 172, 0.72);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    70% {
        box-shadow: 0 0 0 12px rgba(134, 239, 172, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(134, 239, 172, 0);
    }
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: -0.04em;
}

h1 {
    margin-top: 16px;
    max-width: 820px;
    font-size: clamp(2.7rem, 7vw, 5.8rem);
    line-height: 0.92;
}

.gradient-text {
    background: linear-gradient(
        135deg,
        var(--accent),
        var(--accent-2),
        var(--accent-3)
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    max-width: 700px;
    color: var(--muted);
    line-height: 1.75;
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #020617;
    border: none;
}

.terminal {
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.terminal-top {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--danger);
}
.dot:nth-child(2) {
    background: var(--warning);
}
.dot:nth-child(3) {
    background: var(--accent-3);
}

.terminal pre {
    margin: 0;
    white-space: pre-wrap;
    color: #c7d2fe;
    font-family: var(--mono);
    font-size: 0.9rem;
    line-height: 1.75;
}

body.light .terminal pre {
    color: #1e293b;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 10px 0 36px;
}

.stat {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.stat strong {
    display: block;
    font-size: 1.8rem;
    letter-spacing: -0.04em;
}

.stat span {
    color: var(--muted);
    font-size: 0.88rem;
}

section {
    padding: 34px 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-head p {
    color: var(--muted);
    max-width: 720px;
    line-height: 1.65;
    margin: 8px 0 0;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin: 20px 0;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 15px;
    border-radius: 15px;
    border: 1px solid var(--line);
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(125, 211, 252, 0.7);
    box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.1);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.tool-card,
.resource-card,
.wiki-card,
.snippet-card,
.project-card,
.panel {
    padding: 20px;
    transition:
        transform 180ms ease,
        border-color 180ms ease;
}

.tool-card:hover,
.resource-card:hover,
.wiki-card:hover,
.snippet-card:hover,
.project-card:hover {
    transform: translateY(-3px);
    border-color: rgba(125, 211, 252, 0.48);
}

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: rgba(125, 211, 252, 0.13);
    border: 1px solid rgba(125, 211, 252, 0.18);
    font-size: 1.3rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tag {
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--muted);
    border: 1px solid var(--line);
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.card-copy {
    color: var(--muted);
    line-height: 1.62;
    margin: 0;
}

.wiki-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-list button {
    text-align: left;
    border-radius: 14px;
    padding: 12px 14px;
}

.sidebar-list button.active {
    background: linear-gradient(
        135deg,
        rgba(125, 211, 252, 0.18),
        rgba(192, 132, 252, 0.16)
    );
    border-color: rgba(125, 211, 252, 0.45);
}

.wiki-content h3 {
    font-size: 1.7rem;
    margin-bottom: 8px;
}
.wiki-content p,
.wiki-content li {
    color: var(--muted);
    line-height: 1.7;
}
.wiki-content code {
    color: var(--accent);
    font-family: var(--mono);
}

.snippet-card pre {
    overflow-x: auto;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    color: #dbeafe;
    font-family: var(--mono);
    font-size: 0.82rem;
    line-height: 1.55;
}

body.light .snippet-card pre {
    background: rgba(15, 23, 42, 0.05);
    color: #172554;
}

.copy-btn {
    padding: 8px 11px;
    font-size: 0.78rem;
}

.lab-map {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.map-node {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    min-height: 110px;
}

.map-node strong {
    display: block;
    margin-bottom: 8px;
}
.map-node span {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.footer {
    padding: 34px 0 50px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    margin-top: 30px;
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .hero,
    .wiki-layout {
        grid-template-columns: 1fr;
    }
    .grid-3,
    .grid-2,
    .stats,
    .lab-map {
        grid-template-columns: repeat(2, 1fr);
    }
    .nav-links {
        display: none;
    }
}

@media (max-width: 620px) {
    .grid-3,
    .grid-2,
    .stats,
    .lab-map,
    .search-row {
        grid-template-columns: 1fr;
    }
    .hero-card {
        padding: 24px;
    }
    .section-head {
        display: block;
    }
    .controls {
        display: none;
    }
}
