:root {
  --paper: #f1ede5;
  --surface: #faf7f0;
  --surface-2: #e7dfd3;
  --ink: #1c2a30;
  --muted: #626e72;
  --line: rgba(28, 42, 48, .2);
  --blue: #315f6d;
  --blue-soft: #acc6ce;
  --clay: #c79c7d;
  --clay-dark: #76503d;
  --sage: #bdc9b2;
  --green: #287c5c;
  --amber: #a96f2c;
  --rose: #c9afb6;
  --shadow: 0 22px 52px rgba(42, 52, 53, .09);
  --sans: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

html[data-theme="dark"] {
  --paper: #0b1933;
  --surface: #122441;
  --surface-2: #1a3151;
  --ink: #eef3ff;
  --muted: #aebbd3;
  --line: rgba(225, 234, 255, .2);
  --blue: #91a9ff;
  --blue-soft: #315aa6;
  --clay: #b58e78;
  --clay-dark: #d1b19d;
  --sage: #344966;
  --green: #60d59a;
  --amber: #ffca66;
  --rose: #718dc3;
  --shadow: 0 22px 56px rgba(2, 9, 24, .3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { min-width: 0; margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
::selection { color: var(--surface); background: var(--blue); }
.shell { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 13px; color: var(--surface); background: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header { min-height: 88px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; justify-self: start; font-weight: 700; letter-spacing: -.035em; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: var(--surface); background: var(--ink); font-size: 10px; letter-spacing: -.04em; }
.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav a { font-size: 10px; font-weight: 700; letter-spacing: .13em; text-decoration: none; text-transform: uppercase; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 6px; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.theme-toggle { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; font-size: 18px; }
.theme-toggle:hover { color: var(--paper); background: var(--ink); }
.small-button { display: inline-flex; align-items: center; min-height: 40px; padding: 10px 13px; border: 1px solid var(--ink); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.small-button:hover { color: var(--surface); background: var(--ink); }

.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 28px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .19em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 30px; height: 2px; flex: 0 0 auto; background: currentColor; }
.hero { min-height: 760px; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr); align-items: center; gap: clamp(60px, 9vw, 130px); padding: 92px 0 110px; }
.hero h1, .tech-hero h1 { max-width: 820px; margin: 0; font-size: clamp(65px, 9vw, 116px); font-weight: 500; line-height: .88; letter-spacing: -.07em; }
.hero h1 em, .tech-hero h1 em { color: var(--blue); font-style: normal; font-weight: 400; }
.hero-lede, .tech-lede { max-width: 690px; margin: 34px 0 0; color: var(--muted); font-size: clamp(19px, 2vw, 24px); line-height: 1.48; letter-spacing: -.025em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 38px; }
.primary-link { display: inline-flex; align-items: center; gap: 16px; padding: 14px 17px; border: 1px solid var(--ink); color: var(--surface); background: var(--ink); font-size: 12px; font-weight: 700; text-decoration: none; }
.primary-link:hover { color: var(--ink); background: transparent; }
.text-link { font-size: 12px; font-weight: 700; text-underline-offset: 5px; }

.mail-machine { position: relative; width: min(100%, 430px); aspect-ratio: 1; justify-self: end; }
.mail-machine::before { content: ""; position: absolute; inset: 8%; border: 1px solid rgba(28, 42, 48, .42); border-radius: 50%; transform: scaleX(.78) rotate(-22deg); }
html[data-theme="dark"] .mail-machine::before { border-color: rgba(225, 234, 255, .42); }
.machine-address, .machine-vault, .machine-provider, .machine-envelope { position: absolute; display: grid; place-items: center; border: 1px solid var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.machine-address { top: 8%; left: 4%; width: 92px; aspect-ratio: 1; border-radius: 50%; color: var(--surface); background: var(--blue); font-family: var(--serif); font-size: 46px; }
.machine-provider { top: 5%; right: 2%; width: 122px; min-height: 92px; padding: 16px; font-size: 9px; font-weight: 800; letter-spacing: .13em; line-height: 1.6; text-align: center; text-transform: uppercase; }
.machine-provider b { display: block; color: var(--blue); font-size: 17px; letter-spacing: -.03em; text-transform: none; }
.machine-envelope { top: 50%; left: 50%; width: 46%; height: 31%; overflow: hidden; transform: translate(-50%, -50%); }
.machine-envelope::before, .machine-envelope::after { content: ""; position: absolute; left: 50%; width: 72%; aspect-ratio: 1; border: 1px solid var(--ink); background: var(--surface); transform: translateX(-50%) rotate(45deg); }
.machine-envelope::before { top: -72%; }
.machine-envelope::after { bottom: -80%; }
.machine-vault { right: 2%; bottom: 7%; width: 122px; min-height: 104px; padding: 16px; font-size: 9px; font-weight: 800; letter-spacing: .13em; line-height: 1.6; text-align: center; text-transform: uppercase; }
.machine-vault b { display: block; color: var(--blue); font-size: 18px; letter-spacing: -.03em; }
.machine-dot { position: absolute; width: 13px; aspect-ratio: 1; border-radius: 50%; background: var(--clay); }
.machine-dot.one { top: 21%; right: 15%; }
.machine-dot.two { left: 18%; bottom: 19%; background: var(--sage); }
.machine-caption { position: absolute; left: 2%; bottom: 2%; padding: 9px 11px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 10px; }

.signal-strip { overflow: hidden; border-block: 1px solid var(--line); color: var(--muted); }
.signal-track { width: max-content; display: flex; gap: 42px; padding: 17px 0; font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.signal-track span::after { content: "—"; margin-left: 42px; opacity: .5; }

.section { padding: 126px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 64px; align-items: start; margin-bottom: 64px; }
.section-kicker { margin: 10px 0 0; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.section-heading h2 { max-width: 900px; margin: 0; font-size: clamp(45px, 6vw, 76px); font-weight: 500; line-height: 1; letter-spacing: -.055em; }
.section-heading h2 em { color: var(--blue); font-family: var(--serif); font-weight: 400; }
.section-intro { max-width: 720px; margin: 28px 0 0; color: var(--muted); font-size: 18px; line-height: 1.65; }

.thesis { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(45px, 8vw, 110px); align-items: start; }
.thesis-quote { margin: 0; padding: 38px 0 38px 34px; border-left: 4px solid var(--clay); font-size: clamp(34px, 4.8vw, 59px); font-weight: 500; line-height: 1.03; letter-spacing: -.05em; }
.thesis-copy { color: var(--muted); font-size: 18px; line-height: 1.72; }
.thesis-copy p:first-child { margin-top: 0; }
.thesis-copy strong { color: var(--ink); font-weight: 600; }

.principle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.principle { min-height: 290px; padding: 30px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.principle:nth-child(2) { background: var(--surface-2); }
.principle:nth-child(3) { background: var(--sage); color: #1c2a30; }
.principle:nth-child(4) { background: var(--clay); color: #1c2a30; }
.principle-number { display: block; margin-bottom: 72px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.principle h3 { margin: 0 0 13px; font-size: 28px; font-weight: 500; letter-spacing: -.04em; }
.principle p { max-width: 470px; margin: 0; font-size: 15px; line-height: 1.62; opacity: .82; }

.journey { padding: 44px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.journey-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.journey-step { position: relative; min-height: 210px; padding: 24px 24px 20px 0; border-top: 2px solid var(--ink); }
.journey-step + .journey-step { padding-left: 24px; border-left: 1px solid var(--line); }
.journey-step::before { content: ""; position: absolute; top: -6px; left: 0; width: 10px; aspect-ratio: 1; border-radius: 50%; background: var(--blue); }
.journey-step + .journey-step::before { left: 24px; }
.journey-step span { display: block; margin-bottom: 54px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.journey-step h3 { margin: 0 0 9px; font-size: 18px; font-weight: 600; letter-spacing: -.025em; }
.journey-step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.journey-note { max-width: 760px; margin: 34px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.difference-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.difference { padding: 28px; border-top: 3px solid var(--clay); background: var(--surface); }
.difference h3 { margin: 0 0 12px; font-size: 21px; font-weight: 600; letter-spacing: -.035em; }
.difference p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.honesty { margin-top: 46px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 64px; padding-top: 34px; border-top: 1px solid var(--line); }
.honesty h3 { margin: 0; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.honesty p { max-width: 760px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }

.cta-panel { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); align-items: end; gap: 60px; padding: clamp(40px, 7vw, 82px); color: #faf7f0; background: #315f6d; }
.cta-panel h2 { margin: 0; font-size: clamp(48px, 7vw, 82px); font-weight: 500; line-height: .94; letter-spacing: -.06em; }
.cta-panel p { margin: 0 0 25px; color: rgba(250, 247, 240, .78); font-size: 16px; line-height: 1.65; }
.cta-panel .primary-link { color: #315f6d; border-color: #faf7f0; background: #faf7f0; }
.cta-panel .primary-link:hover { color: #faf7f0; background: transparent; }

/* Technical page */
.tech-hero { padding: 96px 0 88px; border-bottom: 1px solid var(--line); }
.tech-hero h1 { max-width: 1000px; font-size: clamp(62px, 9vw, 108px); }
.fact-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 58px; border-block: 1px solid var(--line); }
.fact { padding: 20px 20px 20px 0; }
.fact + .fact { padding-left: 20px; border-left: 1px solid var(--line); }
.fact span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.fact strong { font-size: 14px; font-weight: 600; }
.status-live { color: var(--green); }
.status-concept { color: var(--amber); }

.tech-section { padding: 92px 0; border-bottom: 1px solid var(--line); }
.tech-heading { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 54px; margin-bottom: 46px; }
.tech-heading .number { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.tech-heading h2 { max-width: 860px; margin: 0; font-size: clamp(38px, 5vw, 62px); font-weight: 500; line-height: 1; letter-spacing: -.05em; }
.tech-heading p { max-width: 760px; margin: 18px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }

.architecture { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.flow-panel { padding: 30px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.flow-panel h3 { margin: 0 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -.04em; }
.flow-panel > p { margin: 0 0 30px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.flow-list { list-style: none; margin: 0; padding: 0; counter-reset: flow; }
.flow-list li { position: relative; min-height: 70px; padding: 0 0 22px 48px; counter-increment: flow; }
.flow-list li:not(:last-child)::after { content: ""; position: absolute; top: 30px; bottom: 4px; left: 14px; border-left: 1px solid var(--line); }
.flow-list li::before { content: counter(flow, decimal-leading-zero); position: absolute; top: 0; left: 0; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: var(--surface); background: var(--ink); font-size: 8px; font-weight: 800; }
.flow-list strong { display: block; margin-bottom: 5px; font-size: 13px; }
.flow-list span { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.trust-note { margin-top: 22px; padding: 16px; border-left: 3px solid var(--amber); color: var(--muted); background: var(--surface-2); font-size: 12px; line-height: 1.55; }

.component-table, .schema-table, .failure-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.component-table th, .component-table td, .schema-table th, .schema-table td, .failure-table th, .failure-table td { padding: 16px 17px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.component-table th, .schema-table th, .failure-table th { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.component-table td, .schema-table td, .failure-table td { font-size: 13px; line-height: 1.55; }
.component-table td:first-child, .schema-table td:first-child { font-weight: 700; }
.component-table code, .schema-table code, .failure-table code, .inline-code { padding: 2px 5px; color: var(--ink); background: var(--surface-2); font: 12px/1.4 Consolas, "SFMono-Regular", monospace; overflow-wrap: anywhere; }

.security-grid, .decision-grid, .gap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.agent-heroes, .agent-component-table, .learning-panels { margin-top: 14px; }
.learning-panels .flow-panel > p { margin-bottom: 0; }
.security-card, .decision, .gap { padding: 26px; border: 1px solid var(--line); background: var(--surface); }
.security-card span, .decision span, .gap span { display: block; margin-bottom: 26px; color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.security-card h3, .decision h3, .gap h3 { margin: 0 0 10px; font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.security-card p, .decision p, .gap p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.62; }
.gap { border-top: 3px solid var(--amber); }
.gap span { color: var(--amber); }

.data-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 42px; align-items: start; }
.data-copy { color: var(--muted); font-size: 15px; line-height: 1.7; }
.data-copy h3 { margin: 0 0 12px; color: var(--ink); font-size: 26px; font-weight: 600; letter-spacing: -.04em; }
.data-copy p { margin: 0 0 24px; }
.maildir-tree { padding: 22px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); font: 12px/1.8 Consolas, "SFMono-Regular", monospace; white-space: pre-wrap; }

.path-pair { display: grid; gap: 14px; }
.diagram { overflow-x: auto; padding: 28px; border: 1px solid var(--line); background: var(--surface); }
.diagram-label { margin: 0 0 20px; color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.diagram-track { min-width: 880px; display: flex; align-items: stretch; gap: 24px; }
.diagram-track-outbound { min-width: 760px; }
.diagram-node { position: relative; flex: 1; min-width: 130px; padding: 18px; border: 1px solid var(--ink); background: var(--paper); }
.diagram-node:not(:last-child)::after { content: "→"; position: absolute; top: 50%; right: -19px; color: var(--blue); font-size: 18px; transform: translateY(-50%); }
.diagram-node small { display: block; margin-bottom: 25px; color: var(--muted); font-size: 8px; letter-spacing: .13em; text-transform: uppercase; }
.diagram-node strong { display: block; font-size: 13px; line-height: 1.4; }
.diagram-node.boundary { border-style: dashed; border-color: var(--amber); }
.diagram-node.concept { border-style: dashed; border-color: var(--blue); }
.diagram-legend { display: flex; gap: 20px; margin-top: 18px; color: var(--muted); font-size: 10px; }
.diagram-legend span::before { content: ""; width: 18px; display: inline-block; margin-right: 7px; border-top: 1px solid var(--ink); vertical-align: middle; }
.diagram-legend .external::before { border-top-style: dashed; border-color: var(--amber); }
.diagram-legend .conceptual::before { border-top-style: dashed; border-color: var(--blue); }
.scope-note { border-left-color: var(--blue); }

.tech-footer-cta { padding: 80px 0 100px; }
.tech-footer-cta .cta-panel { background: #253f55; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 34px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.site-footer .brand { color: var(--ink); font-size: 13px; text-transform: none; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .mail-machine { width: min(530px, 100%); justify-self: center; }
  .thesis, .data-layout { grid-template-columns: 1fr; }
  .journey-flow { grid-template-columns: 1fr 1fr; }
  .journey-step:nth-child(3) { border-left: 0; }
  .difference-grid { grid-template-columns: 1fr; }
  .architecture { grid-template-columns: 1fr; }
  .cta-panel { grid-template-columns: 1fr; align-items: start; }
  .fact-strip { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .fact:nth-child(4) { border-top: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 72px; }
  .brand-mark { width: 34px; height: 34px; }
  .small-button { width: 40px; padding: 0; justify-content: center; font-size: 0; }
  .small-button::after { content: "↗"; font-size: 14px; }
  .hero { gap: 40px; padding: 62px 0 80px; }
  .hero h1, .tech-hero h1 { font-size: clamp(53px, 16vw, 76px); }
  .mail-machine { width: min(88vw, 390px); }
  .machine-address { width: 72px; font-size: 37px; }
  .machine-provider { width: 104px; min-height: 82px; padding: 12px; }
  .machine-vault { width: 102px; min-height: 88px; }
  .section { padding: 84px 0; }
  .section-heading, .tech-heading { grid-template-columns: 1fr; gap: 18px; }
  .principle-grid, .security-grid, .decision-grid, .gap-grid { grid-template-columns: 1fr; }
  .principle { min-height: 250px; }
  .journey { padding: 24px; }
  .journey-flow { grid-template-columns: 1fr; }
  .journey-step + .journey-step { padding-left: 0; border-left: 0; }
  .journey-step + .journey-step::before { left: 0; }
  .honesty { grid-template-columns: 1fr; gap: 16px; }
  .tech-hero { padding: 70px 0 64px; }
  .fact-strip { grid-template-columns: 1fr; }
  .fact + .fact { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .component-table, .schema-table, .failure-table { display: block; overflow-x: auto; white-space: normal; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
