/* Keystone — the public website at the main address (served by the edge router; see server/src/tenancy/edge.ts).
   Plain CSS, system fonts, light and dark mode; no build step, no external requests. */

:root {
  --page: #f6f6f3;
  --page-2: #efeee9;
  --surface: #ffffff;
  --ink: #111110;
  --ink-2: #52514e;
  --muted: #7a7972;
  --line: #e4e3dd;
  --accent: #5b4ce0;
  --accent-hover: #4b3dcc;
  --accent-soft: #efedfd;
  --accent-ink: #4336c4;
  --violet: #8b7cf6;
  --yellow: #f7c948;
  --coral: #ff8a7a;
  --mint: #4fd1a5;
  --sky: #5ab8f5;
  --shadow: 0 1px 2px rgb(17 17 16 / 0.04), 0 12px 40px -12px rgb(17 17 16 / 0.18);
  --shadow-lg: 0 2px 4px rgb(17 17 16 / 0.04), 0 40px 80px -30px rgb(40 30 120 / 0.35);
  --radius: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e0e0d;
    --page-2: #151513;
    --surface: #1a1a18;
    --ink: #f7f7f5;
    --ink-2: #c3c2b7;
    --muted: #8f8e85;
    --line: #2a2a27;
    --accent: #8f84f5;
    --accent-hover: #a39af7;
    --accent-soft: #25213d;
    --accent-ink: #b8b0ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 40px -12px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 40px 80px -30px rgb(80 60 220 / 0.35);
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* a link like /#/console is on its way to the app: show nothing meanwhile */
html.leaving body { visibility: hidden; }

[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 10px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; transition: background .15s, transform .15s, box-shadow .15s, border-color .15s;
}
.btn:active { transform: scale(.98); }
.btn.big { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -8px rgb(91 76 224 / .55); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn.ghost:hover { border-color: var(--ink-2); }
.btn.light { background: #fff; color: #2a1f8f; }
.btn.light:hover { background: #f1efff; }
.btn.outline { color: #fff; border-color: rgb(255 255 255 / .45); }
.btn.outline:hover { border-color: #fff; background: rgb(255 255 255 / .08); }
.btn.primary span[aria-hidden], .btn.light span[aria-hidden] { transition: transform .2s; }
.btn.primary:hover span[aria-hidden], .btn.light:hover span[aria-hidden] { transform: translateX(3px); }

/* ---------------- navigation ---------------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; text-decoration: none; letter-spacing: -0.01em; }
.links { display: flex; gap: 22px; margin-left: 12px; }
.links a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.links a:hover { color: var(--ink); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang select {
  appearance: none; -webkit-appearance: none; height: 40px; padding: 0 30px 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface) no-repeat right 11px center / 10px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E");
  color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
}

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

.hero { position: relative; padding: 72px 0 40px; overflow: hidden; }
.glow {
  position: absolute; inset: -20% -10% auto; height: 760px; pointer-events: none; z-index: -1;
  background:
    radial-gradient(40% 50% at 22% 30%, color-mix(in srgb, var(--violet) 32%, transparent), transparent 70%),
    radial-gradient(35% 45% at 80% 20%, color-mix(in srgb, var(--sky) 26%, transparent), transparent 70%),
    radial-gradient(30% 40% at 60% 60%, color-mix(in srgb, var(--coral) 18%, transparent), transparent 70%);
  filter: blur(10px);
}
.hero-in { text-align: center; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--accent-ink); background: var(--accent-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 span { display: inline-block; }
.hero h1 { font-size: clamp(42px, 8vw, 84px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
.grad { background: linear-gradient(100deg, var(--accent) 10%, #c056e8 55%, var(--coral) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 660px; margin: 22px auto 0; font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-2); }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.fine { margin-top: 14px; font-size: 13px; color: var(--muted); }

.shot { margin: 0; position: relative; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.shot img { width: 100%; }
.hero-shot { margin: 56px auto 0; max-width: 1080px; box-shadow: var(--shadow-lg); overflow: visible; }
.hero-shot picture, .hero-shot img { border-radius: 0 0 var(--radius) var(--radius); }
.frame { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.frame span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }

/* the buddy gang peeks over the edge of the screenshot */
.gang { position: absolute; right: 28px; top: -38px; display: flex; align-items: flex-end; gap: 4px; }
.gang svg { width: 44px; height: 44px; overflow: visible; filter: drop-shadow(0 6px 8px rgb(0 0 0 / .15)); animation: hop 3.2s ease-in-out infinite; }
.gang svg:nth-child(2) { width: 58px; height: 58px; animation-delay: .16s; }
.gang svg:nth-child(3) { animation-delay: .32s; }
.gang svg:nth-child(4) { animation-delay: .48s; }
.gang svg:nth-child(5) { animation-delay: .64s; }
@keyframes hop { 0%, 70%, 100% { transform: translateY(0); } 78% { transform: translateY(-9px) scale(1.04, .97); } 86% { transform: translateY(0) scale(.98, 1.03); } }

/* ---------------- facts band ---------------- */

.band { padding: 36px 0 24px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fact { padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.fact strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: var(--accent-ink); }
.fact span { font-size: 14px; color: var(--ink-2); }

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

.section { padding: 96px 0; }
.section.alt { background: var(--page-2); }
.section h2 { font-size: clamp(30px, 4.6vw, 48px); font-weight: 800; letter-spacing: -0.035em; }
.sub { margin-top: 18px; font-size: 18px; color: var(--ink-2); }
.center .sub { margin-left: auto; margin-right: auto; }

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 48px; }
.cards3.tight { margin-top: 28px; }
.card { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.card p { font-size: 15px; color: var(--ink-2); }
.icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; margin-bottom: 16px; font-size: 22px; font-weight: 700; color: #fff; }
.cards3 .card:nth-child(1) .icon { background: var(--violet); }
.cards3 .card:nth-child(2) .icon { background: var(--mint); }
.cards3 .card:nth-child(3) .icon { background: var(--coral); }

/* ---------------- product tabs ---------------- */

.tabs-wrap { margin-top: 40px; }
.tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 0 auto 28px; padding: 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.tabs button {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); background: none; border: 0; cursor: pointer;
  height: 38px; padding: 0 18px; border-radius: 999px; transition: background .15s, color .15s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--page); }
.panel { display: grid; grid-template-columns: 5fr 7fr; gap: 40px; align-items: center; animation: fade .35s ease; }
.panel[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel-text h3 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.panel-text p { margin-top: 14px; font-size: 16px; color: var(--ink-2); }
.panel-text ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.panel-text li { position: relative; padding-left: 28px; font-size: 15px; }
.panel-text li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft) no-repeat center / 10px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l3 3 5-6' fill='none' stroke='%235b4ce0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

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

.split { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: center; }
.split.rev { grid-template-columns: 4fr 7fr; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; align-items: start; }
.steps li::before { content: counter(s); grid-row: span 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; font-weight: 700; color: #fff; background: var(--accent); }
.steps li:nth-child(2)::before { background: var(--sky); }
.steps li:nth-child(3)::before { background: var(--mint); }
.steps li:nth-child(4)::before { background: var(--coral); }
.steps b { font-size: 16px; }
.steps span { font-size: 15px; color: var(--ink-2); }

.phone { margin: 0 auto; max-width: 300px; border-radius: 40px; padding: 10px; background: #111; box-shadow: var(--shadow-lg); }
.phone img { border-radius: 30px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chips.center { justify-content: center; margin-top: 36px; }
.chips span { font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.note { margin-top: 18px; font-size: 14px; color: var(--muted); }
.agent-head { margin-top: 88px; }
.note.center { margin-left: auto; margin-right: auto; max-width: 780px; padding: 0 20px; }

/* ---------------- final call to action ---------------- */

.final { padding: 40px 0 96px; }
.final-in {
  text-align: center; color: #fff; padding: 72px 28px; border-radius: 32px;
  background: radial-gradient(60% 80% at 15% 0%, #7d6cf7 0%, transparent 60%), radial-gradient(60% 80% at 90% 100%, #e0609a 0%, transparent 60%), #3a2bb8;
  box-shadow: var(--shadow-lg);
}
.final h2 { font-size: clamp(30px, 4.6vw, 48px); font-weight: 800; letter-spacing: -0.035em; }
.final p { max-width: 640px; margin: 18px auto 0; font-size: 18px; color: rgb(255 255 255 / .85); }

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

.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13px; color: var(--muted); }
.foot-in { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.footer nav { display: flex; gap: 20px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }
.ver { opacity: .7; }

/* ---------------- reveal on scroll ---------------- */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .gang svg, .panel { animation: none; }
}

/* ---------------- smaller screens ---------------- */

@media (max-width: 960px) {
  .links { display: none; }
  .panel, .split, .split.rev { grid-template-columns: 1fr; gap: 28px; }
  .split.rev .phone { order: 2; }
  .cards3 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .nav-in { gap: 10px; }
  .brand span { display: none; }
  .hide-sm { display: none; }
  .lang select { max-width: 92px; padding: 0 24px 0 10px; text-overflow: ellipsis; }
  .hero { padding-top: 48px; }
  .btn.big { width: 100%; }
  .section { padding: 64px 0; }
  .tabs { border-radius: 18px; }
  .tabs button { padding: 0 12px; height: 34px; font-size: 13px; }
  .gang { right: 10px; top: -26px; }
  .gang svg { width: 30px; height: 30px; }
  .gang svg:nth-child(2) { width: 40px; height: 40px; }
  .facts { gap: 10px; }
  .fact { padding: 14px; }
  .fact strong { font-size: 24px; }
  .fact span { font-size: 13px; }
  .final-in { padding: 48px 20px; border-radius: 24px; }
}

/* analytics consent banner */
.consent { position: fixed; z-index: 50; left: 16px; right: 16px; bottom: 16px; max-width: 640px; margin-inline: auto; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; padding: 16px 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); font-size: 13px; line-height: 1.5; }
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 280px; color: var(--ink-2); }
.consent-btns { display: flex; gap: 8px; }
