:root {
  color-scheme: light;
  --ink: #1c1a17;
  --paper: #f3efe7;
  --paper-deep: #e8e0d2;
  --rust: #9d3f2d;
  --moss: #4a5e4e;
  --gold: #c38b24;
  --line: rgba(28, 26, 23, 0.19);
  --shell: min(1180px, calc(100vw - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.shell { width: var(--shell); margin-inline: auto; }

.nav {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; font-weight: 750; }
.brand small { display: block; font-size: 10px; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.brand-mark { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(var(--rust) 0 28%, var(--gold) 28% 52%, var(--moss) 52% 76%, var(--ink) 76%); }
.site-nav { display: flex; align-items: center; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.site-nav a { padding: 8px 11px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.site-nav a:hover:not(.button), .site-nav a[aria-current="page"] { color: var(--paper); background: var(--rust); }
.site-nav .button-small { min-height: 34px; padding-inline: 15px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.button:hover { background: var(--rust); border-color: var(--rust); }
.button-small { min-height: 38px; padding-inline: 17px; }
.button-light { color: var(--ink); background: var(--paper); border-color: var(--paper); }
.button-light:hover { color: var(--paper); background: transparent; }

.hero { padding: clamp(72px, 10vw, 142px) 0 42px; }
.eyebrow, .section-number { font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.045em; line-height: .95; }
h1 { max-width: 920px; font-size: clamp(58px, 9.5vw, 132px); }
h1 em { color: var(--rust); font-weight: 400; }
.lede { max-width: 680px; margin: 38px 0 28px; font-size: clamp(19px, 2.2vw, 28px); line-height: 1.35; }
.actions { display: flex; align-items: center; gap: 25px; }
.text-link { font-weight: 700; text-underline-offset: 5px; }
.agent-flow { list-style: none; display: grid; grid-template-columns: repeat(5,1fr); padding: 0; margin: 86px 0 0; border: 1px solid var(--line); }
.agent-flow li { position: relative; min-height: 92px; padding: 17px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.agent-flow li:not(:last-child)::after { content: "→"; position: absolute; right: -9px; top: 34px; z-index: 1; padding: 0 3px; color: var(--rust); background: var(--paper); font-weight: 800; }
.agent-flow li:last-child { color: var(--paper); background: var(--rust); border-right: 0; }
.agent-flow small { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.agent-flow b { font-size: 14px; }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 18px; border: 1px solid var(--line); }
.palette span { position: relative; min-height: 158px; padding: 18px; display: flex; flex-direction: column; justify-content: end; color: white; background: var(--swatch); }
.palette span:nth-child(2), .palette span:nth-child(5) { color: var(--ink); }
.palette b { font-size: 13px; }
.palette small { opacity: .76; }

.manifesto { display: grid; grid-template-columns: 1fr 3fr; gap: 40px; padding: 150px 0; border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(42px, 6.5vw, 82px); }
.manifesto div p { max-width: 700px; margin: 36px 0 0; font-size: 20px; }

.pipeline { padding: 140px 0; }
.section-heading { display: grid; grid-template-columns: 1fr 3fr; gap: 40px; }
.pipeline ol { list-style: none; padding: 0; margin: 84px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); }
.pipeline li { padding: 22px 18px 0 0; border-right: 1px solid var(--line); }
.pipeline li + li { padding-left: 18px; }
.pipeline li:last-child { border-right: 0; }
.pipeline li > span { display: block; color: var(--rust); font-family: Georgia, serif; font-size: 34px; }
.pipeline strong { display: block; margin-top: 42px; font-size: 18px; }
.pipeline p { font-size: 14px; }

.evidence { color: var(--paper); background: var(--ink); }
.evidence-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 80px; padding: 140px 0; }
.evidence .section-number { color: #d9a441; }
.principles { border-top: 1px solid rgba(243,239,231,.25); }
.principles article { display: grid; grid-template-columns: 160px 1fr; gap: 25px; padding: 24px 0; border-bottom: 1px solid rgba(243,239,231,.25); }
.principles span { font-weight: 750; }
.principles p { margin: 0; color: rgba(243,239,231,.72); }

.roadmap { padding: 140px 0; }
.roadmap h2 { max-width: 800px; }
.roadmap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 70px; }
.roadmap-grid div { min-height: 210px; padding: 26px; border: 1px solid var(--line); }
.roadmap-grid b { font-family: Georgia, serif; font-size: 26px; }
.roadmap-grid p { margin-top: 50px; }

.explore { padding: 140px 0 20px; border-top: 1px solid var(--line); }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 70px; }
.feature { min-height: 300px; padding: 30px; border: 1px solid var(--line); text-decoration: none; transition: transform .2s ease, background .2s ease; }
.feature:hover { transform: translateY(-4px); background: var(--paper-deep); }
.feature-accent { color: var(--paper); background: var(--rust); border-color: var(--rust); }
.feature-accent:hover { background: #853523; }
.feature span, .kicker { font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.feature h3 { margin: 28px 0 10px; font: 400 clamp(34px, 4vw, 54px)/1 Georgia, serif; letter-spacing: -.035em; }
.feature p { max-width: 520px; min-height: 70px; }
.feature b { display: inline-block; margin-top: 30px; }

/* Interior pages */
.page-hero { padding: clamp(70px, 9vw, 125px) 0 80px; border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 1050px; font-size: clamp(52px, 8vw, 104px); }
.page-hero .lede { max-width: 760px; }
.breadcrumbs { margin-bottom: 34px; font-size: 13px; }
.breadcrumbs a { text-underline-offset: 4px; }
.content-section { padding: 90px 0; }
.content-section + .content-section { border-top: 1px solid var(--line); }
.content-section h2 { font-size: clamp(38px, 5vw, 64px); }
.intro-grid { display: grid; grid-template-columns: .8fr 1.8fr; gap: 60px; }
.intro-grid > *, .article-layout > *, .section-heading > * { min-width: 0; }
.prose { max-width: 760px; }
.prose p, .prose li { font-size: 18px; line-height: 1.7; }
.prose h2 { margin-top: 70px; }
.prose h3 { margin-top: 42px; font: 400 30px/1.15 Georgia, serif; }
.prose code, .code-block { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-block { overflow-x: auto; padding: 24px; color: #f3efe7; background: #1c1a17; font-size: 14px; line-height: 1.7; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 55px; }
.card { padding: 26px; border: 1px solid var(--line); }
.card h3 { margin: 25px 0 10px; font: 400 30px/1.05 Georgia, serif; }
.card p { color: rgba(28,26,23,.72); }
.card a { font-weight: 750; text-underline-offset: 4px; }
.status { display: inline-flex; padding: 5px 9px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

/* Playground */
.tool-layout { display: grid; grid-template-columns: minmax(260px,.75fr) minmax(0,1.65fr); gap: 22px; padding: 70px 0 110px; }
.tool-panel, .tool-output { padding: 28px; border: 1px solid var(--line); }
.tool-panel h2, .tool-output h2 { font-size: 36px; }
.field { display: grid; gap: 9px; margin-top: 26px; }
.field label { font-size: 13px; font-weight: 750; }
.color-input { display: grid; grid-template-columns: 52px 1fr; gap: 10px; }
input[type="color"] { width: 52px; height: 48px; padding: 3px; border: 1px solid var(--line); background: transparent; }
input[type="text"] { width: 100%; min-height: 48px; padding: 0 14px; color: var(--ink); background: #fffaf2; border: 1px solid var(--line); border-radius: 0; font: inherit; text-transform: uppercase; }
.tool-note { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: rgba(28,26,23,.7); }
.tool-version { margin: 8px 0 0; color: rgba(28,26,23,.68); font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.generated-preview { min-height: 220px; margin: 28px 0; padding: 34px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); }
.preview-button { align-self: flex-start; padding: 12px 17px; border-radius: 999px; font-weight: 750; }
.token-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.token { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 12px; background: var(--paper); }
.token-swatch { width: 44px; height: 44px; border: 1px solid rgba(28,26,23,.15); background: var(--token); }
.token-sample { display: grid; place-items: center; font-style: normal; font-weight: 800; }
.token span { font-size: 13px; }
.token b { font-size: 12px; font-family: ui-monospace, monospace; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
button.button { cursor: pointer; font: inherit; }
.button-secondary { color: var(--ink); background: transparent; }
.button-secondary:hover { color: var(--paper); }
.result-message { min-height: 24px; font-size: 13px; font-weight: 700; }

/* Compiler */
.compiler-role-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; margin-top: 70px; background: var(--line); border: 1px solid var(--line); }
.compiler-role-grid article { min-height: 230px; padding: 26px; background: var(--paper); }
.compiler-role-grid b { font: 400 29px/1.05 Georgia, serif; }
.compiler-role-grid p { margin-top: 55px; color: rgba(28,26,23,.72); }

/* Recipes and examples */
.recipe-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.recipe { overflow: hidden; border: 1px solid var(--line); }
.recipe-preview { min-height: 250px; padding: 30px; display: flex; flex-direction: column; justify-content: space-between; }
.recipe-preview h3 { max-width: 360px; margin: 0; font: 400 42px/1 Georgia, serif; }
.recipe-meta { display: grid; grid-template-columns: 1fr 1fr; }
.recipe-meta div { padding: 16px; border-top: 1px solid var(--line); }
.recipe-meta div + div { border-left: 1px solid var(--line); }
.recipe-meta small { display: block; opacity: .62; }
.recipe-meta b { font-family: ui-monospace, monospace; font-size: 13px; }
.example-stack { display: grid; gap: 34px; margin-top: 60px; }
.example { display: grid; grid-template-columns: .7fr 1.3fr; min-height: 400px; border: 1px solid var(--line); }
.example-copy { padding: 34px; }
.example-copy h3 { font: 400 38px/1 Georgia, serif; }
.example-ui { padding: 45px; display: grid; place-items: center; }
.mini-window { width: min(100%, 480px); padding: 22px; background: var(--mini-surface); color: var(--mini-text); box-shadow: 0 24px 80px rgba(0,0,0,.18); }
.mini-window .mini-bar { height: 8px; width: 38%; margin-bottom: 36px; background: var(--mini-muted); }
.mini-window h4 { margin: 0; font: 400 32px/1.05 Georgia, serif; }
.mini-window p { opacity: .72; }
.mini-window b { display: inline-block; margin-top: 22px; padding: 10px 14px; color: var(--mini-button-text); background: var(--mini-button); }

.closing { padding: 80px; color: var(--paper); background: var(--rust); display: flex; align-items: center; justify-content: space-between; }
.closing p { max-width: 650px; margin: 0; font-family: Georgia, serif; font-size: clamp(38px, 5vw, 68px); line-height: 1; }
footer { display: flex; justify-content: space-between; padding: 38px 0 55px; font-size: 13px; }
footer a { font-weight: 750; text-underline-offset: 4px; }

/* Long-form guides */
.article-layout { display: grid; grid-template-columns: 230px minmax(0,760px); justify-content: space-between; gap: 70px; }
.article-menu { position: sticky; top: 24px; align-self: start; display: grid; border-top: 1px solid var(--line); }
.article-menu .kicker { padding: 18px 0 12px; }
.article-menu a { padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; font-size: 13px; }
.article-menu a:hover { color: var(--rust); }
.guide-prose h2 { scroll-margin-top: 25px; font-size: clamp(40px,5vw,62px); }
.article-intro { margin-top: 0; font: 400 clamp(24px,3vw,34px)/1.35 Georgia, serif; }
.guide-callout { margin: 38px 0; padding: 26px; border-left: 5px solid var(--rust); background: var(--paper-deep); }
.guide-callout b { display: block; font-family: Georgia, serif; font-size: 24px; }
.guide-callout p { margin-bottom: 0; }
.guide-callout-dark { color: var(--paper); background: var(--ink); border-color: var(--gold); }
.role-table { width: 100%; margin: 35px 0; border-collapse: collapse; font-size: 15px; }
.role-table th, .role-table td { padding: 15px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.role-table th { color: var(--paper); background: var(--ink); }
.article-palette { display: grid; grid-template-columns: repeat(4,1fr); margin: 34px 0; }
.article-palette span { min-height: 145px; padding: 16px; display: flex; flex-direction: column; justify-content: end; background: var(--sample); }
.article-palette small { opacity: .76; }
.checklist { padding: 0; list-style: none; counter-reset: guide-check; }
.checklist li { position: relative; padding: 17px 16px 17px 58px; border-top: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 1px solid var(--line); }
.checklist li::before { counter-increment: guide-check; content: counter(guide-check, decimal-leading-zero); position: absolute; left: 12px; color: var(--rust); font: 700 15px Georgia, serif; }
.article-ending { margin-top: 70px; padding: 32px; color: var(--paper); background: var(--rust); display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.article-ending b, .article-ending span { display: block; }
.article-ending b { font: 400 25px/1.1 Georgia, serif; }
.article-ending span { margin-top: 6px; font-size: 13px; opacity: .8; }

@media (max-width: 760px) {
  .nav { min-height: 0; padding: 18px 0 0; flex-wrap: wrap; gap: 16px; }
  .site-nav { width: 100%; padding: 8px 0 12px; overflow-x: auto; border: 0; border-top: 1px solid var(--line); border-radius: 0; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 7px 10px; }
  .site-nav .button { min-height: 32px; }
  .palette { grid-template-columns: 1fr; }
  .palette span { min-height: 92px; }
  .agent-flow { grid-template-columns: 1fr; margin-top: 60px; }
  .agent-flow li { min-height: 74px; border-right: 0; border-bottom: 1px solid var(--line); }
  .agent-flow li:not(:last-child)::after { content: "↓"; right: 18px; top: auto; bottom: -10px; }
  .manifesto, .section-heading, .evidence-grid { grid-template-columns: 1fr; }
  .pipeline ol, .roadmap-grid, .feature-grid, .card-grid, .recipe-grid, .compiler-role-grid { grid-template-columns: 1fr; }
  .tool-layout, .intro-grid, .example { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; gap: 38px; }
  .article-menu { position: static; grid-template-columns: 1fr 1fr; }
  .article-menu .kicker { grid-column: 1 / -1; }
  .article-menu a { padding-right: 12px; }
  .article-palette { grid-template-columns: 1fr 1fr; }
  .article-ending { align-items: flex-start; flex-direction: column; }
  .role-table { display: block; overflow-x: auto; }
  .tool-panel, .tool-output { padding: 20px; }
  .token { grid-template-columns: 44px minmax(0,1fr); }
  .token b { grid-column: 2; }
  .pipeline li { min-height: 190px; border-right: 0; border-bottom: 1px solid var(--line); padding-left: 0 !important; }
  .closing { padding: 45px 28px; flex-direction: column; align-items: flex-start; gap: 35px; }
  footer { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
