/* ==========================================================================
   API Espresso — shared design system
   Palette: cool paper + espresso-bean ink + copper accent (brass/copper,
   not terracotta — tied to the machine, not the cup). Type: Space Grotesk
   (display + body) paired with IBM Plex Mono (code, prices, technical
   labels). One signature element (the pressure gauge) lives in the homepage
   hero only — everything else stays deliberately quiet.
   ========================================================================== */

:root {
  --paper: #f5f4f1;
  --paper-raised: #ffffff;
  --ink: #1b1512;
  --ink-soft: #5c4f47;
  --line: #dedad3;
  --line-strong: #c9c3ba;

  /* Copper used as text (links, labels) needs to meet body-text contrast on
     --paper; the brighter value is reserved for hover states and for
     large-scale / graphical use (gauge, badges, borders) where the lower
     non-text contrast bar applies. Same two hex values discussed in the
     design plan — just assigned by contrast need rather than vibe. */
  --copper: #8a4a1f;
  --copper-bright: #b5652d;
  --copper-wash: #f2e6da;

  --crema-1: #d9a24b;
  --crema-2: #8a4a1f;
  --crema-3: #3c2415;

  --danger: #a13f2a;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 10px;
  --shadow-card: 0 1px 2px rgba(27, 21, 18, 0.04), 0 1px 1px rgba(27, 21, 18, 0.03);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14100d;
    --paper-raised: #1b1512;
    --ink: #f2ede6;
    --ink-soft: #b2a89f;
    --line: #332a24;
    --line-strong: #46392f;

    --copper: #e0a066;
    --copper-bright: #f0b87e;
    --copper-wash: #2b2019;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

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

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

/* Brass fittings in the side margins — a repeating pipe-coupling motif
   (seam line + collar + four bolt ticks), same instrument language as the
   gauge. CSS-only so it's automatically on every page without touching
   markup. Only shown where there's actual margin to put it in; SVG colors
   are hardcoded per color scheme since custom properties don't resolve
   inside a background-image data URI. */
@media (min-width: 1100px) {
  body {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='160' viewBox='0 0 28 160'%3E%3Cline x1='14' y1='0' x2='14' y2='160' stroke='%23B5652D' stroke-width='1' opacity='0.3'/%3E%3Ccircle cx='14' cy='80' r='7' fill='none' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3Ccircle cx='14' cy='80' r='3' fill='none' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='14' y1='69' x2='14' y2='73' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='14' y1='87' x2='14' y2='91' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='3' y1='80' x2='7' y2='80' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='21' y1='80' x2='25' y2='80' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='160' viewBox='0 0 28 160'%3E%3Cline x1='14' y1='0' x2='14' y2='160' stroke='%23B5652D' stroke-width='1' opacity='0.3'/%3E%3Ccircle cx='14' cy='80' r='7' fill='none' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3Ccircle cx='14' cy='80' r='3' fill='none' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='14' y1='69' x2='14' y2='73' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='14' y1='87' x2='14' y2='91' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='3' y1='80' x2='7' y2='80' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='21' y1='80' x2='25' y2='80' stroke='%23B5652D' stroke-width='1.5' opacity='0.45'/%3E%3C/svg%3E");
    background-repeat: repeat-y, repeat-y;
    background-position: left top, right top;
  }
}
@media (min-width: 1100px) and (prefers-color-scheme: dark) {
  body {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='160' viewBox='0 0 28 160'%3E%3Cline x1='14' y1='0' x2='14' y2='160' stroke='%23E0A066' stroke-width='1' opacity='0.3'/%3E%3Ccircle cx='14' cy='80' r='7' fill='none' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3Ccircle cx='14' cy='80' r='3' fill='none' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='14' y1='69' x2='14' y2='73' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='14' y1='87' x2='14' y2='91' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='3' y1='80' x2='7' y2='80' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='21' y1='80' x2='25' y2='80' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='160' viewBox='0 0 28 160'%3E%3Cline x1='14' y1='0' x2='14' y2='160' stroke='%23E0A066' stroke-width='1' opacity='0.3'/%3E%3Ccircle cx='14' cy='80' r='7' fill='none' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3Ccircle cx='14' cy='80' r='3' fill='none' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='14' y1='69' x2='14' y2='73' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='14' y1='87' x2='14' y2='91' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='3' y1='80' x2='7' y2='80' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3Cline x1='21' y1='80' x2='25' y2='80' stroke='%23E0A066' stroke-width='1.5' opacity='0.45'/%3E%3C/svg%3E");
    background-repeat: repeat-y, repeat-y;
    background-position: left top, right top;
  }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a {
  color: var(--copper);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 2px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
a:hover {
  color: var(--copper-bright);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--copper-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------- header */

header.site {
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark:hover { color: var(--ink); text-decoration: none; }
.wordmark .dot { color: var(--copper); }
.wordmark-text { display: inline-flex; align-items: baseline; gap: 2px; }
.wordmark-icon { color: var(--copper); flex-shrink: 0; }

.back-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}
/* Homepage has no "back" link, but the header still needs a second flex
   child here so the wordmark's start-edge alignment under
   justify-content:space-between is identical on every page — some browsers
   (older WebKit in particular) treat a lone flex-between child as centered
   rather than flex-start, which is where the position drift came from. */
.back-link[aria-hidden="true"] { visibility: hidden; }
.back-link:hover { color: var(--copper); }

/* ------------------------------------------------------------------ hero */

.hero {
  padding: 64px 0 56px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.12;
  margin-bottom: 16px;
}
.hero p.lede {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 46ch;
}

/* signature gauge */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.gauge-caption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.gauge-subcaption {
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--ink-soft);
  opacity: 0.75;
  margin-top: -4px;
}
.gauge-face { fill: var(--paper-raised); stroke: var(--line-strong); stroke-width: 2; }
.gauge-tick { stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.gauge-tick.major { stroke: var(--ink-soft); stroke-width: 2.5; }
.gauge-label { font-family: var(--font-mono); font-size: 9px; fill: var(--ink-soft); }
.gauge-hub { fill: var(--copper); }
.gauge-needle {
  stroke: var(--copper);
  stroke-width: 3;
  stroke-linecap: round;
  transform-box: view-box;
  transform-origin: 100px 100px;
  transform: rotate(128deg);
  animation: gauge-sweep 1100ms cubic-bezier(0.2, 0.8, 0.2, 1) 150ms both;
}
@keyframes gauge-sweep {
  from { transform: rotate(-135deg); }
  to { transform: rotate(128deg); }
}
@media (prefers-reduced-motion: reduce) {
  .gauge-needle { animation: none; transform: rotate(128deg); }
}

/* ------------------------------------------------------------- sections */

main section { padding: 48px 0; }
main section + section { border-top: 1px solid var(--line); }

h2.section-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin: 0 0 28px;
  font-weight: 600;
}

/* ------------------------------------------------------ product directory */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--ink);
}
a.product-card {
  border-top: 3px solid var(--copper);
}
a.product-card:hover {
  border-color: var(--copper-bright);
  border-top-color: var(--copper-bright);
}
.product-card.soon {
  border-top: 3px dashed var(--line-strong);
  border-style: dashed;
  opacity: 0.72;
}
.product-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--copper);
}
.product-card h3 {
  font-size: 17px;
  margin: 0;
}
.product-card p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
  flex-grow: 1;
}
.product-card .card-foot {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--copper);
  margin-top: 4px;
}
.badge-soon {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 8px;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-display);
}
.btn-primary {
  background: var(--copper);
  color: #fff;
}
.btn-primary:hover { background: var(--copper-bright); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover { border-color: var(--copper); color: var(--copper); }
.btn-disabled {
  background: var(--paper);
  color: var(--ink-soft);
  border-color: var(--line);
  cursor: not-allowed;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cta-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* ----------------------------------------------------------------- steps */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--paper-raised);
}
.step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--copper);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
}
.step h3 { font-size: 14.5px; margin: 0 0 6px; }
.step p { font-size: 13px; color: var(--ink-soft); margin: 0; }

/* ------------------------------------------------------------- code block */

pre.code-block {
  background: var(--ink);
  color: #ece5dd;
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
}
pre.code-block .comment { color: #8a7c72; }
pre.code-block .string { color: var(--crema-1); }

/* ------------------------------------------------------------ pricing table */

table.pricing {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
table.pricing th, table.pricing td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
table.pricing th {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
table.pricing tr.highlight td { background: var(--paper-raised); }
table.pricing td.tier-name { font-weight: 600; }
table.pricing td.price { font-family: var(--font-mono); }
table.pricing tfoot td {
  border-bottom: none;
  padding-top: 16px;
  color: var(--ink-soft);
  font-size: 13px;
  font-family: var(--font-mono);
}

/* -------------------------------------------------------------- legal prose */

.legal {
  max-width: 680px;
}
.legal .updated {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.legal h2 {
  font-size: 18px;
  margin-top: 2em;
}
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { color: var(--ink-soft); font-size: 15px; }
.legal strong { color: var(--ink); }
.legal ul { padding-left: 1.2em; }

/* ----------------------------------------------------------------- footer */

footer.site {
  border-top: 1px solid var(--line);
  padding: 32px 0 56px;
}
footer.site .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
}
.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
}
.footer-links a:hover { color: var(--copper); }
.footer-copy {
  font-size: 13px;
  color: var(--ink-soft);
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .gauge-wrap { order: -1; }
  .hero h1 { font-size: 30px; }
  .product-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
  header.site .wrap { padding: 16px 20px; }
  table.pricing { font-size: 13px; }
  table.pricing th, table.pricing td { padding: 10px 8px; }
}
