/* Byte Paladin page styles: tokens only, palette lives in theme.css. */

body { font-size: 1.0625rem; }
.mono { font-family: var(--font-mono); }

/* Header: edge to edge, a single hairline under it */
.site-header { background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.125rem; }
.brand svg { width: 28px; height: 32px; color: var(--accent); flex: none; }
.brand span { font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.9375rem; }
.nav-links { font-family: var(--font-mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8125rem; }
.nav-links a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-button); background: transparent; color: var(--ink); cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle:hover { border-color: var(--ink); }
.no-js .theme-toggle { display: none; }
.mobile-nav { display: flex; gap: 20px; width: var(--shell); margin-inline: auto; padding-bottom: 12px; font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; overflow-x: auto; }
.mobile-nav a { text-decoration: none; color: var(--muted-strong); padding-block: 10px; white-space: nowrap; }
.mobile-nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
@media (min-width: 900px) { .mobile-nav { display: none; } }

/* Hero: type-led split, the pixel shield as the one image */
.hero { min-height: min(78svh, 820px); background: var(--bg); }
.hero-home .display { max-width: 13ch; }
.hero-home .lead { margin-top: 8px; }
.hero-art { display: grid; place-items: center; }
.hero-art svg { width: min(100%, 420px); height: auto; color: var(--ink); }
.hero-art .px-accent { fill: var(--accent-fill); }
.hero-art .px { fill: currentColor; }
.hero-art .px-dim { fill: var(--line-strong); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 12px; font-family: var(--font-mono); font-size: var(--fs-small); color: var(--muted); }
.hero-meta span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; background: var(--accent); vertical-align: 1px; }
@media (max-width: 899px) { .hero-art svg { width: 220px; } .hero-home .hero-inner { grid-template-columns: 1fr; } .hero-art { order: -1; justify-items: start; } }

/* Topic rule list: tags in mono */
.tag { font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.band-ink .tag { color: var(--accent-fill); }
.rule-list a { text-decoration: none; }
.rule-list a:hover .h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.rule-list p { color: var(--muted-strong); }

/* Habit ledger on the anvil band */
.band-ink .index-list > li { border-color: color-mix(in srgb, var(--on-ink) 22%, transparent); }
.band-ink .index-list > li::before { color: var(--accent-fill); font-family: var(--font-mono); font-weight: 500; }
.band-ink .index-list p { color: var(--on-ink-muted); }

/* Article index */
.post-list > li { border-top: 1px solid var(--line-strong); }
.post-list > li:last-child { border-bottom: 1px solid var(--line-strong); }
.post-list a { display: grid; gap: 8px 32px; padding-block: 28px; text-decoration: none; }
.post-list a:hover .h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.post-list p { color: var(--muted-strong); max-width: 62ch; }
.post-list .meta { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--muted); }
@media (min-width: 900px) { .post-list a { grid-template-columns: 12rem minmax(0, 1fr); } .post-list .meta { padding-top: 6px; } }

/* Closing brief (bordered panel 1 of 2) */
.brief .actions { justify-content: flex-start; }

/* Sub-page hero */
.hero-compact { border-bottom: 1px solid var(--line); }
.hero-compact .display { font-size: clamp(2.3rem, 1.4rem + 3.8vw, 4.5rem); max-width: 20ch; }
.crumbs { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--muted-strong); }

/* Article body */
.article-grid { display: grid; gap: 40px; }
@media (min-width: 1000px) { .article-grid { grid-template-columns: minmax(0, 1fr) 16rem; gap: 80px; } .article-aside { position: sticky; top: calc(var(--header-height) + 32px); align-self: start; } }
.article-aside { font-size: var(--fs-small); color: var(--muted-strong); }
.article-aside .kv > div { padding-block: 12px; grid-template-columns: 1fr; }
.prose { max-width: 68ch; font-size: 1.125rem; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-top: 2.2em; }
.prose h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; margin-top: 1.8em; }
.prose a { color: var(--accent-text); text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }
.prose ul, .prose ol { padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.5em; }
.prose ul > li + li, .prose ol > li + li { margin-top: 0.5em; }
.prose ul > li::before { content: ""; position: absolute; left: 0.2em; top: 0.72em; width: 7px; height: 7px; background: var(--accent); }
.prose ol { counter-reset: step; }
.prose ol > li { counter-increment: step; position: relative; padding-left: 2.6em; }
.prose ol > li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0.15em; font-family: var(--font-mono); font-size: 0.875rem; color: var(--accent-text); }
.prose strong { font-weight: 650; }
.prose .callout { margin-block: 1.8em; font-size: 1rem; }
.prose .callout p { margin: 0; }
.prose .board-wrap { margin-block: 1.6em; }
.prose .board { font-size: 0.9375rem; line-height: 1.5; }
.prose .board th[scope="row"] { font-weight: 600; }
.disclosure { border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; font-size: var(--fs-small); color: var(--muted-strong); }
.disclosure strong { font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-bottom: 4px; color: var(--ink); }
.sources { margin-top: 3em; padding-top: 1.4em; border-top: 2px solid var(--ink); }
.sources h2 { margin-top: 0; font-size: 1.125rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.sources li { font-size: 1rem; }

/* Contact form (bordered panel 2 of 2 on the contact page) */
.form { display: grid; gap: 22px; }
.field-row { display: grid; gap: 8px; }
.field-row label { font-family: var(--font-mono); font-size: var(--fs-small); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.field-row input, .field-row textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-size: 1rem;
}
.field-row textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
.field-row input:focus-visible, .field-row textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status[data-state="ok"] { color: var(--ink); }
.form-status[data-state="ok"]::before, .form-status[data-state="error"]::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; background: var(--accent); vertical-align: 1px; }
.form-status[data-state="error"] { color: var(--ink); }
.form .small { color: var(--muted); }

/* Footer */
.site-footer .brand-line { display: grid; gap: 10px; max-width: 34ch; color: var(--muted-strong); }
.footer-bottom { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line-strong); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--muted); font-family: var(--font-mono); font-size: var(--fs-micro); }

/* Stack gaps and column counts as classes (the CSP allows no inline styles) */
.s8 { --stack: 8px; } .s10 { --stack: 10px; } .s12 { --stack: 12px; } .s16 { --stack: 16px; } .s20 { --stack: 20px; } .s22 { --stack: 22px; }
.cols-4 { --cols: 4; }
.hero.hero-compact { min-height: 0; }
.hero-home .lead { margin-top: 20px; }
.rule-list a, .rule-list a > *, .post-list a > span, .post-list .stack > * { display: block; }
