/* house.css — the LABS house look, lean (newsites544, 2026-09-28).

   One document, two skins: paper is the default and what a crawler gets; html[data-dark] is the dark skin, set by
   assets/js/edition.js from the reader's remembered choice (labs_edition). Every colour below is a token, so the
   dark skin is a re-declaration of tokens and nothing else. A site adds its own sheet AFTER this one and may
   re-declare --accent / --accent-ink (both skins) and add its own components under its own class prefix.

   The token names and values are the house's. */

@font-face {
    font-family: 'DM Sans'; font-style: normal; font-weight: 200 700; font-display: swap;
    src: url('/assets/fonts/dm-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                   U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'DM Sans'; font-style: normal; font-weight: 200 700; font-display: swap;
    src: url('/assets/fonts/dm-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
                   U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
                   U+A720-A7FF;
}
@font-face {
    font-family: 'Roboto Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
    src: url('/assets/fonts/roboto-mono-latin.woff2') format('woff2');
}

:root {
    --ink:        #1E262B;
    --ink-77:     rgba(30, 38, 43, .77);
    --ink-55:     rgba(30, 38, 43, .64);   /* 4.7:1 on paper; the name is the house's */
    --muted:      #717171;
    --paper:      #ffffff;
    --tint:       #FAFAFA;
    --card:       #ffffff;
    --deep:       #11161C;
    --line:       rgba(30, 38, 43, .12);
    --line-soft:  rgba(30, 38, 43, .07);
    --accent:     #C2410C;                 /* hairlines, live marks, links on hover — never a large fill */
    --accent-ink: #9A3412;                 /* accent when it is TEXT on paper: 7.3:1 */
    --on-accent:  #ffffff;
    --good:       #166534;
    --warn:       #92400E;
    --bad:        #B91C1C;
    --measure:    1180px;
    --gutter:     clamp(16px, 5vw, 56px);
    --radius:     10px;
    --sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
    --mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}
html[data-dark] {
    --ink:        #FFFFFF;
    --ink-77:     rgba(255, 255, 255, .72);
    --ink-55:     rgba(255, 255, 255, .58);
    --muted:      #8A9199;
    --paper:      #0C1116;
    --tint:       #10161C;
    --card:       #121920;
    --deep:       #1A222C;
    --line:       rgba(255, 255, 255, .16);
    --line-soft:  rgba(255, 255, 255, .09);
    --accent:     #F97316;
    --accent-ink: #FDBA74;
    --on-accent:  #11161C;
    --good:       #4ADE80;
    --warn:       #FBBF24;
    --bad:        #F87171;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
    margin: 0; background: var(--paper); color: var(--ink);
    font: 400 1rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[hidden] { display: none !important; }
img, svg, canvas, video { max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ masthead */
.mast {
    position: sticky; top: 0; z-index: 50; background: var(--paper);
    border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(8px)) {
    .mast { background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); }
}
.mast__in { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.mast__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.mast__brand svg, .mast__brand img { width: 28px; height: 28px; flex: none; }
.mast__nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.mast__nav::-webkit-scrollbar { display: none; }
.mast__nav a {
    text-decoration: none; font-size: .9rem; color: var(--ink-77); padding: 8px 10px; border-radius: 8px; white-space: nowrap;
}
.mast__nav a:hover { color: var(--ink); background: var(--line-soft); }
.mast__nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

/* the edition switch: two buttons, sun and moon */
.ed { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; }
.ed button {
    -webkit-appearance: none; appearance: none; background: none; border: 0; margin: 0; cursor: pointer;
    width: 32px; height: 28px; border-radius: 999px; display: grid; place-items: center; color: var(--ink-55);
}
.ed button svg { width: 15px; height: 15px; }
.ed button.is-on { background: var(--ink); color: var(--paper); cursor: default; }

/* ------------------------------------------------------------------ bands */
.hero { padding-block: clamp(36px, 6vw, 84px) clamp(28px, 4vw, 56px); }
.eyebrow {
    font: 500 .74rem/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-55);
    display: flex; align-items: center; gap: 10px; margin: 0 0 18px;
}
.eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--accent); }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 4rem); font-weight: 200; letter-spacing: -.04em; line-height: 1.04; max-width: 18ch; }
.hero h1 b, .hero h1 strong { font-weight: 600; }
.lede { font-size: clamp(1.02rem, 1.5vw, 1.2rem); line-height: 1.6; color: var(--ink-77); max-width: 62ch; margin: 22px 0 0; }
.band { padding-block: clamp(36px, 5vw, 72px); border-top: 1px solid var(--line); }
.band--tint { background: var(--tint); }
.band h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 .7em; }
.band h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; margin: 1.6em 0 .4em; }
.prose { max-width: 70ch; color: var(--ink-77); line-height: 1.7; }
.prose a, .link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.prose a:hover, .link:hover { text-decoration-color: var(--accent); }
.prose code, code.k { font-family: var(--mono); font-size: .88em; background: var(--line-soft); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.note { font-size: .88rem; line-height: 1.6; color: var(--ink-55); max-width: 72ch; }
.src { font: 400 .78rem/1.5 var(--mono); color: var(--ink-55); overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ parts */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
a.card { text-decoration: none; display: block; transition: border-color .15s; }
a.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; font-size: .92rem; color: var(--ink-77); line-height: 1.55; }

.btn {
    -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink);
    color: var(--paper); font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--paper); }
html[data-dark] .btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--line-soft); border-color: var(--ink-55); color: var(--ink); }
html[data-dark] .btn--ghost:hover { background: var(--line-soft); border-color: var(--ink-55); color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; min-height: 34px; padding: 0 13px;
    border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-77);
    font-size: .85rem; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-55); color: var(--ink); }
.chip.is-on, .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font: 500 .74rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-55); }
.input, .select, .textarea {
    width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--card); color: var(--ink); font-size: 1rem;   /* 16px: iOS does not zoom a 16px field */
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink-55); outline: 2px solid var(--accent); outline-offset: 1px; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row > .field { flex: 1 1 220px; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th, table.t td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.t th { font: 500 .72rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-55); white-space: nowrap; background: var(--tint); }
table.t tr:last-child td { border-bottom: 0; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }

.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.kv dt, .kv dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); min-width: 0; overflow-wrap: anywhere; }
.kv dt { font: 500 .74rem/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-55); }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv dt { border-bottom: 0; padding-bottom: 0; } }

.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 .72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-77); }
.tag--good { color: var(--good); border-color: currentColor; }
.tag--warn { color: var(--warn); border-color: currentColor; }
.tag--bad  { color: var(--bad);  border-color: currentColor; }
.live { display: inline-flex; align-items: center; gap: 7px; }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.status { min-height: 1.6em; font-size: .9rem; color: var(--ink-55); }
.status[data-state="error"] { color: var(--bad); }
.status[data-state="ok"] { color: var(--good); }

.crumbs { font-size: .82rem; color: var(--ink-55); padding-top: 22px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ footer */
.foot { border-top: 1px solid var(--line); padding-block: 40px 56px; font-size: .88rem; color: var(--ink-55); background: var(--tint); }
.foot__in { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.foot h2 { font: 500 .72rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-55); margin: 0 0 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot a { text-decoration: none; color: var(--ink-77); }
.foot a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.foot__legal { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .8rem; }

@media (max-width: 640px) {
    .mast__in { gap: 10px; min-height: 54px; }
    .mast__nav a { padding: 8px 8px; font-size: .86rem; }
}
@media print {
    .mast, .foot, .ed, .skip { display: none !important; }
    body { background: #fff; color: #000; }
}
