/* Patchboard: page-only composition on top of the write-up system (.wu-composed in style.css).
   A product page for software in daily use: the app leads, then why it exists, then how it's built, with
   numbers last. One change of material, never a new identity: "Screens around the house" sits on paper,
   using the site's own light-theme tokens, because that's where the e-ink side of Patchboard lives.
   Hairlines and type, as elsewhere. Rules target classes or direct children, never bare descendant spans:
   the site's typesetter wraps word pairs in <span class="tie">. */

.pb .specs-section > p + p { margin-top: var(--space-3); }
.pb code { font-family: var(--font-mono); font-size: 0.92em; }
.pb-label { font-family: var(--font-mono); font-size: var(--fs-meta); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); }
.pb .ss { display: block; width: 100%; height: auto; border: 1px solid var(--border-light); border-radius: var(--radius); }

/* ---- Hero: the desktop Home, with the phone's E-ink look over its corner ---- */
.pb-hero { margin: var(--space-6) 0 0; }
.pb-hero .ss { display: block; height: auto; border: 1px solid var(--border-light); border-radius: var(--radius); }
/* Both screens share one grid cell: the desktop at the top left, the phone over its lower right. */
.pb-hero-shots { display: grid; }
.pb-hero-shots > .ss { grid-area: 1 / 1; }
.pb-hero-shots > .pb-hero-desk { width: 88%; }
.pb-hero-shots > .pb-hero-phone { justify-self: end; align-self: end; width: 22%; max-width: 15rem; margin-top: var(--space-6);
    border-radius: 16px; border-color: var(--border-light); box-shadow: 0 0 0 6px var(--bg); }
/* The caption is the figure's own line ("Fig. 1 ..."), like every figure on the site; the actions follow as a row. */
.pb-hero-cap { margin-top: var(--space-3); max-width: 60rem; font-family: var(--font-mono); font-size: var(--fs-meta); line-height: 1.5; color: var(--text-faint); }
.pb-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
    margin: var(--space-4) 0 var(--space-7); padding: var(--space-3) 0; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border); }
@media (max-width: 760px) {
    /* Phones keep the pair: the desktop full width, the phone larger over its lower right. */
    .pb-hero-shots > .pb-hero-desk { width: 100%; }
    .pb-hero-shots > .pb-hero-phone { width: 40%; margin-top: 38%; margin-right: var(--space-2); border-radius: 12px; }
    /* The two actions share the row, each label on one line; the narrowest phones put the second below. */
    .pb-hero-actions > .btn { flex: 1 1 auto; justify-content: center; text-align: center; white-space: nowrap; }
}

/* ---- What it does: three chapters, each one picture ---- */
.pb .specs-section > .pb-chapter { display: grid; gap: var(--space-3); margin-top: var(--space-6); max-width: none; min-width: 0; }
.pb-chapter > h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h3); line-height: 1.2; color: var(--white); }
.pb-chapter > p { max-width: var(--wu-measure); margin: 0; }
.pb-chapter > .ss { margin-top: var(--space-2); }

/* ---- Screens around the house: the paper band. The site's light tokens, redefined here so every child
   (text, hairlines, captions, links) follows them, in every site theme. ---- */
.pb .specs-section > .pb-paper {
    --bg: #f5f2eb; --bg-raised: #eeeae1; --border: #d9d4ca; --border-light: #c9c3b8;
    --text: #24272b; --text-dim: #4d5156; --text-faint: #5f6267; --accent: #2c6699; --white: #16181b; --tech: #3d7db8;
    display: grid; gap: var(--space-4); margin: var(--space-7) 0 var(--space-6); max-width: none; min-width: 0;
    padding: var(--space-6) var(--space-5); background: var(--bg); color: var(--text); border-radius: var(--radius-lg);
}
/* On the light theme the page is already paper: the band is a whiter sheet with a hairline. */
[data-theme="light"] .pb .specs-section > .pb-paper { --bg: #fdfcf8; border: 1px solid var(--border); }
.pb-paper a { color: var(--accent); }
.pb-paper-kicker { margin: 0; font-family: var(--font-mono); font-size: var(--fs-meta); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); }
.pb-paper > h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.8rem); line-height: 1.15; color: var(--white); text-wrap: balance; }
.pb-paper > p { margin: 0; max-width: var(--wu-measure); color: var(--text); }
.pb-paper-shots { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); margin-top: var(--space-2); }
.pb-paper-shots > figure { margin: 0; min-width: 0; display: grid; gap: var(--space-2); align-content: start; }
.pb-paper-shots .ss { border-color: var(--border-light); }
/* The panel picture is the one-bit image itself, on white. */
.pb-paper-shots .pb-panel { background: #ffffff; }
.pb-paper-shots figcaption { font-size: var(--fs-small); line-height: 1.55; color: var(--text-dim); }
.pb-paper-shots figcaption > b { display: block; margin-bottom: 0.15rem; font-weight: 600; color: var(--white); }
.pb-paper-notes { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--space-6); }
.pb-paper-notes > li { margin: 0; padding: var(--space-3) 0 0; border-top: 1px solid var(--border); font-size: var(--fs-small); line-height: 1.55; color: var(--text-dim); }
.pb-paper-notes > li::before { content: none; display: none; }
.pb-paper-notes > li > b { display: block; font-weight: 600; color: var(--white); }
@media (width >= 760px) {
    .pb-paper-shots { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
    .pb-paper-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) { .pb .specs-section > .pb-paper { padding: var(--space-5) var(--space-4); } }

/* ---- How it's built: three nodes and what crosses between them ---- */
.pb .specs-section > .pb-arch { margin: var(--space-5) 0 var(--space-5); max-width: none; min-width: 0; }
.pb-arch-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.pb-node { min-width: 0; border: 1px solid var(--border-light); border-radius: var(--radius); background: var(--bg-raised); }
.pb-node-core { border-color: var(--tech); }
.pb-node > .pb-node-name { margin: 0; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--white); }
.pb-node > ul { list-style: none; margin: 0; padding: 0.45rem 0.8rem 0.65rem; display: grid; gap: 0.3rem; }
.pb-node > ul > li { margin: 0; padding: 0; border: 0; font-size: var(--fs-small); line-height: 1.45; color: var(--text); }
.pb-node > ul > li::before { content: none; display: none; }
/* A link: a hairline with what crosses it, above and below. Vertical on phones, horizontal from 860px. */
.pb-link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem;
    min-height: 4.2rem; font-family: var(--font-mono); font-size: 0.68rem; line-height: 1.25; color: var(--text-faint); text-align: center; }
.pb-link::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--text-faint); }
.pb-link > span { position: relative; padding: 0.1rem 0.35rem; background: var(--bg); }
.pb-arch > figcaption { margin-top: var(--space-3); font-family: var(--font-mono); font-size: var(--fs-meta); line-height: 1.5; color: var(--text-faint); }
@media (width >= 860px) {
    .pb-arch-row { grid-template-columns: minmax(0, 1fr) minmax(5.5rem, 0.5fr) minmax(0, 1.2fr) minmax(5.5rem, 0.5fr) minmax(0, 1fr); align-items: stretch; }
    .pb-link { min-height: 0; gap: 1.9rem; }
    .pb-link::before { top: 50%; bottom: auto; left: 0; right: 0; width: auto; height: 1px; }
    .pb-link > span { padding: 0 0.2rem; }
}
@media (forced-colors: active) { .pb-link::before { background: CanvasText; } .pb-node-core { border-color: CanvasText; } }

/* ---- Run it ---- */
.pb .specs-section > .pb-code { margin: var(--space-3) 0 var(--space-4); padding: var(--space-3) var(--space-4); max-width: none; overflow-x: auto;
    background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
    font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.6; color: var(--text); tab-size: 2; }
.pb-code > code { white-space: pre; }
.pb-code:focus-visible { outline: 2px solid var(--tech); outline-offset: 2px; }
.pb .specs-section > .pb-aside { margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); font-size: var(--fs-small); line-height: 1.6; color: var(--text-dim); }
.pb-aside > .pb-label { margin-right: var(--space-2); }

/* ---- Still being built: the releases that changed what it can do ---- */
.pb .specs-section > .pb-miles { list-style: none; margin: var(--space-4) 0 var(--space-3); padding: 0; max-width: none; counter-reset: none; }
.pb-miles > li { display: grid; grid-template-columns: 4.2rem 3.6rem minmax(0, 1fr); gap: var(--space-3); margin: 0; padding: 0.55rem 0;
    border-top: 1px solid var(--border); font-size: 0.97rem; line-height: 1.5; color: var(--text); }
.pb-miles > li:last-child { border-bottom: 1px solid var(--border); }
.pb-miles > li::before { content: none; display: none; }
.pb-miles time, .pb-miles .pb-ver { font-family: var(--font-mono); font-size: var(--fs-meta); line-height: 1.9; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.pb-miles .pb-ver { color: var(--tech); }
@media (max-width: 30rem) { .pb-miles > li { grid-template-columns: 3.6rem minmax(0, 1fr); } .pb-miles .pb-ver { display: none; } }

/* ---- Adoption: the site's stat line, then the definitions ---- */
.pb-nowrap { white-space: nowrap; }   /* a date that must not break, even at the end of its paragraph */
.pb .specs-section > .pb-fine { margin-top: var(--space-2); font-size: var(--fs-small); line-height: 1.6; color: var(--text-dim); }

@media (width >= 1080px) {
    /* The paper band crosses the heading rail, as the site's other full-width figures do; that section's
       heading stays put instead of sliding over it. */
    .wu-composed .specs-section > .pb-paper { grid-column: 1 / -1; }
    .wu-composed .specs-section:has(> .pb-paper) > h2:first-of-type { position: static; }
    .wu-composed .specs-section > :is(.pb-chapter, .pb-arch, .pb-code, .pb-miles) { grid-column: 3; max-width: none; }
}
