:root {
    --bg: #0b1220;
    --bg-soft: #111a2a;
    --surface: rgba(18, 28, 44, 0.82);
    --surface-strong: #121d2d;
    --surface-light: #f7f9fc;
    --text: #eff4fb;
    --muted: #aebad0;
    --line: rgba(255, 255, 255, 0.08);
    --primary: #66a6ff;
    --primary-strong: #2b78e4;
    --accent: #67dfcb;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max-width: 1320px;
    --font: "Segoe UI", Inter, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(102, 166, 255, 0.18), transparent 30%),
        radial-gradient(circle at bottom left, rgba(103, 223, 203, 0.12), transparent 32%),
        linear-gradient(180deg, #0a1220 0%, #0f1827 100%);
}

.layout {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    padding: 24px;
}

.sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    background: rgba(15, 24, 39, 0.86);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 22px 18px;
    backdrop-filter: blur(18px);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.brand-badge {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #08111e;
    font-size: 1.45rem;
    font-weight: 800;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    padding: 6px;
}

.brand-block h1,
.topbar-copy h2,
.hero-copy h3,
.doc-section h3 {
    margin: 0;
}

.brand-block p,
.hero-copy p,
.info-card p,
.doc-section p,
.doc-section li,
.topbar-copy .eyebrow {
    color: var(--muted);
}

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

.sidebar-nav a {
    color: var(--text);
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(102, 166, 255, 0.14);
    transform: translateX(2px);
}

.content {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.topbar,
.hero,
.doc-section {
    background: rgba(15, 24, 39, 0.78);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    font-weight: 700;
}

.topbar-link,
.callout code,
.doc-section code {
    color: #cfe4ff;
}

.topbar-link {
    text-decoration: none;
    font-weight: 600;
}

.menu-button {
    display: none;
    border: 0;
    border-radius: 12px;
    background: rgba(102, 166, 255, 0.14);
    color: var(--text);
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.hero {
    display: block;
    padding: 28px;
}

.hero-card,
.info-card,
.callout,
pre,
.checklist {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.hero-card,
.info-card,
.callout,
.checklist {
    padding: 18px;
}

.hero-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    padding: 10px;
    margin-bottom: 8px;
}

.hero-card h4,
.info-card h4 {
    margin-top: 0;
    margin-bottom: 12px;
}

.doc-section {
    padding: 28px;
}

.doc-section h3 {
    margin-bottom: 14px;
}

.section-figure {
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.section-figure img {
    display: block;
    width: 100%;
    min-height: 220px;
    max-height: 320px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(102, 166, 255, 0.12), rgba(103, 223, 203, 0.08));
    cursor: zoom-in;
}

.section-figure.compact img {
    min-height: 0;
    max-height: 420px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.02);
}

.image-panel {
    margin: 16px 0 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.image-panel summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 700;
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
}

.image-panel summary::-webkit-details-marker {
    display: none;
}

.image-panel summary::after {
    content: "+";
    float: right;
    color: var(--primary);
    font-size: 1.1rem;
    line-height: 1;
}

.image-panel[open] summary::after {
    content: "−";
}

.image-panel .section-figure {
    margin: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.number-list {
    padding-left: 20px;
}

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

.image-grid .section-figure {
    margin: 0;
}

.image-grid figcaption {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 14px;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(122, 162, 255, 0.16);
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 800;
    border: 1px solid rgba(122, 162, 255, 0.28);
}

pre {
    margin: 14px 0;
    padding: 16px 18px;
    overflow-x: auto;
}

code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.95em;
}

.callout {
    margin-top: 16px;
}

.checklist {
    display: grid;
    gap: 12px;
}

.checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.checklist input {
    accent-color: var(--primary);
}

.lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 8, 14, 0.82);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 60;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-dialog {
    max-width: min(1200px, calc(100vw - 48px));
    max-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 80px);
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: #0d1624;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 24, 39, 0.92);
    color: var(--text);
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 1080px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 16px;
        top: 16px;
        bottom: 16px;
        width: min(320px, calc(100vw - 32px));
        z-index: 20;
        transform: translateX(-115%);
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-button {
        display: inline-flex;
    }
}

@media (max-width: 820px) {
    .hero,
    .grid.two,
    .grid.three {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .layout {
        padding: 14px;
    }

    .topbar,
    .hero,
    .doc-section {
        padding: 20px;
        border-radius: 22px;
    }

    .lightbox {
        padding: 18px;
    }

    .lightbox-close {
        top: 14px;
        right: 14px;
        padding: 9px 14px;
    }
}
