:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1d1f;
  --muted: #5d6066;
  --line: #e3e3df;
  --accent: #2f5bd3;
  --accent-soft: #e8eefc;
  --ok: #1e7a4f;
  --warn: #9a5b00;
  --radius: 14px;
  --maxw: 880px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121315;
    --surface: #1b1c1f;
    --text: #ececec;
    --muted: #a4a7ad;
    --line: #2c2e33;
    --accent: #8ea8ff;
    --accent-soft: #1f2740;
    --ok: #5cc493;
    --warn: #f0b45c;
  }
}
:root[data-theme="dark"] {
  --bg: #121315;
  --surface: #1b1c1f;
  --text: #ececec;
  --muted: #a4a7ad;
  --line: #2c2e33;
  --accent: #8ea8ff;
  --accent-soft: #1f2740;
  --ok: #5cc493;
  --warn: #f0b45c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Top bar */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px;
  padding: 4px 12px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* Hero */
.hero { padding: 56px 0 32px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 14px; letter-spacing: .02em; margin: 0 0 8px; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 18px; margin: 0 0 24px; max-width: 640px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600;
  background: var(--accent); color: #fff;
}
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }

/* Cards and metrics */
.section { padding: 24px 0 8px; }
.section h2 { font-size: 22px; margin: 0 0 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 6px; font-size: 20px; }
.card p { margin: 0 0 14px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.tags li { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.metric { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.metric b { display: block; font-size: 24px; line-height: 1.2; }
.metric span { color: var(--muted); font-size: 13px; }
.metric .tag { font-size: 11px; font-weight: 600; }
.metric .measured { color: var(--ok); }
.metric .estimated { color: var(--warn); }
.soon { opacity: .75; }
.estimate { font-size: 13px; color: var(--muted); margin: -4px 0 16px; }
.estimate b { color: var(--warn); }

/* Pipeline: horizontal on wide screens, vertical on phones (no sideways scrolling) */
.pipeline .v { display: none; }
@media (max-width: 640px) {
  .pipeline .h { display: none; }
  .pipeline .v { display: block; min-width: 0; max-width: 320px; margin: 0 auto; }
}

/* Pipeline diagram */
.pipeline { margin: 8px 0 24px; }
.pipeline svg { width: 100%; height: auto; display: block; }
.pipeline .box { fill: var(--surface); stroke: var(--line); }
.pipeline .box.pm { fill: var(--accent-soft); stroke: var(--accent); }
.pipeline text { fill: var(--text); font: 600 13px "Inter", system-ui, sans-serif; }
.pipeline .sub { fill: var(--muted); font-weight: 400; font-size: 11px; }
.pipeline .arrow { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.pipeline .h .arrow { marker-end: url(#arrowhead); }
.pipeline .v .arrow { marker-end: url(#arrowhead-v); }
.pipeline #arrowhead path, .pipeline #arrowhead-v path { fill: var(--muted); }

/* Case study article (rendered from Markdown) */
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 22px 22px; margin-bottom: 32px; }
.article h1 { font-size: clamp(24px, 4vw, 32px); margin-top: 20px; }
.article h2 { font-size: 21px; margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); }
.article h3 { color: var(--muted); font-weight: 500; font-size: 16px; margin-top: -4px; }
.article blockquote { margin: 16px 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.article blockquote p { margin: 0; }
.article table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.article th, .article td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.article th { background: var(--bg); }
.article th:empty { display: none; } /* summary tables use an empty header row */

/* Demo call to action */
.cta { display: grid; gap: 4px; text-decoration: none; color: var(--text); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 20px; }
.cta:hover { filter: brightness(.97); }
.cta-t { font-weight: 700; font-size: 18px; color: var(--accent); }
.cta-s { color: var(--muted); font-size: 14px; }
.cta-go { font-weight: 600; color: var(--accent); }

/* Screenshots */
.gallery { display: grid; gap: 16px; margin: 0 0 24px; }
.shot { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shot a { display: block; }
.shot img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.shot figcaption { padding: 10px 14px; font-size: 14px; color: var(--muted); }
.shot figcaption b { color: var(--text); }

footer { color: var(--muted); font-size: 13px; padding: 24px 0 40px; border-top: 1px solid var(--line); margin-top: 24px; }

/* Language blocks: the other language is always hidden, whatever other styles say. */
html[lang="es"] [data-lang-block="en"], html[lang="en"] [data-lang-block="es"] { display: none !important; }
.metric .tag { margin-left: 4px; }
