/* Kayavak website. System fonts only and no third-party requests: the site
   keeps the same promise as the app. Colours match the app (one indigo accent). */

:root {
  --bg: #f6f7f9;
  --bg-alt: #eef0f6;
  --surface: #ffffff;
  --text: #0f1424;
  --muted: #5a6378;
  --line: #e3e6ec;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef0ff;
  --good: #15803d;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgb(16 24 40 / 4%), 0 4px 16px rgb(16 24 40 / 6%);
  --shadow-lg: 0 2px 6px rgb(16 24 40 / 5%), 0 24px 48px rgb(16 24 40 / 12%);
  --radius: 14px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  /* read by the avatar renderers */
  --stage-top: #f1f3f8;
  --stage-bottom: #dde2ec;
  --paper: #f7f8fb;
  --paper-grid: #e3e6ec;
  --ink: #111827;
  --accent-ink: #4f46e5;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --bg-alt: #10131b;
    --surface: #151922;
    --text: #e9ebf1;
    --muted: #9aa2b4;
    --line: #262b37;
    --accent: #a5b4fc;
    --accent-strong: #c7d2fe;
    --accent-soft: #1d2040;
    --good: #4ade80;
    --on-accent: #0b0d12;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 30%), 0 24px 48px rgb(0 0 0 / 40%);
    --stage-top: #1a1f2b;
    --stage-bottom: #11141c;
    --paper: #161a23;
    --paper-grid: #232834;
    --ink: #e5e7eb;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); margin-bottom: 32px; }
h3 { font-size: 1.1rem; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-alt); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.i { width: 1.15em; height: 1.15em; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 12px 20px; font: 600 1rem var(--font); text-decoration: none; cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-light { background: #fff; color: #312e81; }
.btn-sm { padding: 8px 14px; font-size: .9rem; border-radius: 10px; box-shadow: none; }
.btn-lg { padding: 16px 28px; font-size: 1.1rem; border-radius: 14px; }
.link { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand.small { font-size: 1rem; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--text); background: var(--bg-alt); }
@media (max-width: 860px) { .nav { display: none; } .topbar-inner .btn { margin-left: auto; } }

/* Hero */
.hero { padding: 72px 0 88px; background: radial-gradient(60% 60% at 80% 20%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } .hero { padding-top: 40px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
h1 { font-size: clamp(2.5rem, 6vw, 4.2rem); letter-spacing: -0.035em; margin-bottom: 20px; }
.grad { background: linear-gradient(90deg, var(--accent), #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin-bottom: 32px; }
.lede em { font-style: normal; color: var(--text); font-weight: 600; }
.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.cta-note { color: var(--muted); font-size: .9rem; }
.cta-mobile { display: grid; gap: 12px; }
.cta-mobile .row { display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-note { font-size: 1.05rem; }
.trust { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .92rem; font-weight: 500; }
.trust li { display: flex; align-items: center; gap: 6px; }
.trust .i { color: var(--good); }

/* Live demo */
.demo { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.live { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); font-weight: 500; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgb(239 68 68 / 60%); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgb(239 68 68 / 0%); } 100% { box-shadow: 0 0 0 0 rgb(239 68 68 / 0%); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.seg { display: inline-flex; background: var(--bg-alt); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; font: 600 .85rem var(--font); color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 10%); }
.demo-stage { position: relative; aspect-ratio: 5 / 3; background: linear-gradient(var(--stage-top), var(--stage-bottom)); }
/* Two people side by side: each half is a 5:6 window onto a 4:3 canvas,
   cropped around the speaker (see setupDemo in site.js). */
.demo-pair { display: grid; grid-template-columns: 1fr 1fr; height: 100%; }
.demo-half { position: relative; overflow: hidden; }
.demo-half + .demo-half { border-left: 1px solid var(--line); }
.demo-half canvas { position: absolute; top: 0; width: 160%; height: 100%; display: block; left: -46%; }
.demo-half canvas[data-mirror] { left: -14%; }
.caption { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: rgb(15 20 36 / 82%); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: .9rem; font-weight: 500; white-space: nowrap; opacity: 0; transition: opacity .3s; pointer-events: none; }
.caption.show { opacity: 1; }
.demo-play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; box-shadow: var(--shadow-lg); }
.demo-play .i { width: 32px; height: 32px; }
.demo-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); }
.demo-foot strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* Sections */
.section { padding: 96px 0; }
.section.alt { background: var(--bg-alt); }
.kicker { color: var(--accent); font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card p { color: var(--muted); margin-top: 8px; }
.aside { margin-top: 28px; color: var(--muted); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 16px; }

.report-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 960px) { .report-grid { grid-template-columns: 1fr; } }
.shot { border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 24px; }
.features h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.features h3 .i { color: var(--accent); }
.features p { color: var(--muted); }

.people { display: flex; align-items: center; gap: 24px; margin-top: 56px; flex-wrap: wrap; }
.faces { display: flex; }
.faces img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: top; border: 3px solid var(--bg-alt); margin-left: -12px; background: var(--surface); }
.faces img:first-child { margin-left: 0; }
.people p { flex: 1; min-width: 260px; color: var(--muted); }
.people strong { color: var(--text); }

.who { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 960px) { .who { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .who { grid-template-columns: 1fr; } }

.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 960px) { .privacy-grid { grid-template-columns: 1fr; } }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checks li { position: relative; padding-left: 30px; color: var(--muted); }
.checks li strong { color: var(--text); }
.checks li::before { content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; border-radius: 50%; background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat; }
.checks.small { gap: 10px; font-size: .95rem; margin: 20px 0 24px; }
.file { margin: 0; background: #0f1424; color: #e5e7eb; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); }
.file-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; font: 500 .85rem var(--mono); background: #171c2e; color: #c7d2fe; }
.file-head .muted { color: #8a92a6; }
.file pre { margin: 0; padding: 20px 16px; overflow-x: auto; font: .85rem/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; }
.file code { background: none; padding: 0; }
.file figcaption { padding: 0 16px 16px; color: #9aa2b4; font-size: .9rem; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 960px) { .plans { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; position: relative; }
.plan .btn { margin-top: auto; }
.plan.featured { border: 2px solid var(--accent); }
.price { margin-top: 8px; color: var(--muted); }
.price span { font-size: 1.8rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin-right: 6px; }
.badge { position: absolute; top: -12px; right: 20px; background: var(--accent); color: var(--on-accent); font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }

.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .platforms { grid-template-columns: 1fr; } }
.platform { display: flex; flex-direction: column; gap: 12px; }
.platform h3 { display: flex; align-items: center; gap: 8px; }
.platform .muted { margin: 0; font-size: .92rem; }
.platform.current { border: 2px solid var(--accent); }
.alt-install { font-size: .88rem; color: var(--muted); }

.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 10px; color: var(--muted); }

.final { padding: 88px 0; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; text-align: center; }
.final-inner { display: grid; gap: 16px; justify-items: center; }
.final h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.final p { opacity: .85; font-size: 1.1rem; margin-bottom: 12px; }

.footer { padding: 40px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-size: .9rem; color: var(--muted); }

/* Download dialog */
.modal { width: min(560px, 100% - 32px); border: 0; border-radius: 20px; padding: 32px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgb(15 20 36 / 55%); backdrop-filter: blur(4px); }
.modal h2 { font-size: 1.5rem; margin: 0 0 20px; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-close button { border: 0; background: var(--bg-alt); color: var(--muted); width: 36px; height: 36px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; }
.install { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.install code { white-space: nowrap; }
.retry { margin-top: 16px; font-size: .9rem; }
.next { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.next h3 { margin-bottom: 12px; }
.timeline { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 6px; color: var(--muted); font-size: .95rem; }
.timeline strong { color: var(--text); }

/* Free forever + who makes it */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
@media (max-width: 960px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid h2 { margin-bottom: 20px; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.about-grid .card { padding: 32px; }
.free { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 60%); }
.maker { display: flex; flex-direction: column; gap: 14px; }
.maker p { margin: 0; }
.maker-head { display: flex; align-items: center; gap: 18px; }
.maker-head .kicker { margin-bottom: 4px; }
.maker-name { margin: 0 !important; }
.monogram { display: grid; place-items: center; flex: none; width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; font-weight: 800; font-size: 1.5rem; letter-spacing: .02em; box-shadow: var(--shadow); }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.footer a { color: inherit; font-weight: 600; }

/* ---- Shared footer ---- */
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-cols p { margin-top: 10px; font-size: .92rem; }
.footer-cols nav { display: grid; gap: 8px; align-content: start; font-size: .92rem; }
.footer-cols nav h2 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.footer-cols nav a { color: var(--text); text-decoration: none; }
.footer-cols nav a:hover { color: var(--accent); }
.footer-legal { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .85rem; }
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr 1fr; } .footer-cols > div { grid-column: 1 / -1; } }
.nav a[aria-current="page"] { color: var(--text); background: var(--bg-alt); }

/* ---- Articles (about, use-case pages) ---- */
.prose { padding: 48px 0 80px; font-size: 1.06rem; line-height: 1.75; }
.prose h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); margin: 8px 0 16px; letter-spacing: -0.03em; }
.prose .lede { font-size: 1.2rem; color: var(--muted); margin-bottom: 20px; }
.prose h2 { font-size: 1.5rem; margin: 44px 0 12px; }
.prose h3 { font-size: 1.15rem; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose a { text-underline-offset: 3px; }
.prose pre { background: #0f1424; color: #e5e7eb; border-radius: 12px; padding: 16px 18px; overflow-x: auto; font: .88rem/1.6 var(--mono); }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 700; background: var(--bg-alt); }
.crumbs { display: flex; gap: 8px; font-size: .9rem; color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 20px; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.cta-band h2 { margin: 0 0 4px !important; font-size: 1.3rem !important; }
.cta-band p { margin: 0 !important; }
.profile-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 12px; }
.profile-links .btn { text-decoration: none; }

.notfound { padding: 96px 0; text-align: center; }
.notfound h1 { font-size: 2.4rem; margin: 8px 0 12px; }

.maker-name a { color: inherit; text-decoration: none; }
