/* kaveyl.app – one stylesheet, no external fonts or scripts (fast, private). Kaveyl indigo with warm accents. */
:root {
  --indigo: #4f46e5;
  --indigo-deep: #3730a3;
  --indigo-soft: #eef2ff;
  --accent-ink: #4f46e5; /* indigo as text colour: links, labels, badge – lighter in dark mode for contrast */
  --amber: #f59e0b;
  --coral: #f97362;
  --teal: #14b8a6;
  --pink: #ec4899;
  --sky: #38bdf8;
  --bg: #fbfbfe;
  --surface: #ffffff;
  --ink: #1e1b3a;
  --muted: #5b5876;
  --line: #e6e4f2;
  --code: #f4f3fb;
  --shadow: 0 20px 50px -24px rgba(49, 46, 129, 0.35);
  --radius: 18px;
  --max: 1160px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e1a;
    --surface: #18172a;
    --ink: #ecebf7;
    --muted: #a9a6c4;
    --line: #2a2843;
    --code: #201f35;
    --indigo-soft: #23214a;
    --accent-ink: #a5b4fc;
    --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--accent-ink);
}
code {
  font: 0.88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}

/* ── header ─────────────────────────────────────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: saturate(1.4) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand img {
  width: 32px;
  height: 32px;
}
.top nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 0.95rem;
}
.top nav a {
  color: var(--muted);
  text-decoration: none;
}
.top nav a:hover {
  color: var(--ink);
}
.lang {
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  text-decoration: none;
}
@media (max-width: 820px) {
  .top nav {
    display: none;
  }
  .lang {
    margin-left: auto;
  }
}

/* ── buttons & badges ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 10px 24px -12px var(--indigo);
}
.btn.ghost {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--indigo-soft);
  border: 1px solid color-mix(in srgb, var(--indigo) 35%, transparent);
  padding: 5px 12px;
  border-radius: 999px;
}
.badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 30%, transparent);
}

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 40px;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 720px;
  background:
    radial-gradient(40% 50% at 20% 30%, color-mix(in srgb, var(--indigo) 22%, transparent), transparent 70%),
    radial-gradient(35% 45% at 80% 20%, color-mix(in srgb, var(--pink) 16%, transparent), transparent 70%),
    radial-gradient(30% 40% at 60% 70%, color-mix(in srgb, var(--teal) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: grid;
  gap: 48px;
}
.hero-text {
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}
.hero-text .lead {
  margin-left: auto;
  margin-right: auto;
}
.hero-text .cta,
.hero-text .facts {
  justify-content: center;
}
.hero figure {
  max-width: 1100px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 18px 0 18px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, var(--indigo), var(--pink) 55%, var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 1.18rem;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 34em;
}
.hero .cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero .facts {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 26px;
  font-size: 0.92rem;
  color: var(--muted);
}
.hero .facts span::before {
  content: '✓ ';
  color: var(--teal);
  font-weight: 800;
}

/* ── sections ───────────────────────────────────────────────────────────── */
section {
  padding: 84px 0;
}
section.alt {
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--indigo-soft) 70%, transparent) 18%, color-mix(in srgb, var(--indigo-soft) 70%, transparent) 82%, transparent);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--accent-ink);
}
h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 10px 0 14px;
}
h3 {
  font-size: 1.2rem;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.intro {
  max-width: 46em;
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0 0 40px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 900px) {
  .grid3,
  .grid2 {
    grid-template-columns: 1fr;
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card p {
  margin: 0;
  color: var(--muted);
}
.card .icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: #fff;
}
.i-indigo {
  background: linear-gradient(135deg, var(--indigo), #7c74ff);
}
.i-teal {
  background: linear-gradient(135deg, var(--teal), #5eead4);
}
.i-coral {
  background: linear-gradient(135deg, var(--coral), var(--amber));
}
.i-pink {
  background: linear-gradient(135deg, var(--pink), #f9a8d4);
}
.i-sky {
  background: linear-gradient(135deg, #0ea5e9, var(--sky));
}
.i-amber {
  background: linear-gradient(135deg, #d97706, var(--amber));
}
.card .icon svg {
  width: 24px;
  height: 24px;
}
.shot {
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--surface);
}
figure {
  margin: 0;
}
figcaption {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}
.checks {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}
.checks li {
  padding-left: 30px;
  position: relative;
  margin: 10px 0;
  color: var(--muted);
}
.checks li strong {
  color: var(--ink);
}
.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--indigo), var(--pink));
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* sources */
.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.95rem;
}
.chip svg {
  width: 18px;
  height: 18px;
  color: var(--accent-ink);
}

/* feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) {
  .features {
    grid-template-columns: 1fr;
  }
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.feature h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.feature h3 .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.feature ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.feature li {
  margin: 4px 0;
}

/* comparison table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
th,
td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: color-mix(in srgb, var(--indigo-soft) 60%, transparent);
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody th {
  font-weight: 700;
}

/* gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 900px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

/* closed loop steps */
.loop-examples {
  display: grid;
  gap: 18px;
}
.example {
  border-left: 4px solid var(--indigo);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
}
.example:nth-child(2) {
  border-color: var(--teal);
}
.example:nth-child(3) {
  border-color: var(--coral);
}
.example p {
  margin: 0;
  color: var(--muted);
}

/* install */
.terminal {
  background: #15142a;
  color: #e7e5ff;
  border-radius: var(--radius);
  padding: 22px 24px;
  font: 0.92rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.terminal .c {
  color: #8f8bb8;
}
.terminal .p {
  color: #f9a8d4;
}

/* coming soon band */
.soon {
  border-radius: 28px;
  padding: 56px 40px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(60% 120% at 10% 0%, rgba(236, 72, 153, 0.55), transparent 60%),
    radial-gradient(60% 120% at 90% 100%, rgba(20, 184, 166, 0.5), transparent 60%),
    linear-gradient(135deg, var(--indigo-deep), var(--indigo));
}
.soon h2 {
  color: #fff;
}
.soon p {
  color: #e0e7ff;
  max-width: 40em;
  margin: 0 auto 8px;
}

footer {
  padding: 40px 0 56px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}
footer .wrap {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}
footer .right {
  margin-left: auto;
  display: flex;
  gap: 18px;
}
footer a {
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .spin {
    animation: spin 40s linear infinite;
    transform-origin: 50% 50%;
    transform-box: fill-box;
  }
  .flow {
    stroke-dasharray: 6 8;
    animation: flow 1.6s linear infinite;
  }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  @keyframes flow {
    to {
      stroke-dashoffset: -28;
    }
  }
}

/* spacing helpers (no inline styles: CSP style-src 'self') */
.mb12 { margin-bottom: 12px; }
.mt10 { margin-top: 10px; }
.mt40 { margin-top: 40px; }
.mt44 { margin-top: 44px; }
.mt48 { margin-top: 48px; }
.pt0 { padding-top: 0; }
.narrow { max-width: 300px; margin: 0 auto; }
.d-indigo { background: #4f46e5; }
.d-teal { background: #14b8a6; }
.d-amber { background: #f59e0b; }
.d-pink { background: #ec4899; }
.d-sky { background: #0ea5e9; }
.d-violet { background: #8b5cf6; }

/* SVG colours follow light/dark through classes (var() in presentation attributes is not reliable) */
.f-surface { fill: var(--surface); }
.f-line { fill: var(--line); }
.f-ink { fill: var(--ink); }
.f-muted { fill: var(--muted); }
.s-line { stroke: var(--line); }
svg text { font-family: inherit; }

/* 404 */
.pt404 { padding: 18vh 24px; }
.logo404 { margin: 0 auto 12px; }

footer .small { font-size: 0.8rem; margin-top: 10px; }
/* legal pages */
.legal { max-width: 760px; padding: 56px 24px 80px; }
.legal h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); letter-spacing: -0.02em; margin: 0 0 8px; }
.legal h2 { font-size: 1.3rem; margin: 36px 0 8px; }
.legal p, .legal li { color: var(--muted); }
.legal address { font-style: normal; color: var(--ink); line-height: 1.7; }
.legal .updated { font-size: 0.9rem; color: var(--muted); }

/* Pictures open large on click – CSS only (:target), so the CSP can keep forbidding scripts. Closing: click anywhere, ×, or Back. */
.zoom {
  display: block;
  position: relative;
  cursor: zoom-in;
  border-radius: 14px;
}
.zoom::after {
  content: '';
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(30, 27, 58, 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center/20px no-repeat;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.zoom:hover::after,
.zoom:focus-visible::after {
  opacity: 1;
}
.zoom:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 4px;
}
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 3vh 3vw;
  background: rgba(10, 9, 25, 0.96);
  align-items: center;
  justify-content: center;
}
.lightbox:target {
  display: flex;
}
.lightbox img {
  position: relative;
  max-width: 100%;
  max-height: 94vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.lb-close {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}
.lb-x {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  text-decoration: none;
}
.lb-x:hover {
  background: rgba(255, 255, 255, 0.26);
}
