:root {
  --paper: #fbfbf8;
  --ink: #0d0d0d;
  --muted: #5f5f63;
  --rule: #0d0d0d;
  --hair: #dcdcd5;
  --tint: #f1f1ec;
  --bounds: #7d93ff;
  --flash: #ff2d16;
  /* thermal scale, cold → hot */
  --h1: #2b3bff;
  --h2: #1fa3ff;
  --h3: #f5c400;
  --h4: #ff7a00;
  --h5: #ff2d16;
  --mono: "Martian Mono", ui-monospace, Menlo, monospace;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --pad: clamp(16px, 4vw, 56px);
  --indent: calc(5rem + 24px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--h1);
  outline-offset: 3px;
}

code,
pre,
kbd {
  font-family: var(--mono);
  font-variation-settings: "wdth" 87.5;
}

p code,
td code,
li code {
  padding: 0 3px;
  background: #e9e9e2;
  font-size: 0.8em;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
}

.skip-link:focus {
  transform: none;
}

/* Layout bounds - the debug overlay React Native developers already know.
   Every [data-c] element is labelled with its component name. */

[data-c] {
  position: relative;
}

body.bounds-on [data-c] {
  outline: 1px dashed var(--bounds);
  outline-offset: -6px;
}

body.bounds-on [data-c]::before {
  content: "<" attr(data-c) ">";
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 6px;
  padding: 1px 5px;
  background: var(--paper);
  color: var(--bounds);
  font-family: var(--mono);
  font-size: 10px;
  font-variation-settings: "wdth" 75;
  line-height: 1.4;
  pointer-events: none;
}

body [data-c].is-flashing {
  outline: 2px solid var(--flash);
  outline-offset: -6px;
}

.section-badge {
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  font-variation-settings: "wdth" 75;
  pointer-events: none;
  animation: fade 1.2s ease-out forwards;
}

/* Header */

.bar {
  display: flex;
  gap: 28px;
  align-items: center;
  padding: 18px var(--pad);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  font-variation-settings: "wdth" 75;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark span {
  margin-left: 2px;
  padding: 0 4px;
  outline: 2px solid var(--flash);
  outline-offset: -1px;
  color: var(--flash);
}

.bar-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 13px;
  font-variation-settings: "wdth" 87.5;
}

.bar-nav a,
.foot a,
.row-note a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.bar-nav a:hover,
.foot a:hover,
.row-note a:hover {
  border-bottom-color: currentColor;
}

.bounds-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
  font-variation-settings: "wdth" 75;
}

.bounds-toggle b {
  min-width: 2.4em;
  padding: 1px 6px;
  background: var(--bounds);
  color: #fff;
  font-weight: 600;
}

.bounds-toggle[aria-pressed="false"] b {
  background: var(--hair);
  color: var(--muted);
}

/* Hero */

.hero {
  padding: clamp(48px, 9vw, 120px) var(--pad) clamp(40px, 6vw, 80px);
  border-bottom: 1px solid var(--rule);
}

.kicker {
  margin: 0 0 clamp(40px, 5vw, 64px);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-variation-settings: "wdth" 87.5;
}

.hero h1 {
  font-size: clamp(2.5rem, 13vw, 12.5rem);
  font-weight: 800;
  font-variation-settings: "wdth" 75;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.flash-word {
  position: relative;
  display: inline-block;
  padding: 0 0.06em;
  outline: 0.035em solid var(--flash);
  outline-offset: -0.02em;
}

.flash-word::after {
  content: attr(data-label);
  position: absolute;
  bottom: 100%;
  left: -0.035em;
  padding: 2px 8px;
  background: var(--ink);
  color: #fff;
  font-size: clamp(10px, 1vw, 14px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.5;
  white-space: nowrap;
}

.flash-word.pulse {
  animation: pulse 0.9s ease-out;
}

.hero-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: baseline;
  margin-top: clamp(28px, 4vw, 48px);
  font-family: var(--mono);
  font-variation-settings: "wdth" 87.5;
}

.answer-badge {
  padding: 4px 10px;
  background: var(--ink);
  color: #fff;
  font-size: clamp(14px, 1.6vw, 20px);
}

.answer-note {
  color: var(--muted);
  font-size: clamp(13px, 1.3vw, 16px);
}

.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  margin-top: clamp(40px, 6vw, 80px);
  padding-top: 24px;
  border-top: 1px solid var(--hair);
}

.hero-foot p {
  max-width: 38rem;
  margin: 0;
  font-size: clamp(17px, 1.5vw, 20px);
}

.install {
  display: flex;
  justify-self: start;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--rule);
  background: #fff;
}

.install code {
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 15px;
  white-space: nowrap;
}

.install code::before {
  content: "$ ";
  color: var(--muted);
}

.copy {
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--rule);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  font-variation-settings: "wdth" 75;
}

.copy:hover {
  background: var(--flash);
}

/* Section rows */

section {
  padding: clamp(40px, 6vw, 88px) var(--pad);
  border-bottom: 1px solid var(--rule);
}

.row-head {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  margin-bottom: clamp(28px, 4vw, 52px);
}

.num {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.row-head h2 {
  font-size: clamp(1.6rem, 3.4vw, 3rem);
  font-weight: 700;
  font-variation-settings: "wdth" 75;
  line-height: 1;
  letter-spacing: -0.03em;
}

.row-note {
  margin: 0;
  color: var(--muted);
}

.row-note code {
  padding: 0 3px;
  background: #e9e9e2;
  color: var(--ink);
  font-size: 0.8em;
}

/* Demo */

.demo-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 44px);
  margin-left: var(--indent);
}

.app {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px 16px 22px;
  border: 1px solid var(--rule);
  background: #fff;
}

.app-title {
  display: flex;
  justify-content: space-between;
  margin: 0 0 6px;
  font-weight: 600;
}

.app-title span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.node {
  display: grid;
  gap: 2px;
  padding: 12px 12px 12px 14px;
  border-left: 3px solid var(--ink);
  background: var(--tint);
}

.node em {
  font-family: var(--mono);
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  font-variation-settings: "wdth" 87.5;
}

.node span {
  color: var(--muted);
  font-size: 14px;
}

.node-memo {
  border-left-style: dotted;
}

.flash {
  position: absolute;
  z-index: 2;
  border: 2px solid var(--c, var(--flash));
  pointer-events: none;
  animation: fade 1.2s ease-out forwards;
}

.flash-badge {
  position: absolute;
  bottom: 100%;
  left: -2px;
  padding: 1px 6px;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-variation-settings: "wdth" 75;
  line-height: 1.5;
  white-space: nowrap;
}

.demo-side {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keys button {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  font-variation-settings: "wdth" 87.5;
}

.keys button:hover {
  background: var(--ink);
  color: var(--paper);
}

.keys button:active {
  transform: translateY(1px);
}

kbd {
  padding: 0 5px;
  border: 1px solid currentColor;
  font-size: 11px;
}

.heat {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-variation-settings: "wdth" 75;
}

.heat ol {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.heat li {
  width: 44px;
  padding: 3px 0 0;
  border-top: 6px solid var(--c);
  text-align: center;
}

.log {
  min-height: 250px;
  margin: 0;
  padding: 16px 18px;
  overflow: hidden;
  background: var(--ink);
  color: #c9c9c2;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.log .log-head {
  color: #fff;
}

.log .log-quiet {
  color: #6f6f69;
}

/* Reasons table */

.reason-table {
  width: calc(100% - var(--indent));
  margin-left: var(--indent);
  border-collapse: collapse;
}

.reason-table th,
.reason-table td {
  padding: 16px 18px 16px 0;
  border-top: 1px solid var(--hair);
  text-align: left;
  vertical-align: top;
}

.reason-table thead th {
  padding-top: 0;
  border-top: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  font-variation-settings: "wdth" 75;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reason-table tbody th {
  width: 7rem;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}

.reason-table td:nth-child(2) {
  width: 44%;
}

.reason-table td:nth-child(2) code {
  padding: 0;
  background: none;
  font-size: 14px;
}

.reason-table tbody tr:hover {
  background: var(--tint);
}

/* Setup */

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

.step {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 20px;
}

.step + .step {
  border-left: 1px solid var(--rule);
}

.step-n {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-variation-settings: "wdth" 75;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tabs {
  display: flex;
}

.tab {
  padding: 5px 12px;
  border: 1px solid var(--rule);
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
}

.tab + .tab {
  border-left: 0;
}

.tab.is-active {
  background: var(--ink);
  color: var(--paper);
}

.install-block {
  margin-top: -14px;
}

.install-block code {
  flex: 1;
}

.code {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  background: var(--tint);
  font-size: 13px;
  line-height: 1.65;
}

.code i {
  font-style: normal;
}

.code .k {
  color: #6a3cff;
}

.code .s {
  color: #c2410c;
}

.code .f {
  color: #1d4ed8;
}

.code .c {
  color: #8a8a85;
}

.code-log {
  background: var(--ink);
  color: #c9c9c2;
}

/* API */

.api-list {
  display: grid;
  margin-left: var(--indent);
  border-top: 1px solid var(--rule);
}

.api-item {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px 40px;
  padding: 26px 0;
  border-bottom: 1px solid var(--hair);
}

.api-item h3 {
  grid-row: span 2;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  font-weight: 600;
}

.api-item h3 code {
  font-variation-settings: "wdth" 75;
}

.api-item p {
  margin: 0;
}

.props {
  display: grid;
  margin: 6px 0 0;
  border-top: 1px solid var(--rule);
}

.props div {
  display: grid;
  grid-template-columns: 9rem 6.5rem 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
}

.props dt {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

.props dd {
  margin: 0;
  color: var(--muted);
}

.props dd code {
  padding: 0;
  background: none;
  color: var(--ink);
  font-size: 12px;
}

/* How it works */

.inside-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 40px;
  margin-left: var(--indent);
}

.does,
.doesnt {
  margin: 0;
  padding: 0;
  list-style: none;
}

.does {
  counter-reset: step;
}

.does li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  padding: 14px 0;
  border-top: 1px solid var(--hair);
}

.does li::before {
  counter-increment: step;
  content: "0" counter(step);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2;
}

.does li b {
  font-family: var(--mono);
  font-size: 0.85em;
  font-variation-settings: "wdth" 87.5;
}

.doesnt {
  align-self: start;
  padding: 18px 20px;
  border: 1px solid var(--rule);
}

.doesnt::before {
  content: "never";
  display: block;
  margin-bottom: 8px;
  color: var(--flash);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doesnt li {
  padding: 6px 0 6px 22px;
  text-indent: -22px;
}

.doesnt li::before {
  content: "×";
  display: inline-block;
  width: 22px;
  color: var(--flash);
  font-family: var(--mono);
  text-indent: 0;
}

/* Agents */

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

.agents-grid .code {
  font-size: 12px;
}

.agents-foot {
  margin: 20px 0 0 var(--indent);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-variation-settings: "wdth" 87.5;
}

.agents-foot a {
  color: var(--ink);
}

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  align-items: center;
  padding: 28px var(--pad) 36px;
  font-family: var(--mono);
  font-size: 13px;
  font-variation-settings: "wdth" 87.5;
}

.foot p {
  margin: 0;
  color: var(--muted);
}

.foot nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
}

/* Motion */

@keyframes fade {
  0%,
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes pulse {
  0% {
    background: rgba(255, 45, 22, 0.14);
  }
  100% {
    background: transparent;
  }
}

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

  .flash,
  .section-badge {
    animation-duration: 2s;
  }

  .flash-word.pulse {
    animation: none;
  }
}

/* Responsive */

@media (max-width: 980px) {
  :root {
    --indent: 0px;
  }

  .row-head {
    grid-template-columns: 3rem minmax(0, 1fr);
  }

  .row-note {
    grid-column: 2;
  }

  .reason-table {
    width: 100%;
  }

  .demo-grid,
  .inside-grid,
  .setup-grid,
  .agents-grid,
  .api-item {
    grid-template-columns: 1fr;
  }

  .step + .step {
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .api-item h3 {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .bar {
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .bar-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .bounds-toggle {
    margin-left: auto;
  }

  .hero-foot {
    grid-template-columns: 1fr;
  }

  .row-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .row-note {
    grid-column: auto;
  }

  .reason-table,
  .reason-table tbody,
  .reason-table tr,
  .reason-table th,
  .reason-table td {
    display: block;
    width: 100%;
  }

  .reason-table thead {
    display: none;
  }

  .reason-table tr {
    padding: 14px 0;
    border-top: 1px solid var(--hair);
  }

  .reason-table th,
  .reason-table td {
    padding: 2px 0;
    border: 0;
  }

  .reason-table td:nth-child(2) {
    width: 100%;
  }

  .props div {
    grid-template-columns: 1fr auto;
  }

  .props dd:last-child {
    grid-column: 1 / -1;
  }

  .foot nav {
    margin-left: 0;
  }
}
