:root {
    --bg: #0b1020;
    --panel: #1d253e;
    --panel-2: #0b1226;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --brand: #a681f6;
    --accent: #22d3ee;
    --ok: #34d399;
    --warn: #f59e0b;
    --danger: #ef4444;
    --ring: rgba(139, 92, 246, .3);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --radius: 16px;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji';
    color: var(--text);
    background: radial-gradient(1200px 600px at 10% -10%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, rgba(139, 92, 246, 0.12), transparent 60%),
    linear-gradient(180deg, #0b1020 0%, #0b1020 100%);
}

a {
    color: var(--accent);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

.container {
    display: grid;
    grid-template-columns:280px 1fr;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

@media (max-width: 960px) {
    .container {
        grid-template-columns:1fr
    }

    .toc {
        position: static
    }
}

header.hero {
    grid-column: 1 / -1;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: visible;
    z-index: 5;
}

header.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 12px;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.25), transparent);
    pointer-events: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(34, 211, 238, .12);
    color: var(--accent);
    border: 1px solid rgba(34, 211, 238, .3);
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .3px;
    text-transform: uppercase
}

.hero h1 {
    margin: 14px 0 8px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.1
}

.hero p {
    color: var(--muted);
    max-width: 70ch;
    margin: 0
}

.cta-row {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #7c3aed, #5b21b6);
    color: #fff;
    font-weight: 700
}

.btn.secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, .12);
    color: var(--text)
}

.btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, .3);
    transition: all .15s ease;
}

.toc {
    position: sticky;
    top: 20px;
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius);
    padding: 18px 16px;
    box-shadow: var(--shadow);
    height: max-content;
}

.aside.toc, aside.toc {
    position: sticky;
    top: 20px;
    z-index: 100; /* lift above .panel cards */
    align-self: start; /* prevent grid stretch interfering with sticky */
}

.toc h3 {
    margin: 6px 0 10px;
    font-size: 14px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .12em
}

.toc a {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text)
}

.toc a.current {
    background: rgba(139, 92, 246, .16);
    outline: 1px solid var(--ring)
}

main.article {
    display: flex;
    flex-direction: column;
    gap: 18px
}

section.panel {
    position: relative;
    border-radius: var(--radius);
    padding: 26px 30px;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .55), 0 0 0 1px rgba(139, 92, 246, .15);
    transition: transform .15s ease, box-shadow .2s ease;
}

section.panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .6), 0 0 0 1px rgba(139, 92, 246, .25)
}

    section.panel::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        pointer-events: none;
        background: radial-gradient(circle at top left, rgb(251 250 255 / 8%), transparent 40%), radial-gradient(circle at bottom right, rgb(255 255 255 / 8%), transparent 40%);
    }

section.panel:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(139, 92, 246, .25);
    transition: transform .12s ease, box-shadow .15s ease
}

section.panel h2 {
    color: #e5e7ff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .45)
}

section.panel h2::after {
    content: "";
    display: block;
    width: 64px;
    height: 2px;
    margin-top: 10px;
    background: linear-gradient(90deg, #8b5cf6, #22d3ee);
    border-radius: 2px;
    opacity: .75
}

aside.toc {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, 0.05)
}

h2 {
    margin: .2rem 0 .5rem;
    font-size: clamp(20px, 3.2vw, 28px)
}

h3 {
    margin: 1.2rem 0 .5rem;
    font-size: clamp(18px, 2.6vw, 22px)
}

p {
    margin: .4rem 0 1rem
}

ul {
    margin: .2rem 0 1rem 1.1rem
}

li {
    margin: .4rem 0
}

.callout {
    position: relative;
    background: linear-gradient(180deg, rgba(139, 92, 246, .15), rgba(34, 211, 238, .08));
    border-left: 5px solid var(--brand);
    border-radius: 10px;
    padding: 16px 18px;
    color: #e8eaff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2), 0 0 12px rgba(34, 211, 238, 0.1);
    transition: transform .15s ease, box-shadow .2s ease;
}

.callout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3), 0 0 16px rgba(34, 211, 238, 0.25)
}

.callout strong {
    color: #fff;
    text-shadow: 0 0 6px rgba(139, 92, 246, 0.4)
}

.footer {
    grid-column: 2;
    text-align: center;
    opacity: .8;
    margin-top: 28px;
    color: var(--muted);
    justify-self: stretch;
}

/* Single-column layout on narrow screens */
@media (max-width: 960px) {
    .footer {
        grid-column: 1;
    }
}

.anchor {
    opacity: 0;
    margin-left: .4rem;
    font-size: .9rem;
    transition: opacity .2s
}

h2:hover .anchor, h3:hover .anchor {
    opacity: .6
}

code.inline {
    background: rgba(148, 163, 184, .15);
    padding: .2rem .4rem;
    border-radius: 6px
}

.hero-image {
    text-align: center;
    margin-bottom: 1rem
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow)
}

.svg-banner {
    grid-column: 1 / -1;
    text-align: center
}

.svg-banner img, .svg-banner svg {
    width: 160px;
    height: auto;
    display: inline-block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2))
}

/* Remove all page background gradients/patterns */
html, body {
    background: var(--panel-2) !important; /* pick a flat color that fits your theme */
    background-image: none !important;
}

.cta-panel {
    display: grid;
    place-items: center;
    min-height: 40px;
    text-align: center;
}
.cta-panel .btn { margin-top: 0; }

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f8fafc;
        --panel: #ffffff;
        --panel-2: #f1f5f9;
        --text: #0f172a;
        --muted: #475569;
        --ring: rgba(99, 102, 241, .25);
    }

    body {
        background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    }

    section.panel h2 {
        color: #1f2937; /* slate-800 */
    }

    .callout {
        background: linear-gradient(180deg, rgb(78 0 255 / 15%), rgb(2 0 255 / 8%));
        color: #2b2f5b;
    }

    .badge {
        background: rgb(88 66 129);
        color: #0edfd4;
    }

    .callout strong {
        color: #000000;
    }

    html, body {
        background: var(--panel-2) !important;
        background-image: none !important;
    }

    section.panel::before {
        background: radial-gradient(circle at top left, rgba(139, 92, 246, .08), transparent 60%), radial-gradient(circle at bottom right, rgba(139, 92, 246, .08), transparent 20%);
    }

    header.hero::after {
        background: none;
    }

    .btn.secondary {
        border-color: rgba(255, 255, 255, .12);
        background: linear-gradient(180deg, #4d2f7e, #6e5d89);
        color: #fff;
    }
}