/* SMS Webhook — editorial spec sheet.
   Two type families (serif display, sans text) plus mono for data.
   Grays: ink, muted, rule. One accent: the app blue. */
:root {
  --paper: #fbfaf7;
  --ink: #141414;
  --muted: #6b6a66;
  --rule: #e4e1da;
  --accent: #2b5bd8;
  --ok: #0f8a5f;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111110;
    --ink: #eeece6;
    --muted: #9a978f;
    --rule: #2a2926;
    --accent: #8aa6ff;
    --ok: #4fd1a1;
  }
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
::selection { background: var(--accent); color: var(--paper); }

.page { width: min(1080px, 100% - 48px); margin-inline: auto; }
@media (max-width: 560px) { .page { width: calc(100% - 32px); } }

/* Masthead */
.mast { display: flex; align-items: center; gap: 12px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.mast .name { display: flex; align-items: center; gap: 10px; font-weight: 500; text-decoration: none; }
.mast .name img { width: 26px; height: 26px; border-radius: 7px; }
.mast nav { margin-left: auto; display: flex; gap: 28px; font-size: 15px; }
.mast nav a { text-decoration: none; color: var(--muted); transition: color 150ms ease; }
.mast nav a:hover { color: var(--ink); }
.mast nav { align-items: center; }
.mast nav a.buy img { width: 120px; margin: -6px -8px -6px 0; }
@media (max-width: 640px) { .mast nav a:not(.buy) { display: none; } }

/* Type */
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.display em { font-style: italic; }
h2.display { font-size: clamp(38px, 5.4vw, 64px); }
.label {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.lede { font-size: 20px; line-height: 1.5; color: var(--muted); max-width: 38ch; }
.muted { color: var(--muted); }

/* Hero */
.hero { padding: 96px 0 72px; }
.hero .display { max-width: 15ch; }
.hero .lede { margin-top: 28px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; margin-top: 36px; }
.badge { display: inline-block; transition: transform 160ms var(--ease-out); }
.badge:active { transform: scale(0.97); }
/* The official badge PNG has about 6% transparent padding; pull it back to the text edge. */
.badge img { width: 200px; margin: -8px 0 -8px -13px; }
.actions .note { font-size: 15px; color: var(--muted); }

/* Works with */
.works { padding: 8px 0 56px; display: grid; gap: 18px; }
.works-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 16px; }
@media (max-width: 640px) { .works-row { grid-template-columns: 1fr; gap: 10px; } }
.logos { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.logos li { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); }
.logos i {
  width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
}
.logos .more { color: var(--muted); }

/* Specimen: SMS in, request out */
.specimen {
  display: grid;
  grid-template-columns: 0.8fr auto 1.2fr;
  align-items: center;
  gap: 32px;
  padding: 56px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 860px) { .specimen { grid-template-columns: 1fr; gap: 20px; } .specimen .arrow { transform: rotate(90deg); justify-self: start; } }
.specimen figure { margin: 0; min-width: 0; }
@media (max-width: 560px) { .request { font-size: 12px; } }
.specimen figcaption { margin-bottom: 14px; }
.bubble {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border-radius: 22px 22px 22px 6px;
  padding: 16px 18px;
  max-width: 340px;
}
.bubble .from { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.bubble p { margin-top: 4px; }
.arrow { font-family: var(--mono); color: var(--muted); font-size: 20px; }
.request {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.request .m { color: var(--accent); }
.request .h { color: var(--muted); }
.request .ok { color: var(--ok); }

/* Numbered sections */
.chapter { display: grid; grid-template-columns: 200px 1fr; gap: 40px; padding: 88px 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 860px) { .chapter { grid-template-columns: 1fr; gap: 16px; padding: 64px 0; } }
.chapter > .label { padding-top: 14px; }
.chapter .intro { margin-top: 20px; max-width: 52ch; }

.spec { margin-top: 48px; border-top: 1px solid var(--rule); }
.spec > div { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 640px) { .spec > div { grid-template-columns: 1fr; gap: 4px; } }
.spec dt { font-weight: 500; }
.spec dd { color: var(--muted); }
.spec code, .rule code, .chat code { font-family: var(--mono); font-size: 0.86em; color: var(--ink); }

/* Rule sentence */
.rule {
  margin-top: 40px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.3;
}
.rule .tok { font-family: var(--mono); font-size: 0.62em; padding: 3px 10px; border: 1px solid var(--rule); border-radius: 8px; vertical-align: 0.18em; white-space: nowrap; }
/* Target token in the brand color of the service. JS rotates --bg, icon and name. */
.rule .tok.target {
  display: inline-flex; align-items: center; gap: 0.35em;
  background: var(--bg); border-color: var(--bg); color: #fff;
  font-family: var(--sans); font-weight: 500;
  transition: opacity 180ms ease, filter 180ms ease, background-color 240ms ease, border-color 240ms ease;
}
.rule .tok.target b { font-weight: 500; }
.rule .tok.target.out { opacity: 0; filter: blur(4px); }
.rule .tok.target i {
  width: 1.05em; height: 1.05em; flex: none; background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
}

/* Chat transcript for MCP */
.chat { margin-top: 48px; display: grid; gap: 14px; max-width: 620px; }
.chat .you, .chat .ai { padding: 14px 18px; border-radius: 18px; }
.chat .you { justify-self: end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 6px; }
.chat .tool { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-left: 18px; border-left: 2px solid var(--rule); }
.chat .ai { background: color-mix(in srgb, var(--ink) 6%, transparent); border-bottom-left-radius: 6px; }
.chat .you { transform-origin: bottom right; }
.chat .ai { transform-origin: bottom left; justify-self: start; }

/* Chat animation. Only active when JS adds .armed, so the text shows without JS. */
.chat.armed > * {
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
}
.chat.armed > .in { opacity: 1; transform: none; }
.chat .tool-text { white-space: pre-wrap; }
.chat .tool.typing .tool-text::after {
  content: ""; display: inline-block; width: 0.55em; height: 1.1em; margin-left: 2px;
  vertical-align: -0.2em; background: currentColor; opacity: 0.6;
}
.chat .dots { display: none; gap: 4px; align-items: center; height: 1.6em; }
.chat .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot 1s ease-in-out infinite; }
.chat .dots i:nth-child(2) { animation-delay: 120ms; }
.chat .dots i:nth-child(3) { animation-delay: 240ms; }
@keyframes dot { 0%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.chat.armed .ai .answer { display: none; }
.chat.armed .ai.thinking .dots { display: inline-flex; }
.chat.armed .ai.answered .answer { display: inline; }
.chat.armed .answer .w { opacity: 0; filter: blur(3px); transition: opacity 240ms var(--ease-out), filter 240ms var(--ease-out); }
.chat.armed .ai.answered .answer .w { opacity: 1; filter: none; }

.callout { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); max-width: 60ch; }
.callout strong { font-weight: 500; }

/* Screens */
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 48px; }
@media (max-width: 860px) { .shots { grid-template-columns: 1fr 1fr; } }
.shots figure { margin: 0; }
.shots img { border-radius: 22px; outline: 1px solid var(--rule); outline-offset: -1px; }
.shots figcaption { margin-top: 10px; }

/* Buy */
.buy-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 32px; padding: 96px 0; border-bottom: 1px solid var(--rule); }
.buy-row .display { max-width: 12ch; }
.buy-row .side { max-width: 320px; }
.buy-row .side p { color: var(--muted); margin-bottom: 20px; }

/* Footer */
.foot { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 32px 0 56px; font-size: 14px; color: var(--muted); }
.foot nav { display: flex; gap: 24px; margin-left: auto; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* Document pages */
.doc { padding: 80px 0 96px; max-width: 680px; }
.doc .display { font-size: clamp(44px, 6vw, 72px); margin: 12px 0 8px; }
.doc h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 48px 0 12px; }
.doc p, .doc li { color: var(--muted); }
.doc ul { padding-left: 20px; display: grid; gap: 8px; }
.doc strong { color: var(--ink); font-weight: 500; }
.doc a { color: var(--accent); }

/* One load-in for the request, nothing on scroll */
.request .ln { display: block; min-height: 1.75em; opacity: 0; animation: ln 360ms var(--ease-out) forwards; }
@keyframes ln { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .request .ln { animation: none; opacity: 1; } }

/* ---------- Content pages ---------- */
.doc.wide { max-width: 760px; }
.doc .lede { margin: 20px 0 8px; max-width: 46ch; }
.doc h2 { scroll-margin-top: 24px; }
.doc p + p { margin-top: 12px; }
.doc code { font-family: var(--mono); font-size: 0.88em; color: var(--ink); }
.doc .label a { text-decoration: none; color: inherit; }
.doc .label a:hover { color: var(--ink); }

.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.steps li { counter-increment: s; position: relative; padding: 14px 0 14px 40px; border-bottom: 1px solid var(--rule); color: var(--muted); }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 17px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.steps strong { color: var(--ink); font-weight: 500; }

.code {
  margin: 16px 0; padding: 18px 20px; border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 4px 12px; border-radius: 999px;
  background: var(--bg, var(--ink)); color: #fff; font-weight: 500; font-size: 15px;
}
.chip.plain { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.mark {
  width: 1.05em; height: 1.05em; flex: none; background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
}
.pill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 20px; font-size: 15px; }
.pill-row strong { color: var(--ink); font-weight: 500; }

.int-grid { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 40px; border-top: 1px solid var(--rule); }
@media (max-width: 560px) { .int-grid { grid-template-columns: 1fr; } }
.int-card {
  display: grid; gap: 10px; justify-items: start; padding: 22px 0; text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.int-grid .int-card:nth-child(odd) { padding-right: 20px; }
.int-card .muted { font-size: 15px; transition: color 150ms ease; }
.int-card:hover .muted { color: var(--ink); }
.int-card .chip { transition: transform 160ms var(--ease-out); }
.int-card:active .chip { transform: scale(0.97); }

.related { padding-left: 20px; }
.cta-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--rule);
}
.cta-band p { color: var(--ink); }

.qa { border-bottom: 1px solid var(--rule); }
.doc .qa:first-of-type { margin-top: 32px; border-top: 1px solid var(--rule); }
.qa summary {
  list-style: none; cursor: pointer; padding: 18px 32px 18px 0; position: relative;
  font-family: var(--serif); font-size: 24px; line-height: 1.3; color: var(--ink);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+"; position: absolute; right: 4px; top: 16px; font-family: var(--mono); font-size: 18px; color: var(--muted);
  transition: transform 200ms var(--ease-out);
}
.qa[open] summary::after { transform: rotate(45deg); }
.qa p { padding-bottom: 20px; }

/* Footer with link columns */
.foot { display: block; }
.foot-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 8px 0 32px; }
@media (max-width: 720px) { .foot-links { grid-template-columns: 1fr 1fr; } }
.foot-links ul { list-style: none; padding: 0; margin-top: 10px; display: grid; gap: 6px; }
.foot-links a { font-size: 15px; }
.foot-note { font-size: 13px; color: var(--muted); padding-top: 20px; border-top: 1px solid var(--rule); }

/* Home logo strip items are links */
.logos a { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; transition: color 150ms ease; }
@media (hover: hover) { .logos a:hover { color: var(--muted); } }
