:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f2f0ec;
  --text: #1d2125;
  --muted: #5b636b;
  --border: #e2ded7;
  --accent: #0f6b62;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ee;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06);
  --radius: 10px;
  --max: 1080px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1b1f23;
    --surface-2: #22272c;
    --text: #e7e9eb;
    --muted: #9aa3ab;
    --border: #2f353b;
    --accent: #4fb3a6;
    --accent-ink: #0b1513;
    --accent-soft: #1d3330;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: 0.01em; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 20px; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav .btn { color: var(--accent-ink); }
@media (max-width: 640px) {
  .nav a:not(.btn) { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); filter: none; }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Sections */
section { padding: 72px 0; }
section + section { border-top: 1px solid var(--border); }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 46rem; }
.section-head { max-width: 46rem; margin-bottom: 32px; }
.section-head p { color: var(--muted); }

.hero { padding: 96px 0 80px; }
.hero h1 { max-width: 15em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .creds { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 0.92rem; }
.hero .creds span::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* Cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column;
}
.card h3 { margin-bottom: 6px; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .num { color: var(--accent); font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.card .foot { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.quote { font-style: italic; color: var(--text); border-left: 3px solid var(--accent); padding-left: 12px; margin: 4px 0 14px; font-size: 0.95rem; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tags li, .tags a {
  font-size: 0.8rem; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); text-decoration: none; font-weight: 600;
}

/* Two-column feature */
.split { display: grid; gap: 40px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 10px 0 10px 30px; position: relative; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: "→"; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }
.checklist.no li::before { content: "✕"; color: var(--muted); }
.checklist strong { display: block; }
.checklist span { color: var(--muted); font-size: 0.95rem; }

/* Service detail */
.service { padding: 40px 0; border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.service:first-of-type { border-top: 0; }
.service-body { display: grid; gap: 32px; grid-template-columns: 1.3fr 1fr; }
@media (max-width: 820px) { .service-body { grid-template-columns: 1fr; } }
.service ul { padding-left: 1.2em; margin: 0 0 1em; }
.service li { margin-bottom: 4px; }
.aside {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  font-size: 0.95rem;
}
.aside h4 { margin: 0 0 6px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.aside p { margin-bottom: 16px; }
.aside .tags { margin-bottom: 16px; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { font-size: 0.88rem; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; background: var(--surface); }
.toc a:hover { border-color: var(--accent); color: var(--accent); }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; min-width: 11rem; }
@media (max-width: 640px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--border); padding: 12px 0; }
  td { border: 0; padding: 4px 16px; }
}

/* Contact */
.contact {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px; box-shadow: var(--shadow);
  display: grid; gap: 32px; grid-template-columns: 1.4fr 1fr; align-items: center;
}
@media (max-width: 820px) { .contact { grid-template-columns: 1fr; padding: 28px; } }
.contact .actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-form[hidden] { display: none; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-weight: 600; }
.contact-form input, .contact-form textarea {
  font: inherit; font-weight: 400; font-size: 0.95rem;
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.contact-form .check { flex-direction: row; align-items: center; font-weight: 400; }
.contact-form .check[hidden] { display: none; }
.contact-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form button { align-self: flex-start; }
.form-status { margin: 0; font-size: 0.9rem; color: var(--muted); }
.form-status[data-kind="ok"] { color: var(--accent); font-weight: 600; }
.form-status[data-kind="error"] { color: #c0392b; }
.form-turnstile:empty { display: none; }

/* Footer */
.site-footer { padding: 32px 0 96px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--border); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* ---------- Home page (Blueprint) ---------- */
/* Always dark, so it sets its own tokens rather than following the color scheme. */
.home {
  --bg: #0c2b29;
  --surface: #123a37;
  --surface-2: #1c4a46;
  --text: #eef6f4;
  --muted: #b6cdc9;
  --border: #2c524e;
  --accent: #7fdccf;
  --accent-ink: #0c2b29;
  --accent-soft: #1c4a46;
  --max: 1200px;
  color: var(--text);
}
.home .chat-panel, .home .path {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-2: #edf2f1;
  --text: #142624;
  --muted: #4d5f5c;
  --border: #c9d6d3;
  --accent: #0f6b62;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ee;
  color: var(--text);
}
.home section { border-top: 0; scroll-margin-top: 60px; }
.home .btn { border-radius: 6px; font-weight: 700; }
.home .btn:not(.small):not(.chat-launcher) { padding: 13px 22px; font-size: 1rem; }
.home .btn.secondary { border-color: #5d837e; font-weight: 600; }
.home .chat-panel .btn { padding: 10px 18px; font-size: 0.95rem; }
.home .muted { color: var(--muted); }
.home .eyebrow { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 400; font-size: 0.85rem; text-transform: none; letter-spacing: 0; }
.home h1 { max-width: 1000px; font-size: clamp(2.4rem, 6.4vw, 4.9rem); line-height: 1.05; letter-spacing: -0.025em; font-weight: 600; }
.home .hero { padding: clamp(56px, 9vw, 112px) 0 clamp(44px, 6vw, 72px); }
.home .hero .lede { max-width: 700px; line-height: 1.5; margin-top: 1.2em; }
.home h2 { letter-spacing: -0.02em; font-weight: 600; }

.path { background: var(--bg); padding: clamp(48px, 6vw, 80px) 0; }
.stages { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); }
.stage { background: var(--surface); border: 1px solid var(--border); border-top: 6px solid var(--accent); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.stage p { margin: 0; }
.stage h2 { margin: 0; font-size: 2.1rem; line-height: 1.1; }
.stage-label { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; font-weight: 700; }
.stage .stage-proof { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.92rem; }
.stage-proof.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.also { margin: 28px 0 0; color: var(--muted); }
.also a { font-weight: 600; }

.band { background: var(--surface); }
.home-contact { display: grid; gap: 40px 56px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.home-contact h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.1; }
.home .contact-form input, .home .contact-form textarea { border-color: #5d837e; }
.home .form-status[data-kind="error"] { color: #ffb4a8; }

.who-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 0 48px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.who-list a { display: block; padding: 16px 0; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.who-list strong { display: block; font-size: 1.2rem; font-weight: 500; }
.who-list span { color: var(--muted); font-size: 0.92rem; }
.who-list a:hover strong { color: var(--accent); }

/* ---------- Chat widget ---------- */
.chat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  box-shadow: var(--shadow); padding: 12px 20px;
}
.chat-launcher[hidden] { display: none; }

.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 40px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 48px rgb(0 0 0 / 0.18);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel[hidden] { display: none; }
@media (max-width: 520px) {
  .chat-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
}

.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.chat-head strong { display: block; font-size: 0.98rem; }
.chat-head small { color: var(--muted); font-size: 0.8rem; }
.chat-head .icon-btn { background: none; border: 0; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.chat-head .icon-btn:hover { background: var(--surface-2); color: var(--text); }
.chat-head .tools { display: flex; gap: 2px; align-items: center; }
.chat-head .tools .reset { font-size: 0.8rem; }

.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 0.94rem; line-height: 1.5; overflow-wrap: anywhere; }
.msg p { margin: 0 0 0.6em; }
.msg p:last-child, .msg ul:last-child { margin-bottom: 0; }
.msg ul { margin: 0 0 0.6em; padding-left: 1.1em; }
.msg.bot { background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--accent); color: var(--accent-ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.error { background: transparent; border: 1px dashed var(--border); color: var(--muted); align-self: flex-start; }
.msg .svc { margin-top: 10px; }
.msg .handoff { margin-top: 12px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 0.84rem; text-align: left;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.chat-form { border-top: 1px solid var(--border); padding: 12px; display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea {
  flex: 1; resize: none; max-height: 140px; min-height: 42px; overflow-y: hidden;
  font: inherit; font-size: 0.94rem; line-height: 1.4;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
.chat-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.chat-form button { flex: none; height: 42px; }
.chat-form button:disabled { opacity: 0.5; cursor: default; }
.chat-note { padding: 0 14px 10px; font-size: 0.74rem; color: var(--muted); }
.chat-turnstile:empty { display: none; }
.chat-turnstile { padding: 0 12px 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .typing i { animation: none; opacity: 0.6; }
}
