@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&family=Lora:ital,wght@0,400;0,600;1,400&family=Playfair+Display:ital,wght@1,400&display=swap');

:root {
    --bg: #0a0c10;
    --surface: #111318;
    --surface2: #181c24;
    --border: #232836;
    --border2: #2e3448;
    --text: #e8eaf0;
    --text-muted: #7a839a;
    --text-dim: #4a5268;
    --accent: #4f8ef7;
    --accent2: #7c5cfc;
    --accent3: #f0a05a;
    --accent4: #3ecf8e;
    --accent5: #f06292;
    --accent6: #29b6f6;
    --tag-bg: #1a2035;
    --code-bg: #0d1117;
    --glow: rgba(79, 142, 247, 0.15);
    --shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sora', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
}

/* ─── LAYOUT ─── */
.layout {
    min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 0 0 40px;
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 2px;
}

.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 2;
}

.sidebar-brand .logo-text {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.9;
}
.sidebar-brand .sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

.nav-section {
    padding: 8px 12px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
}
.nav-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--accent);
}
.nav-item.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(79, 142, 247, 0.07);
}
.nav-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
}
.nav-number {
    margin-left: auto;
    font-size: 10px;
    background: var(--tag-bg);
    color: var(--text-dim);
    padding: 1px 6px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
}

/* ─── MAIN CONTENT ─── */
.main {
    margin-left: 280px;
    padding: 60px 72px 100px;
}

/* ─── HERO ─── */
.hero {
    padding: 60px 0 50px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 64px;
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: -72px;
    right: -72px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
    opacity: 0.4;
}

.hero-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hero-eyebrow::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: var(--accent);
}

.hero h1 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #a0b4d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.hero-desc {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 560px;
    line-height: 1.8;
}

.hero-meta {
    display: flex;
    gap: 24px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.hero-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.hero-stat strong {
    color: var(--text);
}

.learning-path {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    margin-top: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
}
.path-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}
.path-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.path-arrow {
    color: var(--text-dim);
    font-size: 12px;
    margin: 0 8px;
}

/* ─── SECTIONS ─── */
.section {
    margin-bottom: 80px;
    scroll-margin-top: 32px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.section-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}
.section-num {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
    font-weight: 500;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}
.section h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.2;
}
.section-tagline {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── SUBSECTIONS ─── */
h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 32px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
h3::before {
    content: '';
    display: block;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: var(--accent);
    flex-shrink: 0;
}

h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 24px 0 10px;
}

p {
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.8;
}

/* ─── CARDS ─── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    transition:
        border-color 0.2s,
        transform 0.15s;
}
.card:hover {
    border-color: var(--border2);
    transform: translateY(-1px);
}
.card-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.card-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ─── CODE BLOCKS ─── */
pre,
code {
    font-family: 'JetBrains Mono', monospace;
}
pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.7;
    margin: 14px 0 20px;
    position: relative;
}
pre .comment {
    color: #6e7a8a;
}
pre .kw {
    color: #c792ea;
}
pre .str {
    color: #c3e88d;
}
pre .fn {
    color: #82aaff;
}
pre .num {
    color: #f78c6c;
}
pre .cmd {
    color: #89ddff;
}
pre .flag {
    color: var(--accent3);
}

code {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    color: var(--accent3);
}
pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.code-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.code-lang {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim);
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 6px;
}

/* ─── STEP LIST ─── */
.steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 16px 0;
}
.step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 1px;
}
.step-content {
    flex: 1;
}
.step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.step-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ─── TAGS ─── */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}
.tag {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    background: var(--tag-bg);
    border: 1px solid var(--border2);
    color: var(--text-muted);
}
.tag.blue {
    color: var(--accent);
    border-color: rgba(79, 142, 247, 0.3);
    background: rgba(79, 142, 247, 0.08);
}
.tag.purple {
    color: var(--accent2);
    border-color: rgba(124, 92, 252, 0.3);
    background: rgba(124, 92, 252, 0.08);
}
.tag.orange {
    color: var(--accent3);
    border-color: rgba(240, 160, 90, 0.3);
    background: rgba(240, 160, 90, 0.08);
}
.tag.green {
    color: var(--accent4);
    border-color: rgba(62, 207, 142, 0.3);
    background: rgba(62, 207, 142, 0.08);
}
.tag.pink {
    color: var(--accent5);
    border-color: rgba(240, 98, 146, 0.3);
    background: rgba(240, 98, 146, 0.08);
}
.tag.cyan {
    color: var(--accent6);
    border-color: rgba(41, 182, 246, 0.3);
    background: rgba(41, 182, 246, 0.08);
}

/* ─── ALERT BOXES ─── */
.alert {
    border-radius: 10px;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 13.5px;
    line-height: 1.7;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.alert-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}
.alert.info {
    background: rgba(79, 142, 247, 0.08);
    border: 1px solid rgba(79, 142, 247, 0.2);
    color: #9bb8f0;
}
.alert.warning {
    background: rgba(240, 160, 90, 0.08);
    border: 1px solid rgba(240, 160, 90, 0.2);
    color: #d4a573;
}
.alert.tip {
    background: rgba(62, 207, 142, 0.08);
    border: 1px solid rgba(62, 207, 142, 0.2);
    color: #7dc9a4;
}
.alert.danger {
    background: rgba(240, 98, 146, 0.08);
    border: 1px solid rgba(240, 98, 146, 0.2);
    color: #d4839c;
}

/* ─── TABLE ─── */
.table-wrap {
    overflow-x: auto;
    margin: 16px 0 24px;
    border-radius: 10px;
    border: 1px solid var(--border);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
th {
    background: var(--surface);
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}
td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    vertical-align: top;
}
tr:last-child td {
    border-bottom: none;
}
tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}
td strong {
    color: var(--text);
    font-weight: 600;
}
td code {
    font-size: 12px;
}

/* ─── DIVIDER ─── */
.divider {
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
    margin: 40px 0;
}

/* ─── CHECKLIST ─── */
.checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}
.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
}
.checklist li::before {
    content: '○';
    color: var(--border2);
    flex-shrink: 0;
    font-size: 13px;
    margin-top: 2px;
}
.checklist li.done::before {
    content: '●';
    color: var(--accent4);
}

/* ─── QUOTE ─── */
blockquote {
    border-left: 3px solid var(--accent2);
    padding: 2px 0 2px 18px;
    margin: 16px 0;
    font-style: italic;
    color: var(--text-muted);
    font-family: 'Lora', serif;
    font-size: 15px;
}

/* ─── INLINE BADGE ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.badge.must {
    background: rgba(240, 98, 146, 0.15);
    color: var(--accent5);
}
.badge.rec {
    background: rgba(62, 207, 142, 0.15);
    color: var(--accent4);
}
.badge.opt {
    background: rgba(79, 142, 247, 0.12);
    color: var(--accent);
}

/* ─── TOC Progress bar ─── */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 200;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    width: 0%;
    transition: width 0.1s;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .main {
        margin-left: 0;
        padding: 32px 24px 80px;
    }
    .hero h1 {
        font-size: 28px;
    }
}
