:root {
    --canvas: #f7f7f4;
    --canvas-soft: #fafaf7;
    --card: #ffffff;
    --surface-strong: #e6e5e0;
    --hairline: #e6e5e0;
    --hairline-strong: #cfcdc4;
    --ink: #26251e;
    --body: #5a5852;
    --muted: #807d72;
    --primary: #f54e00;
    --thinking: #dfa88f;
    --grep: #9fc9a2;
    --read: #9fbbe0;
    --edit: #c0a8dd;
    --done: #c08532;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -80px;
    z-index: 10;
    background: var(--ink);
    color: var(--canvas);
    padding: 10px 14px;
    border-radius: 8px;
}

.skip-link:focus {
    top: 16px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(247, 247, 244, 0.96);
    border-bottom: 1px solid var(--hairline);
    backdrop-filter: blur(16px);
}

.topbar,
.site-nav,
.hero,
.doc-shell,
.practice-band,
.article-layout,
.site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
}

.nav-toggle {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    border: 1px solid var(--hairline-strong);
    border-radius: 8px;
    background: var(--card);
    color: var(--ink);
    padding: 0 14px;
    font: inherit;
}

.site-nav {
    display: none;
    padding: 0 0 16px;
    gap: 8px;
    flex-wrap: wrap;
}

.site-nav.open {
    display: flex;
}

.site-nav a {
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: var(--card);
    padding: 8px 12px;
    color: var(--body);
    text-decoration: none;
    font-size: 14px;
}

.site-nav a.active {
    background: var(--ink);
    color: var(--canvas);
}

.hero {
    display: grid;
    gap: 32px;
    padding: 56px 0 40px;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 920px;
    margin-bottom: 20px;
    font-size: clamp(36px, 7vw, 72px);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

h2 {
    margin-bottom: 14px;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.hero p,
.article-header p,
section > p {
    color: var(--body);
}

.hero-image,
.split-header figure {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background: var(--card);
}

.hero-image img,
.split-header img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

figcaption {
    padding: 10px 14px;
    color: var(--muted);
    font-size: 13px;
}

.doc-shell {
    display: grid;
    gap: 24px;
    padding: 40px 0 80px;
}

.toc-card,
.module-card,
.related-card,
.note-list article,
.article-layout section,
.page-toc {
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--card);
}

.toc-card {
    align-self: start;
    padding: 24px;
}

.toc-card nav,
.page-toc {
    display: grid;
    gap: 8px;
}

.toc-card a,
.page-toc a {
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--canvas-soft);
    color: var(--body);
    text-decoration: none;
}

.doc-grid {
    display: grid;
    gap: 16px;
}

.module-card {
    padding: 24px;
}

.module-card span,
.related-card span {
    display: inline-flex;
    margin-bottom: 16px;
    border-radius: 999px;
    background: var(--surface-strong);
    padding: 5px 10px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.module-card p,
.related-card small {
    color: var(--body);
}

.module-card a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.practice-band {
    display: grid;
    gap: 24px;
    border-top: 1px solid var(--hairline);
    padding: 64px 0 80px;
}

.note-list {
    display: grid;
    gap: 14px;
}

.note-list article {
    padding: 20px;
}

.article-layout {
    padding: 32px 0 80px;
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 32px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}

.article-header {
    margin-bottom: 24px;
}

.split-header {
    display: grid;
    gap: 24px;
}

.page-toc {
    margin: 24px 0;
    padding: 12px;
}

.article-layout section {
    margin: 16px 0;
    padding: 24px;
}

.article-layout ul {
    padding-left: 20px;
}

details {
    margin-top: 16px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--canvas-soft);
    padding: 14px 16px;
}

summary {
    cursor: pointer;
    font-weight: 700;
}

summary + p {
    margin-top: 12px;
}

.related-block {
    margin-top: 32px;
}

.related-grid {
    display: grid;
    gap: 14px;
}

.related-card {
    display: grid;
    padding: 20px;
    text-decoration: none;
}

.related-card strong {
    margin-bottom: 8px;
}

.site-footer {
    border-top: 1px solid var(--hairline);
    padding: 48px 0;
}

.footer-grid {
    display: grid;
    gap: 24px;
}

.site-footer h2 {
    font-size: 22px;
}

.site-footer p,
.site-footer a {
    color: var(--body);
}

.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 760px) {
    .nav-toggle {
        display: none;
    }

    .site-nav {
        display: flex;
        padding-bottom: 18px;
    }

    .hero,
    .practice-band,
    .split-header,
    .footer-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }

    .doc-shell {
        grid-template-columns: 300px 1fr;
    }

    .doc-grid,
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1040px) {
    .doc-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
