/* setup-guide.css — the Provenote beginner guide, in the site-16 article chrome.
   Loaded after site-16.css (and setup-guide-figs.css, the generated figure theme),
   only on /projects/claude-code/setup[/codex].
   Same tokens as the rest of the site (paper / ink / one oxblood accent, Fraunces
   display, mono labels); nothing here introduces a new colour.
   Oxblood is kept for exactly three things: the step numeral, the Stuck row and links.
   Type ramp (rem): .6875 labels · .75 buttons · .8125 meta · .875 code · .9375 body-small · 1.0625 lead.
   No inline styles are needed anywhere: every rule lives in this file. */

/* ── Per-OS visibility. data-os-pref is set on <html> by setup-guide.js. ── */
/* data-os holds one or more space-separated systems ("mac linux" = both). */
html[data-os-pref="mac"] [data-os]:not([data-os~="mac"]),
html[data-os-pref="windows"] [data-os]:not([data-os~="windows"]),
html[data-os-pref="linux"] [data-os]:not([data-os~="linux"]) { display: none; }

/* ── Header standfirst (the "note before you start") ───────────────────── */
.guide-standfirst strong { font-style: normal; font-family: var(--body); font-weight: 700; color: var(--ink); }
.guide-standfirst a {
    color: var(--oxblood); text-decoration: none;
    background-image: linear-gradient(var(--oxblood), var(--oxblood));
    background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 1px;
}
.guide-standfirst a:hover { background-size: 100% 2px; }

/* ── Controls: route switch + OS switch ─────────────────────────────────── */
.guide-tools {
    display: flex; flex-wrap: wrap; align-items: flex-end;
    gap: 0.9rem 1.8rem; margin: 1.6rem 0 1.2rem;
}
.seg-group { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.seg-label {
    font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--ink-soft);
}
.seg {
    display: inline-flex; border: 1px solid var(--frame); border-radius: 6px;
    background: transparent;
}
.seg__item {
    position: relative;
    font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.03em;
    color: var(--ink-soft); background: transparent; border: 0;
    padding: 0.5rem 0.95rem; cursor: pointer; text-decoration: none;
    line-height: 1.4; display: inline-block; box-sizing: border-box;
    transition: color 0.15s ease, box-shadow 0.15s ease;
}
.seg__item:first-child { border-radius: 5px 0 0 5px; }
.seg__item:last-child { border-radius: 0 5px 5px 0; }
.seg__item + .seg__item { border-left: 1px solid var(--hairline); }
.seg__item:hover { color: var(--ink); }
/* Active = outlined and bold, not a solid chip (the H1 stays the loudest thing) */
.seg__item[aria-current="page"],
.seg__item[aria-pressed="true"] {
    color: var(--ink); font-weight: 700;
    box-shadow: inset 0 0 0 2px var(--ink);
}
.seg__item:focus-visible { outline: 2px solid var(--oxblood); outline-offset: -2px; }

/* ── Journey: only on narrow screens (the Contents rail does this from 861px) ── */
.journey { display: none; }
.journey__sum {
    cursor: pointer; list-style: none; position: relative;
    font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.03em;
    color: var(--ink-soft); padding: 0.7rem 1.6rem 0.7rem 0;
    border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.journey__sum::-webkit-details-marker { display: none; }
.journey__sum::after {
    content: "+"; position: absolute; right: 0.2rem; top: 0.7rem; color: var(--ink-soft);
}
.journey[open] > .journey__sum::after { content: "\2212"; }
.journey__sum:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 2px; }
.journey__list {
    list-style: none; margin: 0.5rem 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem;
}
.journey__item { margin: 0; padding: 0; }
.journey__item a {
    display: flex; align-items: baseline; gap: 0.55rem; padding: 0.75rem 0;
    text-decoration: none; color: var(--ink-soft); background: none;
    border-bottom: 1px solid var(--hairline);
}
.journey__item a:hover { color: var(--ink); }
.journey__no {
    flex: none; font-family: var(--mono); font-size: 0.75rem;
    letter-spacing: 0.06em; color: var(--ink-soft);
}
.journey__t { font-size: 0.875rem; line-height: 1.3; }
@media (max-width: 860px) {
    .journey { display: block; margin: 0 0 0.4rem; }
}

/* ── Guide body ─────────────────────────────────────────────────────────── */
.guide :is(.step, .part, .fold, .os-block, .note, .see, .cmd) > * + * { margin-top: 1.15rem; }
.guide > * + * { margin-top: 0; }

.guide .part > h2 { margin-top: 0; }
.guide .part__t { display: block; }
.guide .part__k {
    display: block; margin-bottom: 0.35rem;
    font-family: var(--mono); font-style: normal; font-weight: 500;
    font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--oxblood);
}
.guide .step,
.guide .part { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline); }
.guide .part--lead,
.guide > .part:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.guide .part--lead > * + * { margin-top: 1.15rem; }
.guide > .part--lead + * { margin-top: 0.4rem; }

/* Step heading: a filled numeral (the accent) + the title in ink */
.guide .step > h3 {
    display: flex; align-items: center; gap: 0.95rem; margin-top: 0;
    font-size: clamp(1.45rem, 3vw, 1.85rem); font-style: normal; line-height: 1.2;
}
.article-content.guide :is(h2, h3) { color: var(--ink); }
.guide .step > h3::before {
    content: attr(data-step); flex: none;
    display: inline-grid; place-items: center;
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    background: var(--oxblood); color: var(--paper);
    font-family: var(--display); font-weight: 500; font-size: 1.25rem; line-height: 1; font-style: normal;
    font-variation-settings: "opsz" 48;
}

/* "Why" as a quiet lead line: roman, ink-soft */
.guide .step__why {
    font-family: var(--body); font-style: normal; font-size: 1.0625rem;
    line-height: 1.55; color: var(--ink-soft);
}
.article-content.guide .step__why { color: var(--ink-soft); }
.guide .step__why strong {
    font-family: var(--mono); font-style: normal; font-weight: 500;
    font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-soft); margin-right: 0.55rem;
}

/* Sub-steps (5a, 5b, ...): the label is always its own line */
.guide .substep > strong:first-child {
    display: block; margin-bottom: 0.2rem;
    font-family: var(--mono); font-size: 0.8125rem; font-weight: 500;
    letter-spacing: 0.04em; color: var(--ink-soft);
}

/* Command boxes */
.cmd {
    border: 1px solid var(--frame); border-radius: 6px;
    background: color-mix(in oklab, var(--ink) 6%, transparent);
    min-width: 0; max-width: 100%;
}
.cmd__bar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
    padding: 0.35rem 0.5rem 0.35rem 0.9rem; border-radius: 5px 5px 0 0;
    background: color-mix(in oklab, var(--paper-deep) 80%, var(--ink) 4%);
    border-bottom: 1px solid var(--hairline);
}
.cmd__label {
    font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--ink-soft);
}
.cmd__copy {
    position: relative;
    font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.03em;
    color: var(--ink); background: var(--paper); border: 1px solid var(--frame);
    border-radius: 4px; padding: 0.3rem 0.75rem; cursor: pointer; min-width: 4.4rem;
    transition: border-color 0.15s ease;
}
.cmd__copy:hover { border-color: var(--ink); }
.cmd__copy.is-done { font-weight: 700; border-color: var(--ink); }
.cmd__copy:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 2px; }
.article-content .cmd pre {
    margin: 0; border: 0; border-radius: 0 0 5px 5px; background: transparent;
    padding: 0.95rem 1.05rem; overflow-x: auto; max-width: 100%;
    font-size: 0.875rem; white-space: pre;
}
.article-content .cmd pre:focus-visible { outline: 2px solid var(--oxblood); outline-offset: -2px; }
/* Messages you paste to the assistant are prose: let them wrap inside the box. */
.article-content .cmd--prose pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* "You should see" + the picture: one form, no frame (the figure carries its own panel) */
.see > * + * { margin-top: 0.9rem; }
.see__lead > strong:first-child {
    font-family: var(--mono); font-weight: 500; font-size: 0.6875rem;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft);
    margin-right: 0.35rem;
}
.shot { margin-left: 0; margin-right: 0; }
.shot svg, .shot img { display: block; width: 100%; max-width: 560px; height: auto; margin-inline: auto; }

/* Done / Stuck rows: Done is a plain tick line; Stuck is the one tinted row */
.guide .check {
    display: block; position: relative;
    font-size: 0.9375rem; line-height: 1.5; margin-top: 0.8rem;
}
.guide .check strong { font-weight: 700; }
.guide .check__mark {
    position: absolute; display: inline-grid; place-items: center;
    font-family: var(--mono); line-height: 1; font-weight: 700;
}
.guide .check--done { padding: 0 0 0 1.6rem; color: var(--ink); }
.guide .check--done .check__mark { left: 0.1rem; top: 0.2rem; font-size: 0.9375rem; color: var(--ink-soft); }
.guide .check--done .check__mark::before { content: "\2713"; }
.guide .check--stuck {
    padding: 0.6rem 0.9rem 0.6rem 2.5rem; border-radius: 6px;
    background: color-mix(in oklab, var(--oxblood) 8%, transparent);
}
.guide .check--stuck .check__mark {
    left: 0.85rem; top: 0.75rem; width: 1.1rem; height: 1.1rem; border-radius: 50%;
    font-size: 0.75rem; background: var(--oxblood); color: var(--paper);
}
.guide .check--stuck .check__mark::before { content: "?"; }

/* Callouts: a quiet rule, no box */
.note {
    padding: 0.1rem 0 0.1rem 1rem; border-left: 2px solid var(--hairline);
    font-size: 0.9375rem;
}
.guide .note > * + * { margin-top: 0.6rem; }

/* Per-OS blocks */
.os-block {
    border-left: 2px solid var(--hairline); padding: 0.1rem 0 0.1rem 1.1rem;
}
.os-block__label {
    font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--ink-soft);
}
.guide .os-block > .os-block__label + * { margin-top: 0.6rem; }
.guide .os-block .shot { margin-top: 1rem; }

/* Folds (details) */
.fold { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 0.75rem 0; }
.fold + .fold { border-top: 0; }
.fold > summary {
    cursor: pointer; list-style: none; font-weight: 700; padding-right: 1.6rem; position: relative;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
    content: "+"; position: absolute; right: 0.2rem; top: 0;
    font-family: var(--mono); font-weight: 400; color: var(--ink-soft);
}
.fold[open] > summary::after { content: "\2212"; }
.fold > summary:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 4px; }
.fold__hint { font-weight: 400; font-size: 0.8125rem; color: var(--ink-soft); }
.guide .fold > summary + * { margin-top: 0.9rem; }
.guide .fold > :not(summary) { max-width: 100%; }

.guide img { max-width: 100%; height: auto; }

/* ── Touch targets: 44px, via the site's ::after hit-area pattern ─────────
   (a positioned ::after grows the target without moving the type) */
@media (pointer: coarse), (max-width: 1024px) {
    .seg__item::after { content: ""; position: absolute; inset: -0.6rem 0; }
    .cmd__copy::after { content: ""; position: absolute; inset: -0.6rem -0.3rem; }
    .fold > summary::before,
    .journey__sum::before { content: ""; position: absolute; inset: -0.65rem 0; }
    .guide-standfirst a { position: relative; }
    .guide-standfirst a::after { content: ""; position: absolute; inset: -0.35rem -0.25rem; }
}

/* ── Jump targets clear the sticky mobile masthead (~88px) ──────────────── */
@media (max-width: 640px) {
    .article-content.guide .step > h3,
    .article-content.guide .part > h2 { scroll-margin-top: 6.5rem; }
}

/* ── Narrow screens ─────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .guide-tools { gap: 0.8rem 1.2rem; }
    .seg { max-width: 100%; }
    .seg__item { padding: 0.55rem 0.8rem; }
    .guide .step { margin-top: 1.6rem; padding-top: 1.4rem; }
    .guide .step > h3::before { width: 2.1rem; height: 2.1rem; font-size: 1.05rem; }
    .os-block { padding-left: 0.8rem; }
    .article-content .cmd pre { font-size: 0.8125rem; padding: 0.8rem 0.85rem; }
    .journey__list { grid-template-columns: minmax(0, 1fr); }
}

/* Short inline code (<= 32 chars, class set by the parser) does not break at "-" or spaces
   ("git --version", "/ai-architecture:plan"); long spans still wrap. Command boxes wrap on their own. */
body.setup-guide :not(pre) > code.code-nw { white-space: nowrap; }

/* ── Contents rail: Parts as group headings, Steps nested beneath (body.setup-guide only) ── */
body.setup-guide .toc__item--part { margin-top: 1.6rem; line-height: 1.25; }
body.setup-guide .toc__item--h1 + .toc__item--part { margin-top: 1.1rem; }
body.setup-guide .toc__item--tail { margin-top: 1.2rem; }
body.setup-guide .toc__sub { list-style: none; margin: 0; padding: 0; }
body.setup-guide .article-rail { max-height: calc(100vh - 3rem); overflow-y: auto; overscroll-behavior: contain; }
body.setup-guide .toc__item--part a { color: var(--ink); font-weight: 500; }
body.setup-guide .toc__k {
    display: block; margin-bottom: 0.15rem;
    font-family: var(--mono); font-size: 0.625rem; font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--oxblood);
}
body.setup-guide .toc__item--step { padding-left: 0.9rem; display: flex; gap: 0.5rem; margin-top: 0.35rem; }
body.setup-guide .toc__item--step::before {
    content: attr(data-step); flex: none; min-width: 1.1rem; text-align: right;
    font-family: var(--mono); font-size: 0.68rem; line-height: 1.7; color: var(--ink-soft);
}
body.setup-guide .toc__item--step a { font-weight: 400; }
body.setup-guide .toc__item--part a:hover,
body.setup-guide .toc__item--step a:hover { color: var(--oxblood); }
body.setup-guide .toc__item--part a.is-active,
body.setup-guide .toc__item--step a.is-active { color: var(--oxblood); font-weight: 600; }
