/* okxproject — shared styles */
:root {
  --cream: #EFECE3;
  --cream-2: #E4E0D3;
  --black: #000;
  --lime: #BDDB3F;
  --muted: #57544B;
  --on-dark: #EFECE3;
  --on-dark-muted: #B9B5A8;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 60ch;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header-h: 4rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  background: var(--cream);
  color: var(--black);
  font-family: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.0625rem, 0.95rem + 0.35vw, 1.25rem);
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--black); outline-offset: 4px; }
.on-dark a:focus-visible, .on-dark button:focus-visible { outline-color: var(--lime); }
p { margin: 0; max-width: var(--measure); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.02; letter-spacing: -.025em; }
ul, ol, dl, dd { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
.wrap { padding-inline: var(--gutter); }
.muted { color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- page transitions ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(*) { animation-duration: .55s; animation-timing-function: var(--ease); }
  ::view-transition-old(root) { animation: vt-out .25s ease both; }
  ::view-transition-new(root) { animation: vt-in .45s var(--ease) both; }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(24px); } }
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  view-transition-name: site-head;
  font-size: .95rem;
}
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.15rem; letter-spacing: -.03em; text-decoration: none; }
.brand svg { width: 1.05em; height: 1.05em; overflow: visible; }
.site-head nav { display: flex; gap: clamp(1rem, 2.5vw, 2rem); }
.site-head nav a { text-decoration: none; position: relative; padding-block: .25rem; }
.site-head nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--black);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.site-head nav a:hover::after, .site-head nav a[aria-current]::after { transform: scaleX(1); }

/* ---------- hero (home) ---------- */
.hero { padding-block: clamp(2rem, 7vh, 5.5rem) clamp(3rem, 8vh, 6rem); }
.wordmark {
  font-size: clamp(3rem, 19vw, 40rem);
  font-weight: 800; letter-spacing: -.055em; line-height: .95;
  white-space: nowrap; margin-left: -.04em;
  padding-top: .28em; padding-bottom: .14em;
  overflow-x: visible; overflow-y: clip;
}
.wordmark .ch { display: inline-block; }
.wordmark svg { display: inline-block; width: .5em; height: .5em; margin-inline: .035em .03em; overflow: visible; vertical-align: baseline; transform-origin: 50% 60%; transition: transform .6s var(--ease); }
.xmark .s-lime { stroke: var(--lime); }
.xmark .s-black { stroke: var(--black); }
.on-dark .xmark .s-black { stroke: var(--cream); }

.hero-copy {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem); margin-top: clamp(1.5rem, 5vh, 4rem); align-items: start;
}
.hero-copy h2 { font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.4rem); font-weight: 600; max-width: 16ch; }
.hero-copy p + p { margin-top: 1em; }

@media (prefers-reduced-motion: no-preference) {
  .js .wordmark .ch { transform: translateY(115%); animation: rise .9s var(--ease) calc(var(--i) * 45ms + 80ms) forwards; }
  .js .wordmark .s-lime { stroke-dasharray: 177; stroke-dashoffset: 177; animation: draw .8s cubic-bezier(.6, 0, .2, 1) .55s forwards; }
  .js .wordmark .s-black { stroke-dasharray: 134; stroke-dashoffset: 134; animation: draw .6s cubic-bezier(.6, 0, .2, 1) .25s forwards; }
  .js .hero-copy { opacity: 0; transform: translateY(18px); animation: settle .9s var(--ease) .95s forwards; }
  @keyframes rise { to { transform: none; } }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes settle { to { opacity: 1; transform: none; } }
}

/* ---------- section scaffolding ---------- */
.sec { padding-block: clamp(3.5rem, 9vh, 7rem); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem 3rem; flex-wrap: wrap; margin-bottom: clamp(1.75rem, 4vh, 3rem); }
.sec-head h2, .h-xl { font-size: clamp(2.25rem, 1.2rem + 3.8vw, 5rem); }
.sec-head p { color: var(--muted); max-width: 40ch; }
.dark { background: var(--black); color: var(--on-dark); }
.dark .muted { color: var(--on-dark-muted); }
.lime { background: var(--lime); }

/* word-rise headings */
.js [data-split] .w { display: inline-block; overflow: clip; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
@media (prefers-reduced-motion: no-preference) {
  .js [data-split] .w > span { display: inline-block; transform: translateY(110%); transition: transform .9s var(--ease) calc(var(--i) * 45ms); }
  .js [data-split].is-in .w > span { transform: none; }
  .js [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .8s ease calc(var(--d, 0) * 90ms), transform .9s var(--ease) calc(var(--d, 0) * 90ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}

/* status squares */
.status { display: inline-flex; align-items: center; gap: .55em; font-size: .95rem; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: .7em; height: .7em; border: 2px solid currentColor; flex: none; }
.status.live::before { background: var(--lime); border-color: var(--black); }
.status.internal::before { background: var(--black); }
@media (prefers-reduced-motion: no-preference) {
  .status.live::before { animation: ping 2.4s ease-out infinite; }
  @keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, .4); } 70%, 100% { box-shadow: 0 0 0 .55em rgba(0, 0, 0, 0); } }
}

/* ---------- featured work rows ---------- */
.work-list { list-style: none; border-bottom: 2px solid var(--black); }
.work {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 10rem;
  gap: clamp(1rem, 3vw, 3rem); align-items: end;
  padding: clamp(1.5rem, 4.5vh, 3rem) var(--gutter);
  border-top: 2px solid var(--black);
}
.work::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--lime);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.work:hover::before, .work:focus-within::before { transform: scaleX(1); }
.work h3 { font-size: clamp(2rem, 1rem + 4.4vw, 5.5rem); font-weight: 800; letter-spacing: -.04em; display: flex; align-items: baseline; }
.work h3 a { text-decoration: none; display: inline-block; }
.work h3 a::after { content: ""; position: absolute; inset: 0; }
.work h3 a:focus-visible { outline: none; }
.work:focus-within { outline: 3px solid var(--black); outline-offset: -3px; }
.work h3 .xmark { width: 0; height: .5em; flex: none; overflow: visible; opacity: 0; transition: width .5s var(--ease), opacity .3s ease, margin .5s var(--ease); }
.work:hover h3 .xmark, .work:focus-within h3 .xmark { width: .5em; opacity: 1; margin-right: .16em; }
.work h3 .xmark .s-lime { stroke: var(--cream); }
.work .what { font-weight: 500; max-width: 34ch; }
.work .meta { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.work .go { font-size: .95rem; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; }

/* ---------- studio tools (accordion) ---------- */
.tools { border-bottom: 2px solid var(--black); }
.tools details { border-top: 2px solid var(--black); }
.tools summary {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 9rem 1.5rem;
  gap: clamp(1rem, 3vw, 3rem); align-items: baseline;
  padding-block: clamp(1rem, 2.5vh, 1.5rem); cursor: pointer; list-style: none;
}
.tools summary::-webkit-details-marker { display: none; }
.tools summary h3 { font-size: clamp(1.35rem, 1.05rem + 1.1vw, 2rem); }
.tools summary .what { font-weight: 500; }
.tools .plus { position: relative; width: 1rem; height: 1rem; align-self: center; }
.tools .plus::before, .tools .plus::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--black); transition: transform .4s var(--ease); }
.tools .plus::after { transform: rotate(90deg); }
.tools details[open] .plus::after { transform: rotate(0deg); }
.tools .more { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 9rem 1.5rem; gap: clamp(1rem, 3vw, 3rem); padding-bottom: clamp(1.25rem, 3vh, 2rem); }
.tools .more > div { grid-column: 2; color: var(--muted); }
.tools .more ul { list-style: none; margin-top: .75rem; display: grid; gap: .35rem; }
.tools .more li { padding-left: 1.2em; position: relative; }
.tools .more li::before { content: ""; position: absolute; left: 0; top: .55em; width: .5em; height: .5em; background: var(--lime); border: 1.5px solid var(--black); }
@media (prefers-reduced-motion: no-preference) {
  .tools details[open] .more { animation: settle .5s var(--ease) both; }
}

/* ---------- figures ---------- */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 3rem); }
.figures > div { border-top: 2px solid var(--lime); padding-top: .9rem; }
.figures dt { font-size: clamp(2.2rem, 1.2rem + 3.6vw, 5rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--lime); font-variant-numeric: tabular-nums; }
.figures dd { margin-top: .6rem; color: var(--on-dark-muted); font-size: .98rem; max-width: 24ch; }
.figures.on-light > div { border-top-color: var(--black); }
.figures.on-light dt { color: var(--black); }
.figures.on-light dd { color: var(--muted); }

/* ---------- approach ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: start; }
.split > h2 { font-size: clamp(2.25rem, 1.2rem + 3.8vw, 5rem); position: sticky; top: calc(var(--header-h) + 1.5rem); }
.split .body > * + * { margin-top: 1em; }
.tenets { display: grid; gap: clamp(2rem, 5vh, 3.5rem); }
.tenets h3 { font-size: clamp(1.6rem, 1.1rem + 1.9vw, 2.9rem); font-weight: 600; max-width: 20ch; }
.tenets p { margin-top: .75rem; color: var(--muted); }
.dark .tenets p { color: var(--on-dark-muted); }

/* ---------- contact + footer ---------- */
.contact h2 { font-size: clamp(2.25rem, 1.2rem + 4.2vw, 5.5rem); max-width: 15ch; }
.contact p { margin-top: 1.25rem; }
.btn {
  display: inline-block; margin-top: 2rem; padding: .9em 1.5em; background: var(--black); color: var(--cream);
  font-weight: 600; text-decoration: none; position: relative; isolation: isolate; overflow: hidden;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--cream); transform: translateY(101%); transition: transform .45s var(--ease); }
.btn:hover { color: var(--black); }
.btn:hover::before { transform: none; }
.site-foot { display: flex; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 1.5rem; font-size: .9rem; color: var(--muted); }

/* ---------- case page ---------- */
.case-head { padding-block: clamp(2rem, 7vh, 5rem) clamp(2rem, 5vh, 3.5rem); }
.crumb { display: inline-flex; gap: .5em; align-items: center; font-size: .95rem; text-decoration: none; margin-bottom: clamp(1.5rem, 4vh, 3rem); }
.crumb:hover { text-decoration: underline; }
.crumb svg { width: .9em; height: .9em; }
.case-head h1 { font-size: clamp(2.75rem, 1rem + 8.6vw, 10rem); font-weight: 800; letter-spacing: -.05em; line-height: .95; margin-top: 1rem; text-wrap: balance; }
.case-head .lede { font-size: clamp(1.3rem, 1rem + 1.3vw, 2.1rem); font-weight: 500; line-height: 1.25; max-width: 30ch; margin-top: clamp(1.25rem, 3vh, 2rem); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem clamp(1rem, 3vw, 3rem); border-top: 2px solid var(--black); padding-top: 1rem; margin-top: clamp(2rem, 5vh, 3.5rem); }
.facts dt { font-size: .9rem; color: var(--muted); }
.facts dd { font-weight: 600; margin-top: .15rem; }

.demo-sec { padding-block: clamp(2.5rem, 7vh, 5rem); }
.demo-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: clamp(1.25rem, 3vh, 2rem); }
.demo-top h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem); }
.demo-top p { color: var(--on-dark-muted); font-size: .95rem; }

.steps { list-style: none; counter-reset: s; display: grid; gap: 0; border-bottom: 2px solid var(--black); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; padding-block: 1.25rem; border-top: 2px solid var(--black); }
.steps li::before { content: counter(s); font-size: clamp(1.8rem, 1.2rem + 1.6vw, 2.8rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.steps h3 { font-size: clamp(1.2rem, 1rem + .7vw, 1.6rem); font-weight: 700; }
.steps p { margin-top: .35rem; color: var(--muted); }

.plain-list { list-style: none; display: grid; gap: .9rem; }
.plain-list li { padding-left: 1.5em; position: relative; max-width: var(--measure); }
.plain-list li::before { content: ""; position: absolute; left: 0; top: .5em; width: .6em; height: .6em; background: var(--lime); border: 2px solid var(--black); }
.dark .plain-list li::before { border-color: var(--lime); }
.plain-list b { font-weight: 700; }

/* timeline */
.timeline { list-style: none; position: relative; padding-left: 1.75rem; display: grid; gap: 1.4rem; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: .3rem; top: .4rem; bottom: .4rem; width: 2px; background: color-mix(in srgb, var(--black) 18%, transparent); }
.timeline::after { background: var(--black); transform-origin: top; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .timeline::after { animation: grow linear both; animation-timeline: view(); animation-range: entry 20% cover 75%; }
    @keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  }
}
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -1.75rem; top: .42em; width: .75rem; height: .75rem; background: var(--lime); border: 2px solid var(--black); }
.timeline time { font-size: .9rem; color: var(--muted); display: block; }
.timeline b { font-weight: 700; display: block; }
.timeline span { color: var(--muted); display: block; max-width: 52ch; }

/* autonomy ladder */
.ladder { list-style: none; display: grid; gap: .5rem; }
.ladder li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center;
  margin-left: calc(var(--i) * 5%); padding: 1rem 1.25rem; border: 2px solid var(--on-dark);
}
.ladder li b { font-weight: 600; }
.ladder li em { font-style: normal; font-weight: 700; white-space: nowrap; }
.ladder li.free em { color: var(--lime); }
.ladder li.never { background: var(--on-dark); color: var(--black); }

/* next project */
.next { display: block; text-decoration: none; padding: clamp(2.5rem, 8vh, 5rem) var(--gutter); border-top: 2px solid var(--black); position: relative; isolation: isolate; }
.next::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--lime); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease); }
.next:hover::before, .next:focus-visible::before { transform: scaleY(1); }
.next small { font-size: .95rem; display: block; margin-bottom: .5rem; }
.next strong { font-size: clamp(2.5rem, 1rem + 7vw, 8rem); font-weight: 800; letter-spacing: -.05em; line-height: .95; display: inline-block; }

/* ---------- demo: pipeline ---------- */
.pl { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: center; }
.pl-col { display: grid; gap: .75rem; }
.pl h3 { font-size: .9rem; font-weight: 500; color: var(--on-dark-muted); letter-spacing: 0; margin-bottom: .25rem; }
.pl-node, .pl-gate { position: relative; border: 2px solid var(--on-dark); padding: .8rem 1rem; display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; transition: background .25s ease, color .25s ease, border-color .25s ease; }
.pl-node b { font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-node.fire { background: var(--on-dark); color: var(--black); }
.pl-gate { flex-direction: column; align-items: flex-start; gap: .1rem; }
.pl-gate b { font-weight: 700; }
.pl-gate small { color: var(--on-dark-muted); font-size: .85rem; transition: color .25s ease; }
.pl-gate.pass { border-color: var(--lime); }
.pl-gate.hold { background: var(--on-dark); color: var(--black); }
.pl-gate.hold small { color: var(--muted); }
.port { position: absolute; width: 2px; height: 2px; top: 50%; pointer-events: none; }
.pl-node .port { right: -1px; }
.pl-gate .port { left: -1px; }
.pl-feed { border: 2px solid var(--on-dark); display: flex; flex-direction: column; height: 27rem; position: relative; }
.pl-feed .port { left: -1px; top: 4.5rem; }
.pl-feed header { padding: .8rem 1rem; border-bottom: 2px solid var(--on-dark); display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.pl-feed header b { font-weight: 700; }
.pl-feed header span { font-size: .85rem; color: var(--on-dark-muted); }
.pl-feed ul { list-style: none; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; overflow: hidden; flex: 1; }
.pl-feed li { background: var(--lime); color: var(--black); padding: .7rem .85rem; font-size: .95rem; line-height: 1.35; max-width: 92%; }
.pl-feed li small { display: block; font-size: .8rem; opacity: .7; margin-top: .25rem; }
@media (prefers-reduced-motion: no-preference) {
  .pl-feed li { animation: pop .5s var(--ease) both; }
  @keyframes pop { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
}
.pl-layer { position: absolute; inset: 0; pointer-events: none; }
.pl-dot { position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--lime); will-change: transform; }
.pl-dot.dropped { background: transparent; border: 2px solid var(--on-dark-muted); }
.pl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem clamp(1rem, 3vw, 3rem); margin-top: clamp(1.5rem, 4vh, 2.5rem); border-top: 2px solid var(--on-dark); padding-top: 1rem; }
.pl-stats dt { font-size: .9rem; color: var(--on-dark-muted); }
.pl-stats dd { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pl-stats .ok dd { color: var(--lime); }

/* ---------- demo: reader grid ---------- */
.rg { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.rg-grid { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: clamp(2px, .45vw, 6px); }
.rg-lane { display: grid; gap: clamp(2px, .45vw, 6px); }
.rg-tile { aspect-ratio: 9 / 16; border: 1.5px solid color-mix(in srgb, var(--on-dark) 30%, transparent); position: relative; transition: background .3s ease, border-color .3s ease; }
.rg-tile.reading { border-color: var(--on-dark); background: color-mix(in srgb, var(--on-dark) 22%, transparent); }
.rg-tile.is-event { background: var(--lime); border-color: var(--lime); }
.rg-tile.is-sponsor::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 14%; height: 18%; background: var(--black); }
.rg-tile.is-other { background: color-mix(in srgb, var(--on-dark) 24%, transparent); border-color: transparent; }
.rg-side { display: grid; gap: 1.25rem; }
.rg-count dt { font-size: .9rem; color: var(--on-dark-muted); }
.rg-count dd { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.6rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--lime); }
.rg-last { border: 2px solid var(--on-dark); }
.rg-last h3 { font-size: .9rem; font-weight: 500; color: var(--on-dark-muted); padding: .7rem 1rem; border-bottom: 2px solid var(--on-dark); letter-spacing: 0; }
.rg-last dl { padding: .5rem 1rem .8rem; }
.rg-last dl div { display: flex; justify-content: space-between; gap: 1rem; padding-block: .4rem; border-bottom: 1px solid color-mix(in srgb, var(--on-dark) 25%, transparent); }
.rg-last dl div:last-child { border-bottom: 0; }
.rg-last dt { color: var(--on-dark-muted); }
.rg-last dd { font-weight: 600; text-align: right; }
.rg-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .9rem; color: var(--on-dark-muted); }
.rg-legend li { display: inline-flex; align-items: center; gap: .5em; }
.rg-legend i { width: .6em; height: 1em; display: inline-block; border: 1.5px solid var(--on-dark-muted); position: relative; }
.rg-legend .e { background: var(--lime); border-color: var(--lime); }
.rg-legend .s { background: var(--lime); border-color: var(--lime); }
.rg-legend .s::after { content: ""; position: absolute; left: 15%; right: 15%; bottom: 12%; height: 25%; background: var(--black); }
.rg-legend .o { background: color-mix(in srgb, var(--on-dark) 24%, transparent); border-color: transparent; }

/* ---------- demo: chat ---------- */
.chat { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: stretch; }
.chat-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.chat-tabs button { background: none; border: 2px solid var(--on-dark); padding: .5em 1em; cursor: pointer; font-weight: 500; transition: background .25s ease, color .25s ease; }
.chat-tabs button[aria-selected="true"] { background: var(--lime); border-color: var(--lime); color: var(--black); }
.chat-win { border: 2px solid var(--on-dark); display: flex; flex-direction: column; min-height: 26rem; }
.chat-win header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .8rem 1rem; border-bottom: 2px solid var(--on-dark); }
.chat-win header b { font-weight: 700; }
.chat-win header span { color: var(--on-dark-muted); font-size: .9rem; }
.chat-log { list-style: none; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; justify-content: flex-end; }
.chat-log li { max-width: 86%; padding: .7rem .9rem; line-height: 1.4; font-size: .98rem; }
.chat-log .cust { align-self: flex-start; border: 2px solid var(--on-dark); }
.chat-log .bot { align-self: flex-end; background: var(--on-dark); color: var(--black); }
.chat-log .bot u { text-decoration-thickness: .1em; }
.chat-log .sys { align-self: center; max-width: 100%; background: var(--lime); color: var(--black); font-weight: 700; font-size: .9rem; padding: .45rem .9rem; }
.chat-log .typing { align-self: flex-end; background: var(--on-dark); display: inline-flex; gap: .3rem; padding: .85rem .9rem; }
.chat-log .typing i { width: .4rem; height: .4rem; background: var(--black); display: block; }
@media (prefers-reduced-motion: no-preference) {
  .chat-log li { animation: pop .45s var(--ease) both; }
  .chat-log .typing i { animation: tick 1s steps(1) infinite; }
  .chat-log .typing i:nth-child(2) { animation-delay: .2s; }
  .chat-log .typing i:nth-child(3) { animation-delay: .4s; }
  @keyframes tick { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }
}
.trace { border: 2px solid var(--on-dark); display: flex; flex-direction: column; }
.trace h3 { font-size: .9rem; font-weight: 500; letter-spacing: 0; color: var(--on-dark-muted); padding: .8rem 1rem; border-bottom: 2px solid var(--on-dark); }
.trace ol { list-style: none; padding: .5rem 1rem 1rem; display: grid; gap: 0; }
.trace li { padding-block: .7rem; border-bottom: 1px solid color-mix(in srgb, var(--on-dark) 25%, transparent); display: grid; gap: .1rem; }
.trace li:last-child { border-bottom: 0; }
.trace li small { color: var(--on-dark-muted); font-size: .85rem; }
.trace li b { font-weight: 600; }
.trace li.act b { color: var(--lime); }
@media (prefers-reduced-motion: no-preference) { .trace li { animation: settle .45s var(--ease) both; } }

/* ---------- demo: reading (pulsesight) ---------- */
.rd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: start; }
.rd-switch { display: inline-grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--on-dark); margin-top: 1.5rem; position: relative; isolation: isolate; }
.rd-switch::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: var(--lime); z-index: -1; transition: transform .45s var(--ease); }
.rd-switch[data-mode="context"]::before { transform: translateX(100%); }
.rd-switch button { background: none; border: 0; padding: .7em 1.2em; cursor: pointer; font-weight: 600; transition: color .3s ease; }
.rd-switch button[aria-pressed="true"] { color: var(--black); }
.rd-intro p { color: var(--on-dark-muted); margin-top: 1rem; max-width: 38ch; }
.rd-list { list-style: none; display: grid; gap: .75rem; }
.rd-list li { border: 2px solid var(--on-dark); padding: 1rem 1.1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1.25rem; align-items: start; }
.rd-list q { quotes: none; font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.rd-list .gloss { color: var(--on-dark-muted); font-size: .92rem; grid-column: 1; }
.rd-list .tag { grid-row: 1 / span 2; grid-column: 2; align-self: center; min-width: 7.5rem; text-align: center; padding: .4em .8em; font-weight: 700; font-size: .9rem; border: 2px solid var(--on-dark); transition: background .35s ease, color .35s ease, border-color .35s ease, transform .45s var(--ease); }
.rd-list .tag.pos { background: var(--lime); border-color: var(--lime); color: var(--black); }
.rd-list .tag.neg { background: var(--on-dark); color: var(--black); }
.rd-list .tag.flip { transform: rotateX(90deg); }
.rd-list .why { grid-column: 1 / -1; font-size: .9rem; color: var(--lime); min-height: 1.4em; }

/* ---------- 404 ---------- */
.lost { min-height: 70vh; display: grid; align-content: center; gap: 1.5rem; }
.lost h1 { font-size: clamp(3rem, 1rem + 10vw, 11rem); font-weight: 800; letter-spacing: -.05em; line-height: .95; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hero-copy, .split, .rg, .chat, .rd { grid-template-columns: 1fr; }
  .split > h2 { position: static; }
  .work { grid-template-columns: 1fr; align-items: start; gap: .75rem; }
  .work .meta { flex-direction: row; gap: 1.25rem; align-items: center; }
  .tools summary { grid-template-columns: minmax(0, 1fr) 1.5rem; gap: .35rem 1rem; }
  .tools summary .what, .tools summary .status { grid-column: 1; }
  .tools summary .plus { grid-column: 2; grid-row: 1; }
  .tools .more { display: block; }
  .figures, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl { grid-template-columns: 1fr; }
  .pl-sources, .pl-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-rules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pl-col > h3 { grid-column: 1 / -1; }
  .pl-node { flex-direction: column; gap: 0; }
  .pl-node .port { right: 50%; top: 100%; }
  .pl-gate .port { left: 50%; top: 0; }
  .pl-feed .port { left: 50%; top: 0; }
  .pl-gate small { display: none; }
  .ladder li { margin-left: calc(var(--i) * 2.5%); }
}
@media (max-width: 520px) {
  .site-head nav a.opt { display: none; }
  .ladder li { grid-template-columns: 1fr; gap: .25rem; }
  .rd-list li { grid-template-columns: 1fr; }
  .rd-list .tag { grid-row: auto; grid-column: 1; justify-self: start; }
  .steps li { grid-template-columns: 2.75rem minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
