:root {
  color-scheme: light;
  --ink: #1d1d1f; --body: #3d3d42; --muted: #6e6e73;
  --paper: #fff; --panel: #f5f5f7; --rail: #f5f5f7; --line: #d2d2d7;
  --accent: #06c; --accent-hover: #0071e3; --code: #f5f5f7;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
[data-theme="dark"] { color-scheme: dark; --ink: #f5f5f7; --body: #d2d2d7; --muted: #a1a1a6; --paper: #1d1d1f; --panel: #2c2c2e; --rail: #242426; --line: #48484a; --accent: #2997ff; --accent-hover: #64b5ff; --code: #2c2c2e; }
@media (prefers-color-scheme: dark) { [data-theme="system"] { color-scheme: dark; --ink: #f5f5f7; --body: #d2d2d7; --muted: #a1a1a6; --paper: #1d1d1f; --panel: #2c2c2e; --rail: #242426; --line: #48484a; --accent: #2997ff; --accent-hover: #64b5ff; --code: #2c2c2e; } }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--body); }
a { color: var(--accent); text-underline-offset: .14em; }
a:hover { color: var(--accent-hover); }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: .65rem 1rem; border-radius: .5rem; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 1rem; }
.topbar { display: flex; align-items: center; gap: 2rem; min-height: 4.25rem; padding: .7rem clamp(1rem, 4vw, 3rem); background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.wordmark { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; white-space: nowrap; font-size: .95rem; font-weight: 650; letter-spacing: -.01em; }
.wordmark img { width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); object-fit: cover; }
.wordmark small { display: block; margin-top: .14rem; color: var(--muted); font-size: .68rem; font-weight: 500; letter-spacing: .01em; }
.estate-nav { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-left: auto; color: var(--muted); white-space: nowrap; }
.estate-nav a { color: inherit; text-decoration: none; font-size: .86rem; }
.estate-nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.topbar-actions { display: flex; gap: .5rem; margin-left: .5rem; }
.theme-button, .menu-button { min-height: 2.25rem; padding: .42rem .7rem; cursor: pointer; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: .55rem; font: 500 .75rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.theme-button:hover, .menu-button:hover { border-color: var(--accent); color: var(--accent); }
.menu-button { display: none; }
.workspace { display: grid; grid-template-columns: 18rem minmax(0, 1fr); max-width: 96rem; margin: auto; }
.chapter-rail { min-height: calc(100vh - 4.25rem); padding: 2.1rem 1rem; background: var(--rail); border-right: 1px solid var(--line); }
.rail-label, .eyebrow, .canvas-kicker { color: var(--muted); font-size: .68rem; font-weight: 650; letter-spacing: .08em; line-height: 1.35; text-transform: uppercase; }
.rail-label { padding: 0 .55rem .8rem; }
.machine-label { margin-top: 1.8rem; }
.rail-home, .rail-link { display: flex; gap: .65rem; padding: .48rem .55rem; color: var(--body); text-decoration: none; border-radius: .45rem; font-size: .84rem; }
.rail-home { color: var(--ink); font-weight: 650; margin-bottom: .35rem; }
.rail-link span:first-child { color: var(--muted); min-width: 1.35rem; font-size: .72rem; }
.rail-link.active, .rail-link:hover, .rail-home:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.machine-link { display: block; padding: .32rem .55rem; font: .68rem/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.canvas { min-width: 0; padding: clamp(1.5rem, 4vw, 3rem) clamp(1.4rem, 5vw, 5rem) 3rem; }
.breadcrumbs { color: var(--muted); font-size: .82rem; margin-bottom: 1.2rem; }
.breadcrumbs span { margin: 0 .4rem; }
.canvas-kicker { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.publication-state { color: var(--accent); }
article { max-width: 72rem; padding: clamp(2.2rem, 5vw, 4.2rem) 0; }
article > h1, article > h2:first-child { max-width: 24ch; margin: 0 0 1rem; color: var(--ink); font: 650 clamp(2.35rem, 5vw, 4.2rem)/1.05 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; letter-spacing: -.045em; }
article > h1 + p, article > h2:first-child + p, article .lead { max-width: 52rem; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.18rem); line-height: 1.55; }
article h2 { margin-top: 3rem; color: var(--ink); font-size: clamp(1.55rem, 2.7vw, 2.35rem); line-height: 1.12; letter-spacing: -.03em; }
article h3 { margin-top: 2rem; color: var(--ink); font-size: 1.25rem; }
article p, article li { max-width: 74ch; }
article img { max-width: 100%; }
article pre { padding: 1rem; overflow: auto; background: var(--code); border: 1px solid var(--line); border-radius: .55rem; }
article code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
article blockquote { margin-left: 0; padding-left: 1rem; border-left: 3px solid var(--accent); color: var(--muted); }
article table { border-collapse: collapse; display: block; overflow: auto; }
article th, article td { border: 1px solid var(--line); padding: .55rem .7rem; text-align: left; }
.index-section { margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.25rem; }
.section-heading h2 { margin: .35rem 0 0; }
.section-heading p { max-width: 34rem; margin: 0; color: var(--muted); font-size: .94rem; }
.index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.index-card { display: block; min-height: 8rem; padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--panel); color: var(--ink); text-decoration: none; }
.index-card:hover { border-color: var(--accent); }
.index-card h2 { margin: .55rem 0 .35rem; font-size: 1rem; font-weight: 650; letter-spacing: -.01em; }
.index-card p, .machine { color: var(--muted); font: .72rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.machine-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .5rem; }
.machine { display: block; padding: .7rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--panel); text-decoration: none; }
.boundary { margin-top: 3rem; padding: 1rem 1.25rem; border-left: 3px solid var(--accent); background: var(--panel); }
.boundary p { max-width: 70ch; margin-bottom: 0; }
.footer { display: grid; gap: .7rem; padding: 2rem 0 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.footer-estate, .footer-legal { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.footer-estate strong { color: var(--ink); margin-right: .35rem; }
.footer a { color: inherit; }
.footer small { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
@media (max-width: 60rem) { .estate-nav { gap: .45rem; } .estate-nav span { display: none; } }
@media (max-width: 48rem) { .topbar { flex-wrap: wrap; gap: .8rem; } .estate-nav { order: 3; width: 100%; justify-content: flex-start; overflow: auto; } .menu-button { display: inline-block; } .chapter-rail { display: none; position: fixed; inset: 4.25rem 0 0; z-index: 4; overflow: auto; } .chapter-rail[data-open="true"] { display: block; } .workspace { display: block; } .canvas { padding-top: 1.25rem; } .section-heading { display: block; } .section-heading p { margin-top: .7rem; } }
