/* SPDX-License-Identifier: AGPL-3.0-only */
:root {
  --bg: #fbfaf7;
  --bg-alt: #f3f1ea;
  --surface: #ffffff;
  --text: #1c1f1e;
  --muted: #5b625f;
  --line: #e3e1da;
  --accent: #196b5b;
  --accent-2: #2f9c80;
  --accent-soft: #dcefe8;
  --accent-text: #ffffff;
  --warn: #8a500f;
  --warn-soft: #fbf0e1;
  --code-bg: #f1efe9;
  --term-bg: #13201c;
  --term-text: #d7eee6;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 8px 24px rgba(20, 30, 25, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1312;
    --bg-alt: #141a18;
    --surface: #181e1c;
    --text: #e9ece9;
    --muted: #a3aba7;
    --line: #2a322f;
    --accent: #5cc4a9;
    --accent-2: #8fdcc6;
    --accent-soft: #1b3a32;
    --accent-text: #0b1512;
    --warn: #f0b46b;
    --warn-soft: #2b2216;
    --code-bg: #1f2523;
    --term-bg: #0b100e;
    --term-text: #cfe9e0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-underline-offset: 2px; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }
:not(pre) > code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: .75em 0; }
pre.term { background: var(--term-bg); color: var(--term-text); border-color: transparent; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: inline-grid; place-items: center; }
.mark svg { width: 18px; height: 18px; fill: none; stroke: var(--accent-text); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-size: .95em; padding: 4px 0; }
nav a:hover, nav a:focus-visible { color: var(--text); }

.hero { padding: 64px 0 40px; background: radial-gradient(900px 400px at 85% 10%, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .9em; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 var(--accent-2); animation: ping 2.4s ease-out infinite; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); line-height: 1.1; margin: 0 0 20px; letter-spacing: -.025em; }
h1 .accent { color: var(--accent); }
.lead { font-size: 1.15em; color: var(--muted); max-width: 58ch; margin: 0 0 28px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.button { display: inline-block; padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); transition: transform .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.button.ghost { background: var(--surface); color: var(--accent); }
.note { color: var(--muted); font-size: .9em; margin-top: 22px; }

.flow { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 18px 12px; box-shadow: var(--shadow); color: var(--accent); }
.flow figcaption { color: var(--muted); font-size: .88em; text-align: center; margin-top: 4px; }
.flow-svg { width: 100%; height: auto; display: block; }
.flow-svg .link { stroke: var(--line); stroke-width: 3; fill: none; stroke-linecap: round; }
.flow-svg .flowline { stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.flow-svg .packet { fill: var(--accent-2); opacity: 0; }
.flow-svg .node rect:first-child { fill: var(--bg-alt); stroke: var(--line); stroke-width: 1.5; }
.flow-svg .node.core rect:first-child { fill: var(--accent-soft); stroke: var(--accent); }
.flow-svg .icon { fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.flow-svg .icon-dot { fill: var(--text); }
.flow-svg .phone { fill: var(--surface); stroke: var(--text); stroke-width: 2; }
.flow-svg .approve { fill: var(--line); }
.flow-svg .tick, .flow-svg .done { fill: none; stroke: var(--accent-text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.flow-svg .done { stroke: var(--accent); stroke-width: 3; }
.flow-svg .label { fill: var(--muted); font: 600 13px system-ui, sans-serif; }
.flow-svg .label.strong { fill: var(--text); }
.flow-svg .tag { fill: var(--accent); font: 600 11px ui-monospace, Menlo, monospace; opacity: 0; }

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; padding-top: 8px; padding-bottom: 56px; }
.pillar { padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: transform .2s ease, box-shadow .2s ease; }
.pillar:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pillar svg { width: 36px; height: 36px; padding: 7px; border-radius: 10px; background: var(--accent-soft); fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pillar h3 { font-size: 1.05rem; margin: 12px 0 6px; }
.pillar p { margin: 0; color: var(--muted); font-size: .95em; }

.block { padding: 64px 16px; }
.block.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-left: 0; padding-right: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 8px; letter-spacing: -.015em; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 24px; max-width: 65ch; }
.sub.small { font-size: .92em; margin-top: 12px; }

.walk { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.chat { list-style: none; margin: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); display: grid; gap: 10px; min-height: 470px; align-content: start; }
.msg { border-radius: 14px; padding: 10px 14px; max-width: 90%; font-size: .95em; }
.msg .who { display: block; font-size: .75em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.msg.user { background: var(--accent); color: var(--accent-text); justify-self: end; border-bottom-right-radius: 4px; }
.msg.user .who { color: inherit; opacity: .8; }
.msg.bot { background: var(--bg-alt); border-bottom-left-radius: 4px; }
.msg.tool { font-family: ui-monospace, Menlo, monospace; font-size: .82em; background: var(--term-bg); color: var(--term-text); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; max-width: 100%; }
.msg .call { color: #8fdcc6; font-weight: 700; }
.msg .call::before { content: "→ "; opacity: .6; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-weight: 700; font-size: .9em; margin-right: 4px; }
.pill.wait { background: #4a3a17; color: #f6cf8b; }
.pill.ok { background: #1d4a3d; color: #9ff0d6; }

.device { justify-self: center; width: 230px; aspect-ratio: 9 / 18; border-radius: 34px; background: var(--term-bg); padding: 10px; box-shadow: var(--shadow); }
.screen { height: 100%; border-radius: 26px; background: var(--surface); padding: 26px 16px 16px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.screen .salon { margin: 0; font-size: .8em; font-weight: 700; color: var(--accent); }
.screen .ask { margin: 0 0 6px; font-weight: 700; font-size: 1.05em; line-height: 1.25; }
.screen dl { margin: 0; display: grid; gap: 4px; font-size: .85em; }
.screen dl div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.screen dt { color: var(--muted); }
.screen dd { margin: 0; font-weight: 600; }
.approve-btn, .approved { position: absolute; left: 16px; right: 16px; bottom: 22px; text-align: center; padding: 11px; border-radius: 12px; font-weight: 700; font-size: .9em; }
.approve-btn { background: var(--accent); color: var(--accent-text); }
.approved { background: var(--accent-soft); color: var(--accent); display: flex; justify-content: center; align-items: center; gap: 6px; opacity: 0; }
.approved svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.grid { display: grid; gap: 16px; margin-top: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; min-width: 0; }
.card p { margin: .4em 0; }
.card.small p { color: var(--muted); }
.card.warn { border-left: 4px solid var(--warn); }
.outcomes { margin-top: 32px; }
.badge { display: inline-block; font-size: .72em; font-weight: 800; letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); margin-right: 6px; vertical-align: 2px; }
.callout { margin-top: 20px; background: var(--accent-soft); border-radius: 16px; padding: 16px 20px; display: flex; gap: 14px; align-items: flex-start; }
.callout p { margin: 0; }
.callout svg { flex: none; width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }

.table { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 600px; }
td code { white-space: nowrap; overflow-wrap: normal; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--bg-alt); }
.scope { font-family: ui-monospace, Menlo, monospace; font-size: .8em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.scope.r { background: var(--accent-soft); color: var(--accent); }
.scope.w { background: var(--warn-soft); color: var(--warn); }
.scope.off { background: var(--bg-alt); color: var(--muted); }

.stat .big { font-size: 2.2rem; font-weight: 800; color: var(--text); margin: 0; line-height: 1.1; }
.stat .big span { font-size: .45em; color: var(--muted); font-weight: 600; margin-left: 3px; }

.never-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; align-items: start; }
.never { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.never li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 44px; position: relative; }
.never li::before { content: "✕"; position: absolute; left: 14px; top: 11px; width: 20px; height: 20px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-size: .75em; font-weight: 800; display: grid; place-items: center; }
.report { margin-top: 24px; color: var(--muted); }

.foot { padding: 32px 0 48px; color: var(--muted); font-size: .9em; }
.foot p { margin: 6px 0; }

@media (max-width: 860px) {
  .hero-grid, .walk, .never-wrap { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 40px; }
  .chat { min-height: 0; }
  .device { width: 210px; }
}

/* ---------- motion ---------- */
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes l1 { 0%, 0% { stroke-dashoffset: 100; } 12%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 100; } }
@keyframes p1 { 0%, 0% { opacity: 0; transform: translate(0, 0); } 1% { opacity: 1; } 12% { opacity: 1; transform: translate(64px, 0px); } 14%, 100% { opacity: 0; transform: translate(64px, 0px); } }
@keyframes t1 { 0%, 0% { opacity: 0; } 4%, 92% { opacity: 1; } 100% { opacity: 0; } }
.flow-svg .l1 { animation: l1 9s ease-in-out infinite; }
.flow-svg .p1 { animation: p1 9s ease-in-out infinite; }
.flow-svg .t1 { animation: t1 9s ease-in-out infinite; }
@keyframes l2 { 0%, 22% { stroke-dashoffset: 100; } 34%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 100; } }
@keyframes p2 { 0%, 22% { opacity: 0; transform: translate(0, 0); } 23% { opacity: 1; } 34% { opacity: 1; transform: translate(64px, 0px); } 36%, 100% { opacity: 0; transform: translate(64px, 0px); } }
@keyframes t2 { 0%, 22% { opacity: 0; } 26%, 92% { opacity: 1; } 100% { opacity: 0; } }
.flow-svg .l2 { animation: l2 9s ease-in-out infinite; }
.flow-svg .p2 { animation: p2 9s ease-in-out infinite; }
.flow-svg .t2 { animation: t2 9s ease-in-out infinite; }
@keyframes l3 { 0%, 44% { stroke-dashoffset: 100; } 56%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 100; } }
@keyframes p3 { 0%, 44% { opacity: 0; transform: translate(0, 0); } 45% { opacity: 1; } 56% { opacity: 1; transform: translate(0px, 56px); } 58%, 100% { opacity: 0; transform: translate(0px, 56px); } }
@keyframes t3 { 0%, 44% { opacity: 0; } 48%, 92% { opacity: 1; } 100% { opacity: 0; } }
.flow-svg .l3 { animation: l3 9s ease-in-out infinite; }
.flow-svg .p3 { animation: p3 9s ease-in-out infinite; }
.flow-svg .t3 { animation: t3 9s ease-in-out infinite; }
@keyframes l4 { 0%, 66% { stroke-dashoffset: 100; } 78%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 100; } }
@keyframes p4 { 0%, 66% { opacity: 0; transform: translate(0, 0); } 67% { opacity: 1; } 78% { opacity: 1; transform: translate(0px, 88px); } 80%, 100% { opacity: 0; transform: translate(0px, 88px); } }
@keyframes t4 { 0%, 66% { opacity: 0; } 70%, 92% { opacity: 1; } 100% { opacity: 0; } }
.flow-svg .l4 { animation: l4 9s ease-in-out infinite; }
.flow-svg .p4 { animation: p4 9s ease-in-out infinite; }
.flow-svg .t4 { animation: t4 9s ease-in-out infinite; }
@keyframes glow { 0%, 100% { stroke-width: 1.5; } 50% { stroke-width: 4; } }
.flow-svg .n2 rect:first-child { animation: glow 9s ease-in-out infinite; }
@keyframes approve { 0%, 56% { fill: var(--line); } 62%, 92% { fill: var(--accent); } 100% { fill: var(--line); } }
@keyframes tick { 0%, 58% { opacity: 0; } 63%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes done { 0%, 78% { opacity: 0; } 82%, 92% { opacity: 1; } 100% { opacity: 0; } }
.flow-svg .approve { animation: approve 9s ease-in-out infinite; }
.flow-svg .tick { animation: tick 9s ease-in-out infinite; }
.flow-svg .done { animation: done 9s ease-in-out infinite; }
@keyframes s1 { 0%, 3% { opacity: 0; transform: translateY(8px); } 6%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
.chat .s1 { animation: s1 18s ease-out infinite; }
@keyframes s2 { 0%, 9% { opacity: 0; transform: translateY(8px); } 12%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
.chat .s2 { animation: s2 18s ease-out infinite; }
@keyframes s3 { 0%, 15% { opacity: 0; transform: translateY(8px); } 18%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
.chat .s3 { animation: s3 18s ease-out infinite; }
@keyframes s4 { 0%, 22% { opacity: 0; transform: translateY(8px); } 25%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
.chat .s4 { animation: s4 18s ease-out infinite; }
@keyframes s5 { 0%, 30% { opacity: 0; transform: translateY(8px); } 33%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
.chat .s5 { animation: s5 18s ease-out infinite; }
@keyframes s6 { 0%, 50% { opacity: 0; transform: translateY(8px); } 53%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
.chat .s6 { animation: s6 18s ease-out infinite; }
@keyframes s7 { 0%, 58% { opacity: 0; transform: translateY(8px); } 61%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
.chat .s7 { animation: s7 18s ease-out infinite; }
@keyframes s8 { 0%, 66% { opacity: 0; transform: translateY(8px); } 69%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
.chat .s8 { animation: s8 18s ease-out infinite; }
@keyframes press { 0%, 40% { transform: none; opacity: 1; } 42% { transform: scale(.94); } 44% { transform: none; opacity: 1; } 46%, 97% { opacity: 0; } 100% { opacity: 1; } }
@keyframes approved { 0%, 44% { opacity: 0; transform: translateY(6px); } 47%, 90% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; } }
@keyframes ready { 0%, 22% { opacity: .3; } 25%, 92% { opacity: 1; } 97%, 100% { opacity: .3; } }
.screen > .salon, .screen > .ask, .screen > dl { animation: ready 18s ease-out infinite; }
.approve-btn { animation: press 18s ease-in-out infinite; }
.approved { animation: approved 18s ease-in-out infinite; }
@keyframes fill { from { width: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .flow-svg .flowline { stroke-dashoffset: 0; }
  .flow-svg .tag, .flow-svg .tick, .flow-svg .done { opacity: 1; }
  .flow-svg .approve { fill: var(--accent); }
  .approve-btn { opacity: 0; }
  .approved { opacity: 1; }
  .screen > * { opacity: 1; }
}
@media (max-width: 600px) {
  .flow-svg .tag { font-size: 13px; }
  .flow-svg .label { font-size: 15px; }
}
