:root {
    --bg:  #F5F2EC;
    --ink: #18160F;
    --sub: #78746C;
    --rule:rgba(24,22,15,.1);
    --ac:  #1E4919;
    --gold:#B8860B;
    --sf: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    --se: 'Playfair Display', Georgia, serif;
    --mo: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

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

html {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sf);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 32px;
}

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

/* ── Nav ─────────────────────────────────────────── */
nav {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--rule);
}

.logo {
    font-family: var(--se);
    font-size: 17px;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: 9px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 28px;
}

nav a {
    font-size: 13px;
    color: var(--sub);
    transition: color .18s;
}

nav a:hover { color: var(--ac); }

/* ── Hero ────────────────────────────────────────── */
.hero { padding: 88px 0 64px; }

h1 {
    font-family: var(--se);
    font-size: clamp(38px, 7.5vw, 60px);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1.05;
    margin-bottom: 32px;
}

h1 em { font-style: italic; color: var(--ac); }

blockquote {
    font-family: var(--se);
    font-style: italic;
    font-size: 14px;
    line-height: 1.8;
    color: var(--sub);
    max-width: 460px;
    border-left: 1px solid var(--ac);
    padding-left: 20px;
    margin-bottom: 48px;
}

blockquote footer {
    margin: 8px 0 0;
    background: none;
}

cite {
    font-style: normal;
    font-family: var(--sf);
    font-size: 11px;
    letter-spacing: .03em;
    opacity: .65;
}

dl.metrics {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.metric { display: flex; flex-direction: column; gap: 4px; }

.val {
    font-family: var(--se);
    font-size: 26px;
    color: var(--ac);
    letter-spacing: -.02em;
}

.lbl {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sub);
    order: -1;
}

/* ── Sections ────────────────────────────────────── */
section {
    padding: 56px 0;
    border-top: 1px solid var(--rule);
}

h2 {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--sub);
    margin-bottom: 28px;
}

/* ── Wander ──────────────────────────────────────── */
.hero-wander {
    margin-top: 40px;
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.wander {
    all: unset;
    font-family: var(--se);
    font-size: 17px;
    font-style: italic;
    color: var(--ac);
    cursor: pointer;
    border-bottom: 1px solid var(--ac);
    padding-bottom: 1px;
    transition: opacity .18s;
}

.wander:hover    { opacity: .65; }
.wander:disabled { opacity: .35; cursor: wait; }

.wander-note {
    font-size: 12px;
    color: var(--sub);
}

/* ── Code ────────────────────────────────────────── */
pre {
    font-family: var(--mo);
    font-size: 12px;
    line-height: 1.9;
    background: rgba(24,22,15,.04);
    border: 1px solid var(--rule);
    padding: 18px 22px;
    overflow-x: auto;
    margin-top: 20px;
}

pre code {
    display: block;
    background: none;
    padding: 0;
    border: none;
    font-size: inherit;
}

code {
    font-family: var(--mo);
    font-size: 12px;
    background: rgba(24,22,15,.06);
    padding: 1px 6px;
}

.ck { color: var(--sub); opacity: .65; }
.kw { color: var(--ac); }
.st { color: var(--gold); }

/* ── Steps ───────────────────────────────────────── */
ol.steps {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    counter-reset: s;
}

.step {
    display: flex;
    gap: 16px;
    counter-increment: s;
}

.step::before {
    content: counter(s);
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 1px solid rgba(30,73,25,.35);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 10px;
    color: var(--ac);
    font-weight: 500;
    margin-top: 2px;
}

.step p      { font-size: 13px; color: var(--sub); line-height: 1.65; }
.step strong { color: var(--ink); font-weight: 500; }

/* ── Figure ──────────────────────────────────────── */
figure { margin: 0; }

/* ── Footer ──────────────────────────────────────── */
footer {
    padding: 32px 0 48px;
    border-top: 1px solid var(--rule);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--sub);
    flex-wrap: wrap;
    gap: 8px;
    letter-spacing: .03em;
}

footer a:hover { color: var(--ac); }

/* ── Accessibility ───────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 500px) {
    body         { padding: 0 20px; }
    h1           { font-size: 34px; }
    dl.metrics   { gap: 24px; }
    nav ul       { gap: 18px; }
}
