/* ==========================================================================
   Candidate Finder — documentation
   Direction: printed technical manual. Warm paper, hairline rules,
   serif display type, mono metadata, one ochre accent.
   ========================================================================== */

:root {
    /* Surfaces — neutrals tinted warm so they read as paper, not empty grey */
    --paper: #fbfaf7;
    --surface: #ffffff;
    --surface-sink: #f5f2ea;

    /* Ink */
    --ink: #1c1b18;
    --ink-soft: #56524a;
    --ink-mute: #7d786e;

    /* Lines */
    --line: #e2ddd1;
    --line-soft: #eee9df;

    /* Accent — ochre, used sparingly */
    --accent: #9a4a12;
    --accent-deep: #7a390c;
    --accent-wash: #f8ede1;

    /* Semantic */
    --ok: #2c6742;
    --ok-wash: #eaf3ed;
    --warn: #86560a;
    --warn-wash: #fdf3dc;

    --code-bg: #f4f1e9;

    --shadow-sm: 0 1px 2px rgba(28, 27, 24, .05);
    --shadow-md: 0 1px 2px rgba(28, 27, 24, .06), 0 10px 26px -14px rgba(28, 27, 24, .28);

    --measure: 70ch;
    --sidebar: 290px;
    --radius: 3px;
}

/* --------------------------------------------------------------- reset --- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* keep anchored headings clear of the sticky top bar */
    scroll-padding-top: 84px;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16.5px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

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

::selection { background: var(--accent-wash); color: var(--accent-deep); }

/* ----------------------------------------------------------- skip link --- */

.skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: top .18s ease;
}
.skip:focus { top: 12px; color: #fff; }

/* ----------------------------------------------------------- top bar ---- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 60px;
    padding: 0 24px;
    background: rgba(251, 250, 247, .9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.topbar__brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
    min-width: 0;
}
.topbar__mark {
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.01em;
    white-space: nowrap;
}
.topbar__edition {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-mute);
    white-space: nowrap;
}

.topbar__nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.topbar__link {
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
}
.topbar__link:hover { background: var(--surface-sink); color: var(--ink); }
.topbar__link[aria-current="page"] {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

/* hamburger — mobile only */
.navtoggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.navtoggle:hover { background: var(--surface-sink); }

/* ------------------------------------------------------------- shell ---- */

.shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    gap: 0;
    max-width: 1440px;
    margin: 0 auto;
    align-items: start;
}

/* ------------------------------------------------------------- toc ------ */

.toc {
    position: sticky;
    top: 60px;
    align-self: start;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 28px 22px 64px 28px;
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
}

.toc__search {
    position: relative;
    margin-bottom: 22px;
}
.toc__search input {
    width: 100%;
    padding: 9px 12px 9px 32px;
    font: inherit;
    font-size: 13.5px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.toc__search input::placeholder { color: var(--ink-mute); }
.toc__search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    stroke: var(--ink-mute);
    pointer-events: none;
}

.toc__group {
    margin: 22px 0 8px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.toc__group:first-of-type { margin-top: 0; }

.toc a {
    display: block;
    padding: 5px 10px 5px 12px;
    margin-left: -12px;
    border-left: 2px solid transparent;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.toc a:hover { color: var(--ink); background: var(--surface-sink); }
.toc a.is-active {
    color: var(--accent-deep);
    font-weight: 600;
    border-left-color: var(--accent);
    background: var(--accent-wash);
}
.toc__empty {
    display: none;
    padding: 10px 2px;
    font-size: 13px;
    color: var(--ink-mute);
}

/* --------------------------------------------------------- main --------- */

.main {
    padding: 48px 48px 120px;
    min-width: 0;
}
.main > * { max-width: var(--measure); }

/* --------------------------------------------------------- masthead ----- */

.masthead { margin-bottom: 44px; }

.eyebrow {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 14px;
}

.masthead h1 {
    margin: 0 0 16px;
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.015em;
}

.lede {
    margin: 0 0 22px;
    font-size: 18.5px;
    line-height: 1.6;
    color: var(--ink-soft);
    max-width: 62ch;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11.5px;
    letter-spacing: .02em;
    color: var(--ink-soft);
}
.chip--accent { background: var(--accent-wash); border-color: #ecd8c3; color: var(--accent-deep); }

/* ---------------------------------------------------------- headings --- */

.section {
    padding-top: 8px;
    margin-bottom: 54px;
}

h2 {
    margin: 0 0 18px;
    padding-top: 6px;
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-size: 27px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.01em;
    border-top: 2px solid var(--ink);
    display: inline-block;
    width: 100%;
}

h3 {
    margin: 34px 0 12px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.005em;
}

h4 {
    margin: 24px 0 8px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- lists --- */

ol, ul { margin: 0 0 18px; padding-left: 22px; }
li { margin-bottom: 7px; }
li:last-child { margin-bottom: 0; }
ul ul, ol ol, ul ol, ol ul { margin-top: 7px; margin-bottom: 0; }

strong { font-weight: 650; color: var(--ink); }

/* numbered step list */
.steps {
    list-style: none;
    counter-reset: step;
    padding-left: 0;
}
.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 42px;
    margin-bottom: 20px;
}
.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: var(--paper);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
}

/* ----------------------------------------------------------- callouts --- */

.callout {
    position: relative;
    margin: 22px 0;
    padding: 14px 18px 14px 18px;
    background: var(--surface-sink);
    border: 1px solid var(--line);
    border-left: 3px solid var(--ink-mute);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 15.5px;
    color: var(--ink-soft);
}
.callout p:last-child { margin-bottom: 0; }
.callout__label {
    display: block;
    margin-bottom: 5px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.callout--note { background: var(--surface-sink); }
.callout--tip { background: var(--ok-wash); border-color: #cfe2d5; border-left-color: var(--ok); }
.callout--tip .callout__label { color: var(--ok); }
.callout--warn { background: var(--warn-wash); border-color: #efdfb6; border-left-color: var(--warn); }
.callout--warn .callout__label { color: var(--warn); }
.callout--key { background: var(--accent-wash); border-color: #ecd8c3; border-left-color: var(--accent); }
.callout--key .callout__label { color: var(--accent-deep); }

/* --------------------------------------------------------------- code --- */

code {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: .875em;
    background: var(--code-bg);
    padding: .1em .38em;
    border-radius: 2px;
    border: 1px solid var(--line-soft);
    word-break: break-word;
}

pre {
    position: relative;
    margin: 20px 0;
    padding: 16px 18px;
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.6;
}
pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: inherit;
    white-space: pre;
}
.copy {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 9px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-mute);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 2px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, color .15s ease;
}
pre:hover .copy,
.copy:focus-visible { opacity: 1; }
.copy:hover { color: var(--accent-deep); border-color: var(--accent); }

/* path / tree */
.tree {
    margin: 18px 0;
    padding: 16px 18px;
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.8;
    color: var(--ink-soft);
    overflow-x: auto;
    white-space: pre;
}
.tree b { color: var(--ink); font-weight: 600; }

/* -------------------------------------------------------------- table --- */

.tablewrap { margin: 20px 0; overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}
caption {
    caption-side: bottom;
    padding-top: 10px;
    font-size: 13px;
    color: var(--ink-mute);
    text-align: left;
}
th {
    text-align: left;
    padding: 9px 14px 9px 0;
    border-bottom: 2px solid var(--ink);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    white-space: nowrap;
}
td {
    padding: 10px 14px 10px 0;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: top;
}
td:last-child, th:last-child { padding-right: 0; }
tbody tr:hover td { background: #fcfbf8; }

/* ------------------------------------------------------------ figures --- */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

figure.shot {
    margin: 22px 0;
    max-width: 100%;
}
figure.shot img {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease;
}
figure.shot figcaption {
    margin-top: 9px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-mute);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .01em;
}
.gallery figure.shot { margin: 0; }

.shot-link {
    display: block;
    cursor: zoom-in;
    border-radius: var(--radius);
}
.shot-link:hover img {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ----------------------------------------------------------- lightbox --- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(28, 27, 24, .9);
}
.lightbox[open], .lightbox.is-open { display: flex; }
.lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 90px);
    border-radius: var(--radius);
    box-shadow: 0 24px 70px -20px rgba(0, 0, 0, .7);
    background: #fff;
}
.lightbox__close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .2); }
.lightbox__caption {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    color: rgba(255, 255, 255, .75);
    padding: 0 20px;
}

body.is-locked { overflow: hidden; }

/* ---------------------------------------------------------- back link --- */

.totop {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 15px;
    background: var(--ink);
    color: var(--paper);
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, background .2s ease;
}
.totop.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.totop:hover { background: var(--accent-deep); }

/* ------------------------------------------------------------- footer --- */

.docfooter {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 26px 0 0;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink-mute);
}
.docfooter a { color: var(--ink-soft); }

/* --------------------------------------------------------- responsive --- */

@media (max-width: 1080px) {
    :root { --sidebar: 258px; }
    .main { padding: 40px 34px 100px; }
}

@media (max-width: 900px) {
    .navtoggle { display: inline-flex; }
    .topbar { padding: 0 16px; gap: 10px; }
    .topbar__edition { display: none; }

    .shell { grid-template-columns: minmax(0, 1fr); }

    .toc {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 60;
        width: min(310px, 86vw);
        max-height: none;
        padding: 76px 20px 40px 24px;
        background: var(--paper);
        border-right: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        transform: translateX(-102%);
        transition: transform .24s cubic-bezier(.22, 1, .36, 1);
    }
    .toc.is-open { transform: translateX(0); }

    .toc__search { margin-top: 4px; }

    .main { padding: 32px 20px 96px; }
    .masthead h1 { font-size: 30px; }
    h2 { font-size: 23px; }
    .lede { font-size: 17px; }

    .gallery { grid-template-columns: 1fr; }
    .totop { right: 16px; bottom: 16px; }
}

@media (max-width: 480px) {
    .topbar__nav { gap: 2px; }
    .topbar__link { padding: 7px 10px; font-size: 12.5px; }
    .steps > li { padding-left: 36px; }
    .main { padding: 26px 16px 92px; }
}

/* ------------------------------------------------------------ motion --- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

/* ------------------------------------------------------------- print --- */

@media print {
    .topbar, .toc, .totop, .lightbox, .copy, .navtoggle { display: none !important; }
    .shell { display: block; }
    .main { padding: 0; }
    .main > * { max-width: none; }
    body { background: #fff; font-size: 11.5pt; }
    h2 { break-after: avoid; page-break-after: avoid; }
    figure.shot { break-inside: avoid; page-break-inside: avoid; }
    a { color: #000; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
}
