/* ===========================================================
   CAICHE — high-contrast B/W landing
   Inter for body, Instrument Serif italic for the "stick out"
   =========================================================== */

:root {
  --ink: #0a0a0a;
  --ink-2: #1c1c1c;
  --ink-3: #3a3a3a;
  --ink-4: #6a6a6a;
  --ink-5: #9a9a9a;
  --rule: #e2e2e0;
  --rule-2: #cfcfcc;
  --paper: #f5f3ee;
  --paper-2: #ecebe5;
  --bg: #ffffff;

  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 64px);

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans:  "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.005em;
  /* Instrument Serif italic has a smaller x-height than Inter at the same
     font-size, so lowercase italic words visually appear smaller next to the
     sans. Bump 1.10× globally to optically match for body-text italics
     (paragraphs, FAQ, lede, etc.). Display headlines override below. */
  font-size: 1.10em;
}

code { font-family: var(--mono); font-size: 0.9em; }

/* ===== TOPBAR ===== */
/* Soft-launch notice strip above the topbar. */
.preview-banner {
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.03em;
  text-align: center; padding: 6px 16px; line-height: 1.4;
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 14px var(--gutter);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 600; font-size: 17px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; display: block; }
.brand-word { font-weight: 600; }
.topnav {
  display: flex; gap: 28px;
  justify-content: center;
  font-size: 14px; color: var(--ink-3);
}
.topcta { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.link { color: var(--ink-3); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  transition: transform .15s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--paper); }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* ===== SHARED ===== */
section { padding: clamp(64px, 8vw, 120px) var(--gutter); }
.section-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin: 0 0 28px;
  font-weight: 500;
}
.section-eyebrow span { color: var(--ink); font-weight: 600; }

.display {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(48px, 7.5vw, 116px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  margin: 0;
  text-transform: uppercase;
}
.display em {
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  /* For display headlines we use uppercase italics — cap-height is closer
     between the two fonts, so a smaller bump keeps caps from over-shooting. */
  font-size: 1.04em;
}
.display-sm {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 56px;
  max-width: 22ch;
}
.display-sm em { font-weight: 400; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.01em; }
.micro {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* ===== HERO ===== */
.hero { padding-top: 64px; padding-bottom: 24px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  margin-bottom: 36px;
  color: var(--ink-3);
}
.hero-tag .dot {
  width: 7px; height: 7px; background: var(--ink); border-radius: 50%;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.hero h1.display { max-width: 16ch; }
.lede {
  margin: 36px 0 36px;
  max-width: 60ch;
  font-size: clamp(17px, 1.4vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
}
.lede em { color: var(--ink); }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-fineprint {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}

/* ===== FLOW (hero diagram: producer ⇄ cache ⇄ buyer) =====
   One looped exchange that shows the whole thesis: a buyer's query hits the
   cache, a sourced answer snaps back in <1s, and 90% routes to the producer
   on every resale. Pure CSS; reduced-motion parks it as a static still. */
.flow {
  margin-top: 72px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--paper);
  padding: 44px 24px 26px;
  position: relative;
  overflow: hidden;
}
.flow-rail {
  display: flex;
  align-items: flex-start;
  max-width: 760px;
  margin: 0 auto;
}

.flow-node {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex: 0 0 auto;
  width: 116px;
  text-align: center;
}
/* Side chips sit in a 104px band so their centers land on the same axis as the
   (taller) cache disc — the wire then connects icon-to-icon, not through text. */
.flow-node:not(.cache) .node-chip { margin: 26px 0; }
.node-chip {
  width: 52px; height: 52px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  display: grid; place-items: center;
}
.node-chip svg { width: 24px; height: 24px; }
.node-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--ink); }
.node-sub { font-family: var(--mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.02em; }

/* cache — the focal node */
.flow-node.cache { width: 132px; }
.cache-disc {
  width: 104px; height: 104px;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  position: relative;
  animation: cachePulse 5s ease-in-out infinite;
}
.cache-disc::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%; border: 1.5px solid var(--ink);
  opacity: 0; animation: cacheSonar 5s ease-out infinite;
}
.cache-label { font-family: var(--sans); font-weight: 700; letter-spacing: 0.08em; font-size: 15px; }
.cache-sub { font-family: var(--mono); font-size: 9px; color: var(--ink-5); letter-spacing: 0.04em; }

/* wires carry the moving tokens — pinned to the 52px icon-center axis */
.flow-wire {
  position: relative;
  align-self: flex-start;
  margin-top: 51px;
  flex: 1 1 auto;
  height: 2px;
  min-width: 56px;
}
.flow-wire::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, var(--rule-2) 0 6px, transparent 6px 12px);
}

.token {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-family: var(--mono); font-size: 10px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  opacity: 0;
}
.token.answer, .token.payout {
  background: #fff; color: var(--ink); border: 1px solid var(--ink);
}
.token.query  { animation: qmove 5s ease-in-out infinite; }
.token.answer { animation: amove 5s ease-in-out infinite; }
.token.payout { animation: pmove 5s ease-in-out infinite; }

/* right wire: query buyer→cache (right→left), then answer cache→buyer (left→right) */
@keyframes qmove {
  0%   { left: 100%; opacity: 0; }
  5%   { opacity: 1; }
  26%  { left: 0%;   opacity: 1; }
  31%  { left: 0%;   opacity: 0; }
  100% { left: 0%;   opacity: 0; }
}
@keyframes amove {
  0%, 33% { left: 0%;   opacity: 0; }
  38%     { opacity: 1; }
  60%     { left: 100%; opacity: 1; }
  66%     { left: 100%; opacity: 0; }
  100%    { left: 100%; opacity: 0; }
}
/* left wire: 90% payout cache→producer (right→left), in sync with the answer */
@keyframes pmove {
  0%, 33% { left: 100%; opacity: 0; }
  38%     { opacity: 1; }
  60%     { left: 0%;   opacity: 1; }
  66%     { left: 0%;   opacity: 0; }
  100%    { left: 0%;   opacity: 0; }
}
/* cache reacts when the query lands */
@keyframes cachePulse {
  0%, 24% { transform: scale(1); }
  30%     { transform: scale(1.07); }
  38%     { transform: scale(1); }
  100%    { transform: scale(1); }
}
@keyframes cacheSonar {
  0%, 26% { transform: scale(1);    opacity: 0; }
  30%     { opacity: 0.5; }
  56%     { transform: scale(1.55); opacity: 0; }
  100%    { transform: scale(1.55); opacity: 0; }
}
/* producer "earns" ticks when the payout arrives */
.flow-node.producer .node-sub { animation: earnTick 5s ease-in-out infinite; }
@keyframes earnTick {
  0%, 56% { opacity: 0.55; transform: scale(1); }
  62%     { opacity: 1;    transform: scale(1.12); color: var(--ink); }
  70%     { transform: scale(1); }
  100%    { opacity: 0.55; }
}

.flow-caption {
  margin: 30px auto 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
  max-width: 54ch;
}

/* reduced motion: park as a clean static diagram */
@media (prefers-reduced-motion: reduce) {
  .token, .cache-disc, .cache-disc::after, .flow-node.producer .node-sub { animation: none; }
  .token.query  { left: 50%; opacity: 1; }
  .token.payout { left: 50%; opacity: 1; }
  .token.answer { display: none; }
  .flow-node.producer .node-sub { opacity: 1; }
}

/* ===== PATHS ===== */
.paths-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.path {
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 32px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 20px;
}
.path:nth-child(2) { background: var(--paper); }
.path-h { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); }
.path-h .num { color: var(--ink); font-weight: 600; }
.dot-sep { color: var(--ink-5); }
.path h4 {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(24px, 2.4vw, 36px); line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
}
.path h4 em { font-weight: 400; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li {
  /* Use position-relative + padding-left so post-bullet content flows as one
     continuous text block (text + <code> + text wraps naturally on word
     boundaries). flex would split text-runs around inline elements into
     separate flex items, breaking the sentence into stacked rows. */
  position: relative;
  padding: 12px 0 12px 38px;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.5;
  border-top: 1px solid var(--rule);
}
.steps li:first-child { border-top: 0; padding-top: 4px; }
.steps li > span:first-child {
  position: absolute;
  left: 0;
  top: 14px;
  font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--ink); border-radius: 50%;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 500;
}
.steps li:first-child > span:first-child { top: 6px; }
.steps li code, .steps li b {
  font-weight: 600; color: var(--ink);
}
.path .btn { align-self: flex-start; margin-top: 8px; }

/* ===== HOW (4 step) ===== */
.how-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.how-grid li {
  padding: 28px 24px;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 14px;
}
.how-grid li:last-child { border-right: 0; }
.how-grid header {
  display: flex; justify-content: space-between; align-items: baseline;
}
.how-grid .num {
  font-family: var(--serif); font-style: italic;
  font-size: 44px; line-height: 1; letter-spacing: -0.02em;
}
.how-grid h5 {
  font-family: var(--sans); font-weight: 500;
  font-size: 19px; line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
}
.how-grid p {
  font-size: 14px; color: var(--ink-3); line-height: 1.55;
  margin: 0;
}
.how-grid code { color: var(--ink); }

/* ===== TERMINAL ===== */
.terminal {
  border-radius: 12px;
  background: var(--ink);
  color: #f5f3ee;
  overflow: hidden;
  border: 1px solid var(--ink);
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.4);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #181818;
  border-bottom: 1px solid #262626;
  font-family: var(--mono); font-size: 11px;
  color: #a0a09a;
}
.t-dot { width: 11px; height: 11px; border-radius: 50%; background: #444; }
.t-title { margin-left: 12px; flex: 1; }
.t-time { color: #777; }
.terminal-body {
  margin: 0; padding: 22px 26px;
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  color: #e8e5dd;
}
.terminal-body .cmt { color: #6a6a6a; font-style: italic; }
.terminal-body .kw  { color: #fff; font-weight: 600; }
.terminal-body .str { color: #c2b280; }
.terminal-body .key { color: #9bb8c7; }
.terminal-body .num { color: #d4a07a; }
.terminal-body .flag { color: #888; }

/* ===== PRICING ===== */
.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.tier {
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 28px 26px;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--bg);
}
.tier.featured {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.tier.featured .tier-words,
.tier.featured .tier-price span,
.tier.featured p { color: #c2c2bd; }
.tier.featured ul li::before { background: #fff; }
.tier header { display: flex; justify-content: space-between; align-items: baseline; }
.tier-name { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; font-weight: 600; }
.tier-words { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.tier-price { display: flex; align-items: baseline; gap: 8px; }
.tier-price b {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(36px, 4vw, 56px); letter-spacing: -0.03em; line-height: 1;
}
.tier-price span { font-family: var(--mono); font-size: 13px; color: var(--ink-4); }
.tier p { font-size: 14px; color: var(--ink-3); margin: 0; }
.tier ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tier ul li {
  font-size: 13px; color: var(--ink-2);
  padding-left: 18px; position: relative;
}
.tier ul li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 8px; height: 1px; background: var(--ink);
}
.tier.featured ul li { color: #e8e5dd; }
.pricing-note {
  margin-top: 28px;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}
.pricing-note span { color: var(--ink); font-weight: 600; }

/* ===== AGENTS / MCP ===== */
.agents-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  margin-bottom: 48px;
}
.install-card {
  background: var(--ink); color: #fff;
  border-radius: 14px;
  padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.install-card:nth-child(2) {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
}
.install-label { font-size: 11px; letter-spacing: 0.1em; color: var(--ink-5); }
.install-card:nth-child(2) .install-label { color: var(--ink-4); }
.install-line {
  margin: 0;
  font-family: var(--mono); font-size: 14px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.install-line .prompt { color: #888; margin-right: 10px; }
.install-meta { font-size: 11px; color: var(--ink-5); }
.install-card:nth-child(2) .install-meta { color: var(--ink-4); }

.tools { border-top: 1px solid var(--ink); padding-top: 28px; }
.tools-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-3); margin-bottom: 16px; font-weight: 600; }
.tools ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.tools li {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  align-items: baseline;
}
.tools li code {
  font-size: 13px; font-weight: 500; color: var(--ink);
}
.tools li span { color: var(--ink-3); font-size: 13px; }

/* ===== SELL / CAICHE ME ===== */
.sell-lede {
  font-size: 18px; line-height: 1.55;
  max-width: 70ch; color: var(--ink-2);
  margin: 0 0 48px;
}
.sell-flow {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr 24px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}
.step {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px 18px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 8px;
}
.step-n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-4); }
.step h6 { font-family: var(--sans); font-weight: 500; font-size: 17px; letter-spacing: -0.015em; margin: 0; }
.step .speech {
  font-size: 11.5px; color: var(--ink-3);
  background: var(--paper); padding: 8px 10px;
  border-radius: 6px; word-break: break-word;
}
.step-arrow {
  text-align: center; color: var(--ink-4); font-family: var(--mono); font-size: 18px;
}

.earnings {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
  border-top: 1px solid var(--ink);
  padding-top: 36px;
}
.earnings-h h6 {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(22px, 2vw, 30px); letter-spacing: -0.02em;
  line-height: 1.1; margin: 8px 0 0;
}
.earnings-rows { display: flex; flex-direction: column; }
.earnings-rows .row {
  display: grid; grid-template-columns: 1fr auto;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  font-size: 13px;
}
.earnings-rows .row:first-child { border-top: 0; }
.earnings-rows .row span { color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.earnings-rows .row b { font-family: var(--sans); font-weight: 500; font-size: 16px; letter-spacing: -0.01em; }
.earnings-rows .row.hi b { font-size: 22px; }
.earnings-rows .row.hi { padding: 22px 0; }

/* ===== TRUST ===== */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}
.trust-card {
  padding: 28px 26px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  display: flex; flex-direction: column; gap: 12px;
  min-height: 220px;
}
.trust-num {
  font-family: var(--serif); font-style: italic;
  font-size: 36px; line-height: 1; letter-spacing: -0.02em;
  color: var(--ink-3);
}
.trust-card h6 {
  font-family: var(--sans); font-weight: 500;
  font-size: 18px; letter-spacing: -0.015em; margin: 0;
}
.trust-card p { font-size: 14px; color: var(--ink-3); margin: 0; line-height: 1.55; }
.trust-card code { color: var(--ink); }

/* ===== FAQ ===== */
.faq-list { margin: 0; padding: 0; }
.qa {
  display: grid; grid-template-columns: 0.7fr 1.3fr;
  gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}
.qa:last-child { border-bottom: 1px solid var(--rule); }
.qa dt {
  font-family: var(--sans); font-weight: 500;
  font-size: 20px; letter-spacing: -0.015em; line-height: 1.2;
}
.qa dd {
  margin: 0;
  font-size: 15px; line-height: 1.6; color: var(--ink-2);
}

/* ===== CTA ===== */
.cta {
  background: var(--ink);
  color: #fff;
  text-align: left;
  padding: clamp(80px, 10vw, 160px) var(--gutter);
}
.cta .display { color: #fff; max-width: 14ch; }
.cta .display em { color: #fff; }
.cta-actions { display: flex; gap: 12px; margin-top: 48px; flex-wrap: wrap; }
.cta-actions .btn-dark { background: #fff; color: var(--ink); border-color: #fff; }
.cta-actions .btn-dark:hover { background: var(--paper); }
.cta-actions .btn-ghost { color: #fff; border-color: #fff; }
.cta-actions .btn-ghost:hover { background: #181818; }
.cta-fineprint {
  margin-top: 32px; color: #888; font-size: 12px;
}
.cta-fineprint code { color: #f5f3ee; }
.cta-fineprint a { color: #f5f3ee; text-decoration: underline; text-underline-offset: 3px; }

/* ===== FOOTER ===== */
.footer { padding: 64px var(--gutter) 32px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}
.foot-tag { font-size: 13px; color: var(--ink-3); margin-top: 12px; line-height: 1.5; }
.foot-col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.foot-col h6 {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); margin: 0 0 4px; font-weight: 600;
}
.foot-col a { color: var(--ink-2); }
.footer-rule { height: 1px; background: var(--rule); margin-bottom: 18px; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--ink-4); font-size: 11px;
}

/* ===== INNER PAGES (signup, account, sell, claim, browse, etc.) ===== */
.inner-page { padding: clamp(40px, 5vw, 72px) var(--gutter); max-width: 980px; margin: 0 auto; }
.inner-page-narrow { max-width: 640px; }
.inner-page-wide { max-width: var(--maxw); }
.page-eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin: 0 0 8px; }
.page-eyebrow span { color: var(--ink); font-weight: 600; }
.page-title { font-family: var(--sans); font-weight: 600; font-size: clamp(32px, 4vw, 48px); line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 12px; }
.page-title em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.page-lede { font-size: 17px; line-height: 1.55; color: var(--ink-2); margin: 0 0 36px; max-width: 60ch; }
.page-lede em { font-family: var(--serif); font-style: italic; color: var(--ink); }

.section-h { font-family: var(--sans); font-weight: 500; font-size: 22px; letter-spacing: -0.02em; margin: 32px 0 14px; }
.section-h-mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 28px 0 12px; font-weight: 600; }

a.inline-link { text-decoration: underline; text-underline-offset: 3px; }
a.inline-link:hover { color: var(--ink-2); }

/* ===== FORMS ===== */
.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; font-weight: 500; }
.field-label .req { color: var(--ink); }
.field-input, .field-textarea, .field-select {
  display: block; width: 100%;
  padding: 10px 12px;
  font-size: 14px; font-family: var(--sans);
  background: var(--bg);
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  color: var(--ink);
  line-height: 1.4;
}
.field-input:focus, .field-textarea:focus, .field-select:focus {
  outline: 2px solid var(--ink); outline-offset: 1px;
  border-color: var(--ink);
}
.field-textarea { font-family: var(--mono); font-size: 13px; line-height: 1.55; min-height: 100px; resize: vertical; }
.field-input.mono { font-family: var(--mono); }
.field-help { font-size: 12px; color: var(--ink-4); margin-top: 6px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rule); }
.form-fineprint { font-size: 12px; color: var(--ink-4); flex: 1; min-width: 200px; }

/* ===== ALERTS ===== */
.alert { padding: 14px 16px; border-radius: 6px; font-size: 13.5px; line-height: 1.55; margin-bottom: 16px; }
.alert-info { background: var(--paper); border: 1px solid var(--rule-2); color: var(--ink-2); }
.alert-warn { background: #fdfaf2; border: 1px solid #e8d8a8; color: #5a4810; }
.alert-error { background: #fdf3f3; border: 1px solid #e2c2c2; color: #6a2020; }
.alert-success { background: #f3faf6; border: 1px solid #b8dcc8; color: #14593a; }
.alert-strong { font-weight: 600; }
.alert code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 3px; }

/* ===== STAT GRID + DATA TABLES ===== */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.stat-grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat { border: 1px solid var(--rule); padding: 18px; border-radius: 12px; background: var(--bg); }
.stat-label { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); }
.stat-value { font-family: var(--sans); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.1; }
.stat-foot { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 0 16px; }
.data-table thead th {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--ink); color: var(--ink-3); font-weight: 600;
}
.data-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; font-family: var(--mono); }
.data-table .neg { color: var(--ink-4); }

/* ===== INFO CARD ===== */
.info-card {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px 22px;
  background: var(--bg);
  margin-bottom: 18px;
}
.info-card.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.info-card.dark code { background: rgba(255,255,255,0.1); }
.info-card.paper { background: var(--paper); }
.info-card.featured { border: 2px solid var(--ink); padding: 22px 24px; }
.info-card-h { font-family: var(--sans); font-weight: 600; font-size: 18px; letter-spacing: -0.015em; margin: 0 0 8px; }
.info-card p { margin: 0 0 8px; line-height: 1.55; }
.info-card p:last-child { margin-bottom: 0; }

/* ===== CODE BLOCKS ===== */
.code-block {
  background: var(--ink); color: #f5f3ee;
  border-radius: 8px; padding: 14px 16px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  overflow-x: auto;
  word-break: break-word; white-space: pre-wrap;
  margin: 0 0 12px;
}
.code-block .comment { color: #6a6a6a; font-style: italic; }
.code-inline { font-family: var(--mono); background: var(--paper); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; word-break: break-word; }

/* Copy-to-clipboard button overlaid on a code-block. JS handler in /static/copy.js. */
.copy-wrap { position: relative; }
.copy-wrap .code-block { padding-right: 76px; }
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--ink-4);
  border-radius: 4px; padding: 4px 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.copy-btn:hover:not(:disabled) { background: #fff; }
.copy-btn:disabled { opacity: 0.7; cursor: default; }

/* ===== PROSE (rendered markdown) ===== */
.prose { font-size: 15px; line-height: 1.6; color: var(--ink); }
.prose h1 { font-family: var(--sans); font-weight: 600; font-size: 28px; letter-spacing: -0.02em; margin: 32px 0 14px; line-height: 1.15; }
.prose h2 { font-family: var(--sans); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; margin: 28px 0 12px; line-height: 1.2; }
.prose h3 { font-family: var(--sans); font-weight: 500; font-size: 18px; letter-spacing: -0.015em; margin: 22px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px 22px; padding: 0; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: var(--mono); background: var(--paper); padding: 1px 6px; border-radius: 4px; font-size: 0.92em; }
.prose pre { background: var(--ink); color: #f5f3ee; padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.65; margin: 0 0 14px; }
.prose pre code { background: transparent; color: inherit; padding: 0; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { border-left: 3px solid var(--ink); padding: 4px 0 4px 16px; margin: 0 0 14px; color: var(--ink-3); font-style: italic; }
.prose table { border-collapse: collapse; margin: 0 0 14px; width: 100%; font-size: 13.5px; }
.prose table th, .prose table td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; }
.prose table th { font-weight: 600; background: var(--paper); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 24px 0; }

/* ===== UNIT LIST ROWS (browse) ===== */
.unit-list { display: flex; flex-direction: column; gap: 12px; }
.unit-row {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--bg);
  transition: border-color .15s ease, transform .15s ease;
}
.unit-row:hover { text-decoration: none; border-color: var(--ink); transform: translateY(-1px); }
.unit-row-h { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 6px; }
.unit-row-title { font-family: var(--sans); font-weight: 600; font-size: 16.5px; letter-spacing: -0.015em; line-height: 1.3; }
.unit-row-price { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.unit-row-summary { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; margin-bottom: 8px; }
.unit-row-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.unit-row-meta .tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: var(--paper); color: var(--ink-3); }
.unit-row-meta .tag.theme { background: var(--ink); color: #fff; }

/* Pre-paywall excerpt on /units/<slug>. Visually distinct from full content via
   the small eyebrow label + a soft bottom fade hinting "more behind the paywall". */
.preview-excerpt { position: relative; margin-bottom: 24px; }
.preview-excerpt-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--ink-4); margin: 0 0 8px;
}
.preview-excerpt .prose { position: relative; }
.preview-excerpt .prose::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 64px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--paper));
}

/* Producer-dashboard unit row: clickable preview + a small actions strip on the right. */
.producer-unit-row { display: flex; gap: 12px; align-items: stretch; }
.producer-unit-row .producer-unit-link { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.producer-unit-row .producer-unit-link:hover { text-decoration: none; }
.producer-unit-row .producer-unit-actions { display: flex; flex-direction: column; gap: 6px; align-self: center; }
.producer-unit-row .inline-form { margin: 0; }
.producer-unit-retired { opacity: 0.7; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

.search-bar { display: flex; gap: 8px; margin-bottom: 24px; }
.search-bar .field-input { flex: 1; }
.search-bar .field-select { width: auto; min-width: 160px; }

/* session bar (logout etc) */
.session-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 12.5px; color: var(--ink-4); margin-bottom: 24px; }
.session-bar form { display: inline; }
.session-bar button { background: none; border: 0; padding: 0; color: var(--ink-4); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* steps numbered (used in /sell instructions etc) */
.numbered-steps { list-style: none; padding: 0; margin: 0 0 16px; counter-reset: step; }
.numbered-steps > li {
  display: grid; grid-template-columns: 28px 1fr; gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  font-size: 14.5px; line-height: 1.55;
  counter-increment: step;
}
.numbered-steps > li:first-child { border-top: 0; padding-top: 4px; }
.numbered-steps > li::before {
  content: counter(step);
  font-family: var(--mono); font-size: 11px;
  width: 24px; height: 24px;
  border: 1px solid var(--ink); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 500;
}
.numbered-steps strong { font-weight: 600; }

@media (max-width: 700px) {
  .stat-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .data-table { font-size: 12px; }
  .data-table thead th, .data-table tbody td { padding: 8px 6px; }
}

/* ===== DENSITY (tweak) ===== */
body[data-density="tight"] section { padding-top: clamp(48px, 5vw, 80px); padding-bottom: clamp(48px, 5vw, 80px); }
body[data-density="tight"] .display-sm { margin-bottom: 36px; }

/* ===== TYPE VARIANT ===== */
body[data-type="serif"] em { font-family: var(--serif); }
body[data-type="mono"] em { font-family: var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85em; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .topnav { display: none; }
  .paths-grid { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: 1fr; }
  .sell-flow { grid-template-columns: 1fr; }
  .step-arrow { transform: rotate(90deg); padding: 6px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .qa { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 600px) {
  .topcta .link { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  /* flow rail shrinks to fit narrow screens (stays horizontal) */
  .flow { padding: 32px 14px 22px; }
  .flow-node { width: 80px; }
  .flow-node.cache { width: 92px; }
  .cache-disc { width: 82px; height: 82px; }
  .node-chip { width: 44px; height: 44px; }
  .node-chip svg { width: 20px; height: 20px; }
  .flow-node:not(.cache) .node-chip { margin: 19px 0; }   /* center 44px chip on the 82px disc axis */
  .flow-wire { min-width: 24px; margin-top: 40px; }
  .token { font-size: 9px; padding: 2px 6px; }
  .node-label { font-size: 9.5px; letter-spacing: 0.06em; }
  .node-sub, .cache-sub { font-size: 9px; }
  .cache-label { font-size: 13px; }
}

/* === Inline-style replacement utilities ====================================
 *
 * Minimal utility set so templates can compose layout/spacing/color without
 * `style="..."` attrs — that lets us drop `'unsafe-inline'` from the
 * style-src CSP directive. Add new utilities here rather than re-introducing
 * inline styles.
 */

/* margins */
.mt-6  { margin-top: 6px;  }
.mt-8  { margin-top: 8px;  }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-36 { margin-top: 36px; }
.mt-48 { margin-top: 48px; }
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: 4px;  }
.mb-8  { margin-bottom: 8px;  }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mxa   { margin-left: auto; margin-right: auto; }
/* `0 0 Npx` shorthand bottom-only helpers for inline contexts */
.m-bot-8   { margin: 0 0 8px;  }
.m-bot-12  { margin: 0 0 12px; }
.m-bot-16  { margin: 0 0 16px; }

/* font sizes */
.fs-12   { font-size: 12px; }
.fs-12-5 { font-size: 12.5px; }
.fs-13   { font-size: 13px; }
.fs-13-5 { font-size: 13.5px; }
.fs-14   { font-size: 14px; }
.fs-14-5 { font-size: 14.5px; }
.fs-15-5 { font-size: 15.5px; }

/* ink colors (text) */
.ink   { color: var(--ink); }
.ink-2 { color: var(--ink-2); }
.ink-3 { color: var(--ink-3); }
.ink-4 { color: var(--ink-4); }

/* layout helpers */
.flex-row-8 { display: flex; gap: 8px; }
.flex-1     { flex: 1; }
.tac        { text-align: center; }

/* width clamps */
.maxw-48 { max-width: 48ch; }
.maxw-50 { max-width: 50ch; }
.maxw-60 { max-width: 60ch; }

/* lists */
.list-bare  { list-style: none; padding-left: 0; }
.break-all  { word-break: break-all; }

/* dividers */
.divider-top-soft   { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--rule); }
.divider-top-strong { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule); }

/* compositions used > 1 place */
.italic-quote-lg { font-family: var(--serif); font-style: italic; font-size: 15.5px; }
.italic-quote-md { font-family: var(--serif); font-style: italic; font-size: 14.5px; }
.bullet-list     { font-size: 14.5px; line-height: 1.6; padding-left: 22px; }
.uppercase-tight { text-transform: uppercase; letter-spacing: 0.06em; }

/* one-off blocks */
.paywall-card-frame { text-align: center; padding: 36px 24px; }
.token-meta-line {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
  margin: 0 0 24px;
}
.featured-card-strong {
  border-color: var(--ink);
  background: var(--paper);
}
.topup-amount-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* claim.html / unit.html: source URL lists */
.claim-source-list {
  font-size: 12.5px;
  line-height: 1.7;
  padding-left: 0;
  list-style: none;
  margin: 0 0 16px;
}
.unit-source-list {
  font-size: 13.5px;
  line-height: 1.7;
  padding-left: 0;
  list-style: none;
}

/* unit.html paywall card */
.paywall-blurb {
  font-size: 14px;
  color: var(--ink-2);
  max-width: 50ch;
  margin: 0 auto 16px;
}
.paywall-fee-line {
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 48ch;
  margin: 14px auto 0;
}
.paywall-stub-note {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 8px;
}

/* sell.html-specific blocks (one-off compositions) */
.sell-protocol-lead {
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 60ch;
  color: var(--ink-2);
}
.sell-confirm-hint {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--ink-3);
}

/* claim_lookup.html: token input formatting */
.token-input { text-transform: uppercase; letter-spacing: 0.04em; }

/* producer.html: withdraw row layout */
.withdraw-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.withdraw-row-info { flex: 1; min-width: 240px; }

/* disabled button (used on the Withdraw button when balance is below threshold) */
.btn[disabled],
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* misc text */
.text-danger { color: #6a2020; }

/* upload.html / producer_welcome.html: 32px-margin section divider */
.divider-top-32 {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

/* browse.html: AI-model tag (filterable; distinct from theme + topical tags) */
.unit-row-meta .tag.tag-model {
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
}

/* browse.html: country tag (visually distinct from theme + model + topical tags) */
.unit-row-meta .tag.tag-country {
  background: var(--paper);
  color: var(--ink);
  border: 1px dashed var(--ink);
}

/* browse.html: prev/next pager */
.browse-pager {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
