/* ============================================================
   NIMBA — Landing page
   Design system aligne sur l'IDE (palette identique)
   Themes : data-theme="dark" (defaut) | data-theme="light"
   ============================================================ */

:root, [data-theme="dark"] {
    --bg:          #1E1E2E;
    --bg-2:        #181825;
    --bg-3:        #11111B;
    --surface:     #1E1E2E;
    --surface-hi:  #313244;
    --text:        #CDD6F4;
    --text-muted:  #A6ADC8;
    --text-dim:    #7F849C;
    --accent:      #FFD700;
    --accent-2:    #FF9D00;
    --accent-soft: rgba(255, 215, 0, 0.12);
    --success:     #A6E3A1;
    --error:       #F38BA8;
    --warning:     #FAB387;
    --border:      #313244;
    --border-soft: #232334;

    --tk-kw:       #FF9D00;
    --tk-str:      #CE9178;
    --tk-var:      #9CDCFE;
    --tk-num:      #B5CEA8;
    --tk-comment:  #6A9955;
    --tk-op:       #FFD700;

    --header-bg:   rgba(17, 17, 27, 0.85);
    --code-bg:     #11111B;
    --shadow-color: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
    --bg:          #FAFAFB;
    --bg-2:        #F0F0F4;
    --bg-3:        #FFFFFF;
    --surface:     #FFFFFF;
    --surface-hi:  #E2E2EA;
    --text:        #1E1E2E;
    --text-muted:  #5C5F77;
    --text-dim:    #8C8FA1;
    --accent:      #D4A300;
    --accent-2:    #BB7600;
    --accent-soft: rgba(212, 163, 0, 0.12);
    --success:     #40A02B;
    --error:       #D20F39;
    --warning:     #DF8E1D;
    --border:      #D9DAE0;
    --border-soft: #E8E8EE;

    --tk-kw:       #BB7600;
    --tk-str:      #B45309;
    --tk-var:      #2563EB;
    --tk-num:      #047857;
    --tk-comment:  #6C7086;
    --tk-op:       #D4A300;

    --header-bg:   rgba(250, 250, 251, 0.85);
    --code-bg:     #1E1E2E;
    --shadow-color: rgba(0, 0, 0, 0.08);
}

    --radius-sm:   6px;
    --radius:      10px;
    --radius-lg:   16px;

    --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:   'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

    --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow:      0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg:   0 24px 60px rgba(0, 0, 0, 0.45);

    --container:   1180px;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

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

ul { list-style: none; }

code, pre { font-family: var(--font-mono); font-size: 0.92em; }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; top: -40px; left: 8px; z-index: 200;
    background: var(--accent); color: var(--bg-3); padding: 8px 16px;
    border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 8px; }

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

/* ==================== BOUTONS ==================== */

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: inherit; font-size: 0.95rem; font-weight: 600;
    text-decoration: none; cursor: pointer;
    transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent); color: var(--bg-3);
    box-shadow: 0 4px 14px rgba(255, 215, 0, 0.25);
}
.btn-primary:hover { background: var(--accent-2); color: var(--bg-3); }

.btn-ghost {
    background: transparent; color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 7px 14px; font-size: 0.875rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }

/* ==================== HEADER ==================== */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-soft);
}

.site-header__inner {
    display: flex; align-items: center; gap: 32px;
    height: 64px;
}

.site-logo {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--text); text-decoration: none;
}
.site-logo__mark {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px;
    background: var(--accent); color: var(--bg-3);
    border-radius: 8px;
    font-weight: 800; font-size: 18px;
}
.site-logo__text {
    font-weight: 800; letter-spacing: 2px; font-size: 18px;
}

.site-nav {
    display: flex; gap: 28px;
    margin-left: auto;
}
.site-nav a {
    color: var(--text-muted); font-weight: 500;
    font-size: 0.95rem;
    padding: 4px 0;
    position: relative;
}
.site-nav a:hover { color: var(--text); }
.site-nav a::after {
    content: ''; position: absolute; left: 0; bottom: -4px;
    width: 0; height: 2px; background: var(--accent);
    transition: width 0.2s;
}
.site-nav a:hover::after { width: 100%; }

.site-header__cta { display: flex; gap: 8px; align-items: center; }

.theme-toggle {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, transform 0.2s;
}
.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: rotate(15deg);
}
.theme-toggle__icon { display: none; }
[data-theme="dark"] .theme-toggle__icon--sun  { display: block; }
[data-theme="light"] .theme-toggle__icon--moon { display: block; }

.site-nav__toggle {
    display: none; flex-direction: column; gap: 4px;
    background: transparent; border: none; cursor: pointer;
    padding: 8px;
}
.site-nav__toggle span {
    display: block; width: 22px; height: 2px; background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}
.site-nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
    .site-header__inner { gap: 16px; }
    .site-nav {
        position: absolute; left: 0; right: 0; top: 64px;
        flex-direction: column; gap: 0;
        background: var(--bg-3);
        border-bottom: 1px solid var(--border);
        padding: 8px 24px;
        transform: translateY(-10px); opacity: 0; pointer-events: none;
        transition: transform 0.2s, opacity 0.2s;
    }
    .site-nav.is-open {
        transform: translateY(0); opacity: 1; pointer-events: auto;
    }
    .site-nav a {
        padding: 14px 0;
        border-bottom: 1px solid var(--border-soft);
    }
    .site-nav a:last-child { border-bottom: none; }
    .site-nav__toggle { display: flex; margin-left: auto; }
    .site-header__cta { display: none; }
}

/* ==================== HERO ==================== */

.hero {
    position: relative;
    padding: 80px 0 100px;
    background:
        radial-gradient(ellipse at 20% 0%, var(--accent-soft), transparent 60%),
        radial-gradient(ellipse at 80% 50%, var(--accent-soft), transparent 60%),
        linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
    overflow: hidden;
}

.hero::before {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(currentColor 1px, transparent 1px),
        linear-gradient(90deg, currentColor 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--border);
    opacity: 0.35;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    pointer-events: none;
}

.hero__inner {
    position: relative;
    display: grid; grid-template-columns: 1.1fr 1fr;
    gap: 64px; align-items: center;
}

.hero__badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    background: var(--accent-soft);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 999px;
    font-size: 0.8rem; font-weight: 500;
    color: var(--accent);
    margin-bottom: 24px;
}
.hero__badge .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero__title {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 800; line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}
.hero__title-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__lede {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 560px;
    margin-bottom: 32px;
}
.hero__lede strong { color: var(--text); font-weight: 600; }

.hero__cta {
    display: flex; gap: 12px; flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero__stats {
    display: flex; gap: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border-soft);
}
.hero__stats > div { font-size: 0.875rem; color: var(--text-muted); }
.hero__stats strong {
    display: block;
    font-size: 1.5rem; color: var(--text);
    font-weight: 700;
}

.hero__visual {
    position: relative;
}
.hero__lang-pill {
    position: absolute; top: -16px; right: -8px;
    background: var(--accent); color: var(--bg-3);
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700; font-size: 0.875rem;
    box-shadow: var(--shadow);
    z-index: 2;
    transition: transform 0.3s;
}

@media (max-width: 900px) {
    .hero { padding: 56px 0 72px; }
    .hero__inner { grid-template-columns: 1fr; gap: 40px; }
    .hero__stats { gap: 24px; }
}

/* ==================== CODE WINDOW ==================== */

.code-window {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
    color: #CDD6F4;
}
.code-window__chrome {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.code-window__chrome .dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--surface-hi);
}
.code-window__chrome .dot--red    { background: #F38BA8; }
.code-window__chrome .dot--yellow { background: #FAB387; }
.code-window__chrome .dot--green  { background: #A6E3A1; }
.code-window__filename {
    margin-left: 12px;
    font-family: var(--font-mono); font-size: 0.8rem;
    color: #A6ADC8;
}
.code-window__loading {
    margin-left: auto;
    font-size: 0.75rem; color: var(--accent);
    animation: pulse 1.5s ease-in-out infinite;
}

.code-window__body {
    padding: 20px 24px;
    color: #CDD6F4;
    font-family: var(--font-mono); font-size: 0.95rem;
    line-height: 1.65;
    overflow-x: auto;
    white-space: pre;
    min-height: 180px;
}

.code-window__output {
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-family: var(--font-mono); font-size: 0.9rem;
    color: #CDD6F4;
}
.code-window__output .muted { color: #A6ADC8; }

/* Tokens de coloration */
.tk-kw       { color: var(--tk-kw); font-weight: 500; }
.tk-str      { color: var(--tk-str); }
.tk-var      { color: var(--tk-var); }
.tk-num      { color: var(--tk-num); }
.tk-comment  { color: var(--tk-comment); font-style: italic; }
.tk-op       { color: var(--tk-op); }

/* ==================== SECTIONS ==================== */

.section {
    padding: 96px 0;
}
.section--alt {
    background: var(--bg-2);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.section__head {
    max-width: 740px;
    margin: 0 auto 56px;
    text-align: center;
}
.section__head h2 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800; line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}
.section__sub {
    font-size: 1.125rem;
    color: var(--text-muted);
}

.eyebrow {
    display: inline-block;
    padding: 4px 12px; margin-bottom: 16px;
    background: var(--accent-soft);
    border-radius: 999px;
    font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--accent);
}

@media (max-width: 700px) {
    .section { padding: 64px 0; }
}

/* ==================== FEATURES ==================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature {
    padding: 28px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.feature:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    background: var(--surface);
}
.feature__icon {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.feature h3 {
    font-size: 1.125rem; font-weight: 600;
    margin-bottom: 8px;
}
.feature p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==================== PLAYGROUND ==================== */

.playground {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.playground__toolbar {
    display: flex; align-items: center; gap: 4px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.playground__tab {
    padding: 6px 12px;
    background: transparent;
    color: #A6ADC8;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.875rem; font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.playground__tab:hover { color: #CDD6F4; background: rgba(255, 255, 255, 0.05); }
.playground__tab.is-active {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.12);
    border-color: rgba(255, 215, 0, 0.3);
}

.playground__spacer { flex: 1; }

.playground__body {
    display: grid; grid-template-columns: 1.2fr 1fr;
    min-height: 320px;
}

.playground__editor textarea {
    width: 100%; height: 100%;
    min-height: 320px;
    padding: 20px;
    background: var(--code-bg);
    color: #CDD6F4;
    border: none; outline: none; resize: none;
    font-family: var(--font-mono); font-size: 0.95rem;
    line-height: 1.65;
    caret-color: var(--accent);
}

.playground__output {
    background: rgba(0, 0, 0, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex; flex-direction: column;
}
.playground__output-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.playground__output-head .muted { color: #A6ADC8; }
.playground__output-body {
    flex: 1;
    padding: 16px 20px;
    color: #CDD6F4;
    font-family: var(--font-mono); font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    max-height: 480px;
}
.playground__output-body .muted { color: #A6ADC8; }
.playground__output-body .err { color: var(--error); }
.playground__output-body .ok  { color: var(--success); }

.playground__status { font-size: 0.75rem; color: var(--text-muted); }
.playground__status.is-running { color: var(--accent); }
.playground__status.is-success { color: var(--success); }
.playground__status.is-error   { color: var(--error); }

@media (max-width: 780px) {
    .playground__body { grid-template-columns: 1fr; }
    .playground__output { border-left: none; border-top: 1px solid var(--border-soft); }
    .playground__editor textarea { min-height: 240px; }
}

/* ==================== MULTILINGUE ==================== */

.ml-demo {
    max-width: 920px; margin: 0 auto;
}

.ml-demo__langs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}

.ml-lang {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px;
    padding: 12px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-family: inherit; cursor: pointer;
    transition: all 0.15s;
}
.ml-lang:hover {
    color: var(--text);
    border-color: var(--accent);
}
.ml-lang.is-active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.ml-lang__code {
    font-weight: 800; font-size: 0.875rem; letter-spacing: 0.05em;
}
.ml-lang__name {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.ml-lang.is-active .ml-lang__name { color: var(--accent); }

.code-window--ml .code-window__body { min-height: 220px; }

.ml-demo__caption {
    text-align: center; margin-top: 20px;
    color: var(--text-muted);
}
.ml-demo__caption code {
    padding: 2px 8px;
    background: var(--surface-hi);
    border-radius: 4px;
    color: var(--success);
}

/* ==================== LECONS ==================== */

.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.lesson-cat {
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.lesson-cat__title {
    font-size: 0.95rem; font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.lesson-cat__list { display: flex; flex-direction: column; gap: 6px; }

.lesson-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}
.lesson-item:hover {
    background: var(--surface-hi);
    color: var(--text);
}
.lesson-item:hover .lesson-item__arrow {
    opacity: 1; transform: translateX(0);
}
.lesson-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.lesson-item__num {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    background: var(--surface-hi);
    border-radius: 6px;
    font-family: var(--font-mono); font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}
.lesson-item__title {
    flex: 1;
    font-size: 0.9375rem; color: var(--text);
}
.lesson-item__arrow {
    color: var(--accent);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s, transform 0.15s;
}

.cta-banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; flex-wrap: wrap;
    padding: 32px 40px;
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.cta-banner h3 {
    font-size: 1.5rem; font-weight: 700; margin-bottom: 4px;
}
.cta-banner p { color: var(--text-muted); }

/* ==================== INSTALL TABS ==================== */

.install-tabs {
    max-width: 820px;
    margin: 0 auto;
}

.install-tabs__head {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.install-tab {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 4px;
    padding: 16px 20px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit; cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}
.install-tab:hover { border-color: var(--accent); }
.install-tab.is-active {
    background: var(--surface);
    border-color: var(--accent);
}
.install-tab strong { font-size: 1rem; font-weight: 600; }

.install-panel {
    display: none;
    padding: 32px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
}
.install-panel.is-active { display: block; }
.install-panel h3 {
    font-size: 1.25rem; font-weight: 600;
    margin-bottom: 12px;
}
.install-panel p {
    color: var(--text-muted); margin-bottom: 20px;
}

.install-code {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    font-family: var(--font-mono); font-size: 0.875rem;
    line-height: 1.7;
    color: #CDD6F4;
    overflow-x: auto;
    white-space: pre;
}

@media (max-width: 700px) {
    .install-tabs__head { grid-template-columns: 1fr; }
}

/* ==================== REFERENCE GRID ==================== */

.ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.ref-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}
.ref-card code {
    flex-shrink: 0;
    padding: 4px 10px;
    background: var(--code-bg);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-weight: 600;
}
.ref-card span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==================== FOOTER ==================== */

.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 56px 0 24px;
}
.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-soft);
}
.site-footer__brand .site-logo { margin-bottom: 12px; }
.site-footer__brand p { color: var(--text-muted); }
.site-footer h4 {
    font-size: 0.875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text); margin-bottom: 16px;
}
.site-footer ul li { margin-bottom: 8px; }
.site-footer ul a {
    color: var(--text-muted); font-size: 0.9375rem;
}
.site-footer ul a:hover { color: var(--accent); }

.site-footer__bottom {
    padding-top: 20px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

@media (max-width: 700px) {
    .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .site-footer__brand { grid-column: 1 / -1; }
}

/* ============================================================
   DOCS PAGES
   ============================================================ */

.docs-layout {
    max-width: var(--container);
    margin: 0 auto;
    padding: 32px 24px 96px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: 88px;
}
.docs-sidebar__inner {
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.docs-sidebar__title {
    font-size: 0.875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.docs-nav-item {
    display: block;
    padding: 10px 14px; margin-bottom: 2px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.docs-nav-item:hover {
    color: var(--text);
    background: var(--surface-hi);
}
.docs-nav-item.is-active {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
    font-weight: 600;
}
.docs-sidebar__cta {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
}
.docs-sidebar__cta .btn { width: 100%; justify-content: center; }

.docs-content {
    min-width: 0;
}

.docs-head { margin-bottom: 40px; }
.docs-head h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800; line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}
.docs-head__sub {
    font-size: 1.0625rem;
    color: var(--text-muted);
}

.docs-section { margin-bottom: 56px; }
.docs-section h2 {
    font-size: 1.5rem; font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}
.docs-section h3 {
    font-size: 1.125rem; font-weight: 600;
    margin: 28px 0 12px;
}
.docs-section p {
    color: var(--text);
    margin-bottom: 16px;
}
.docs-section code {
    font-size: 0.9em;
    padding: 2px 6px;
    background: var(--surface-hi);
    border-radius: 4px;
    color: var(--accent);
}

.docs-code {
    background: var(--code-bg);
    color: #CDD6F4;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin: 16px 0;
    font-family: var(--font-mono); font-size: 0.9rem;
    line-height: 1.65;
    overflow-x: auto;
    white-space: pre;
}
.docs-code code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.docs-code--inline { padding: 10px 14px; margin: 8px 0; }

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 48px;
}
.docs-card {
    display: block;
    padding: 24px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.docs-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    color: var(--text);
}
.docs-card h3 {
    font-size: 1.125rem; font-weight: 600;
    margin-bottom: 6px;
}
.docs-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.docs-card__arrow {
    color: var(--accent);
    font-size: 0.875rem; font-weight: 600;
}

.docs-steps {
    list-style: none;
    counter-reset: docstep;
    padding: 0;
}
.docs-steps > li {
    counter-increment: docstep;
    padding: 12px 0 12px 48px;
    position: relative;
    color: var(--text);
}
.docs-steps > li::before {
    content: counter(docstep);
    position: absolute; left: 0; top: 12px;
    display: grid; place-items: center;
    width: 32px; height: 32px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 50%;
    font-weight: 700; font-size: 0.875rem;
}

.docs-table-wrapper { overflow-x: auto; }
.docs-table-wrapper--scroll { overflow-x: scroll; }
.docs-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
}
.docs-table th, .docs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
    font-size: 0.9375rem;
}
.docs-table th {
    background: var(--bg-2);
    color: var(--text);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.docs-table tr:last-child td { border-bottom: none; }
.docs-table tr:hover td { background: var(--bg-2); }
.docs-table code {
    font-size: 0.875rem;
    white-space: nowrap;
}
.docs-table--compact th, .docs-table--compact td {
    padding: 8px 10px;
    font-size: 0.875rem;
}
.docs-table--builtins td:nth-child(1) code,
.docs-table--builtins td:nth-child(2) code {
    color: var(--accent);
}
.docs-table--builtins td:nth-child(3) code { color: var(--text); }

.docs-langs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin: 16px 0;
}
.docs-lang-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}
.docs-lang-card__code {
    font-family: var(--font-mono);
    font-weight: 700; font-size: 0.875rem;
    padding: 4px 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 4px;
}
.docs-lang-card__name { font-size: 0.9375rem; color: var(--text); }

.docs-langs-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.docs-module {
    margin-bottom: 28px;
    padding: 20px 24px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
}
.docs-module h3 {
    font-size: 1.125rem; font-weight: 600;
    margin: 0 0 8px;
    color: var(--accent);
}
.docs-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}
.docs-list li {
    padding: 6px 0;
    color: var(--text-muted);
    border-bottom: 1px dashed var(--border-soft);
}
.docs-list li:last-child { border-bottom: none; }
.docs-list code {
    color: var(--text);
    margin-right: 4px;
}

.docs-lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
}
.docs-lesson-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s;
}
.docs-lesson-card:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateX(2px);
}
.docs-lesson-card__num {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    background: var(--surface-hi);
    border-radius: 6px;
    font-family: var(--font-mono); font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}
.docs-lesson-card__title { flex: 1; font-size: 0.9375rem; }
.docs-lesson-card__arrow {
    color: var(--accent);
    font-weight: 600;
}

@media (max-width: 900px) {
    .docs-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .docs-sidebar { position: static; }
}
