:root {
    --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
    color-scheme: light dark;
    --background: #f5f2eb;
    --surface: #fbf8f1;
    --surface-muted: #eae8df;
    --text: #292c2e;
    --text-muted: #62645f;
    --line: #d2d2c7;
    --accent: #a4421e;
    --accent-strong: #913819;
    --dark: #08101a;
    --dark-muted: #a8b6c4;
    --shadow: none;
    --content-width: 1120px;
    --chrome-background: #e9e7df;
    --chrome-text: #263b45;
    --chrome-muted: #56645f;
    --chrome-line: #d2d2c7;
}

* {
    box-sizing: border-box;
}

:focus-visible {
    outline: 3px solid var(--accent-strong);
    outline-offset: 4px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
    outline-color: #9a4125;
}

.hero :focus-visible {
    outline-color: white;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 1rem;
    z-index: 1100;
    padding: 0.75rem 1rem;
    background: var(--surface);
    color: var(--text);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: translateY(0);
}

#main-content,
[id] {
    scroll-margin-top: 100px;
}

.primary-nav,
.site-footer nav,
.card-meta,
.article-meta {
    flex-wrap: wrap;
}

.primary-nav a,
.site-footer nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.primary-nav a.active {
    color: #9a4125;
    text-decoration: underline;
    text-underline-offset: 0.4em;
    text-decoration-thickness: 2px;
}

.article-body a {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.content-card,
.section-header > *,
.article-meta > *,
.site-footer > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

.article-body img {
    max-width: 100%;
    height: auto;
}

.article-body pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 1rem;
    background: var(--surface-muted);
}

.article-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

#blazor-error-ui .dismiss {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font: inherit;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--text);
    font-weight: 720;
    letter-spacing: 0;
    line-height: 1.05;
}

h1 {
    max-width: 840px;
    font-size: 4.5rem;
    overflow-wrap: anywhere;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.32rem;
}

p {
    margin: 0;
    color: var(--text-muted);
}

.site-frame {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.site-header {
    position: relative;
    flex: 0 0 auto;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 76px;
    padding: 0 5vw;
    background: var(--chrome-background);
    color: var(--chrome-text);
    border-bottom: 1px solid var(--chrome-line);
    backdrop-filter: blur(18px);
}

#main-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.brand,
.primary-nav,
.site-footer nav {
    display: flex;
    align-items: center;
}

.brand {
    gap: 0.7rem;
    color: var(--chrome-text);
    font-weight: 700;
    white-space: nowrap;
}

.brand-mark {
    display: block;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.primary-nav,
.site-footer nav {
    gap: 1.1rem;
    color: var(--chrome-muted);
    font-size: 0.95rem;
}

.hero {
    position: relative;
    display: grid;
    align-items: end;
    min-height: min(780px, calc(100svh - 120px));
    padding: 12vh 5vw 10vh;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(5, 10, 17, 0.96), rgba(5, 10, 17, 0.78) 43%, rgba(5, 10, 17, 0.18)), url("/images/no-heroes.png") center / cover no-repeat;
}

.hero::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 28%;
    content: "";
    background: linear-gradient(180deg, transparent, rgba(5, 10, 17, 0.72));
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--content-width);
}

.hero h1,
.hero .eyebrow {
    color: white;
}

.hero-copy {
    max-width: 720px;
    margin-top: 1.6rem;
    color: #d7e0ea;
    font-size: 1.25rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2.1rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 700;
}

.button.primary {
    background: var(--accent);
    color: white;
}

.button.secondary {
    border-color: rgba(255, 255, 255, 0.34);
    color: white;
}

.section {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 5.5rem 5vw;
}

.intro-band,
.split-band {
    max-width: none;
    padding-right: max(5vw, calc((100vw - var(--content-width)) / 2 + 5vw));
    padding-left: max(5vw, calc((100vw - var(--content-width)) / 2 + 5vw));
}

.intro-band {
    background: var(--surface);
}

.split-band {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
    gap: 3rem;
    background: var(--surface-muted);
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
    gap: 3rem;
    align-items: start;
    max-width: var(--content-width);
    margin: 0 auto;
}

.section-grid > p,
.split-band > div > p {
    font-size: 1.16rem;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.section-header p {
    max-width: 620px;
    margin-top: 0.8rem;
}

.eyebrow {
    margin-bottom: 0.7rem;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.text-link {
    color: var(--accent-strong);
    font-weight: 700;
    white-space: nowrap;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.content-card {
    display: flex;
    flex-direction: column;
    min-height: 270px;
    padding: 1.35rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.content-card h2,
.content-card h3 {
    margin-top: 1rem;
    font-size: 1.32rem;
    line-height: 1.3;
}

.content-card p {
    margin-top: 0.8rem;
}

.card-submeta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.card-submeta a,
.article-meta a {
    color: var(--accent-strong);
}

.card-meta,
.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-left: 0.45rem;
    padding: 0.08rem 0.45rem;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 999px;
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.draft-notice {
    display: inline-flex;
    margin-bottom: 1rem;
    padding: 0.55rem 0.75rem;
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
    border-radius: 6px;
    color: var(--accent-strong);
    font-size: 0.94rem;
    font-weight: 700;
}

.tag-row,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.tag-row {
    margin-top: auto;
    padding-top: 1.2rem;
}

.tag-row a,
.tag-row span,
.tag-cloud a,
.series-row a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.25rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: 999px;
    color: var(--accent-strong);
    font-size: 0.86rem;
    font-weight: 700;
}

.section-note {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
    border-radius: 8px;
}

.section-note strong {
    color: var(--text);
}

.section-note span,
.section-note a {
    color: var(--text-muted);
}

.section-note a {
    font-weight: 800;
}

.series-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1.5rem;
}

.series-row.expanded {
    margin-bottom: 0;
}

.featured-card {
    display: grid;
    gap: 1rem;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.featured-card h2 {
    max-width: 820px;
}

.featured-card p:not(.eyebrow) {
    max-width: 720px;
    font-size: 1.1rem;
}

.stack-list {
    display: grid;
    gap: 0.8rem;
}

.stack-list > div {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stack-list h3 {
    color: var(--text);
    font-weight: 800;
}

.stack-list p {
    margin-top: 0.25rem;
}

.link-list {
    display: grid;
    gap: 0.8rem;
}

.link-list a {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.link-list span {
    color: var(--text);
    font-weight: 800;
}

.link-list small {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.page-hero {
    padding-top: 7rem;
    padding-bottom: 2.5rem;
}

.page-hero h1 {
    font-size: 3.5rem;
}

.page-hero p:not(.eyebrow) {
    max-width: 740px;
    margin-top: 1rem;
    font-size: 1.16rem;
}

.article-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 7rem 5vw 6rem;
}

.article-header {
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--line);
}

.article-header h1 {
    font-size: 3.5rem;
}

.article-header > p:not(.eyebrow) {
    margin-top: 1rem;
    font-size: 1.16rem;
}

.article-meta {
    justify-content: start;
    margin-top: 1.35rem;
}

.article-body {
    max-width: 760px;
    margin: 2.5rem auto 0;
}

.article-body.standalone {
    margin-top: 0;
}

.about-page .article-body {
    max-width: 740px;
    margin: 2rem 0 0;
}

.article-body p,
.article-body li {
    color: var(--text);
    font-size: 1.08rem;
}

.article-body p + p,
.article-body p + h2,
.article-body ul + h2 {
    margin-top: 1.25rem;
}

.article-body h2 {
    margin-top: 2.2rem;
    font-size: 2rem;
}

.article-body :is(h1, h2, h3, h4, h5, h6) {
    margin-bottom: 1rem;
}

.article-body a {
    color: var(--accent-strong);
    font-weight: 700;
}

.article-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 3rem;
}

.article-nav a {
    display: grid;
    gap: 0.35rem;
    min-height: 96px;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.article-nav small {
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-nav span {
    color: var(--text);
    font-weight: 800;
}

.related-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--line);
}

.card-grid.compact .content-card {
    min-height: 220px;
}

.narrow-page {
    max-width: 760px;
    padding-top: 7rem;
}

.narrow-page p {
    margin-top: 1rem;
}

.narrow-page .button {
    margin-top: 1.5rem;
}

.site-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem 5vw;
    background: var(--chrome-background);
    color: var(--chrome-text);
    border-top: 1px solid var(--chrome-line);
}

.site-footer p {
    max-width: 680px;
    color: var(--chrome-muted);
}

.site-footer a {
    color: var(--chrome-text);
}

.site-header a:hover,
.site-footer a:hover {
    color: #9a4125;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
    padding: 0.8rem 1rem;
    background: #8a1f2d;
    color: white;
    border-radius: 6px;
}

#blazor-error-ui .dismiss {
    margin-left: 1rem;
    cursor: pointer;
}

h1:focus {
    outline: none;
}

@media (prefers-color-scheme: dark) {
    :root {
    --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
        --background: #f5f2eb;
        --surface: #fbf8f1;
        --surface-muted: #eae8df;
        --text: #292c2e;
        --text-muted: #62645f;
        --line: #d2d2c7;
        --accent: #a4421e;
        --accent-strong: #913819;
        --shadow: none;
    }

    .button.primary {
        color: #06111f;
    }
}

@media (max-width: 860px) {
    .site-header {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .primary-nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.1rem;
    }

    .hero {
        min-height: 560px;
        padding-top: 7rem;
    }

    .section,
    .intro-band,
    .split-band {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .section-grid,
    .split-band,
    .section-header {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: start;
        gap: 1.5rem;
    }

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

    .article-nav {
        grid-template-columns: 1fr;
    }

    .content-card {
        min-height: auto;
    }

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

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

    .page-hero h1,
    .article-header h1 {
        font-size: 2.4rem;
    }

    h2 {
        font-size: 2rem;
    }
    h1 {
        font-size: 2.65rem;
    }

    .brand {
        white-space: normal;
    }

    .hero {
        min-height: 480px;
        background-position: 58% center;
    }

    .button {
        width: 100%;
    }

    .article-page,
    .page-hero,
    .narrow-page {
        padding-top: 4.5rem;
    }
}

@media (min-width: 1920px) {
    :root {
    --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
        font-size: 20px;
        --content-width: 1440px;
    }

    .site-header {
        padding-inline: max(5vw, calc((100vw - 1600px) / 2));
    }

    .hero {
        padding-inline: max(5vw, calc((100vw - 1440px) / 2));
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

.brand, code, pre, kbd, samp, .eyebrow, .card-meta, .article-meta { font-family: var(--font-mono); }

/* The landing page scrolls as a document; other pages retain their reading layout. */
body:has(.landing-splash) .site-frame { height: auto; min-height: 100dvh; overflow: visible; }
body:has(.landing-splash) #main-content { overflow: visible; flex: none; }
body:has(.landing-splash) .site-header { position: fixed; inset: 0 0 auto; }
body:has(.landing-splash) .site-footer { position: static; }
html.splash-enabled body:has(.landing-splash) .site-header { transform: translateY(-100%); opacity: 0; visibility: hidden; transition: transform 240ms ease, opacity 240ms ease, visibility 240ms; }
html.splash-enabled.splash-reading body:has(.landing-splash) .site-header,
html.splash-enabled body:has(.landing-splash) .site-header:focus-within { transform: none; opacity: 1; visibility: visible; }
body:has(.landing-splash) .skip-link { z-index: 1200; }
body:has(.landing-splash) #notebook { scroll-margin-top: 76px; }
@media (prefers-reduced-motion: reduce) {
    html.splash-enabled body:has(.landing-splash) .site-header { transition: none; }
}

/* Compact navigation and footer. Native details keeps the menu usable without JavaScript. */
.site-header { justify-content: flex-start; gap: 18px; }
.nav-menu { position: relative; flex: 0 0 44px; }
.nav-menu > summary { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; list-style: none; border: 1px solid transparent; border-radius: 4px; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary:hover, .nav-menu[open] > summary { background: #deded4; border-color: var(--chrome-line); }
.hamburger-icon { display: grid; gap: 5px; width: 21px; }
.hamburger-icon > span { display: block; height: 2px; width: 21px; background: var(--chrome-text); }
.navigation-drawer { position: absolute; top: calc(100% + 12px); left: 0; width: min(285px, 85vw); padding: 20px; background: var(--chrome-background); color: var(--chrome-text); border: 1px solid var(--chrome-line); border-radius: 5px; box-shadow: 0 12px 30px #172b3a18; }
.drawer-label { font-family: var(--font-mono); font-size: .65rem; letter-spacing: .05em; text-transform: uppercase; color: var(--chrome-muted); margin-bottom: 12px; }
.navigation-drawer .primary-nav { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: visible; font-size: .9rem; }
.navigation-drawer .primary-nav a { padding: 9px 10px; border-radius: 3px; }
.navigation-drawer .primary-nav a:hover { background: #deded4; }
.site-footer { display: grid; grid-template-columns: minmax(0, 1fr); padding: .75rem 5vw; gap: 0; }
.site-footer p { font-size: .75rem; }
.footer-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1.25rem; flex-wrap: wrap; }
.site-footer .footer-copyright { max-width: none; width: 100%; margin-top: 12px; margin-bottom: 4px; text-align: center; }
.site-footer .footer-tagline { color: var(--accent); font-weight: 550; }
.footer-disclaimer-link { margin-left: .5rem; text-decoration: underline; text-underline-offset: .2em; }
.about-disclaimer { scroll-margin-top: 2rem; }
.site-footer nav { gap: .85rem; font-size: .78rem; }
@media (max-width: 600px) {
    .footer-top { justify-content: center; text-align: center; }
}
@media (max-width: 860px) {
    .site-header { flex-direction: row; align-items: center; padding-top: .6rem; padding-bottom: .6rem; }
    .site-footer { flex-direction: row; align-items: center; }
}
@media (max-width: 420px) {
    .site-header { gap: 9px; }
    .brand { font-size: .8rem; gap: .45rem; }
    .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
}

/* Editorial reading surfaces match the notebook across system theme preferences. */
.page-hero { padding-top: 3.25rem; padding-bottom: 2.25rem; }
.page-hero h1, .article-header h1, .narrow-page h1 { font-size: clamp(2.25rem, 5vw, 3.8rem); font-weight: 550; letter-spacing: -.04em; line-height: 1.1; }
.article-header h1, .article-body :is(h1, h2, h3, h4, h5, h6) { font-family: var(--font-sans); font-weight: 550; letter-spacing: -.04em; line-height: 1.1; }
.article-body.standalone { padding-top: 1rem; }
.content-card { border-radius: 2px; box-shadow: none; }
.button.primary { color: #fff; }

/* A compact rail anchors navigation without interrupting the reading column. */
:root { --nav-gutter: 80px; }
.site-header,
body:has(.landing-splash) .site-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--nav-gutter);
    height: 100dvh;
    min-height: 0;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border-bottom: 0;
    border-right: 1px solid var(--chrome-line);
    backdrop-filter: none;
}
.site-header .brand-mark { width: 48px; height: 48px; flex-basis: 48px; }
.nav-menu { position: static; flex: 0 0 auto; }
.navigation-drawer {
    position: fixed;
    inset: 0 auto 0 var(--nav-gutter);
    width: min(290px, calc(100vw - var(--nav-gutter)));
    padding: 32px 20px;
    overflow-y: auto;
    border: 0;
    border-right: 1px solid var(--chrome-line);
    border-radius: 0;
    box-shadow: 12px 0 30px #292c2e14;
}
.navigation-drawer .primary-nav a { padding: 14px 10px; }
#main-content, .site-footer { margin-left: var(--nav-gutter); }
body:has(.landing-splash) #main-content { margin-left: 0; }
body:has(.landing-splash) #notebook { margin-left: var(--nav-gutter); scroll-margin-top: 0; }
@media (max-width: 600px) {
    :root { --nav-gutter: 64px; }
    .site-header, body:has(.landing-splash) .site-header { padding-top: 16px; }
    .site-header .brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
}
.navigation-drawer .primary-nav a { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; border-left: 2px solid transparent; }
.navigation-drawer .primary-nav small { font-size: .75rem; font-weight: 400; color: var(--chrome-muted); }
.navigation-drawer .primary-nav a.active { background: #deded4; border-left-color: var(--accent-strong); color: var(--chrome-text); }
@media (max-width: 600px) {
    .site-header, body:has(.landing-splash) .site-header { height: 128px; border-bottom: 1px solid var(--chrome-line); }
    #main-content { margin-left: 0; padding-top: 144px; }
    .site-footer { margin-left: 0; }
    body:has(.landing-splash) #main-content { padding-top: 0; }
    body:has(.landing-splash) #notebook { margin-left: 0; padding-top: 144px; }
}
