*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --text-xs: 0.8125rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-md: 1.125rem;
    --text-lg: 1.25rem;
    --text-xl: 1.5rem;
    --text-2xl: 1.875rem;
    --text-3xl: 2.25rem;

    --leading-tight: 1.15;
    --leading-snug: 1.35;
    --leading-control: 1.4;
    --leading-body: 1.6;

    --muted: #6f6a62;
    --accent: #7d6440;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: #f7f5f1;
    color: #23201c;
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: var(--text-base);
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
}

.brand-links {
    margin-left: auto;
    display: flex;
    align-items: baseline;
}

.brand-links > nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-links a {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.brand-links a:hover {
    color: #23201c;
    border-bottom-color: var(--muted);
}

.brand-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

.brand-links a.current {
    border-bottom-color: var(--muted);
}

.wordmark {
    display: flex;
}

@media (max-width: 640px) {
    .brand {
        flex-wrap: wrap;
    }

    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
        margin-left: auto;
    }

    .brand-links {
        display: none;
        order: 3;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 13px;
        margin-left: 0;
        padding-top: 12px;
        border-top: 1px solid var(--field-border, #ddd);
    }

    .brand-links.is-open {
        display: flex;
        animation: nav-open 0.2s ease;
    }

    .brand-links.is-closing {
        animation: nav-close 0.18s ease forwards;
    }
}

.hamburger.icon-swap {
    opacity: 0;
}

@keyframes nav-open {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes nav-close {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

.wrap {
    flex: 1;
    width: 100%;
    max-width: 65ch;
    margin: 0 auto;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px;
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7d6440;
}

.eyebrow::after {
    content: "";
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.4;
}

h1 {
    margin: 0 0 6px;
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: var(--text-3xl);
    font-weight: 500;
    line-height: 1.2;
    text-wrap: balance;
}

.updated {
    margin: 0 0 40px;
    font-size: var(--text-xs);
    color: #6f6a62;
}

.page-title {
    margin: 0 0 40px;
}

h2 {
    margin: 40px 0 12px;
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: var(--text-2xl);
    font-weight: 500;
    line-height: 1.35;
    text-wrap: balance;
}

h3 {
    margin: 26px 0 8px;
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 1.4;
}

p,
li {
    margin: 0 0 14px;
    font-size: var(--text-base);
    color: #3d3831;
    text-wrap: pretty;
}

ul,
ol {
    margin: 0 0 14px;
    padding-left: 22px;
}

li {
    margin-bottom: 8px;
}

a {
    color: #7d6440;
    text-underline-offset: 2px;
}

a:hover {
    color: #5f4c30;
}

a:focus-visible {
    outline: 2px solid #7d6440;
    outline-offset: 3px;
    border-radius: 2px;
}

strong {
    font-weight: 500;
    color: #23201c;
}

.fields {
    width: 100%;
    margin: 0 0 18px;
    border-collapse: collapse;
    font-size: var(--text-sm);
    table-layout: fixed;
}

.fields caption {
    margin-bottom: 10px;
    font-size: var(--text-xs);
    color: #6f6a62;
    text-align: left;
}

.fields th,
.fields td {
    padding: 9px 12px 9px 0;
    border-bottom: 1px solid #e6e0d5;
    text-align: left;
    vertical-align: top;
}

.fields th {
    width: 30%;
    font-weight: 500;
    color: #23201c;
    overflow-wrap: anywhere;
}

.fields td {
    color: #3d3831;
    overflow-wrap: anywhere;
}

.fields td code {
    font-family:
        ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    font-size: var(--text-xs);
    color: #23201c;
}

.note {
    margin: 0 0 18px;
    padding: 14px 16px;
    background: #fffdfb;
    border: 1px solid #e6e0d5;
    border-left: 3px solid #7d6440;
    border-radius: 4px;
    font-size: var(--text-sm);
    color: #3d3831;
}

.note p:last-child {
    margin-bottom: 0;
}

.toc {
    margin: 28px 0 8px;
    padding: 16px 18px;
    background: #fffdfb;
    border: 1px solid #e6e0d5;
    border-radius: 4px;
}

.toc-title {
    margin: 0 0 8px;
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7d6440;
}

.toc ol {
    margin: 0;
    padding-left: 20px;
}

.toc li {
    margin-bottom: 4px;
    font-size: var(--text-sm);
}

.toc li:last-child {
    margin-bottom: 0;
}

.flow-label {
    margin: 22px 0 8px;
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7d6440;
}

.flow {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.flow-step {
    position: relative;
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 14px 12px;
    background: #fffdfb;
    border: 1px solid #e6e0d5;
    border-radius: 4px;
    font-size: var(--text-sm);
    color: #3d3831;
}

.flow-step strong {
    font-size: var(--text-sm);
    color: #23201c;
}

.flow-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #7d6440;
    color: #fffdfb;
    font-size: var(--text-xs);
    font-weight: 500;
}

.flow-step:not(:last-child)::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: -14px;
    transform: translateY(-50%);
    color: #7d6440;
}

@media (max-width: 560px) {
    .flow {
        flex-direction: column;
        gap: 22px;
    }

    .flow-step {
        flex: 0 0 auto;
    }

    .flow-step:not(:last-child)::after {
        content: "↓";
        top: auto;
        right: auto;
        bottom: -18px;
        left: 50%;
        transform: translateX(-50%);
    }
}

.steps {
    counter-reset: step;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.steps li {
    position: relative;
    margin-bottom: 10px;
    padding-left: 34px;
    counter-increment: step;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    top: 1px;
    left: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 500;
    color: #7d6440;
    background: #f7f5f1;
    border: 1px solid #e6e0d5;
    border-radius: 50%;
}

.steps li:last-child {
    margin-bottom: 0;
}

p code,
li code,
td code,
th code {
    font-family:
        ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    font-size: var(--text-xs);
    color: #23201c;

    overflow-wrap: anywhere;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin-top: 52px;
    padding-top: 26px;
    border-top: 1px solid #e6e0d5;
    font-size: var(--text-xs);
}

.footer-nav a {
    color: #6f6a62;
}

.footer-nav a:hover {
    color: #7d6440;
}

.footer-nav .sep {
    color: #6f6a62;
}

.back-link {
    margin: 32px 0 0;
    font-size: var(--text-xs);
}

.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #6f6a62;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.back-link a:hover {
    color: #7d6440;
    border-bottom-color: #7d6440;
}

.back-link a:focus-visible {
    outline: 2px solid #7d6440;
    outline-offset: 3px;
    border-radius: 2px;
}

@media (max-width: 560px) {
    h1 {
        font-size: var(--text-3xl);
    }
    .fields th,
    .fields td {
        display: block;
        width: auto;
        padding-right: 0;
        border-bottom: 0;
    }

    .fields tr {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid #e6e0d5;
    }

    .fields td {
        padding-top: 2px;
    }
}
