:root {
  --cream: #f7f1e4;
  --cream-soft: #fbf7ed;
  --cream-deep: #efe6d1;
  --mint: #bee7c9;
  --mint-soft: #ddf4e5;
  --graphite: #23231f;
  --copper: #b87333;
  --line: rgba(35, 35, 31, 0.12);
  --line-strong: rgba(35, 35, 31, 0.35);
  --max: 1280px;
  --gutter: clamp(24px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--graphite);
  background: var(--cream);
  font-family: "IBM Plex Sans", "Hanken Grotesk", "Barlow", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--graphite); outline-offset: 4px; }
img { display: block; max-width: 100%; }

.page-grid {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 18% 18%, rgba(221,244,229,.30), transparent 34%),
    radial-gradient(circle at 84% 64%, rgba(190,231,201,.18), transparent 32%);
  background-size: auto, auto;
  background-repeat: no-repeat, no-repeat;
}
.page-grid::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .4;
  background-image: url("header-graphy-original.png");
  background-size: 80px 160px;
  background-repeat: repeat;
  mix-blend-mode: multiply;
}
.site-header, main, footer {
  position: relative;
  z-index: 1;
}
.container { width: min(var(--max), 100%); margin: 0 auto; padding: 0 var(--gutter); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); }

.nav { min-height: 88px; align-items: center; border-bottom: 1px solid var(--line); }
.brand { grid-column: span 6; display: inline-flex; align-items: center; gap: 16px; min-height: 44px; }
.brand img { width: 44px; height: 44px; object-fit: contain; opacity: .86; mix-blend-mode: multiply; }
.brand-title, .brand-subtitle { display: block; text-transform: uppercase; }
.brand-title { font-size: 14px; line-height: 1; font-weight: 500; letter-spacing: .22em; }
.brand-subtitle { margin-top: 6px; font-size: 12px; line-height: 1; letter-spacing: .18em; opacity: .52; }
.nav-links { grid-column: span 6; display: flex; justify-content: flex-end; gap: 32px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; opacity: .68; }
.nav-links a { min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a:hover { opacity: 1; }

.hero { padding: clamp(72px, 9vw, 128px) var(--gutter) clamp(88px, 11vw, 144px); }
.eyebrow { grid-column: span 2; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; opacity: .45; }
.hero-main { grid-column: 4 / span 8; }
h1 { margin: 0; max-width: 960px; font-size: clamp(56px, 8.8vw, 138px); line-height: .88; font-weight: 300; letter-spacing: -.055em; text-wrap: balance; }
.hero-copy { margin-top: 40px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); }
.intro { grid-column: span 7; max-width: 58ch; margin: 0; font-size: 18px; line-height: 1.72; opacity: .72; text-wrap: pretty; }
.focus { grid-column: 9 / span 4; border-left: 2px solid var(--line-strong); padding-left: 20px; padding-top: 4px; align-self: start; font-size: 14px; line-height: 1.65; opacity: .7; }
.label { margin: 0 0 12px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; opacity: .55; }

.content { background: rgba(251, 247, 237, .74); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: clamp(80px, 9vw, 112px) 0; }
.section-label { grid-column: span 3; margin: 0; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; opacity: .45; }
.work-list { grid-column: span 9; border-top: 1px solid rgba(35,35,31,.18); border-bottom: 1px solid rgba(35,35,31,.18); }
.work-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); padding: clamp(32px, 4vw, 44px) 0; border-bottom: 1px solid var(--line); }
.work-row:last-child { border-bottom: 0; }
.work-row:hover .arrow { transform: translateX(6px); }
.num { grid-column: span 2; font-size: 14px; opacity: .45; font-variant-numeric: tabular-nums; }
.work-title { grid-column: span 6; }
.work-title h2 { margin: 0; font-size: clamp(34px, 4vw, 64px); line-height: .94; font-weight: 300; letter-spacing: -.04em; }
.work-title p { max-width: 52ch; margin: 18px 0 0; font-size: 16px; line-height: 1.7; opacity: .66; text-wrap: pretty; }
.meta { grid-column: span 3; font-size: 13px; line-height: 1.5; letter-spacing: .14em; text-transform: uppercase; opacity: .45; }
.arrow { grid-column: span 1; justify-self: end; color: var(--copper); font-size: 34px; line-height: 1; font-weight: 300; transition: transform .18s ease; }

.notes { padding: clamp(80px, 9vw, 112px) 0; }
.note-grid { grid-column: span 9; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.note { min-height: 260px; background: var(--cream-soft); padding: clamp(24px, 3vw, 32px); }
.note.mint { background-color: var(--mint-soft); background-image: linear-gradient(90deg, rgba(221,244,229,.94), rgba(221,244,229,.78)); background-repeat: no-repeat; }
.note h3 { margin: 48px 0 0; font-size: 26px; line-height: 1.08; font-weight: 300; letter-spacing: -.03em; }
.note p { margin: 20px 0 0; font-size: 14px; line-height: 1.65; opacity: .66; text-wrap: pretty; }
.note .label { margin-top: 0; }

.project-hero, .article-hero { padding: clamp(72px, 9vw, 120px) var(--gutter) clamp(48px, 7vw, 88px); }
.project-title, .article-title { grid-column: 3 / span 7; }
.project-title p, .article-title p { max-width: 58ch; margin: 32px 0 0; font-size: 18px; line-height: 1.72; opacity: .72; text-wrap: pretty; }
.project-meta { grid-column: 11 / span 2; margin: 0; font-size: 12px; line-height: 1.6; letter-spacing: .16em; text-transform: uppercase; opacity: .52; }
.image-strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); padding-bottom: clamp(72px, 8vw, 104px); }
.image-strip figure { margin: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.image-strip figure:first-child { grid-column: span 7; }
.image-strip figure:not(:first-child) { grid-column: span 5; }
.image-strip img, .article-media img { width: 100%; background: var(--cream-deep); }
figcaption { margin-top: 12px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .5; }
.project-sections, .article-body { padding: clamp(72px, 8vw, 104px) var(--gutter); border-top: 1px solid var(--line); }
.project-section, .article-block { grid-column: span 6; max-width: 60ch; }
.project-section p:last-child, .article-block p:last-child { margin: 0; font-size: 18px; line-height: 1.75; opacity: .72; text-wrap: pretty; }
.article-media { padding-bottom: clamp(48px, 7vw, 88px); }
.article-media img { max-height: 760px; object-fit: cover; }
.article-links { grid-column: span 12; display: flex; gap: 24px; flex-wrap: wrap; margin-top: 24px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; opacity: .68; }
.article-links a { min-height: 44px; display: inline-flex; align-items: center; }

.sr-only { height: 1px; left: -9999px; overflow: hidden; position: absolute; width: 1px; }
.article-source { padding: 0 var(--gutter) clamp(48px, 6vw, 80px); }
.article-source > div { grid-column: 3 / span 7; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); padding: 20px 0 24px; }
.article-source p:not(.label) { max-width: 58ch; margin: 0 0 18px; font-size: 16px; line-height: 1.65; opacity: .72; text-wrap: pretty; }
.article-source a { min-height: 44px; display: inline-flex; align-items: center; color: var(--copper); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.article-source a:hover { color: var(--graphite); }
.pattern-section { padding: 0 var(--gutter) clamp(72px, 8vw, 104px); }
.pattern-panel { grid-column: 2 / span 10; display: grid; grid-template-columns: minmax(180px, .55fr) minmax(0, 1.45fr); gap: clamp(32px, 6vw, 88px); align-items: center; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); padding: clamp(28px, 4vw, 48px) 0; }
.pattern-copy > p:not(.label) { max-width: 34ch; margin: 0; font-size: 16px; line-height: 1.65; opacity: .72; }
.pattern-legend { display: flex; gap: 24px; margin-top: 24px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; opacity: .58; }
.pattern-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vw, 36px); }
.letter-pattern { margin: 0; }
.letter-pattern figcaption { margin-top: 14px; font-size: 13px; color: var(--copper); opacity: 1; }
.binary-pattern { width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.binary-pattern span { display: grid; place-items: center; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(16px, 2.2vw, 28px); }
.binary-pattern .is-on { background: var(--graphite); color: var(--cream-soft); }
.binary-pattern .is-off { color: rgba(35,35,31,.42); background: rgba(251,247,237,.52); }
.function-section { padding: clamp(72px, 8vw, 104px) var(--gutter); border-top: 1px solid var(--line); }
.function-heading { grid-column: span 3; }
.function-heading h2 { max-width: 9ch; margin: 0; font-size: clamp(36px, 4.6vw, 64px); line-height: .96; font-weight: 300; letter-spacing: -.045em; text-wrap: balance; }
.function-heading > p:last-child { max-width: 30ch; margin: 28px 0 0; font-size: 15px; line-height: 1.65; opacity: .66; }
.function-list { grid-column: span 9; border-top: 1px solid var(--line-strong); }
.function-card { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 16px; padding: clamp(32px, 4vw, 48px) 0; border-bottom: 1px solid var(--line); }
.function-meta { grid-column: span 3; }
.function-meta span { color: var(--copper); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.function-meta h3 { margin: 12px 0 0; font-size: 24px; line-height: 1.1; font-weight: 400; letter-spacing: -.025em; }
.function-signature { grid-column: span 6; align-self: start; overflow-wrap: anywhere; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.6; opacity: .58; }
.function-formula { grid-column: 4 / span 6; overflow-x: auto; border-left: 3px solid var(--copper); background: rgba(221,244,229,.58); padding: 22px 24px; }
.function-formula code { white-space: nowrap; color: var(--graphite); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(15px, 1.8vw, 20px); line-height: 1.5; }
.function-card > p { grid-column: 4 / span 5; max-width: 52ch; margin: 4px 0 0; font-size: 16px; line-height: 1.7; opacity: .72; }
.function-example { grid-column: 4 / span 6; min-width: 0; border-top: 1px solid var(--line); padding-top: 18px; }
.function-example span { display: block; margin-bottom: 10px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; opacity: .48; }
.function-example code { display: block; overflow-x: auto; padding-bottom: 6px; white-space: nowrap; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.6; opacity: .68; }
.article-block ul { margin: 0; padding-left: 1.2em; font-size: 18px; line-height: 1.75; opacity: .72; }
.article-block li + li { margin-top: 10px; }
.final-state-section { padding: clamp(72px, 8vw, 104px) var(--gutter); border-top: 1px solid var(--line); }
.final-state-heading { grid-column: span 3; }
.final-state-heading h2 { max-width: 7ch; margin: 0; font-size: clamp(40px, 5.2vw, 72px); line-height: .94; font-weight: 300; letter-spacing: -.05em; text-wrap: balance; }
.final-state-heading > p:last-child { max-width: 32ch; margin: 28px 0 0; font-size: 15px; line-height: 1.65; opacity: .68; }
.final-state-main { grid-column: span 9; min-width: 0; border-top: 1px solid var(--line-strong); }
.weights-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .34fr); align-items: stretch; border-bottom: 1px solid var(--line); }
.weight-grid { display: grid; grid-template-columns: repeat(var(--grid-size), 1fr); border-left: 1px solid var(--line); }
.weight-grid span { min-height: clamp(60px, 6vw, 88px); display: grid; place-items: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(20px, 2.5vw, 34px); font-variant-numeric: tabular-nums; }
.weight-grid span:nth-last-child(-n + 4) { border-bottom: 0; }
.weight-grid .is-positive { background: var(--graphite); color: var(--cream-soft); }
.weight-grid .is-negative { background: rgba(251,247,237,.52); color: rgba(35,35,31,.52); }
.weight-grid .is-zero { background: var(--mint-soft); color: rgba(35,35,31,.48); }
.bias-readout { display: grid; place-items: center; align-content: center; gap: 14px; background: var(--mint-soft); text-align: center; }
.bias-readout span { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; opacity: .5; }
.bias-readout strong { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(38px, 5vw, 68px); font-weight: 400; }
.final-checks { border-bottom: 1px solid var(--line); }
.final-check { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, .8fr) 56px; gap: 20px; align-items: center; min-height: 72px; border-bottom: 1px solid var(--line); padding: 14px 0; }
.final-check:last-child { border-bottom: 0; }
.final-check > span { font-size: 14px; line-height: 1.45; opacity: .64; }
.final-check code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(15px, 1.8vw, 20px); font-variant-numeric: tabular-nums; }
.final-check strong { justify-self: end; color: var(--copper); font-size: 12px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; }
.perceptron-flow { padding-top: clamp(32px, 4vw, 48px); }
.perceptron-flow + .perceptron-flow { margin-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--line); }
.flow-heading { display: grid; grid-template-columns: minmax(120px, .45fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.flow-heading p { margin: 0; }
.flow-heading > p:last-child { max-width: 42ch; font-size: 15px; line-height: 1.6; opacity: .64; }
.flow-stage { display: grid; grid-template-columns: minmax(112px, 148px) minmax(42px, 1fr) minmax(88px, 104px) minmax(42px, 1fr) minmax(104px, 124px); gap: clamp(8px, 1.4vw, 18px); align-items: center; min-width: 0; border: 1px solid var(--line-strong); background: rgba(251,247,237,.5); padding: clamp(16px, 2.4vw, 28px); }
.flow-input { min-width: 0; margin: 0; }
.flow-input figcaption { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.flow-input figcaption span { opacity: .46; }
.flow-input figcaption strong { font-weight: 500; }
.flow-grid { width: min(100%, 124px); aspect-ratio: 1; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.flow-grid span { border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.flow-grid .is-on, .flow-packet .is-on { background: var(--copper); }
.flow-grid .is-off, .flow-packet .is-off { background: var(--cream-soft); }
.flow-track { --flow-shift: clamp(10px, 2.4vw, 28px); height: 1px; position: relative; background: var(--line-strong); }
.flow-track::after { content: ''; width: 6px; height: 6px; position: absolute; right: -1px; top: 50%; border-top: 1px solid var(--graphite); border-right: 1px solid var(--graphite); transform: translateY(-50%) rotate(45deg); }
.flow-packet { width: 30px; aspect-ratio: 1; display: grid; grid-template-columns: repeat(4, 1fr); position: absolute; left: 50%; top: 50%; z-index: 1; border: 1px solid var(--graphite); background: var(--cream-soft); opacity: 0; transform: translate(-50%, -50%) scale(.86); }
.flow-packet span { min-width: 0; border-right: 1px solid rgba(35,35,31,.34); border-bottom: 1px solid rgba(35,35,31,.34); }
.flow-node { width: min(100%, 104px); aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 5px; justify-self: center; border: 1px solid var(--graphite); background: var(--mint-soft); text-align: center; }
.flow-node strong { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(30px, 4vw, 48px); line-height: .9; font-weight: 400; }
.flow-node span { max-width: 8ch; font-size: 9px; line-height: 1.25; letter-spacing: .1em; text-transform: uppercase; opacity: .55; }
.flow-signal-dot { width: 10px; height: 10px; position: absolute; left: 50%; top: 50%; border: 1px solid var(--copper); background: var(--cream-soft); opacity: 0; transform: translate(-50%, -50%); }
.flow-output { min-height: 112px; display: grid; place-items: center; align-content: center; gap: 2px; border: 1px solid var(--copper); background: rgba(184,115,51,.08); text-align: center; }
.flow-output > span { font-size: 9px; letter-spacing: .15em; text-transform: uppercase; opacity: .48; }
.flow-output strong { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--copper); font-size: clamp(32px, 4.4vw, 52px); line-height: 1; font-weight: 400; font-variant-numeric: tabular-nums; }
.flow-output em { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.flow-formula { display: grid; grid-template-columns: minmax(120px, .45fr) minmax(0, 1fr); gap: 24px; align-items: center; border-bottom: 1px solid var(--line); padding: 18px 0; }
.flow-formula span { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; opacity: .46; }
.flow-formula code { min-width: 0; overflow-x: auto; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(13px, 1.7vw, 17px); white-space: nowrap; }
.flow-calculation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); border-bottom: 1px solid var(--line); padding: 18px 0; }
.flow-calculation-rule, .flow-calculation-sum { min-width: 0; }
.flow-calculation-rule > span, .flow-calculation-sum > span { display: block; margin-bottom: 8px; font-size: 10px; letter-spacing: .16em; line-height: 1.45; text-transform: uppercase; opacity: .46; }
.flow-score-equation { display: block; min-width: 0; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(11px, 1.35vw, 15px); line-height: 1.45; white-space: nowrap; }
.flow-calc-steps { height: 28px; position: relative; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.flow-calc-step { display: none; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; position: absolute; inset: 8px 0 auto; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(11px, 1.2vw, 13px); font-variant-numeric: tabular-nums; opacity: 0; }
.flow-calc-step:last-child { display: grid; opacity: .72; }
.flow-calc-step b { font-weight: 500; opacity: .46; }
.flow-calc-step span { color: var(--copper); }
.flow-calculation-sum > code { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px 8px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: clamp(11px, 1.25vw, 14px); line-height: 1.45; font-variant-numeric: tabular-nums; }
.flow-sum-term, .flow-sum-result { display: inline-block; white-space: nowrap; }
.flow-sum-term { opacity: .72; }
.flow-sum-result { color: var(--copper); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .flow-grid .is-on { animation: perceptron-input-pulse 10.4s ease-in-out var(--flow-delay, 0s) infinite both; }
  .flow-packet { animation: perceptron-packet-flow 10.4s ease-in-out var(--flow-delay, 0s) infinite both; }
  .flow-node { animation: perceptron-node-pulse 10.4s ease-in-out var(--flow-delay, 0s) infinite both; }
  .flow-signal-dot { animation: perceptron-output-signal 10.4s ease-in-out var(--flow-delay, 0s) infinite both; }
  .flow-output strong, .flow-output em { animation: perceptron-output-reveal 10.4s ease-in-out var(--flow-delay, 0s) infinite both; }
  .flow-calc-step, .flow-calc-step:last-child { display: grid; animation: perceptron-calculation-step 10.4s linear calc(var(--flow-delay, 0s) + var(--term-delay, 0s)) infinite both; }
  .flow-sum-term { animation: perceptron-sum-term 10.4s linear calc(var(--flow-delay, 0s) + var(--term-delay, 0s)) infinite both; }
  .flow-sum-result { animation: perceptron-sum-result 10.4s ease-out var(--flow-delay, 0s) infinite both; }
}
@keyframes perceptron-input-pulse {
  0%, 4%, 50%, 100% { opacity: .68; transform: scale(.88); }
  7%, 14% { opacity: 1; transform: scale(1); }
  18%, 48% { opacity: .78; transform: scale(.92); }
}
@keyframes perceptron-packet-flow {
  0%, 5%, 26%, 100% { opacity: 0; transform: translate(calc(-50% - var(--flow-shift)), -50%) scale(.78); }
  8% { opacity: 1; }
  21% { opacity: 1; transform: translate(calc(-50% + var(--flow-shift)), -50%) scale(.9); }
  24% { opacity: 0; transform: translate(calc(-50% + var(--flow-shift)), -50%) scale(.7); }
}
@keyframes perceptron-node-pulse {
  0%, 19%, 31%, 100% { opacity: .72; transform: scale(.96); }
  24%, 28% { opacity: 1; transform: scale(1); }
}
@keyframes perceptron-output-signal {
  0%, 38%, 45%, 100% { opacity: 0; transform: translate(calc(-50% - var(--flow-shift)), -50%) scale(.7); }
  40% { opacity: 1; }
  43% { opacity: 1; transform: translate(calc(-50% + var(--flow-shift)), -50%) scale(1); }
  44% { opacity: 0; transform: translate(calc(-50% + var(--flow-shift)), -50%) scale(.7); }
}
@keyframes perceptron-output-reveal {
  0%, 43%, 50%, 100% { opacity: .28; transform: translateY(3px); }
  45%, 49% { opacity: 1; transform: translateY(0); }
}
@keyframes perceptron-sum-term {
  0%, 23.9%, 25%, 100% { color: var(--graphite); opacity: .28; transform: translateY(1px); }
  24%, 24.9% { color: var(--copper); opacity: 1; transform: translateY(0); }
}
@keyframes perceptron-calculation-step {
  0%, 23.9%, 25%, 100% { opacity: 0; transform: translateY(2px); }
  24%, 24.9% { opacity: 1; transform: translateY(0); }
}
@keyframes perceptron-sum-result {
  0%, 43%, 50%, 100% { opacity: .28; transform: translateY(2px); }
  45%, 49% { opacity: 1; transform: translateY(0); }
}
.sidequest-section { padding: 0 var(--gutter) clamp(72px, 8vw, 104px); }
.sidequest-embed { grid-column: 2 / span 10; min-width: 0; overflow: clip; position: relative; border: 1px solid var(--line-strong); background: rgba(251,247,237,.82); }
.sidequest-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; border-bottom: 1px solid var(--line); padding: clamp(24px, 3vw, 40px); }
.sidequest-hero h2 { margin: 0; font-size: clamp(44px, 7vw, 96px); line-height: .9; font-weight: 300; letter-spacing: -.055em; }
.sidequest-hero p:last-child { max-width: 42ch; margin: 20px 0 0; font-size: 16px; line-height: 1.65; opacity: .68; }
.sidequest-die-mark { align-self: start; aspect-ratio: 1; width: clamp(84px, 10vw, 132px); display: grid; place-items: center; color: var(--copper); border: 1px solid var(--copper); background: rgba(184,115,51,.08); clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); font-size: 18px; letter-spacing: .12em; text-transform: uppercase; }
.sidequest-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--line); }
.sidequest-form:focus-within { box-shadow: inset 0 0 0 2px var(--copper); }
.sidequest-form:focus-within input { border-right-color: transparent; }
.sidequest-form input { min-width: 0; min-height: 64px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--graphite); padding: 0 18px; font: inherit; }
.sidequest-form input::placeholder { color: rgba(35,35,31,.42); }
.sidequest-limit { grid-column: 1 / -1; margin: 0; border-top: 1px solid var(--line); color: rgba(35,35,31,.66); font-size: 13px; line-height: 1.4; padding: 10px 18px; }
.sidequest-limit[hidden] { display: none; }
.sidequest-embed button { min-height: 44px; border: 1px solid var(--graphite); border-radius: 0; background: var(--graphite); color: var(--cream-soft); padding: 0 14px; font: inherit; cursor: pointer; }
.sidequest-embed button:hover:not(:disabled) { border-color: var(--copper); background: var(--copper); }
.sidequest-embed button:disabled { cursor: not-allowed; opacity: .36; }
.sidequest-form input:disabled { cursor: wait; opacity: .52; }
.sidequest-embed button:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.sidequest-form input:focus-visible { outline: 0; }
.sidequest-roll { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, auto); border-bottom: 1px solid var(--line); }
.sidequest-roll > div:first-child { padding: clamp(20px, 3vw, 32px); }
.sidequest-die-readout { display: flex; align-items: start; justify-content: space-between; gap: 18px; min-width: 0; margin: 0 0 20px; }
.sidequest-die { margin: 0; color: var(--copper); font-size: clamp(56px, 9vw, 112px); line-height: .82; font-weight: 300; letter-spacing: -.06em; }
.sidequest-die-shape { display: grid; place-items: center; position: relative; overflow: hidden; border: 1px solid var(--copper); background: rgba(184,115,51,.08); color: var(--copper); font-size: 12px; line-height: 1; font-weight: 600; letter-spacing: .10em; text-transform: uppercase; }
.sidequest-die-readout .sidequest-die-shape { flex: 0 0 auto; width: clamp(62px, 7vw, 88px); height: clamp(62px, 7vw, 88px); margin-top: 6px; }
.sidequest-die-shape::after { content: ''; position: absolute; inset: 20%; border: 1px solid rgba(184,115,51,.52); opacity: .46; pointer-events: none; transform: rotate(-22deg); }
.sidequest-die-shape span { position: relative; z-index: 1; }
.sidequest-die-shape.is-empty { opacity: .32; }
.sidequest-die-shape-d2 { border-radius: 50%; clip-path: none; }
.sidequest-die-shape-d2::after { border-radius: 50%; inset: 22%; transform: none; }
.sidequest-die-shape-d4 { clip-path: polygon(50% 3%, 96% 94%, 4% 94%); }
.sidequest-die-shape-d4::after { clip-path: polygon(50% 0, 100% 100%, 0 100%); inset: 26% 24% 18%; transform: none; }
.sidequest-die-shape-d6 { clip-path: polygon(16% 5%, 82% 5%, 95% 18%, 95% 84%, 84% 95%, 18% 95%, 5% 82%, 5% 16%); }
.sidequest-die-shape-d8 { clip-path: polygon(50% 0, 96% 50%, 50% 100%, 4% 50%); }
.sidequest-die-shape-d10 { clip-path: polygon(50% 0, 91% 27%, 79% 100%, 21% 100%, 9% 27%); }
.sidequest-die-shape-d12 { clip-path: polygon(50% 0, 84% 12%, 100% 46%, 88% 80%, 57% 100%, 20% 92%, 0 62%, 8% 25%); }
.sidequest-die-shape-d20 { clip-path: polygon(50% 0, 78% 12%, 96% 38%, 90% 70%, 64% 98%, 32% 94%, 8% 70%, 4% 38%, 22% 12%); }
.sidequest-result { margin: 0; max-width: 44ch; font-size: clamp(20px, 2.3vw, 28px); line-height: 1.14; letter-spacing: -.025em; text-wrap: balance; }
.sidequest-actions { display: grid; grid-template-columns: 1fr; border-left: 1px solid var(--line); }
.sidequest-dice-box { min-height: 184px; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 50% 35%, rgba(184,115,51,.16), transparent 48%), linear-gradient(135deg, rgba(251,247,237,.86), rgba(239,230,209,.74)); opacity: .5; overflow: hidden; pointer-events: none; position: relative; transition: opacity .18s ease; }
.sidequest-embed.can-use-3d-dice .sidequest-dice-box, .sidequest-dice-box.is-ready, .sidequest-dice-box.is-loading { opacity: 1; }
.sidequest-dice-box::before { content: '3D tray'; position: absolute; left: 18px; top: 14px; z-index: 1; color: rgba(35,35,31,.46); font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.sidequest-dice-box.is-ready::before, .sidequest-dice-box.is-rolling::before { opacity: 0; }
.sidequest-dice-box canvas { display: block; width: 100% !important; height: 100% !important; }
.sidequest-visual-status { min-height: 42px; margin: 0; border-bottom: 1px solid var(--line); color: rgba(35,35,31,.66); font-size: 13px; line-height: 1.4; padding: 12px 20px; }
.sidequest-lists { display: grid; grid-template-columns: 1fr; }
.sidequest-lists > section + section { border-left: 0; border-top: 1px solid var(--line); }
.sidequest-list-heading { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 0 18px; }
.sidequest-list-heading h3 { margin: 0; font-size: 15px; font-weight: 500; }
.sidequest-list-heading span { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .46; }
.sidequest-list-heading button { min-height: 36px; border-color: transparent; background: transparent; color: var(--graphite); opacity: .62; }
.sidequest-list { list-style: none; margin: 0; padding: 0; }
.sidequest-row, .sidequest-empty { min-height: 58px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); padding: 10px 14px; }
.sidequest-row.is-picked { background: rgba(184,115,51,.10); box-shadow: inset 5px 0 0 var(--copper); }
.sidequest-row.is-picked .sidequest-number::before { content: '◆ '; color: var(--copper); }
.sidequest-number { font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .12em; opacity: .45; }
.sidequest-title { min-width: 0; overflow-wrap: anywhere; line-height: 1.32; }
.sidequest-row-actions { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.sidequest-row button { height: 44px; min-height: 44px; padding: 0 10px; }
.sidequest-empty { grid-template-columns: 1fr; color: rgba(35,35,31,.52); }
.sidequest-done .sidequest-title { opacity: .46; text-decoration: line-through; }
.sidequest-die-flight { width: 48px; height: 48px; position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; background: var(--cream-soft); }

footer { border-top: 1px solid var(--line); padding: 40px 0; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; opacity: .46; }
.footer-name { grid-column: span 6; }
.footer-links { grid-column: span 6; display: flex; justify-content: flex-end; gap: 24px; }

@media (prefers-reduced-motion: no-preference) { .sidequest-row.is-picked { animation: sidequest-picked-pulse 260ms ease-out; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; } }
@keyframes sidequest-picked-pulse { 0% { box-shadow: inset 0 0 0 var(--copper); } 100% { box-shadow: inset 5px 0 0 var(--copper); } }
@media (max-width: 1100px) {
  .sidequest-embed { grid-column: 2 / span 10; }
}
@media (max-width: 860px) {
  .brand, .nav-links, .eyebrow, .hero-main, .section-label, .work-list, .note-grid, .project-title, .article-title, .project-meta, .article-source > div, .pattern-panel, .function-heading, .function-list, .final-state-heading, .final-state-main, .sidequest-embed { grid-column: span 12; }
  .nav-links { justify-content: flex-start; gap: 20px; flex-wrap: wrap; }
  h1 { font-size: clamp(48px, 16vw, 76px); }
  .intro, .focus, .project-section, .article-block { grid-column: span 12; }
  .focus { margin-top: 8px; }
  .pattern-panel { grid-template-columns: 1fr; }
  .pattern-pair { max-width: 620px; }
  .binary-pattern { width: 100%; }
  .function-heading { padding-bottom: 40px; }
  .function-heading h2 { max-width: 12ch; }
  .final-state-heading { padding-bottom: 40px; }
  .final-state-heading h2 { max-width: 10ch; }
  .num, .work-title, .meta, .arrow { grid-column: span 12; justify-self: start; }
  .arrow { margin-top: -8px; }
  .note-grid, .sidequest-lists, .sidequest-roll { grid-template-columns: 1fr; }
  .sidequest-lists > section + section, .sidequest-actions { border-left: 0; }
  .sidequest-lists > section + section { border-top: 1px solid var(--line); }
  .sidequest-actions { border-top: 1px solid var(--line); }
  .sidequest-row { grid-template-columns: 34px minmax(0, 1fr); }
  .sidequest-row-actions { grid-column: 2; justify-self: start; justify-content: flex-start; }
  .image-strip figure:first-child, .image-strip figure:not(:first-child) { grid-column: span 12; }
  .footer-name, .footer-links { grid-column: span 12; justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .pattern-pair { grid-template-columns: 1fr; }
  .letter-pattern { width: min(240px, 100%); }
  .function-card { grid-template-columns: 1fr; }
  .function-meta, .function-signature, .function-formula, .function-card > p, .function-example { grid-column: 1; }
  .function-formula { margin-top: 6px; padding: 18px; }
  .function-formula code { font-size: 14px; }
  .weights-wrap { grid-template-columns: minmax(0, 1fr) 88px; }
  .weight-grid span { min-height: 72px; }
  .final-check { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .final-check code { grid-column: 1; grid-row: 2; }
  .final-check strong { grid-column: 2; grid-row: 1 / span 2; }
  .flow-heading, .flow-formula { grid-template-columns: 1fr; gap: 8px; }
  .flow-calculation { grid-template-columns: 1fr; gap: 18px; }
  .flow-stage { grid-template-columns: 72px minmax(18px, 1fr) 62px minmax(18px, 1fr) 62px; gap: 4px; padding: 10px; }
  .flow-input figcaption { display: grid; gap: 2px; font-size: 8px; }
  .flow-grid { width: 72px; }
  .flow-track { --flow-shift: 8px; }
  .flow-packet { width: 20px; }
  .flow-node { width: 62px; }
  .flow-node strong { font-size: 27px; }
  .flow-node span { font-size: 7px; }
  .flow-output { min-height: 72px; }
  .flow-output strong { font-size: 27px; }
  .flow-output em { font-size: 9px; }
  .flow-formula { align-items: start; }
  .flow-formula code { width: 100%; }
  .sidequest-hero, .sidequest-form { grid-template-columns: 1fr; }
  .sidequest-form input { border-right: 0; border-bottom: 1px solid var(--line); }
  .sidequest-form:focus-within input { border-bottom-color: transparent; }
  .sidequest-die-mark { width: 88px; }
  .sidequest-row-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sidequest-row button { width: 100%; }
}
