/*
 * The platform site.
 *
 * The palette is the hero's: ink for the ground, sage for perception, paper for
 * the cut, terracotta for the market. Three colours doing three jobs, used
 * nowhere else, so a terracotta thing on this site always means commerce.
 */

:root {
  --ink: #08090b;
  --ink-raised: #0f1316;
  --ink-line: #1e2427;
  --paper: #d9dcd8;
  --paper-dim: rgba(217, 220, 216, 0.56);
  --paper-faint: rgba(217, 220, 216, 0.34);
  --perceive: #7e9e96;
  --perceive-deep: #3c4a4e;
  --commerce: #c08a6a;
  --commerce-warm: #cfaf8e;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    Arial, sans-serif;
  --page: 1180px;
  --rule: 1px solid var(--ink-line);
}

* {
  box-sizing: border-box;
}

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

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

a {
  color: var(--commerce-warm);
  text-decoration: none;
}

a:hover {
  color: var(--paper);
}

h1,
h2,
h3 {
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

code,
pre,
kbd {
  font-family: var(--mono);
}

::selection {
  background: rgba(192, 138, 106, 0.32);
}

/* ── shell ──────────────────────────────────────────────────────────────── */

.wrap {
  width: min(100% - 48px, var(--page));
  margin-inline: auto;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--perceive);
  margin: 0 0 20px;
}

.lede {
  color: var(--paper-dim);
  font-size: 17px;
  max-width: 62ch;
}

/* ── top bar ────────────────────────────────────────────────────────────── */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 44px);
  backdrop-filter: blur(14px);
  background: linear-gradient(
    to bottom,
    rgba(8, 9, 11, 0.86),
    rgba(8, 9, 11, 0)
  );
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.topbar[data-scrolled="true"] {
  background: rgba(8, 9, 11, 0.94);
  border-bottom-color: var(--ink-line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.brand i {
  width: 9px;
  height: 9px;
  border: 1px solid var(--perceive);
  border-radius: 2px;
  animation: blink 5s ease-in-out infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.9;
  }
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  font-size: 13px;
}

.topnav a {
  color: var(--paper-dim);
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  color: var(--paper);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--commerce);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--commerce-warm);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

.btn:hover {
  background: var(--commerce);
  color: var(--ink);
}

.btn-solid {
  background: var(--commerce);
  color: var(--ink);
}

.btn-solid:hover {
  background: var(--commerce-warm);
  color: var(--ink);
}

.btn-quiet {
  border-color: var(--ink-line);
  color: var(--paper-dim);
}

.btn-quiet:hover {
  background: var(--ink-line);
  color: var(--paper);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* A phone's top bar has room for the brand, two links, and the action. */
@media (max-width: 620px) {
  .topbar {
    padding: 14px 18px;
    gap: 12px;
  }
  .brand {
    font-size: 11px;
    letter-spacing: 0.2em;
  }
  .topnav {
    gap: 16px;
    font-size: 12.5px;
  }
  .topnav a {
    white-space: nowrap;
  }
  .hide-sm {
    display: none;
  }
  .btn {
    padding: 8px 14px;
  }
}

/* ── hero ───────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
}

.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero .vignette,
.hero .grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero .vignette {
  background: radial-gradient(
    125% 95% at 50% 46%,
    rgba(0, 0, 0, 0) 45%,
    rgba(0, 0, 0, 0.55) 100%
  );
  mix-blend-mode: multiply;
}

.hero .grain {
  opacity: 0.1;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.5'/></svg>");
}

.hero-copy {
  position: absolute;
  left: clamp(24px, 6vw, 96px);
  bottom: clamp(96px, 18vh, 180px);
  max-width: min(620px, 68vw);
  pointer-events: none;
}

.hero-copy .eyebrow {
  white-space: nowrap;
}

.hero-copy h1 {
  font-size: clamp(32px, 5vw, 66px);
  font-weight: 250;
  letter-spacing: -0.028em;
  color: rgba(217, 220, 216, 0.94);
}

.hero-copy h1 em {
  font-style: normal;
  font-weight: 300;
  color: var(--commerce-warm);
}

.hero-copy p {
  margin: 22px 0 0;
  color: var(--paper-faint);
  font-size: clamp(14px, 1.2vw, 16px);
  max-width: 44ch;
}

.hero-actions {
  position: absolute;
  left: clamp(24px, 6vw, 96px);
  bottom: clamp(36px, 8vh, 84px);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-legend {
  position: absolute;
  right: clamp(20px, 4vw, 56px);
  bottom: clamp(24px, 6vh, 56px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(217, 220, 216, 0.24);
  pointer-events: none;
}

.hero-legend span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hero-legend b {
  width: 14px;
  height: 1px;
  display: block;
}

@media (max-width: 720px) {
  .hero-legend {
    display: none;
  }
  .hero-copy {
    max-width: none;
    right: 24px;
  }
}

/* ── sections ───────────────────────────────────────────────────────────── */

section {
  position: relative;
  padding: clamp(72px, 11vh, 132px) 0;
  border-top: var(--rule);
}

.section-head {
  max-width: 70ch;
  margin-bottom: 52px;
}

.section-head h2 {
  font-size: clamp(26px, 3.2vw, 40px);
}

.section-head p {
  margin: 18px 0 0;
  color: var(--paper-dim);
  max-width: 62ch;
}

/* ── the three moves ────────────────────────────────────────────────────── */

.moves {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  background: var(--ink-line);
  border: var(--rule);
}

.move {
  background: var(--ink);
  padding: 34px 30px 38px;
}

.move .step {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--perceive);
}

.move h3 {
  font-size: 21px;
  margin: 16px 0 12px;
}

.move p {
  margin: 0;
  color: var(--paper-dim);
  font-size: 15px;
}

.move[data-accent="cut"] .step {
  color: var(--paper-faint);
}

.move[data-accent="market"] .step {
  color: var(--commerce);
}

/* ── domain cards ───────────────────────────────────────────────────────── */

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

/* An odd card left alone on the last row widens to fill it, so five domains
   read as a block rather than as four plus a stray. */
.domains .domain:nth-child(3n + 2):last-child {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .domains {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .domains .domain:nth-child(3n + 2):last-child {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .domains {
    grid-template-columns: 1fr;
  }
}

.domain {
  border: var(--rule);
  border-radius: 14px;
  padding: 24px;
  background: var(--ink-raised);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.domain:hover {
  border-color: var(--perceive-deep);
  transform: translateY(-2px);
}

.domain h3 {
  font-size: 17px;
  font-weight: 400;
  margin-bottom: 10px;
}

.domain p {
  margin: 0 0 16px;
  color: var(--paper-dim);
  font-size: 14px;
}

.domain code {
  font-size: 12px;
  color: var(--perceive);
  background: rgba(126, 158, 150, 0.1);
  border: 1px solid rgba(126, 158, 150, 0.2);
  border-radius: 6px;
  padding: 3px 8px;
}

/* ── code blocks ────────────────────────────────────────────────────────── */

.code {
  border: var(--rule);
  border-radius: 14px;
  overflow: hidden;
  background: #06070a;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: var(--rule);
  background: var(--ink-raised);
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: rgba(126, 158, 150, 0.14);
  color: var(--perceive);
}

.copy-btn {
  border: 1px solid var(--ink-line);
  background: transparent;
  color: var(--paper-faint);
  border-radius: 8px;
  font-size: 11px;
  font-family: var(--mono);
  padding: 5px 10px;
  cursor: pointer;
}

.copy-btn:hover {
  color: var(--paper);
  border-color: var(--perceive-deep);
}

.code pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.75;
  color: #b9c2bf;
}

.code pre .k {
  color: var(--perceive);
}

.code pre .s {
  color: var(--commerce-warm);
}

.code pre .c {
  color: #4d5654;
}

/* ── pipeline ───────────────────────────────────────────────────────────── */

.pipeline {
  display: grid;
  gap: 1px;
  background: var(--ink-line);
  border: var(--rule);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stage {
  background: var(--ink);
  padding: 26px 22px;
}

.stage .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper-faint);
}

.stage h4 {
  margin: 12px 0 8px;
  font-size: 15px;
  font-weight: 500;
}

.stage p {
  margin: 0;
  font-size: 13.5px;
  color: var(--paper-dim);
}

/* ── key form ───────────────────────────────────────────────────────────── */

.keybox {
  border: var(--rule);
  border-radius: 18px;
  padding: clamp(26px, 4vw, 44px);
  background: linear-gradient(
    160deg,
    rgba(126, 158, 150, 0.07),
    rgba(192, 138, 106, 0.05)
  );
}

.keyform {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

input[type="email"],
input[type="text"],
input[type="password"],
select,
textarea {
  background: #06070a;
  border: var(--rule);
  border-radius: 10px;
  color: var(--paper);
  font-family: inherit;
  font-size: 14px;
  padding: 12px 14px;
  min-width: 0;
}

input::placeholder,
textarea::placeholder {
  color: rgba(217, 220, 216, 0.28);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--perceive-deep);
}

.keyform input {
  flex: 1 1 280px;
}

.note {
  font-size: 13px;
  color: var(--paper-faint);
  margin: 16px 0 0;
}

.status {
  margin: 16px 0 0;
  font-size: 14px;
  min-height: 20px;
}

.status[data-tone="ok"] {
  color: var(--perceive);
}

.status[data-tone="error"] {
  color: #d98b7a;
}

.status[data-tone="busy"] {
  color: var(--paper-faint);
}

/* ── facts strip ────────────────────────────────────────────────────────── */

.facts {
  display: grid;
  gap: 1px;
  background: var(--ink-line);
  border-block: var(--rule);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.fact {
  background: var(--ink);
  padding: 28px 24px;
}

.fact b {
  display: block;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 400;
  color: var(--commerce-warm);
  letter-spacing: -0.02em;
}

.fact span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--paper-dim);
}

/* ── footer ─────────────────────────────────────────────────────────────── */

footer {
  border-top: var(--rule);
  padding: 44px 0;
  color: var(--paper-faint);
  font-size: 13px;
}

.footrow {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
}

/* ── docs ───────────────────────────────────────────────────────────────── */

.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  padding-top: 116px;
  align-items: start;
}

.docnav {
  position: sticky;
  top: 96px;
  font-size: 13.5px;
  display: grid;
  gap: 2px;
  border-left: var(--rule);
  padding-left: 16px;
}

.docnav a {
  color: var(--paper-faint);
  padding: 3px 0;
}

.docnav a:hover,
.docnav a.active {
  color: var(--paper);
}

.docnav .group {
  margin-top: 18px;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--perceive);
}

.docnav .group:first-child {
  margin-top: 0;
}

.doc h2 {
  font-size: 27px;
  margin: 64px 0 18px;
  scroll-margin-top: 108px;
}

.doc h2:first-of-type {
  margin-top: 0;
}

.doc h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 34px 0 12px;
  scroll-margin-top: 108px;
}

.doc p,
.doc li {
  color: var(--paper-dim);
}

.doc p {
  margin: 0 0 16px;
}

.doc ul {
  margin: 0 0 18px;
  padding-left: 20px;
}

.doc li {
  margin-bottom: 8px;
}

.doc .code {
  margin: 20px 0 26px;
}

.doc code {
  font-size: 13px;
  color: var(--commerce-warm);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 26px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

.doc th,
.doc td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: var(--rule);
  vertical-align: top;
}

.doc th {
  color: var(--paper);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.doc td {
  color: var(--paper-dim);
}

.doc td code {
  white-space: nowrap;
}

.method {
  font-family: var(--mono);
  font-size: 11px;
  border-radius: 5px;
  padding: 3px 7px;
  margin-right: 8px;
  border: 1px solid currentColor;
}

.method.post {
  color: var(--commerce);
}

.method.get {
  color: var(--perceive);
}

.method.delete {
  color: #d98b7a;
}

.callout {
  border: var(--rule);
  border-left: 2px solid var(--perceive);
  border-radius: 0 12px 12px 0;
  padding: 18px 22px;
  margin: 22px 0 26px;
  background: var(--ink-raised);
  font-size: 14.5px;
}

.callout strong {
  color: var(--paper);
  font-weight: 500;
}

@media (max-width: 860px) {
  .docs {
    grid-template-columns: 1fr;
  }
  .docnav {
    position: static;
    border-left: 0;
    padding-left: 0;
    border-bottom: var(--rule);
    padding-bottom: 18px;
  }
}

/* ── playground ─────────────────────────────────────────────────────────── */

.play {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 28px;
  padding: 116px 0 80px;
  align-items: start;
}

.panel {
  border: var(--rule);
  border-radius: 16px;
  background: var(--ink-raised);
  padding: 24px;
}

.panel h2 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.field label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

.field .hint {
  font-size: 12.5px;
  color: var(--paper-faint);
  text-transform: none;
  letter-spacing: 0;
}

.dropzone {
  border: 1px dashed var(--ink-line);
  border-radius: 12px;
  padding: 26px 18px;
  text-align: center;
  color: var(--paper-faint);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone:hover,
.dropzone[data-drag="true"] {
  border-color: var(--perceive);
  background: rgba(126, 158, 150, 0.06);
}

.dropzone img {
  max-width: 100%;
  max-height: 190px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.wire {
  border: var(--rule);
  border-radius: 16px;
  background: #06070a;
  overflow: hidden;
}

.wire-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--paper-faint);
}

.wire-log {
  margin: 0;
  padding: 16px;
  max-height: 320px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: #97a19e;
  white-space: pre-wrap;
  word-break: break-word;
}

.wire-log .req {
  color: var(--commerce-warm);
}

.wire-log .res {
  color: var(--perceive);
}

.wire-log .err {
  color: #d98b7a;
}

.results {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.item-card {
  border: var(--rule);
  border-radius: 14px;
  background: var(--ink-raised);
  padding: 18px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.item-card img.cut {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
}

.item-card h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
  text-transform: capitalize;
}

.item-card p {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--paper-dim);
}

.candidates {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.candidate {
  flex: 0 0 118px;
  border: var(--rule);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
}

.candidate img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  background: #12161a;
}

.candidate span {
  display: block;
  padding: 8px 9px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--paper-dim);
}

.candidate b {
  color: var(--commerce-warm);
  font-weight: 500;
}

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

.progress-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  border-bottom: var(--rule);
  padding-bottom: 8px;
  color: var(--paper-dim);
}

.progress-list em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--perceive);
}

@media (max-width: 900px) {
  .play {
    grid-template-columns: 1fr;
  }
  .item-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }
  .item-card img.cut {
    width: 88px;
    height: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
