/* ------------------------------------------------------------------
   Personal site — black & white, mono / editorial
   Type and art never overlap: clean bars, full-strength painting bands.
   Font: Geist Mono. Art: Henri Rousseau, 1891 (public domain).
------------------------------------------------------------------- */

:root {
  --ink: #111111;
  --body: #4a4a4a;
  --paper: #ffffff;
  --muted: #8a8a8a;
  --rule: #ececec;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.jungle-scene {
  width: 100vw;
  height: 320px;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background: #ffffff;
}

.jungle-scene canvas,
.jungle-scene svg,
.scene-react-root {
  display: block;
  width: 100%;
  height: 100%;
}

.sprite-image {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Top bar: name + nav, clean white, no overlays --- */
.top { border-bottom: 1px solid var(--rule); }

.top-inner {
  max-width: 840px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.brand {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.top nav {
  display: flex;
  gap: 22px;
  font-size: 13.5px;
}

.top nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.top nav a:hover,
.top nav a.active { border-bottom-color: var(--ink); }

/* --- Hamburger toggle (mobile only) --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 2px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  z-index: 10;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 200ms ease, opacity 150ms ease;
}

.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Paintings: full canvas, full color, rotating gallery --- */
.gallery {
  width: 100%;
  margin: 34px 0 0;
  overflow: hidden;
  border-block: 1px solid var(--rule);
  background: var(--paper);
  position: relative;
}

.gallery-label {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 100%;
  padding: 12px 24px;
  color: var(--ink);
  font-size: 12px;
  background: var(--paper);
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.gallery-viewport {
  overflow: hidden;
  overflow-y: hidden;
}

.gallery-track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: max-content;
  padding: 0;
  will-change: transform;
  animation: gallery-drift 420s linear infinite;
}

@keyframes gallery-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-33.3333%, 0, 0); }
}

.gallery-slide {
  flex: 0 0 clamp(160px, 20vw, 260px);
  margin: 0;
}

.gallery-slide img {
  display: block;
  width: 100%;
  height: 185px;
  object-fit: cover;
  background: var(--paper);
  border: 0;
}

.gallery-slide figcaption {
  min-height: 42px;
  padding: 8px 10px 10px;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.gallery-slide figcaption span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

/* --- Type --- */
main { padding: 48px 0 8px; }

h1 {
  color: var(--ink);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 26px;
  letter-spacing: -0.03em;
}

h2 {
  color: var(--ink);
  font-weight: 600;
  font-size: 20px;
  margin: 40px 0 12px;
  letter-spacing: -0.02em;
}

p { margin: 0 0 18px; }

/* Use one weight for every content link, including links that contain <strong>. */
main a,
main a strong { font-weight: 600; }

/* --- Home sections --- */
.home-section {
  margin: 0;
}

.post-meta {
  color: var(--muted);
  font-size: 13px;
}

.post-page {
  padding-bottom: 60px;
}

.beach-bug-page .wrap,
.beach-bug-page .top {
  position: relative;
  z-index: 2;
}

.scarab-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.scarab-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(64px, calc((100vw - 840px) / 2), 170px);
  min-width: 64px;
}

.scarab-rail-left { left: 0; }
.scarab-rail-right { right: 0; }

.scarab {
  position: absolute;
  top: -120px;
  left: 0;
  width: 48px;
  height: 64px;
  opacity: 0.58;
  transform-origin: center;
  animation: scarab-walk-down var(--scarab-duration, 28s) linear infinite;
  animation-delay: var(--scarab-delay, 0s);
  will-change: transform;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.scarab-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  shape-rendering: crispEdges;
}

.scarab-svg rect {
  shape-rendering: crispEdges;
}

.scarab-shadow-pixel {
  fill: rgba(17, 17, 17, 0.09);
}

.scarab-black,
.scarab-legs rect,
.scarab-antennae rect {
  fill: #111111;
}

.scarab-mid {
  fill: #2f2f2f;
}

.scarab-light {
  fill: #dcdcdc;
}

.scarab-cut {
  fill: #f7f7f7;
}

.scarab-legs-left {
  transform-origin: 8px 12px;
  animation: scarab-left-legs 360ms steps(2, end) infinite;
}

.scarab-legs-right {
  transform-origin: 10px 12px;
  animation: scarab-right-legs 360ms steps(2, end) infinite;
}

@keyframes scarab-walk-down {
  from {
    transform:
      translate3d(var(--scarab-x, 20px), -130px, 0)
      rotate(var(--scarab-tilt, 0deg))
      scale(var(--scarab-scale, 0.72));
  }
  45% {
    transform:
      translate3d(calc(var(--scarab-x, 20px) + var(--scarab-drift, 8px)), 45vh, 0)
      rotate(var(--scarab-tilt-opposite, 0deg))
      scale(var(--scarab-scale, 0.72));
  }
  to {
    transform:
      translate3d(var(--scarab-x, 20px), calc(100vh + 140px), 0)
      rotate(var(--scarab-tilt, 0deg))
      scale(var(--scarab-scale, 0.72));
  }
}

@keyframes scarab-left-legs {
  50% { transform: translate3d(1px, 1px, 0); }
}

@keyframes scarab-right-legs {
  50% { transform: translate3d(-1px, -1px, 0); }
}

strong {
  font-weight: 500;
  color: var(--ink);
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #c9c9c9;
  text-decoration-thickness: 1px;
}

a:hover { text-decoration-color: var(--ink); }

.reveal-ready .copy-reveal {
  opacity: 0;
  transform: translateY(5px);
  clip-path: inset(0 0 100% 0);
  transition:
    opacity 180ms ease,
    transform 220ms ease,
    clip-path 220ms steps(4, end);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-ready .copy-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-ready .copy-reveal {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
  }
}

.conversation {
  margin: 22px 0 0;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  position: relative;
}

.chat-prompt {
  color: var(--ink);
  font-weight: 500;
  position: sticky;
  top: 0;
  background: var(--paper);
  padding-bottom: 8px;
  z-index: 1;
}

.chat-log {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
}

.message {
  border-left: 2px solid var(--rule);
  padding-left: 12px;
}

.message.user {
  color: var(--ink);
}

.message.assistant {
  color: var(--body);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.chat-form input,
.chat-form button {
  font: inherit;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 11px;
}

.chat-form input:focus,
.chat-form button:focus {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.chat-form button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Library + projects --- */
.post-list { list-style: none; padding: 0; margin: 0 0 48px; }

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.post-list .date {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.reading-section {
  margin: 0 0 46px;
  border-top: 1px solid var(--ink);
  padding-top: 2px;
}

.reading-note {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.book-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.book-item {
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}

.book-item:not(.has-review),
.book-item summary {
  display: grid;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
}

.book-item:not(.has-review) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.book-item.has-review {
  color: var(--ink);
}

.book-item details {
  margin: 0;
}

.book-item summary {
  grid-template-columns: minmax(0, 1fr) auto 1ch;
  cursor: pointer;
  list-style: none;
}

.book-item summary::-webkit-details-marker {
  display: none;
}

.book-item summary::after {
  content: "+";
  color: var(--muted);
  font-size: 13px;
  justify-self: end;
}

.book-item details[open] summary::after {
  content: "-";
}

.book-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.book-author {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.has-review .book-author {
  color: var(--body);
}

.current-book {
  font-weight: 600;
}

.book-review {
  max-width: 660px;
  padding: 0 0 16px;
  color: var(--body);
}

.book-review p:last-child {
  margin-bottom: 0;
}

.project-list {
  display: grid;
  gap: 0;
  margin: 0 0 48px;
}

.experience-group {
  margin: 0 0 42px;
}

.experience-group .project-list {
  margin-bottom: 0;
}

.experience-heading {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--ink);
}

.project-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.project-item h2,
.project-item h3 {
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.project-date {
  font-weight: 400;
  font-size: 12.5px;
  color: #888;
  margin-left: 6px;
  letter-spacing: -0.02em;
}

.project-item p {
  max-width: 660px;
  margin-bottom: 0;
}

.project-item > a,
.project-status,
.project-links a {
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.project-links {
  display: grid;
  justify-items: end;
  gap: 7px;
}

/* --- Project case studies --- */
.case-study {
  position: relative;
  z-index: 2;
  padding-bottom: 56px;
}


.case-kicker {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 16px;
}

.case-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.case-topline .case-kicker {
  margin-bottom: 0;
}

.case-lede {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.case-stack {
  font-size: 12.5px;
  color: #777;
  letter-spacing: 0.03em;
  margin: -16px 0 32px;
}

.case-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: -12px 0 32px;
}

.case-actions-bottom {
  margin: 28px 0 0;
}

.case-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 22px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  text-decoration: none;
  text-underline-offset: 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
}

.case-button:hover {
  background: #333;
  border-color: #333;
  color: #fff;
  text-decoration: none;
}

.case-button-outline {
  background: transparent;
  color: var(--ink);
  border-color: #cfcfcf;
}

.case-button-outline:hover {
  background: #f7f7f7;
  border-color: var(--ink);
  color: var(--ink);
}

.case-topline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.xgalonso-topline-actions,
.mirn-topline-actions {
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.xgalonso-topline-actions .case-button,
.mirn-topline-actions .case-button {
  padding-inline: 14px;
  white-space: nowrap;
}

.oasis-screenshots {
  display: grid;
  gap: 18px;
  margin: -16px 0 42px;
}

.oasis-screenshots figure {
  margin: 0;
  border: 1px solid var(--rule);
  background: #f5f2ec;
  overflow: hidden;
}

.oasis-screenshots img {
  display: block;
  width: 100%;
  height: auto;
}

.tool-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 42px 24px 28px;
  background: var(--paper);
}

.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.tool-header h1 {
  margin-bottom: 0;
}

.tool-header a {
  font-size: 13px;
  white-space: nowrap;
}

.tool-note {
  max-width: 780px;
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 16px;
}

.tool-frame-shell {
  border: 1px solid var(--rule);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.028) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 17, 0.028) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  padding: 12px;
}

.tool-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.tool-nav a {
  border: 1px solid var(--rule);
  padding: 7px 10px;
  text-decoration: none;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--paper);
}

.tool-nav a:hover {
  border-color: var(--ink);
}

.tool-frame {
  display: block;
  width: 100%;
  height: min(900px, calc(100vh - 220px));
  min-height: 680px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.demo-shell {
  display: grid;
  gap: 14px;
  border: 1px solid var(--rule);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.028) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 17, 0.028) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  padding: 14px;
}

.demo-workbench,
.demo-results {
  display: grid;
  gap: 14px;
}

.demo-workbench {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.demo-results {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.75fr) minmax(320px, 1fr);
  align-items: stretch;
}

.demo-results-compact {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
}

.demo-panel {
  min-width: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 16px;
}

.demo-panel .case-kicker {
  margin-bottom: 12px;
}

.demo-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.demo-panel-heading .case-kicker {
  margin-bottom: 0;
}

.demo-button,
.demo-presets button {
  min-height: 34px;
  border: 1px solid var(--rule);
  background: #fbfbfb;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
}

.demo-button {
  padding: 8px 11px;
  white-space: nowrap;
}

.demo-button:hover,
.demo-presets button:hover {
  border-color: var(--ink);
}

.demo-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.demo-textarea {
  display: block;
  width: 100%;
  min-height: 168px;
  resize: vertical;
  border: 1px solid var(--rule);
  background: #fbfbfb;
  color: var(--ink);
  padding: 12px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.6;
}

.demo-textarea:focus,
.demo-button:focus,
.demo-presets button:focus {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.demo-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.demo-presets button {
  padding: 8px;
  overflow-wrap: anywhere;
}

.demo-sliders {
  display: grid;
  gap: 12px;
}

.demo-sliders div {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) minmax(120px, 1.4fr) 34px;
  align-items: center;
  gap: 10px;
}

.demo-sliders span,
.demo-ev-grid span,
.demo-action-line span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.demo-sliders strong,
.demo-ev-grid strong,
.demo-action-line strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.demo-sliders meter {
  width: 100%;
  height: 12px;
}

.demo-table {
  display: grid;
  gap: 16px;
  min-height: 142px;
  align-content: center;
}

.demo-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.demo-cards span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 62px;
  border: 2px solid var(--ink);
  background: #fbfbfb;
  color: var(--ink);
  box-shadow:
    3px 0 0 #cfcfcf,
    0 3px 0 #cfcfcf,
    3px 3px 0 #cfcfcf;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
}

.demo-cards i {
  width: 1px;
  height: 52px;
  background: var(--rule);
  margin: 0 4px;
}

.demo-action-line {
  display: grid;
  gap: 4px;
}

.demo-ev-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.demo-ev-grid div {
  min-width: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 14px;
}

.demo-ev-grid span,
.demo-ev-grid strong {
  display: block;
}

.demo-ev-grid span {
  margin-bottom: 8px;
}

.demo-ev-grid .best-action {
  background: #f7f7f7;
  box-shadow: inset 0 0 0 1px #cfcfcf;
}

.demo-diagnosis ul {
  margin: 0;
  padding-left: 18px;
}

.demo-diagnosis li {
  margin-bottom: 8px;
}

.demo-diagnosis li:last-child {
  margin-bottom: 0;
}

.demo-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.demo-feature-list span {
  min-width: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: #fbfbfb;
  color: var(--ink);
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.45;
}

.demo-inquire-note {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin: 12px 0 0;
}

.case-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  margin: 28px 0 50px;
}

.case-metrics div {
  min-width: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 16px;
}

.case-metrics strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.case-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.case-section {
  padding: 30px 0;
  border-top: 1px solid var(--rule);
}

.case-section h2 {
  margin-top: 0;
}

.ml-diagram {
  display: block;
  margin: 20px 0 34px;
}

.loop-diagram {
  position: relative;
  min-height: 720px;
  border: 1px solid #d8d8d8;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    #fbfbfb;
  background-size: 28px 28px;
  padding: 24px;
  overflow: hidden;
}

.loop-track {
  position: absolute;
  inset: 90px 112px;
  border: 2px solid #9a9a9a;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.035);
}

.loop-arrow {
  position: absolute;
  background: #fbfbfb;
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  padding: 5px 9px;
  border: 1px solid #bdbdbd;
  white-space: nowrap;
}

.loop-arrow-top {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.loop-arrow-right {
  top: 50%;
  right: -58px;
  transform: translateY(-50%) rotate(90deg);
}

.loop-arrow-bottom {
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.loop-arrow-left {
  top: 50%;
  left: -70px;
  transform: translateY(-50%);
}

.loop-node {
  position: absolute;
  width: 220px;
  min-height: 158px;
}

.loop-node-agents { top: 32px; left: 32px; }
.loop-node-sim { top: 32px; left: calc(50% - 110px); }
.loop-node-features { top: 32px; right: 32px; }
.loop-node-model { top: 276px; right: 32px; }
.loop-node-compiler { bottom: 32px; right: 32px; }
.loop-node-diagnosis { bottom: 32px; left: calc(50% - 110px); }
.loop-node-patch { bottom: 32px; left: 32px; }

.loop-center {
  position: absolute;
  inset: 50%;
  width: 250px;
  min-height: 110px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  text-align: center;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 18px;
}

.agent-axis,
.log-visual,
.parser-visual,
.patch-visual {
  margin: 20px 0;
}

.agent-axis {
  position: relative;
  min-height: 360px;
  border: 1px solid var(--rule);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    #fbfbfb;
  background-size: 28px 28px;
  overflow: hidden;
}

.axis-line {
  position: absolute;
  background: #cfcfcf;
}

.axis-line-x {
  left: 7%;
  right: 7%;
  top: 50%;
  height: 1px;
}

.axis-line-y {
  top: 10%;
  bottom: 10%;
  left: 50%;
  width: 1px;
}

.axis-label {
  position: absolute;
  color: var(--muted);
  font-size: 11px;
  background: #fbfbfb;
  padding: 3px 6px;
}

.axis-label-top {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.axis-label-bottom {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.axis-label-left {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.axis-label-right {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.agent-point {
  position: absolute;
  width: 190px;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 12px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7);
}

.agent-point::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #8a8a8a;
  top: -5px;
  left: -5px;
}

.agent-point strong,
.agent-point span {
  display: block;
}

.agent-point strong {
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.35;
}

.agent-point span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 5px;
}

.agent-tag { left: 18%; top: 20%; }
.agent-lag { right: 12%; top: 18%; }
.agent-calling { left: 20%; bottom: 16%; }
.agent-random { right: 18%; bottom: 18%; }

.log-visual {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.log-visual div {
  min-width: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 14px;
}

.log-visual span,
.log-visual strong,
.log-visual small {
  display: block;
}

.log-visual span {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
}

.log-visual strong {
  color: var(--ink);
  font-size: 14px;
}

.log-visual small {
  color: var(--body);
  line-height: 1.45;
  margin-top: 8px;
}

.parser-visual {
  display: grid;
  grid-template-columns: 1fr auto 1.1fr;
  gap: 12px;
  align-items: stretch;
}

.parser-input,
.parser-output {
  border: 1px solid var(--rule);
  background: #fbfbfb;
  padding: 16px;
}

.parser-input {
  color: var(--ink);
}

.parser-arrow {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.parser-output {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.parser-output span {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  padding: 8px;
  font-size: 12px;
}

.patch-visual {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.patch-visual div {
  min-width: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 14px;
}

.patch-visual span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
}

.patch-visual strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.loop-center strong {
  font-size: 14px;
}

.loop-center span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.diagram-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
}

.diagram-row-center {
  grid-template-columns: minmax(0, 1fr);
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.ml-diagram article {
  min-width: 0;
  border: 1px solid var(--rule);
  padding: 16px;
  background: #fbfbfb;
}

.ml-diagram article span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 10px;
}

.ml-diagram article h3 {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  margin: 0 0 8px;
}

.ml-diagram article p {
  margin-bottom: 0;
  font-size: 12.5px;
  line-height: 1.55;
}

.ml-diagram .diagram-focus {
  background: #f7f7f7;
  border-color: #cfcfcf;
}

.ml-diagram .diagram-focus h3,
.ml-diagram .diagram-focus strong {
  color: var(--ink);
}

.ml-diagram .diagram-focus p,
.ml-diagram .diagram-focus span {
  color: var(--muted);
}

.diagram-arrow {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 18px;
}

.diagram-loop {
  color: var(--ink);
}

.case-steps {
  counter-reset: case-step;
  list-style: none;
  padding: 0;
  margin: 0;
}

.case-steps li {
  counter-increment: case-step;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.case-steps li > div {
  min-width: 0;
}

.case-steps li::before {
  content: counter(case-step, decimal-leading-zero);
  color: var(--muted);
  font-size: 12px;
}

.case-steps strong {
  display: block;
  margin-bottom: 4px;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.case-grid article {
  min-width: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 18px;
}

.case-grid h3 {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  margin: 0 0 10px;
}

.case-grid p {
  margin-bottom: 0;
  font-size: 13.5px;
}

.feature-table {
  display: grid;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  margin-top: 20px;
}

.feature-table > div {
  display: grid;
  grid-template-columns: 180px 1fr;
}

.feature-table span {
  min-width: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 13px 14px;
  overflow-wrap: anywhere;
}

.feature-table span:first-child {
  color: var(--ink);
  font-weight: 500;
  background: #fbfbfb;
}

.forest-visual {
  display: grid;
  grid-template-columns: 0.85fr 1.3fr 0.85fr;
  gap: 12px;
  align-items: stretch;
  margin: 20px 0 20px;
}

.forest-input,
.forest-output,
.tree-stack > div {
  border: 1px solid var(--rule);
  padding: 16px;
  background: #fbfbfb;
}

.forest-input,
.forest-output {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.forest-input h3,
.forest-output h3 {
  color: var(--ink);
  font-size: 15px;
  margin: 0 0 8px;
}

.forest-input p,
.forest-output p {
  margin-bottom: 0;
  font-size: 13px;
}

.tree-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tree-stack > div {
  min-width: 0;
  text-align: center;
  font-size: 12px;
}

.tree-stack strong,
.forest-output strong {
  color: var(--ink);
}

.ev-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  margin-top: 20px;
}

.ev-board div {
  min-width: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 16px;
}

.ev-board span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.ev-board strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.ev-board .best-action {
  background: #f7f7f7;
  box-shadow: inset 0 0 0 1px #cfcfcf;
}

.ev-board .best-action span,
.ev-board .best-action strong {
  color: var(--ink);
}

.case-quote {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 0;
}

.music-page {
  padding-bottom: 36px;
}

.music-intro {
  color: var(--muted);
  margin-top: -12px;
}

.music-section {
  margin: 36px 0 0;
}

.music-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.music-section-heading h2 {
  margin: 0;
}

.music-source {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.music-shelf-scene {
  position: relative;
  padding: 18px 0 4px;
  overflow: visible;
}

.album-shelf {
  position: relative;
  min-width: 0;
  padding: 0 0 10px;
}

.music-grid,
.album-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 26px 14px;
}

.music-card {
  min-width: 0;
  padding: 0;
}

.album-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 72px;
  gap: 10px;
  min-height: 236px;
  transform: translateY(0);
  transition: transform 140ms steps(2, end);
}

.album-card > div {
  min-width: 0;
}

.album-card:hover,
.album-card:focus-within {
  transform: translateY(-4px);
}

.music-art {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 0;
  background: #fff;
  color: var(--ink);
  text-align: center;
  border: 0;
  text-decoration: none;
  box-shadow: none;
  image-rendering: pixelated;
}

.music-art span {
  max-width: 88%;
  font-size: 11px;
  line-height: 1.25;
}

.music-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.music-card h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-card p {
  margin-bottom: 0;
  font-size: 12.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.album-rank {
  display: block;
  color: #111;
  font-size: 11px;
  line-height: 1;
  margin-bottom: 8px;
}

/* --- Footer: clean white, hairline rules --- */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 36px;
}

.site-footer-inner {
  max-width: 840px;
  margin: 0 auto;
  padding: 22px 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.site-footer a { color: var(--ink); }

.credit {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .demo-workbench,
  .demo-results,
  .xgalonso-demo-results {
    grid-template-columns: 1fr;
  }

  .demo-table {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .top-inner {
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .top nav {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 10px 0 2px;
    border-top: 1px solid var(--rule);
  }

  .top.nav-open nav {
    display: flex;
  }

  .top nav a {
    display: block;
    min-height: 44px;
    padding: 11px 0;
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
  }

  .top nav a:hover,
  .top nav a.active {
    border-bottom-color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .demo-shell {
    padding: 10px;
  }

  .demo-panel {
    padding: 13px;
  }

  .demo-panel-heading {
    flex-direction: column;
  }

  .demo-button {
    width: 100%;
  }

  .demo-presets,
  .demo-sliders div,
  .demo-ev-grid,
  .demo-feature-list {
    grid-template-columns: 1fr;
  }

  .demo-cards span {
    width: 40px;
    height: 54px;
    font-size: 15px;
  }

  .demo-cards i {
    display: none;
  }

  .xgalonso-summary,
  .xgalonso-evidence {
    grid-template-columns: 1fr;
  }

  .xgalonso-summary {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 23px; }
  .jungle-scene { height: 220px; }
  .gallery-label { padding-inline: 18px; }
  .gallery-slide { flex-basis: 46vw; }
  .gallery-slide img { height: 135px; }
  main { padding-top: 36px; }
  .chat-form { grid-template-columns: 1fr; }
  .project-item { grid-template-columns: 1fr; gap: 8px; }
  .case-metrics { grid-template-columns: 1fr 1fr; }
  .case-steps li { grid-template-columns: 1fr; gap: 5px; }
  .case-grid { grid-template-columns: 1fr; }
  .case-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .case-topline,
  .tool-header {
    flex-direction: column;
  }

  .xgalonso-topline-actions .case-button,
  .mirn-topline-actions .case-button {
    min-height: 38px;
    padding-inline: 9px;
    font-size: 11.5px;
  }

  /*
   * One line is a desktop promise. Three nowrap buttons need about 295px even at the shrunken
   * mobile sizes above, and a 320px phone only offers 272px of content width — so under 480px,
   * where the topline has already stacked into a column anyway, they wrap rather than push the
   * page sideways.
   */
  .mirn-topline-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .tool-shell {
    padding-inline: 18px;
  }
  .tool-frame {
    min-height: 620px;
  }
  .loop-diagram {
    display: grid;
    gap: 10px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .loop-track,
  .loop-center {
    display: none;
  }
  .loop-node {
    position: static;
    width: auto;
    min-height: 0;
  }
  .diagram-row,
  .diagram-row-center,
  .log-visual,
  .parser-visual,
  .parser-output,
  .patch-visual,
  .forest-visual,
  .feature-table > div,
  .ev-board {
    grid-template-columns: 1fr;
  }
  .diagram-arrow {
    transform: rotate(90deg);
    min-height: 20px;
  }
  .tree-stack {
    grid-template-columns: 1fr 1fr;
  }
  .agent-axis {
    min-height: 0;
    display: grid;
    gap: 10px;
    border: 0;
    background: transparent;
  }
  .axis-line,
  .axis-label {
    display: none;
  }
  .agent-point {
    position: relative;
    inset: auto;
    width: auto;
  }
  .music-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .music-source {
    text-align: left;
  }
  .music-grid,
  .album-gallery {
    grid-template-columns: 1fr;
  }
  .scarab-field { display: none; }
}

@media (max-width: 760px) {
  .music-grid,
  .album-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .music-shelf-scene {
    padding-top: 26px;
  }
  .album-shelf {
    padding-inline: 2px;
  }
  .music-grid,
  .album-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1020px) {
  .scarab {
    opacity: 0.28;
    width: 42px;
    height: 55px;
  }
}

/* ===== Frontier case study ===== */


/* --- Screenshot placeholders --- */
.screenshot-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 2px dashed #cfcfcf;
  background: #fafafa;
  margin: 20px 0;
  padding: 24px;
}

.screenshot-placeholder span {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* --- Wider left column for Guide scoring table --- */
.feature-table-wide > div {
  grid-template-columns: 210px 1fr;
}

/* --- Animated product showcase --- */
.frontier-showcase,
.cortex-showcase,
.mirn-showcase,
.xgalonso-showcase {
  position: relative;
  margin: 24px 0 32px;
  border: 1px solid var(--rule);
  background: #0d1117;
  border-radius: 6px;
  overflow: hidden;
}

.xgalonso-showcase img,
.mirn-showcase img {
  display: block;
  width: 100%;
  height: auto;
}

.xgalonso-showcase video {
  display: block;
  width: 100%;
  height: auto;
}

/* --- XGalonso demo --- */
.xgalonso-demo {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--rule);
  background: #081319;
  color: #d8e1e5;
}

.xgalonso-intent-form,
.xgalonso-demo-panel {
  border: 1px solid #23343c;
  background: #0d1a20;
  padding: 18px;
}

.xgalonso-demo .case-kicker,
.xgalonso-demo .demo-label,
.xgalonso-demo .tool-note {
  color: #78909a;
}

.xgalonso-demo .demo-textarea {
  min-height: 88px;
  border-color: #2d424b;
  background: #09151b;
  color: #e0e8ea;
}

.xgalonso-prompt {
  margin: 0;
  color: #e0e8ea;
  font-size: 14px;
  line-height: 1.7;
}

.xgalonso-requirements,
.xgalonso-squad {
  list-style: none;
  padding: 0;
  margin: 0;
}

.xgalonso-requirements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.xgalonso-requirements li {
  border-left: 2px solid #49d59c;
  padding: 6px 9px;
  color: #d8e1e5;
  font-size: 13px;
  line-height: 1.4;
}

.xgalonso-demo-results {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
}

.xgalonso-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid #23343c;
}

.xgalonso-summary strong,
.xgalonso-summary span {
  display: block;
}

.xgalonso-summary strong {
  color: #f0f4f5;
  font-size: 21px;
  font-weight: 500;
}

.xgalonso-summary span,
.xgalonso-subhead,
.xgalonso-squad small,
.xgalonso-evidence dt {
  color: #78909a;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.xgalonso-subhead {
  margin: 17px 0 7px;
}

.xgalonso-squad li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #1d2d34;
  color: #d8e1e5;
  font-size: 13px;
}

.xgalonso-squad b {
  margin-left: 5px;
  color: #49d59c;
  font-size: 10px;
  font-weight: 500;
}

.xgalonso-position {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: #5baed1;
}

.xgalonso-position.mid { background: #49d59c; }
.xgalonso-position.fwd { background: #ed6a57; }

.xgalonso-recommendation {
  display: flex;
  flex-direction: column;
}

.xgalonso-transfer {
  margin: 2px 0 14px;
  color: #f1f4f5;
  font-size: 15px;
  line-height: 1.45;
}

.xgalonso-transfer span:first-child { color: #ed6a57; }
.xgalonso-transfer span:last-child { color: #49d59c; }
.xgalonso-transfer b { color: #78909a; font-weight: 400; }

.xgalonso-gain {
  color: #49d59c;
  font-size: 29px;
  font-weight: 500;
}

.xgalonso-gain small {
  color: #a9c0c8;
  font-size: 11px;
  font-weight: 400;
}

.xgalonso-recommendation > p:not(.case-kicker):not(.xgalonso-transfer) {
  color: #a9c0c8;
  font-size: 12.5px;
  line-height: 1.6;
}

.xgalonso-evidence {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: auto 0 0;
  padding-top: 16px;
  border-top: 1px solid #23343c;
}

.xgalonso-evidence div { min-width: 0; }
.xgalonso-evidence dt { margin-bottom: 4px; }
.xgalonso-evidence dd { margin: 0; color: #d8e1e5; font-size: 12px; }

.showcase-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
}

.showcase-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.showcase-slide-active {
  opacity: 1;
}

.showcase-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #0d1117;
}

.showcase-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4a4a4a;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s;
}

.showcase-dot-active {
  background: #e0e0e0;
}

/* --- Pipeline loop: 4-node variant --- */
.frontier-pipeline {
  min-height: 520px;
}

.loop-node-historian   { top: 32px;  left: 32px; }
.loop-node-conjecturer { top: 32px;  right: 32px; left: auto; }
.loop-node-guide       { bottom: 32px; right: 32px; left: auto; top: auto; }
.loop-node-planner     { bottom: 32px; left: 32px; top: auto; }

/* --- Evidence chain visual --- */
.evidence-visual {
  display: grid;
  gap: 6px;
  border: 1px solid var(--rule);
  background: #fafafa;
  padding: 16px;
  margin: 16px 0;
}

.evidence-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.5;
}

.evidence-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  background: #fbfbfb;
  font-family: 'Geist Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Reward formula block --- */
.reward-formula {
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px solid var(--rule);
  background: #fafafa;
  font-family: 'Geist Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  margin: 16px 0;
  letter-spacing: 0.02em;
}

/* --- Frontier demo styles --- */
.frontier-demo-baseline,
.frontier-demo-frontier {
  min-width: 0;
}

.frontier-demo-baseline .case-kicker { color: #888; }
.frontier-demo-frontier .case-kicker { color: var(--ink); }

.frontier-demo-evidence {
  margin: 10px 0;
  padding: 0;
  list-style: none;
}

.frontier-demo-evidence li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--body);
}

.frontier-demo-scores {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 4px;
  margin: 10px 0;
  font-size: 11.5px;
}

.frontier-demo-scores span {
  display: flex;
  justify-content: space-between;
  padding: 3px 7px;
  border: 1px solid var(--rule);
  background: #fbfbfb;
  color: var(--body);
}

.frontier-demo-scores strong {
  font-weight: 600;
  color: var(--ink);
}

.frontier-demo-plan {
  list-style: decimal;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 0 0;
}

.frontier-demo-plan li {
  margin-bottom: 4px;
}

.frontier-demo-thesis {
  grid-column: 1 / -1;
}

@media (max-width: 680px) {
  .frontier-demo-scores {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   CORTEX
   ============================================================ */

/* --- Sync-flow graphic (section 2): tools in -> pipeline -> tools out --- */
.cortex-flow {
  display: grid;
  grid-template-columns: 1fr 46px minmax(190px, 1.15fr) 46px 1fr;
  align-items: center;
  margin: 20px 0 34px;
  border: 1px solid #d8d8d8;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    #fbfbfb;
  background-size: 28px 28px;
  padding: 24px;
  gap: 4px;
}

.cortex-flow-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.cortex-flow-heading {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 2px;
}

.cortex-tool-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--body);
}

.cortex-tool-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.45;
  flex: none;
}

.cortex-flow-arrow {
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  text-align: center;
}

.cortex-flow-arrow span {
  font-size: 20px;
  line-height: 1;
}

.cortex-flow-arrow small {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cortex-flow-pipeline {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.cortex-stage {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 11px 13px;
}

.cortex-stage-commit {
  border-color: var(--ink);
}

.cortex-stage b {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.cortex-stage strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}

.cortex-stage small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.cortex-stage-link {
  text-align: center;
  font-size: 12px;
  color: #bdbdbd;
  padding: 3px 0;
}

@media (max-width: 820px) {
  .cortex-flow {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .cortex-flow-arrow span {
    display: inline-block;
    transform: rotate(90deg);
  }
}

/* --- Demo stage accents --- */
.demo-presets button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.cortex-demo-dedup,
.cortex-demo-decide {
  min-width: 0;
}

.cortex-demo-summary {
  grid-column: 1 / -1;
}

.cortex-fact-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.cortex-fact-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: #fbfbfb;
  font-size: 12.5px;
  color: var(--body);
}

.cortex-fact-text {
  min-width: 0;
}

.cortex-fact-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.cortex-fact-reason {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
}

.cortex-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  font-family: 'Geist Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cortex-tag-auto {
  border-color: var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.cortex-tag-review {
  border-color: #bdbdbd;
  background: #fbfbfb;
  color: #666;
}

.cortex-tag-filtered {
  border-style: dashed;
  border-color: #c0392b;
  color: #c0392b;
  background: #fdf4f3;
}

@media (max-width: 680px) {
  .cortex-fact-list li {
    grid-template-columns: auto 1fr;
  }
  .cortex-fact-meta {
    grid-column: 2;
  }
}


/* --- MIRN demo --- */
.mirn-demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 14px;
}

.mirn-arena {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 12px;
  min-width: 0;
}

.mirn-arena canvas {
  display: block;
  width: 100%;
  height: auto;
}

.mirn-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.mirn-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mirn-swatch {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px solid var(--ink);
}

.mirn-swatch-ghost {
  border-top: 2px dashed #b3b3b3;
}

.mirn-swatch-robot {
  border-top: 2px solid #c0392b;
}

.mirn-control {
  margin-bottom: 16px;
}

.mirn-control:last-child {
  margin-bottom: 0;
}

.mirn-control-value {
  color: var(--ink);
}

.mirn-range {
  width: 100%;
  margin: 0;
  accent-color: #111111;
}

.mirn-toggle {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--body);
  line-height: 1.5;
}

.mirn-toggle input {
  margin: 3px 0 0;
  accent-color: #111111;
}

.mirn-seeds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mirn-seeds button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.mirn-readouts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mirn-tile {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 14px 16px;
  min-width: 0;
}

.mirn-tile-label {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.mirn-tile-value {
  display: block;
  font-size: 25px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.mirn-tile-zero {
  display: block;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--rule);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

.mirn-tile-zero strong {
  color: var(--body);
  font-weight: 500;
}

.mirn-verdict {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--ink);
  background: #fbfbfb;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--body);
}

.mirn-verdict strong {
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 900px) {
  .mirn-demo-layout {
    grid-template-columns: 1fr;
  }
  .mirn-readouts {
    grid-template-columns: 1fr;
  }
}
