:root {
    --bg: #fffaf0;
    --fg: #1d2b24;
    --muted: #5c6a60;
    --rule: #eadfc8;
    --link: #0a7370;
    --accent: #e4572e;
    --accent-text: #bf3d17;
    --accent-2: #0a7370;
    --heading: #0f5a47;
    --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1a16;
        --fg: #f1efe6;
        --muted: #a3b0a6;
        --rule: #243730;
        --link: #5fd1c4;
        --accent: #ff8a65;
        --accent-text: #ff8a65;
        --accent-2: #5fd1c4;
        --heading: #8fe0b8;
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    border-top: 6px solid var(--accent);
    border-image: linear-gradient(90deg, var(--accent), #f6b73c 35%, var(--accent-2)) 1;
    background: var(--bg);
    color: var(--fg);
    font: 1.0625rem/1.65 var(--sans);
}

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px;
}

.skip {
    position: absolute;
    left: -9999px;
}
.skip:focus {
    left: 16px;
    top: 16px;
    background: var(--bg);
    padding: 8px 12px;
}

a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

.header { padding-top: 72px; padding-bottom: 24px; }

.portrait {
    width: 240px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 24px;
}

h1 {
    font: 600 clamp(2.25rem, 7vw, 3.25rem)/1.1 var(--serif);
    letter-spacing: -0.01em;
    color: var(--heading);
    margin: 0 0 16px;
}

.lede {
    font-size: 1.25rem;
    line-height: 1.5;
    margin: 0 0 24px;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}
.links a { color: var(--fg); }

section {
    border-top: 1px solid var(--rule);
    padding: 40px 0;
}
section:first-of-type { margin-top: 24px; }

h2 {
    font: 600 0.8125rem/1 var(--sans);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin: 0 0 24px;
}

h3 {
    font: 600 1.5rem/1.25 var(--serif);
    color: var(--heading);
    margin: 0 0 8px;
}

p { margin: 0 0 16px; }

.project { margin-bottom: 56px; }
.project:last-child { margin-bottom: 0; }

figure { margin: 24px 0 0; }

img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: #fff;
}

figcaption {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 8px;
}

h3 a { color: inherit; text-decoration-color: var(--muted); text-decoration-thickness: 1px; }
h3 a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
section > h3 { font-size: 1.25rem; margin-top: 32px; }

/* project pages */
.header--page { padding-top: 40px; }
.back { display: inline-block; margin-bottom: 32px; color: var(--muted); }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.tags li {
    font-size: 0.8125rem;
    color: var(--muted);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 2px 12px;
}

ul, ol { padding-left: 1.25rem; margin: 0 0 16px; }
li { margin-bottom: 8px; }

.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding-left: 40px; margin-bottom: 32px; }
.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 2px;
    font: 600 0.875rem/1 var(--sans);
    color: var(--muted);
    border: 1px solid var(--rule);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
}
.steps h3 { font-size: 1.125rem; }

.diagram a { display: block; }
.diagram img {
    background: #fff;
    width: auto;
    max-width: 100%;
    max-height: 520px;
    margin: 0 auto;
    object-fit: contain;
}

.tree { list-style: none; padding: 0; margin: 0 0 24px; }
.tree > li { font-weight: 600; margin-bottom: 12px; }
.tree ul { list-style: none; padding-left: 16px; margin: 4px 0 0; font-weight: 400; }
.tree ul li { margin-bottom: 2px; }
.hint { color: var(--muted); }
.note { color: var(--muted); font-size: 0.9375rem; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    margin: 0 0 24px;
}
th, td {
    text-align: left;
    vertical-align: top;
    padding: 8px 12px 8px 0;
    border-bottom: 1px solid var(--rule);
}
th {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--rule);
    padding: 24px 0 48px;
}
.pager-next { margin-left: auto; }

.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { margin-bottom: 16px; }

.footer {
    border-top: 1px solid var(--rule);
    padding-top: 24px;
    padding-bottom: 64px;
    color: var(--muted);
    font-size: 0.9375rem;
}
.footer p { margin: 0; }
