:root {
    --bg: #09090b;
    --text: #ededed;
    --text-muted: #a1a1aa;
    --accent: #c20000;
    --accent-hover: #e60000;
    --surface: #18181b;
    --surface-hover: #27272a;
    --border: #27272a;
    --dot-rgb: 255, 255, 255;
    --header-bg: rgba(9, 9, 11, 0.5);
    --node-bg: #111113;
    --scroll-y: 0px;
    --scroll-opacity: 1;
}

body.light-mode {
    --bg: #fafafa;
    --text: #09090b;
    --text-muted: #71717a;
    --surface: #f4f4f5;
    --surface-hover: #e4e4e7;
    --border: #e4e4e7;
    --dot-rgb: 0, 0, 0;
    --header-bg: rgba(250, 250, 250, 0.1);
    --node-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Lenis Smooth Scroll CSS */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

body {
    font-family: "Google Sans", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Canvas Background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Navbar */
body>nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--header-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 450;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text);
}

.theme-btn {
    background: transparent;
    color: var(--text);
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    width: 31.2px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    border: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.theme-btn:hover {
    background: var(--surface);
}

/* Layout & Typography */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

h1,
h2,
h3 {
    font-weight: 450;
    letter-spacing: -0.03em;
}

.accent {
    color: var(--accent);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 10rem;
    position: relative;
    margin-bottom: 20em;
}

.hero-content {
    will-change: transform, opacity;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    transform: translateY(calc(var(--scroll-y) * 0.3));
    opacity: var(--scroll-opacity);
}

.badge-row {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 450;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge .dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem auto;
    min-height: 95px;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--accent);
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
    margin-left: 4px;
    border-radius: 5px;
}

/* AI Text Generation Cursor */
.ai-cursor {
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background: transparent;
    vertical-align: middle;
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
    border-radius: 5px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Install Widget */
.install-widget-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 50;
}

.install-widget {
    display: flex;
    background: var(--header-bg);
    border: 1px solid #27272a;
    border-radius: 5px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
}

body.light-mode .install-widget {
    border: 1px solid #e4e4e7;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.os-selector-area {
    position: relative;
}

.os-btn {
    background: var(--text);
    color: var(--bg);
    border: none;
    padding: 0.8rem 1.2rem;
    font-family: "Google Sans", sans-serif;
    font-weight: 450;
    font-size: 0.95rem;
    border-radius: 7px 0 0 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    transition: opacity 0.2s;
    position: relative;
    z-index: 51;
}

.os-btn:hover {
    opacity: 0.9;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    width: 220px;
    padding: 0.5rem;
    list-style: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 9999;
    pointer-events: none;
}

body.light-mode .dropdown-menu {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu li {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 5px;
    color: var(--text);
    text-align: left;
    transition: background 0.2s;
}

.dropdown-menu li:hover {
    background: var(--surface-hover);
}

.cmd-area {
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: "Google Mono", monospace;
    font-size: 0.9rem;
    color: #d1d5db;
    background: var(--header-bg);
    border-radius: 0 7px 7px 0;
    position: relative;
    z-index: 50;
    backdrop-filter: blur(10px);
}

body.light-mode .cmd-area {
    background: #ffffff;
    color: #18181b;
}

.cmd-area .prompt-prefix {
    color: var(--accent);
}

.copy-btn {
    background: none;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 5px;
    transition: all 0.2s;
}

body.light-mode .copy-btn {
    color: #71717a;
}

.copy-btn:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.doc-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.doc-link:hover {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* Caterpillar Animation Section */
.caterpillar-track {
    width: 100%;
    height: 180px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    overflow: hidden;
    position: relative;
    margin: 2rem 0;
    margin-top: 10rem;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.cat-node {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--node-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: var(--text);
    flex-shrink: 0;
    transition: border-color 0.3s, background 0.3s;
    will-change: transform;
}

.cat-node svg {
    width: 24px;
    height: 24px;
    opacity: 0.7;
}

/* Sections & Animations */
section {
    padding: 6rem 0;
    position: relative;
}

section.toolchain-section {
    padding-bottom: 8rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
    height: 140px;
}

.section-header h2 {
    font-size: 2.5rem;
}

.section-header p {
    color: var(--text-muted);
    max-width: 700px;
    margin: 1rem auto 0;
    min-height: 48px;
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal.delay-1 {
    transition-delay: 0.1s;
}

.reveal.delay-2 {
    transition-delay: 0.2s;
}

.reveal.delay-3 {
    transition-delay: 0.3s;
}

.reveal.delay-5 {
    transition-delay: 0.5s;
}

#ffeatures {
    background: var(--bg);
    padding: 1em;
    border-radius: 5px;
}

/* Grid Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 10rem;
}

.grid.grid-3col {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
    padding: 2.5rem;
    border-radius: 5px;
    transition: transform 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
    height: 380px;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--text-muted);
}

.card-icon {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Syntax Spotlight / Brace Target Box */
.brace-target {
    position: relative;
    z-index: 5;
}

.code-window {
    background: rgba(13, 17, 23, 0.95);
    border-radius: 5px;
    max-width: 650px;
    margin: 0 auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    text-align: left;
    overflow: hidden;
    margin-bottom: 10em;
    backdrop-filter: blur(5px);
}

body.light-mode .code-window {
    background: #ffffff;
    border-color: #e4e4e7;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.window-header {
    background: rgba(13, 17, 23, 0.95);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.light-mode .window-header {
    background: #f4f4f5;
    border-bottom-color: #e4e4e7;
}

.mac-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: none;
}

.cld .code-window {
    margin-bottom: 4em;
}

.mac-btn.close {
    background: transparent;
}

.mac-btn.min {
    background: transparent;
}

.mac-btn.max {
    background: transparent;
}

.file-name {
    margin: 0 auto;
    color: #8b949e;
    font-size: 0.85rem;
    font-family: "Google Mono", monospace;
}

.code-window pre {
    padding: 24px;
    overflow-x: auto;
    font-family: "Google Mono", monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #c9d1d9;
}

body.light-mode .code-window pre {
    color: #24292f;
}

.kw {
    color: #ff7b72;
}

.fn {
    color: #d2a8ff;
}

.cm {
    color: #8b949e;
}

.str {
    color: #a5d6ff;
}

body.light-mode .kw {
    color: #cf222e;
}

body.light-mode .fn {
    color: #8250df;
}

body.light-mode .cm {
    color: #6e7781;
}

body.light-mode .str {
    color: #0a3069;
}

/* Roadmap Section */
.roadmap-list {
    max-width: 700px;
    margin: 0 auto;
    margin-bottom: 10em;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.roadmap-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 5px;
}

.check-icon {
    color: #27c93f;
    flex-shrink: 0;
    margin-top: 2px;
}

.roadmap-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.roadmap-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
    min-height: auto;
}

i {
    margin-right: 0.4em;
}

/* Footer */
footer {
    padding: 4rem 2rem;
    background: transparent;
    margin-top: 6rem;
    backdrop-filter: blur(5px);
    border-radius: 5px 5px 0 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo {
    height: 40px;
    width: fit-content;
    opacity: 0.8;
    filter: grayscale(100%);
    transition: all 0.3s;
}

body.light-mode .footer-logo {
    filter: grayscale(0%);
}

.footer-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
}

body.light-mode .footer-logo:hover {
    filter: grayscale(0%);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 300px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-section-title {
    font-size: 1rem;
    font-weight: 550;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.footer-section-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.footer-link:hover {
    color: var(--text);
    transform: translateX(4px);
}

.footer-divider {
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-socials {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: all 0.3s;
}

.social-link:hover {
    color: white;
}

body.light-mode .social-link:hover {
    color: black;
}

/* Responsive Footer */
@media (max-width: 768px) {
    footer {
        padding: 2rem 1rem;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .footer-socials {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ========================================
   PLAYGROUND SECTION
   ======================================== */

.playground-layout {
    display: flex;
    gap: 0;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    margin-bottom: 10em;
    border: 1px solid var(--border);
}

body.light-mode .playground-layout {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.1);
}

/* Editor Pane */
.playground-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.playground-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(13, 17, 23, 0.95);
}

body.light-mode .playground-toolbar {
    background: #f4f4f5;
    border-bottom-color: #e4e4e7;
}

.toolbar-dots {
    display: flex;
    gap: 8px;
}

.toolbar-title {
    flex: 1;
    color: #8b949e;
    font-size: 0.82rem;
    font-family: "Google Mono", monospace;
    text-align: center;
}

body.light-mode .toolbar-title {
    color: #6e7781;
}

.run-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 15px;
    font-family: "Google Sans", sans-serif;
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
}

.run-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(194, 0, 0, 0.35);
}

.run-btn:active {
    transform: translateY(0);
}

.run-btn i {
    margin-right: 0;
    font-size: 0.9rem;
}

#playground-code {
    flex: 1;
    background: rgba(13, 17, 23, 0.95);
    color: #c9d1d9;
    border: none;
    padding: 24px;
    font-family: "Google Mono", monospace;
    font-size: 0.92rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    min-height: 280px;
    tab-size: 4;
}

body.light-mode #playground-code {
    background: #ffffff;
    color: #24292f;
}

/* Output / Terminal Pane */
.playground-output {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0a0a0c;
    min-width: 0;
    border-left: 1px solid #21262d;
}

body.light-mode .playground-output {
    background: #f9f9fb;
    border-left-color: #e4e4e7;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.82rem;
    color: #6e7681;
    font-family: "Google Mono", monospace;
}

body.light-mode .terminal-header {
    border-bottom-color: #e4e4e7;
    color: #6e7781;
}

.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27c93f;
    box-shadow: 0 0 6px rgba(39, 201, 63, 0.4);
}

.terminal-body {
    padding: 24px;
    font-family: "Google Mono", monospace;
    font-size: 0.88rem;
    line-height: 1.7;
    color: #27c93f;
    flex: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

body.light-mode .terminal-body {
    color: #1a7f37;
}

.terminal-prompt {
    color: var(--accent);
    font-weight: 600;
}

.terminal-muted {
    color: #484f58;
}

body.light-mode .terminal-muted {
    color: #8b949e;
}

.terminal-line {
    display: block;
    opacity: 0;
    transform: translateY(4px);
    animation: termFadeIn 0.3s ease forwards;
}

.terminal-line-error {
    color: #ff7b72;
}

body.light-mode .terminal-line-error {
    color: #cf222e;
}

.terminal-line-info {
    color: #8b949e;
}

.terminal-line-result {
    color: #27c93f;
    font-weight: 500;
}

body.light-mode .terminal-line-result {
    color: #1a7f37;
}

@keyframes termFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   LEARN / DOCS SECTION
   ======================================== */

.learn-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    margin-bottom: 10em;
    min-height: 520px;
}

body.light-mode .learn-layout {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.learn-sidebar {
    background: var(--surface);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid var(--border);
}

.learn-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: "Google Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 450;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
}

.learn-tab:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.learn-tab.active {
    color: var(--text);
    background: var(--surface-hover);
    border-left-color: var(--accent);
    font-weight: 500;
}

.learn-tab i {
    font-size: 1rem;
    min-width: 18px;
    text-align: center;
    margin-right: 0;
}

.learn-content {
    padding: 2.5rem;
    overflow-y: auto;
    background: var(--bg);
}

.learn-panel {
    display: none;
}

.learn-panel.active {
    display: block;
    animation: panelFadeIn 0.35s ease;
}

@keyframes panelFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.learn-panel h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    margin-top: 2.5rem;
    font-weight: 500;
}

.learn-panel h3:first-child {
    margin-top: 0;
}

.learn-panel p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.learn-panel code {
    background: var(--surface);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: "Google Mono", monospace;
    font-size: 0.85em;
    color: var(--accent);
}

.learn-code {
    margin-bottom: 1.5rem;
    max-width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

body.light-mode .learn-code {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.learn-code-error {
    border: 1px solid rgba(255, 123, 114, 0.3);
}

body.light-mode .learn-code-error {
    border-color: rgba(207, 34, 46, 0.2);
}

/* Ownership Rules Cards */
.learn-rules {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.learn-rule {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: var(--surface);
    border-radius: 5px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.learn-rule:hover {
    border-color: var(--accent);
}

.rule-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 5px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.learn-rule strong {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    color: var(--text);
}

.learn-rule p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ========================================
   RESPONSIVE: MOBILE STACKING
   ======================================== */

@media (max-width: 900px) {
    .playground-layout {
        flex-direction: column;
    }

    .playground-output {
        border-left: none;
        border-top: 1px solid #21262d;
    }

    body.light-mode .playground-output {
        border-top-color: #e4e4e7;
    }

    #playground-code {
        min-height: 200px;
    }

    .learn-layout {
        grid-template-columns: 1fr;
    }

    .learn-sidebar {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 0.5rem;
        overflow-x: auto;
        gap: 0;
    }

    .learn-tab {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 0.75rem 1rem;
        white-space: nowrap;
        font-size: 0.82rem;
    }

    .learn-tab.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent);
    }

    .learn-content {
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    .playground-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .toolbar-title {
        display: none;
    }

    .run-btn {
        width: 100%;
        justify-content: center;
        order: 10;
    }

    .learn-tab i {
        display: none;
    }
}

/* ========================================
   PAGE SYSTEM — Show/Hide Virtual Pages
   ======================================== */

.page {
    display: none;
}

.page.active {
    display: block;
}

#bg-canvas.canvas-hidden {
    display: none;
}

/* Nav Active State for Pages */
.nav-link.nav-active {
    color: var(--text) !important;
    position: relative;
}

.nav-link.nav-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 5px;
}

.nav-logo-link {
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* ========================================
   PAGE HERO — Header for Non-Home Pages
   ======================================== */

.page-wrapper {
    padding-top: 80px;
}

.page-hero {
    text-align: center;
    padding: 5rem 2rem 3rem;
    position: relative;
}

.page-hero-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.page-hero-icon i {
    margin-right: 0;
}

.page-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 450;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.page-hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ========================================
   DOCS LAYOUT — Sticky Sidebar + Content
   ======================================== */

.docs-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    border-radius: 5px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    margin-bottom: 6rem;
    min-height: 70vh;
}

body.light-mode .docs-layout {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.docs-sidebar {
    background: var(--node-bg);
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    align-self: start;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.docs-nav {
    padding: 1.5rem 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.docs-nav-heading {
    display: block;
    padding: 0.5rem 1.5rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.docs-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 450;
    border-radius: 21px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.docs-nav-item i {
    font-size: 0.9rem;
    min-width: 16px;
    text-align: center;
    margin-right: 0;
    opacity: 0.7;
}

.docs-nav-item:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.docs-nav-item.active {
    color: var(--text);
    background: var(--surface-hover);
    font-weight: 450;
}

.docs-nav-item.active i {
    opacity: 1;
    color: var(--text);
}

/* Docs Content Area */
.docs-content {
    padding: 3rem;
    background: var(--bg);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* ========================================
   DOWNLOAD PAGE STYLES
   ======================================== */

.hero-download-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.9rem 2.2rem;
    font-size: 1rem;
    font-weight: 450;
    border-radius: 25px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: "Google Sans", sans-serif;
}

.hero-download-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.hero-download-btn i {
    font-size: 1.1rem;
}

.hero-downloadb-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: 450;
    border-radius: 25px;
    cursor: pointer;
    display: inline-block;
    align-items: center;
    text-decoration: none;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: "Google Sans", sans-serif;
    margin-top: 1rem;
    width: fit-content;
}

.hero-downloadb-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.hero-downloadb-btn i {
    font-size: 1.1rem;
}

.download-layout {
    display: flex;
    flex-direction: column;
    gap: 6rem;
    margin-bottom: 6rem;
}

.download-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.download-commands {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
}

.command-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.command-header {
    padding: 0;
}

.command-header h3 {
    font-size: 1.1rem;
    font-weight: 450;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.command-header i {
    color: var(--accent);
    font-size: 1.2rem;
}

.code-content {
    display: flex;
    align-items: center;
    background: var(--header-bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    padding: 0;
    width: 855px;
    margin-bottom: 4rem;
}

.code-content .prompt {
    color: var(--accent);
    padding: 0.8rem 1rem;
    font-family: monospace;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 60px;
    border-right: 1px solid var(--border);
}

.code-content .cmd-text {
    flex: 1;
    padding: 0.8rem 1rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
    overflow: auto;
    white-space: nowrap;
    max-width: 1000px;
}

.copy-cmd-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    border-radius: 5px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.copy-cmd-btn:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.copy-cmd-btn.copied {
    color: var(--accent);
}

.download-executables {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.executable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.executable-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.executable-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.executable-header i {
    font-size: 2rem;
    color: var(--accent);
    flex-shrink: 0;
}

.executable-header h3 {
    font-size: 1.3rem;
    font-weight: 450;
    margin-bottom: 0.25rem;
}

.executable-header .arch {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.executable-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.8rem;
    border-radius: 24px;
    font-family: "Google Sans", sans-serif;
    font-size: 0.95rem;
    font-weight: 450;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: auto;
}

.download-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.download-note {
    padding: 1.5rem;
    background: var(--surface);
    border-left: 4px solid var(--accent);
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.download-note p {
    margin: 0;
    line-height: 1.6;
}

/* Responsive Download Layout */
@media (max-width: 768px) {
    .download-commands {
        grid-template-columns: 1fr;
    }

    .executable-grid {
        grid-template-columns: 1fr;
    }

    .code-content .cmd-text {
        max-width: 200px;
    }
}

.docs-section {
    padding-bottom: 3rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.docs-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.docs-section h2 {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.docs-section h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.docs-section h3:first-of-type {
    margin-top: 1.5rem;
}

.docs-section h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.docs-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.docs-section strong {
    color: var(--text);
}

.docs-section code {
    padding: 2px 7px;
    border-radius: 5px;
    font-family: "Google Mono", monospace;
    font-size: 0.85em;
    color: var(--accent);
}

/* Docs Code Windows */
.docs-code {
    margin-bottom: 1.5rem;
    max-width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

body.light-mode .docs-code {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.docs-code-error {
    border: 1px solid rgba(255, 123, 114, 0.3);
}

body.light-mode .docs-code-error {
    border-color: rgba(207, 34, 46, 0.2);
}

/* Docs Tables */
.docs-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    border: 1px solid var(--border);
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.docs-table thead th {
    background: var(--surface);
    padding: 0.8rem 1.2rem;
    text-align: left;
    font-weight: 500;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.docs-table tbody td {
    padding: 0.7rem 1.2rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    vertical-align: top;
}

.docs-table tbody tr:last-child td {
    border-bottom: none;
}

.docs-table tbody tr:hover {
    background: var(--surface);
}

.docs-table code {
    background: var(--surface-hover);
    padding: 1px 5px;
    border-radius: 5px;
    font-size: 0.85em;
}

/* Docs Lists */
.docs-list {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.docs-list li {
    margin-bottom: 0.5rem;
}

.docs-list li strong {
    color: var(--text);
}

.docs-list li code {
    background: var(--surface);
    padding: 1px 5px;
    border-radius: 5px;
    font-family: "Google Mono", monospace;
    font-size: 0.85em;
    color: var(--accent);
}

/* Nested lists */
.docs-list ul {
    padding-left: 1.5rem;
    margin-top: 0.3rem;
}

/* Docs Callouts */
.docs-callout {
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.docs-callout strong {
    color: var(--text);
}

.docs-callout code {
    background: var(--surface-hover);
    padding: 1px 5px;
    border-radius: 5px;
    font-family: "Google Mono", monospace;
    font-size: 0.85em;
    color: var(--accent);
}

/* ========================================
   RESPONSIVE: DOCS PAGES
   ======================================== */

@media (max-width: 900px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .docs-nav {
        flex-direction: row;
        padding: 0.5rem;
        overflow-x: auto;
        gap: 0;
    }

    .docs-nav-heading {
        display: none;
    }

    .docs-nav-item {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 0.6rem 1rem;
        white-space: nowrap;
        font-size: 0.8rem;
    }

    .docs-nav-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent);
    }

    .docs-content {
        padding: 1.5rem;
    }

    .page-hero {
        padding: 3rem 1.5rem 2rem;
    }
}

@media (max-width: 600px) {
    .docs-nav-item i {
        display: none;
    }

    .docs-section h2 {
        font-size: 1.4rem;
    }

    .docs-table {
        font-size: 0.8rem;
    }

    .docs-table thead th,
    .docs-table tbody td {
        padding: 0.5rem 0.8rem;
    }
}

/* Secure CSS Classes - Replacing Inline Styles */
.docs-code-full-width {
    max-width: 100%;
}

.download-commands-flex {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.command-card-full-width {
    width: 100%;
}

.dual-btn-group-flex {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

.download-btn-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.download-btn-secondary {
    opacity: 0.9;
}

/* Caterpillar Animation Styling */
.cat-node {
    transform: translateY(var(--cat-transform-y, 0px));
}

.cat-svg-icon {
    margin-left: 4px;
}

.os-selector-arrow {
    margin-left: 4px;
}