/* mcc — site styles. No external fonts, scripts or trackers. */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --ink: #15171c;
  --ink-2: #3a3f4a;
  --muted: #646a76;
  --line: #e2dfd7;
  --line-strong: #cfcbc1;
  --accent: #0b7a5c;
  --accent-ink: #ffffff;
  --accent-soft: #e0f1ea;
  --code-bg: #eceae3;
  --code-ink: #23262d;

  /* Terminal is dark in both themes. */
  --term-bg: #101317;
  --term-bar: #1a1e24;
  --term-ink: #d9dde3;
  --term-dim: #7d8592;
  --term-green: #4fd39b;
  --term-yellow: #e9c45a;
  --term-red: #f07a6c;
  --term-blue: #7cb7ff;
  --term-accent: #6fe0b4;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f12;
    --surface: #14171c;
    --surface-2: #1a1e24;
    --ink: #ebe9e4;
    --ink-2: #c4c7cd;
    --muted: #949aa5;
    --line: #252930;
    --line-strong: #343943;
    --accent: #45d29f;
    --accent-ink: #06231a;
    --accent-soft: #12271f;
    --code-bg: #1c2027;
    --code-ink: #e3e5e9;
    --term-bg: #0a0c0f;
    --term-bar: #14171c;
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); letter-spacing: -0.03em; font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); letter-spacing: -0.025em; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }

code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 0.12em 0.38em;
  border-radius: 4px;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 100;
}
.skip:focus { left: 8px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font: 700 1.1rem/1 var(--mono); letter-spacing: -0.02em;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: 0.93rem; font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius-sm);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav .nav-gh { display: inline-flex; align-items: center; gap: 6px; }
.nav .nav-gh svg { width: 16px; height: 16px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 8px; font-weight: 600; font-size: 0.97rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Sections ---------- */

section { padding-block: clamp(56px, 9vw, 104px); }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.eyebrow {
  display: inline-block; font: 600 0.78rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 62ch; }
.section-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(48px, 8vw, 96px) clamp(48px, 7vw, 88px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 5vw, 56px); align-items: center;
}
@media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); } }
.hero h1 { margin-bottom: 20px; }
.hero h1 .hl { color: var(--accent); }
.hero .lede { margin-bottom: 28px; }
.hero-release { margin: 0 0 18px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.trust {
  display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0; list-style: none;
  color: var(--muted); font-size: 0.88rem;
}
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none;
}

/* ---------- Terminal ---------- */

.term {
  background: var(--term-bg); color: var(--term-ink);
  border-radius: var(--radius); border: 1px solid #22272f;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 24px 60px -24px rgba(10,14,20,.45), 0 2px 8px rgba(10,14,20,.12);
  overflow: hidden; min-width: 0;
}
.term-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--term-bar); border-bottom: 1px solid #22272f;
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3f48; display: block; }
.term-bar span { margin-left: 8px; color: var(--term-dim); font: 12px/1 var(--mono); }
.term pre {
  margin: 0; padding: 18px 20px 20px; overflow-x: auto;
  font: 13px/1.62 var(--mono); white-space: pre; tab-size: 2;
}
.term .p { color: var(--term-dim); user-select: none; }
.term .c { color: var(--term-ink); font-weight: 600; }
.term .d { color: var(--term-dim); }
.term .g { color: var(--term-green); }
.term .y { color: var(--term-yellow); }
.term .r { color: var(--term-red); }
.term .b { color: var(--term-blue); }
.term .a { color: var(--term-accent); font-weight: 600; }
.term .w { color: #ffffff; font-weight: 600; }
.term .soft { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Hero terminal tour: site.js replays the transcript over the static <pre>,
   which keeps the height and stays readable by screen readers. */
.tour-screen { position: relative; }
.tour-screen.is-playing > pre:not(.tour-play) { opacity: 0; }
.term .tour-play { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow-y: hidden; }
.tour-caret {
  display: inline-block; width: 0.6em; height: 1.2em; margin-left: 1px; vertical-align: -0.25em;
  background: var(--term-accent); animation: tour-blink 1.1s steps(1) infinite;
}
@keyframes tour-blink { 50% { opacity: 0; } }

/* ---------- Cards / grids ---------- */

.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px;
}
.section-alt .card { background: var(--bg); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-2); margin: 0; font-size: 0.97rem; }
.card .tag {
  font: 600 0.72rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); display: block; margin-bottom: 12px;
}

.costs { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.costs li {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 32px;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
@media (min-width: 820px) { .costs li { grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr); } }
.costs strong { font-weight: 650; }
.costs span { color: var(--ink-2); }

.features { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature { position: relative; }
.feature .icon {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 14px;
}
.feature .icon svg { width: 19px; height: 19px; }
.feature-wide { border-style: dashed; }

.split { display: grid; gap: clamp(28px, 5vw, 56px); grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 980px) { .split { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); } }
.stack-head { display: grid; gap: 8px 48px; grid-template-columns: minmax(0, 1fr); margin-bottom: clamp(24px, 3vw, 36px); }
@media (min-width: 980px) { .stack-head { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: end; } }
.stack-head .checks { margin: 0; }
.checks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 26px; color: var(--ink-2); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 4px;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='%230b7a5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* Steps */
.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step { counter-increment: step; display: flex; flex-direction: column; gap: 12px; }
.step-num {
  font: 600 0.8rem/1 var(--mono); color: var(--muted); display: flex; align-items: center; gap: 10px;
}
.step-num::before {
  content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-weight: 700;
}
.step p { margin: 0; color: var(--ink-2); }

/* Flow diagram */
.flow { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
@media (min-width: 860px) { .flow { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); } }
.flow-node {
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 16px 18px;
}
.flow-node .k { font: 600 0.72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.flow-node code { display: block; margin-top: 10px; background: none; padding: 0; font-size: 0.92rem; color: var(--ink); }
.flow-node p { margin: 8px 0 0; color: var(--ink-2); font-size: 0.92rem; }
.flow-arrow { display: grid; place-items: center; color: var(--muted); }
.flow-arrow svg { width: 22px; height: 22px; }
@media (max-width: 859px) { .flow-arrow svg { transform: rotate(90deg); } }

/* ---------- Code blocks with copy ---------- */

.code {
  position: relative; background: var(--term-bg); color: var(--term-ink);
  border-radius: var(--radius-sm); border: 1px solid #22272f; margin: 0 0 1.2em; min-width: 0;
}
.code pre { margin: 0; padding: 14px 56px 14px 16px; overflow-x: auto; font: 13.5px/1.6 var(--mono); }
.code .cm { color: var(--term-dim); }
.code .p { color: var(--term-dim); user-select: none; }
.copy {
  position: absolute; top: 8px; right: 8px;
  background: #1f242c; color: #c9ced6; border: 1px solid #2f3540; border-radius: 6px;
  font: 600 11.5px/1 var(--sans); padding: 6px 8px; cursor: pointer;
}
.copy:hover { background: #2a313b; color: #fff; }
.copy[data-copied] { color: var(--term-green); border-color: #2c5a46; }

.label { font: 600 0.8rem/1.3 var(--mono); color: var(--muted); margin: 0 0 8px; }

/* ---------- FAQ ---------- */

.faq { border-top: 1px solid var(--line); max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative;
  font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details > div { padding: 0 0 20px; color: var(--ink-2); max-width: 72ch; }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- Final CTA ---------- */

.final { text-align: left; }
.final-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(24px, 4vw, 44px);
  display: grid; gap: clamp(24px, 4vw, 40px); grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 940px) { .final-box { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; } }
.final-box .note { color: var(--muted); font-size: 0.9rem; margin-top: 14px; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: grid; gap: 20px; }
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.disclaimer { max-width: 80ch; margin: 0; font-size: 0.84rem; }

/* ---------- Document pages (docs, changelog, privacy) ---------- */

.page-head { padding-block: clamp(40px, 6vw, 72px) clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); margin-bottom: 12px; }
.page-head .lede { margin: 0; }
.meta { color: var(--muted); font-size: 0.9rem; margin-top: 14px; }

.doc-layout {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px;
  padding-block: clamp(28px, 4vw, 48px) clamp(56px, 8vw, 96px);
}
@media (min-width: 1000px) { .doc-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 56px; } }

.toc { font-size: 0.92rem; }
.toc-inner { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; }
@media (min-width: 1000px) {
  .toc-inner { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; border: 0; background: none; padding: 0; }
}
.toc-title { font: 600 0.74rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; padding-left: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.toc ol ol { padding-left: 12px; margin: 2px 0 6px; border-left: 1px solid var(--line); }
.toc a {
  display: block; padding: 4px 8px; border-radius: 5px; color: var(--ink-2); text-decoration: none; line-height: 1.4;
}
.toc a:hover { color: var(--ink); background: var(--surface-2); }
.toc a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
@media (max-width: 999px) {
  .toc ol ol { display: none; }
  .toc ol { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

.prose { max-width: 780px; min-width: 0; }
.prose > section { padding: 0; margin: 0 0 56px; }
.prose h2 { font-size: clamp(1.45rem, 2.6vw, 1.8rem); padding-top: 8px; margin-bottom: 16px; }
.prose h3 { font-size: 1.12rem; margin-top: 32px; margin-bottom: 10px; }
.prose h3 code, .prose h2 code { font-size: 0.9em; background: none; padding: 0; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--muted); }
.prose strong { color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.anchor { color: var(--line-strong); text-decoration: none; margin-left: 8px; font-weight: 400; opacity: 0; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus { opacity: 1; }

.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td { color: var(--ink-2); }
td code { white-space: nowrap; }

.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 1.4em; color: var(--ink-2);
  overflow-wrap: anywhere;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); }

.synopsis {
  font: 600 0.95rem/1.5 var(--mono); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 1em;
  overflow-x: auto; white-space: nowrap;
}

/* Changelog */
.release { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: clamp(20px, 3vw, 32px); margin-bottom: 28px; }
.release-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; margin-bottom: 18px; }
.release-head h2 { margin: 0; font: 700 1.6rem/1.1 var(--mono); letter-spacing: -0.02em; padding: 0; }
.pill {
  font: 600 0.74rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.pill-muted { background: var(--surface-2); color: var(--muted); }
.pill-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  text-transform: none; letter-spacing: 0; text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.pill-link:hover { border-color: var(--accent); text-decoration: none; }
.pill-tag { padding: 3px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.release h3 { font: 600 0.8rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; }
.release h3:first-of-type { margin-top: 0; }
.release ul { margin: 0; }
.release li { margin-bottom: 10px; }
.ref { font: 0.82rem var(--mono); white-space: nowrap; }

/* Privacy summary */
.summary-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin: 0 0 40px; }
@media (min-width: 720px) { .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.summary-grid .card { padding: 18px; }
.summary-grid .card h3 { font-size: 1rem; margin: 0 0 6px; }
.summary-grid .card p { font-size: 0.93rem; }
