/* deeppde.org — lightweight static reconstruction of the original resource site */

html {
    scroll-behavior: smooth;
}

:root {
    --font-size: 17px;
    --spacing: 0.75rem;
    --topbar-background: #ffffff;
    --topbar-border: #e4e8ec;
    --topbar-h: 60px;
    /* #5 preview: darker overlay so white hero text pops on bright nebula regions */
    --hero-overlay: linear-gradient(180deg, rgba(8, 11, 20, 0.5) 0%, rgba(8, 11, 20, 0.72) 100%);
    --subnav-background: #f7f9fb;
    --toc-shadow: 0 6px 10px -6px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .section-nav {
    --subnav-background: #14181f;
    /* a light-edged shadow reads on dark backgrounds where black shadow can't */
    --toc-shadow: 0 5px 10px -4px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] {
    --topbar-background: #11141a;
    --topbar-border: #2a2f38;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--font-size);
    margin: 0;
}

/* ---- Top bar ---- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: var(--topbar-background);
    border-bottom: 1px solid var(--topbar-border);
    backdrop-filter: saturate(180%) blur(6px);
}

.topbar-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0.03rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--color);
    line-height: 1.02;
}

.brand img {
    width: 22px;
    height: 22px;
}

.brand .brand-title {
    font-size: 1.0rem;
    font-weight: 700;
    line-height: 1.05;
}

.brand .brand-tagline {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-color);
}

.topbar nav {
    margin-left: auto;
}

.topbar nav ul {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Pico adds large padding to nav li and margin/padding to buttons — reset it */
.topbar nav li {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.topbar nav button {
    margin: 0;
    height: auto;
}

.topbar nav a {
    text-decoration: none;
    font-weight: 500;
}

.topbar nav a.active {
    color: var(--color);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

.theme-switch {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--muted-color);
    font-size: 1.1rem;
    padding: 0;
    line-height: 1;
    width: auto;
}

.theme-switch:hover {
    color: var(--primary);
}

/* ---- Hero banner ---- */
.hero {
    position: relative;
    margin: 0; /* Pico gives <section> a bottom margin — kills the white gap above the TOC */
    height: 300px;
    background-image: var(--hero-overlay), url("assets/nebula.jpg");
    background-size: cover;
    background-position: center 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
}

.hero-content {
    max-width: 900px;
}

.hero h1 {
    color: #fff;
    margin: 0;
    font-size: 2.2rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

/* #5 preview: tagline under the hero title */
.hero-tagline {
    color: rgba(255, 255, 255, 0.92);
    margin: 0.6rem 0 0;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* ---- Section nav (in-page TOC) ---- */
.section-nav {
    display: block; /* override Pico's nav flex so the inner ul centers with the content column */
    margin: 0;
    position: sticky;
    /* -1px overlaps the topbar so no content peeks through a sub-pixel gap */
    top: calc(var(--topbar-h) - 1px);
    z-index: 10;
    background-color: var(--subnav-background);
    border-bottom: 1px solid var(--muted-border-color);
    /* clear separation from content scrolling underneath (theme-aware) */
    box-shadow: var(--toc-shadow);
}

.section-nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0.65rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.6rem;
    align-items: center;
    line-height: 1;
}

.section-nav .toc-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-color);
    margin-right: 0.5rem;
}

.section-nav a {
    display: inline-block;
    margin: 0;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--primary);
    background: var(--card-background-color);
    border: 1px solid var(--primary);
}

.section-nav a:hover {
    background: var(--primary);
    color: var(--primary-inverse);
    border-color: var(--primary);
}

/* ---- Content ---- */
.content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 1rem;
}

.content h2 {
    margin-top: 2.4rem;
    margin-bottom: 0.7rem;
    font-size: 1.35rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--muted-border-color);
    /* keep headings clear of the two sticky bars when jumped to */
    scroll-margin-top: calc(var(--topbar-h) + 3.2rem);
}

.content ul {
    padding-left: 1.2rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.intro {
    font-size: 1.02rem;
}

/* ---- Footer ---- */
footer.site-footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    font-size: 0.9rem;
    color: var(--muted-color);
    border-top: 1px solid var(--muted-border-color);
}

footer.site-footer a {
    color: inherit;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .topbar-inner {
        flex-wrap: wrap;
        padding: 0.6rem 1rem;
        gap: 0.6rem;
    }

    .topbar nav ul {
        gap: 1rem;
    }

    .hero {
        height: 220px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero-tagline {
        font-size: 0.8rem;
    }

    .content {
        padding: 1.5rem 1rem 1rem;
    }
}
