:root {
    --bg: #f6f1e7;
    --paper: #fffdf8;
    --ink: #1f2430;
    --muted: #5a6270;
    --line: #d7c8b1;
    --accent: #c0562b;
    --accent-soft: #f6e3d6;
    --accent-strong: #7e3418;
    --code-bg: #1f2430;
    --code-ink: #f6f1e7;
    --display: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    --shadow: 0 18px 48px rgba(63, 45, 28, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(192, 86, 43, 0.08), transparent 28%),
        linear-gradient(180deg, #f8f4eb 0%, #f0e8da 100%);
    color: var(--ink);
    font-family: var(--body);
    line-height: 1.7;
}

body.guide-page {
    background: #efe6d8;
}

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

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

.resource-shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px;
}

.resource-home {
    padding-bottom: 72px;
}

.resource-nav,
.resource-footer,
.resource-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.resource-nav,
.resource-footer {
    padding: 18px 0;
}

.resource-nav a,
.resource-footer a,
.resource-bar a {
    text-decoration: none;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
}

.wordmark-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--accent);
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.wordmark-icon::after {
    content: "";
    position: absolute;
    inset: 7px;
    background: #151a22;
    border-radius: 4px;
}

.wordmark strong {
    color: var(--accent);
}

.nav-links,
.footer-links,
.bar-actions,
.meta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.chip,
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--muted);
    font-size: 0.82rem;
}

.hero-card,
.card,
.guide-sheet,
.notice,
.stat-grid,
.table-wrap,
.quote-block {
    background: var(--paper);
    border: 1px solid rgba(126, 52, 24, 0.12);
    box-shadow: var(--shadow);
}

.hero-card {
    border-radius: 28px;
    padding: 44px;
    margin-top: 8px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero-card h1,
.cover h1,
.guide-section h2,
.guide-section h3,
.hub-section h2 {
    font-family: var(--display);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
}

.hero-card h1,
.cover h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
}

.hero-card p {
    max-width: 760px;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 1.05rem;
}

.button,
.button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}

.button {
    background: var(--accent);
    color: #fff;
}

.button:hover {
    color: #fff;
    background: #d16435;
}

.button-secondary {
    background: transparent;
    color: var(--accent-strong);
    border-color: var(--line);
}

.hub-section {
    margin-top: 36px;
}

.hub-section h2 {
    font-size: 2rem;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    border-radius: 22px;
    padding: 28px;
}

.card h3 {
    font-family: var(--display);
    font-size: 1.4rem;
    margin: 0 0 10px;
}

.card p,
.card li,
.guide-section p,
.guide-section li,
.guide-section td,
.guide-section th {
    color: var(--muted);
}

.card code,
.guide-section code,
.resource-bar code {
    font-family: var(--mono);
    font-size: 0.82rem;
    background: rgba(192, 86, 43, 0.1);
    color: var(--accent-strong);
    padding: 2px 6px;
    border-radius: 6px;
}

.guide-sheet {
    border-radius: 28px;
    padding: 44px;
    margin-top: 20px;
}

.breadcrumbs {
    margin-bottom: 18px;
}

.breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--muted);
}

.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs li + li::before {
    content: "/";
    color: var(--line);
}

.cover {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
}

.cover p {
    max-width: 720px;
    margin: 0 0 16px;
}

.document-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.document-meta div {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: var(--accent-soft);
}

.document-meta dt {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 4px;
}

.document-meta dd {
    margin: 0;
    color: var(--ink);
    font-weight: 600;
}

.toc {
    margin-top: 32px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(246, 227, 214, 0.52);
}

.toc h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.toc ol,
.summary-list,
.checklist,
.reference-list {
    margin: 0;
    padding-left: 20px;
}

.guide-section {
    margin-top: 38px;
}

.guide-section h2 {
    font-size: 2rem;
}

.guide-section h3 {
    font-size: 1.3rem;
    margin-top: 28px;
}

.notice {
    border-radius: 22px;
    padding: 24px;
    margin: 26px 0;
    background: linear-gradient(135deg, rgba(192, 86, 43, 0.08), rgba(255, 255, 255, 0.82));
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px;
    border-radius: 20px;
    overflow: hidden;
    margin: 24px 0;
}

.stat-grid div {
    background: #fffaf2;
    padding: 18px;
}

.stat-grid strong {
    display: block;
    font-family: var(--display);
    font-size: 1.5rem;
    color: var(--accent-strong);
}

.diagram {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 24px;
    background: #fffaf2;
    margin: 24px 0;
}

.diagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.diagram-node {
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
}

.diagram-node strong {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
}

pre {
    overflow-x: auto;
    padding: 18px;
    border-radius: 18px;
    background: var(--code-bg);
    color: var(--code-ink);
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.55;
}

.table-wrap {
    border-radius: 22px;
    overflow: hidden;
    margin: 24px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(126, 52, 24, 0.1);
    text-align: left;
}

th {
    background: #fff7ee;
    color: var(--ink);
}

.quote-block {
    border-left: 4px solid var(--accent);
    border-radius: 0 18px 18px 0;
    padding: 18px 20px;
    margin: 24px 0;
    background: #fffaf4;
}

.quote-block p {
    margin: 0;
}

.print-note {
    margin-top: 40px;
    font-size: 0.88rem;
    color: var(--muted);
}

.resource-footer {
    margin-top: 48px;
    border-top: 1px solid rgba(126, 52, 24, 0.12);
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    .resource-shell {
        padding: 18px;
    }

    .hero-card,
    .guide-sheet,
    .card {
        padding: 26px;
    }
}

@page {
    size: A4;
    margin: 18mm 16mm;
}

@media print {
    body,
    body.guide-page {
        background: #fff;
    }

    .resource-shell {
        max-width: none;
        padding: 0;
    }

    .resource-nav,
    .resource-footer,
    .bar-actions,
    .button,
    .button-secondary {
        display: none !important;
    }

    .guide-sheet,
    .hero-card,
    .card,
    .notice,
    .stat-grid,
    .table-wrap,
    .quote-block {
        box-shadow: none;
    }

    .guide-section,
    .toc,
    .diagram,
    pre,
    .table-wrap,
    .quote-block {
        break-inside: avoid;
    }

    a {
        color: #000;
        text-decoration: none;
    }
}
