:root {
  --paper: #f6f5f1;
  --ink: #15150f;
  --muted: #68675f;
  --rule: #dad8cf;
  --accent: #c2410c;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 56px);
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #0d0d0b; --ink: #eceae2; --muted: #96958b; --rule: #2b2a25; --accent: #f08a4b; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }

.wrap { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; padding: 8px 12px; background: var(--ink); color: var(--paper); z-index: 10; }
.skip:focus { left: 8px; }
.label { font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Header and footer */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; position: relative; z-index: 2; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.brand svg { width: 16px; height: 18px; }
.site-header nav { display: flex; gap: clamp(16px, 3vw, 32px); font-size: 15px; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--ink); }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 48px; margin-top: 120px; padding-block: 32px 48px; border-top: 1px solid var(--rule); font-size: 13px; line-height: 1.7; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Home hero */
.hero { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: min(calc(100svh - 72px), 960px); }
.hero-text { padding-block: clamp(28px, 6vh, 72px) 0; }
.hero h1 { max-width: 15em; font: 400 clamp(2.1rem, 4.7vw, 3.9rem)/1.08 var(--serif); letter-spacing: -0.022em; text-wrap: balance; }
.hero .lede { margin-top: 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: 20px; }
.lede { max-width: 34em; font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.5; color: var(--muted); }
.figure { display: flex; flex-direction: column; margin: 0; min-height: 0; }
.stage { position: relative; flex: 1; min-height: clamp(300px, 46vh, 460px); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.stage canvas.live { cursor: crosshair; }
.figure-bar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 12px 40px; min-height: 64px; padding-block: 14px 8px; font: 11px/1.6 var(--mono); letter-spacing: 0.02em; color: var(--muted); }
.figure-note { flex: 1 1 26em; max-width: 64ch; }
.figure-tools { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.figure-tools[hidden] { display: none; }
.figure-tools span { margin-right: 8px; }
.figure-tools button { min-width: 9ch; padding: 5px 10px; border: 1px solid var(--rule); border-radius: 2px; background: none; color: var(--ink); font: inherit; letter-spacing: 0.04em; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.figure-tools button:hover { border-color: var(--ink); }
.figure-tools button:active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Home sections */
.block { padding-top: 96px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.more { font-size: 15px; text-decoration: none; white-space: nowrap; }
.more span { display: inline-block; transition: transform 0.15s; }
.more:hover span { transform: translateX(3px); }
.rows li { border-bottom: 1px solid var(--rule); }
.rows a { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 8px 40px; align-items: baseline; padding-block: 20px; text-decoration: none; }
.rows h3 { font: 400 clamp(1.2rem, 2vw, 1.5rem)/1.25 var(--serif); letter-spacing: -0.01em; }
.rows p { color: var(--muted); transition: color 0.15s; }
.rows a:hover p { color: var(--ink); }
.kinds a { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px 40px; }
.split > div > * + * { margin-top: 20px; }
.statement { max-width: 24em; font: 400 clamp(1.3rem, 2.3vw, 1.7rem)/1.3 var(--serif); letter-spacing: -0.012em; }
.split .terms { margin-top: 32px; max-width: 40em; }

/* Work with us */
.pitch { max-width: 26em; padding-top: 40px; }
.offers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin-top: 48px; border-bottom: 1px solid var(--rule); }
.offers > li { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-block: 24px 32px; border-top: 1px solid var(--rule); }
.offers h3 { margin-top: 6px; font: 400 clamp(1.2rem, 2vw, 1.5rem)/1.25 var(--serif); letter-spacing: -0.01em; }
.offers p:not(.label) { max-width: 30em; color: var(--muted); }
.offers .more { margin-top: auto; padding-top: 8px; }
.contact-line { margin-top: 28px; color: var(--muted); }
.contact-line a { color: var(--ink); }

/* Research notes, cited like references */
.notes a { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.notes a > div > * + * { margin-top: 6px; }
.block-intro { max-width: 40em; padding-block: 20px 4px; color: var(--muted); }
.refs { margin-top: 20px; border-top: 1px solid var(--rule); }
.offers .refs { align-self: stretch; margin-top: 4px; }
.offers .refs li { display: block; }
.refs li { padding: 0 !important; text-indent: 0 !important; border-bottom: 1px solid var(--rule); }
.refs li::before { content: none !important; }
.refs li + li { margin-top: 0 !important; }
.cite { display: grid; grid-template-columns: 12em minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding-block: 10px; color: var(--ink); text-decoration: none; }
.cite::after { content: "→"; color: var(--muted); transition: transform 0.15s, color 0.15s; }
.cite:hover::after { transform: translateX(3px); color: var(--ink); }
.cite .label { white-space: nowrap; }
.cite-title { font: 400 1.05rem/1.35 var(--serif); }
.cite:hover .cite-title { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.22em; }
.note-body > p:first-child { margin-top: 0; }
.entry .links { color: var(--ink); }
.entry .links li { padding-left: 0; text-indent: 0; }
.entry .links li::before { content: none; }
.links li + li { margin-top: 6px; }
.links .more, .note-next .more { white-space: normal; }
.edition { color: var(--muted); font-size: 15px; }
.note-next { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; padding-top: 36px; border-top: 1px solid var(--rule); }

/* Inner pages */
.page-head { padding-block: clamp(56px, 10vw, 120px) clamp(40px, 6vw, 72px); }
.page-head h1 { margin-top: 20px; max-width: 16em; font: 400 clamp(2.1rem, 4.7vw, 3.6rem)/1.08 var(--serif); letter-spacing: -0.022em; text-wrap: balance; }
.page-head .lede { margin-top: 24px; }
.entry { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 12px 40px; padding-block: 36px; border-top: 1px solid var(--rule); }
.entry > .label { padding-top: 0.45em; }
.entry > div { max-width: 40em; }
.entry h2 { font: 400 clamp(1.35rem, 2.3vw, 1.7rem)/1.25 var(--serif); letter-spacing: -0.012em; }
.entry div > * + * { margin-top: 14px; }
.entry ul { color: var(--muted); }
.entry li { padding-left: 1.2em; text-indent: -1.2em; }
.entry li::before { content: "–"; display: inline-block; width: 1.2em; text-indent: 0; }
.entry li + li { margin-top: 4px; }
.names { font: 400 clamp(1.15rem, 1.9vw, 1.4rem)/1.5 var(--serif); }
.terms { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 10px 24px; }
.terms dt { color: var(--muted); }
.prose > * { max-width: 40em; }
.prose h2 { margin-top: 40px; font: 400 1.35rem/1.25 var(--serif); }
.prose p, .prose ul, .prose ol, .prose dl { margin-top: 12px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: "– "; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--muted); }
.prose dt { margin-top: 14px; font-weight: 600; }
.prose code { font: 0.92em var(--mono); }
.prose .table { max-width: none; margin-top: 20px; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.prose th, .prose td { padding: 9px 16px 9px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose th { border-bottom-color: var(--ink); font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.prose .caption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.prose .formula { padding: 14px 0 14px 20px; border-left: 2px solid var(--accent); font: 15px/1.5 var(--mono); }

/* Note pages */
.meta { margin-top: 20px; font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.aside { font-size: 15px; color: var(--muted); }
.entry.brief ul { color: var(--ink); }
.entry.brief li + li { margin-top: 10px; }
.entry.note { padding-bottom: 56px; }
.entry > .prose { max-width: 40em; }
.entry .prose ul, .entry .prose ol { color: inherit; }
.entry .prose li { padding-left: 0; text-indent: 0; }
.entry .prose li::before { content: none; }
.contents { position: sticky; top: 24px; align-self: start; padding-top: 0.45em; }
.contents ol { margin-top: 12px; padding: 0; list-style: none; font-size: 14px; line-height: 1.4; color: var(--muted); }
.contents li { padding: 0; text-indent: 0; }
.contents li::before { content: none; }
.contents li + li { margin-top: 8px; }
.contents a { text-decoration: none; }
.contents a:hover { color: var(--ink); }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header { height: 64px; }
  .hero { min-height: calc(100svh - 64px); }
  .hero-text { padding-block: 32px 0; }
  .stage canvas { -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
  .figure-bar { min-height: 132px; }
  .figure-tools { flex: 1 1 100%; flex-wrap: wrap; }
  .figure-tools span { flex: 1 1 100%; }
  .block { padding-top: 72px; }
  .rows a, .split, .entry, .offers, .notes a { grid-template-columns: minmax(0, 1fr); }
  .contents { position: static; }
  .entry.note { gap: 28px; }
  .cite { grid-template-columns: minmax(0, 1fr) auto; }
  .cite .label { grid-column: 1 / -1; }
  .rows a { gap: 4px; padding-block: 16px; }
  .kinds a { gap: 8px; }
  .pitch { padding-top: 28px; }
  .offers { margin-top: 32px; }
  .entry { padding-block: 28px; }
  .terms { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .terms dd + dt { margin-top: 12px; }
  .site-footer { margin-top: 80px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .figure, .site-header nav { display: none; } .hero { min-height: 0; } }
