:root {
    --bg: #0a0c10;
    --surface: #111318;
    --surface2: #181b22;
    --border: #1f2330;
    --accent: #00e5a0;
    --accent2: #4f8cff;
    --accent3: #ff5e7e;
    --text: #e8eaf2;
    --text-dim: #7a7f96;
    --text-dimmer: #3a3f56;
    --mono: 'Space Mono', monospace;
    --sans: 'Syne', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
    linear-gradient(rgba(0,229,160,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,160,.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* NAV */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 2.5rem;
    background: rgba(10,12,16,.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav-logo {
    font-family: var(--mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.03em;
    text-decoration: none;
}
.nav-logo span { color: var(--text-dim); font-weight: 400; }
.nav-back {
    font-family: var(--mono);
    font-size: .78rem;
    color: var(--text-dim);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    transition: color .2s;
}
.nav-back:hover { color: var(--accent); }

/* MAIN LAYOUT */
.page {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    padding-top: 64px;
}

/* SIDEBAR */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 2rem 0;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-label {
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--text-dimmer);
    letter-spacing: .15em;
    text-transform: uppercase;
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.module-list { list-style: none; }
.module-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1.5rem;
    cursor: pointer;
    transition: background .2s;
    border-left: 2px solid transparent;
    user-select: none;
}
.module-item:hover { background: var(--surface2); }
.module-item.active {
    background: rgba(0,229,160,.06);
    border-left-color: var(--accent);
}
.module-item-num {
    font-family: var(--mono);
    font-size: .6rem;
    color: var(--text-dimmer);
    padding-top: .15rem;
    flex-shrink: 0;
    min-width: 32px;
}
.module-item.active .module-item-num { color: var(--accent); }
.module-item-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-dim);
    line-height: 1.3;
}
.module-item.active .module-item-title { color: var(--text); }
.module-item-meta {
    font-family: var(--mono);
    font-size: .6rem;
    color: var(--text-dimmer);
    margin-top: .2rem;
}

/* CONTENT AREA */
.content {
    padding: 3rem 3.5rem;
    max-width: 860px;
}

/* BREADCRUMB */
.breadcrumb {
    font-family: var(--mono);
    font-size: .7rem;
    color: var(--text-dimmer);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.breadcrumb span { color: var(--text-dim); }

/* MODULE HEADER */
.module-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    animation: fadeUp .5s ease both;
}
.module-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--mono);
    font-size: .68rem;
    color: var(--accent);
    border: 1px solid rgba(0,229,160,.25);
    background: rgba(0,229,160,.06);
    padding: .3rem .75rem;
    border-radius: 99px;
    margin-bottom: 1rem;
}
.module-badge.blue {
    color: var(--accent2);
    border-color: rgba(79,140,255,.25);
    background: rgba(79,140,255,.06);
}
.module-badge.pink {
    color: var(--accent3);
    border-color: rgba(255,94,126,.25);
    background: rgba(255,94,126,.06);
}
.module-title-lg {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
    margin-bottom: .75rem;
}
.module-desc-lg {
    font-size: .95rem;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 600px;
}
.module-meta-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.meta-chip {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--text-dimmer);
}
.meta-chip svg { opacity: .5; }
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: 1rem;
}
.tag {
    font-family: var(--mono);
    font-size: .62rem;
    padding: .2rem .55rem;
    border-radius: 4px;
    background: var(--surface2);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

/* LESSON LIST */
.lessons-section {
    animation: fadeUp .5s .1s ease both;
}
.lessons-section-title {
    font-family: var(--mono);
    font-size: .7rem;
    color: var(--text-dimmer);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.lesson-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 2.5rem; }
.lesson-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color .2s, background .2s;
    cursor: pointer;
}
.lesson-card:hover {
    border-color: rgba(0,229,160,.25);
    background: rgba(0,229,160,.03);
}
.lesson-num {
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--text-dimmer);
    min-width: 28px;
}
.lesson-info { flex: 1; }
.lesson-name { font-size: .88rem; font-weight: 700; }
.lesson-sub { font-size: .78rem; color: var(--text-dim); margin-top: .2rem; }
.lesson-type {
    font-family: var(--mono);
    font-size: .6rem;
    padding: .15rem .45rem;
    border-radius: 3px;
    flex-shrink: 0;
}
.lesson-type.reading { background: rgba(79,140,255,.1); color: var(--accent2); border: 1px solid rgba(79,140,255,.2); }
.lesson-type.exercise { background: rgba(0,229,160,.1); color: var(--accent); border: 1px solid rgba(0,229,160,.2); }
.lesson-type.project { background: rgba(255,94,126,.1); color: var(--accent3); border: 1px solid rgba(255,94,126,.2); }

/* CODE SAMPLE */
.code-preview-block {
    margin-top: 2.5rem;
    animation: fadeUp .5s .2s ease both;
}
.code-preview-label {
    font-family: var(--mono);
    font-size: .7rem;
    color: var(--text-dimmer);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.code-window {
    background: #0d0f14;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.code-titlebar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #27c93f; }
.code-filename {
    margin-left: .5rem;
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--text-dimmer);
}
.code-body {
    padding: 1.5rem;
    font-family: var(--mono);
    font-size: .82rem;
    line-height: 1.9;
    overflow-x: auto;
}
.kw { color: #ff79c6; }
.fn { color: #50fa7b; }
.st { color: #f1fa8c; }
.cm { color: #6272a4; }
.nm { color: var(--accent2); }
.op { color: #ff79c6; }
.num { color: #bd93f9; }

/* CTA */
.start-cta {
    margin-top: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0,229,160,.07), rgba(79,140,255,.07));
    border: 1px solid rgba(0,229,160,.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    animation: fadeUp .5s .3s ease both;
}
.start-cta-text h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .3rem; }
.start-cta-text p { font-size: .85rem; color: var(--text-dim); }
.btn {
    font-family: var(--sans);
    font-weight: 700;
    font-size: .88rem;
    padding: .7rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 20px rgba(0,229,160,.25);
}
.btn-primary:hover { box-shadow: 0 0 32px rgba(0,229,160,.45); }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .page { grid-template-columns: 1fr; }
    .sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    }
    .content { padding: 2rem 1.25rem; }
    nav { padding: 1rem 1.25rem; }
}