/* Kaleso site-wide styles (tokens, background, nav, buttons, glass cards, type, code, faq, footer). Only transform/opacity are animated; everything else is static or set once. */
:root {
    --bg: #030712;
    --blue: #3b82f6;
    --violet: #8b5cf6;
    --cyan: #22d3ee;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --mx: 50vw;
    --my: 30vh;
}
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 5rem; background: var(--bg); }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: #f3f4f6; overflow-x: clip; -webkit-font-smoothing: antialiased; }
.font-mono, code, pre, .mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.skip { position: absolute; left: -9999px; top: 0; background: #fff; color: #000; padding: .5rem 1rem; z-index: 100; border-radius: 0 0 .5rem 0; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; border-radius: 6px; }

/* ---------- ambient background ---------- */
.bg-layer { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-grid {
    position: absolute; inset: -64px;
    background-image: linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 25%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 25%, #000 20%, transparent 75%);
    animation: grid-drift 24s linear infinite;
}
@keyframes grid-drift { to { transform: translate3d(64px, 64px, 0); } }
.bg-blob { position: absolute; width: 46rem; height: 46rem; border-radius: 50%; filter: blur(90px); opacity: .35; will-change: transform; }
.bg-blob.b1 { left: -12rem; top: -10rem; background: radial-gradient(circle, #2563eb, transparent 65%); animation: float1 22s ease-in-out infinite alternate; }
.bg-blob.b2 { right: -14rem; top: 8rem; background: radial-gradient(circle, #7c3aed, transparent 65%); animation: float2 26s ease-in-out infinite alternate; }
@keyframes float1 { to { transform: translate3d(8rem, 6rem, 0) scale(1.15); } }
@keyframes float2 { to { transform: translate3d(-7rem, 9rem, 0) scale(.9); } }
.bg-noise {
    position: absolute; inset: 0; opacity: .06; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.cursor-glow {
    position: absolute; left: 0; top: 0; width: 36rem; height: 36rem; margin: -18rem 0 0 -18rem; border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,.22), rgba(59,130,246,.08) 40%, transparent 70%);
    transform: translate3d(var(--mx), var(--my), 0); will-change: transform; opacity: 0; transition: opacity .6s;
}
.has-pointer .cursor-glow { opacity: 1; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(3,7,18,.72); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border-color: rgba(255,255,255,.07); }
.nav a.link { color: #cbd5e1; transition: color .2s; position: relative; }
.nav a.link:hover { color: #fff; }
.nav a.link::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: linear-gradient(90deg, var(--blue), var(--violet)); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav a.link:hover::after { transform: scaleX(1); }
.menu-panel { position: absolute; left: 0; right: 0; top: 100%; background: rgba(3,7,18,.97); border-bottom: 1px solid rgba(255,255,255,.08); padding: .5rem 1.5rem 1rem; display: none; }
.menu-panel.open { display: block; }
.menu-panel a { display: block; padding: .8rem 0; color: #e2e8f0; border-bottom: 1px solid rgba(255,255,255,.06); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 600; border-radius: .75rem; padding: .8rem 1.4rem; transition: box-shadow .3s, background .3s, border-color .3s; will-change: transform; }
.btn-primary { color: #fff; background: linear-gradient(135deg, #2563eb, #7c3aed); box-shadow: 0 8px 30px -8px rgba(99,102,241,.7), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { box-shadow: 0 12px 40px -6px rgba(124,58,237,.85), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-ghost { color: #e5e7eb; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28); }
.btn-sm { padding: .45rem .95rem; font-size: .875rem; border-radius: .6rem; }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- type ---------- */
.grad-text { background: linear-gradient(100deg, #60a5fa 0%, #a78bfa 55%, #22d3ee 110%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem; border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .02em; color: #c7d2fe; background: rgba(99,102,241,.12); border: 1px solid rgba(129,140,248,.3); }
.eyebrow .dot { width: .45rem; height: .45rem; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.section-title { font-size: clamp(1.75rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.muted { color: #9ca3af; }

/* ---------- glass + cursor-following border glow ---------- */
.glass { position: relative; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025)); border: 1px solid rgba(255,255,255,.09); border-radius: 1.1rem; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 20px 50px -25px rgba(0,0,0,.8); }
.glow-card::before, .glow-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s; }
.glow-card::before { padding: 1px; background: radial-gradient(260px circle at var(--x, 50%) var(--y, 50%), rgba(139,92,246,.95), rgba(59,130,246,.55) 45%, transparent 70%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask-composite: exclude; }
.glow-card::after { background: radial-gradient(320px circle at var(--x, 50%) var(--y, 50%), rgba(99,102,241,.13), transparent 70%); }
.glow-card:hover::before, .glow-card:hover::after, .glow-card.lit::before, .glow-card.lit::after { opacity: 1; }
@media (hover: none) { .glow-card::before { opacity: .55; background: linear-gradient(135deg, rgba(59,130,246,.5), rgba(139,92,246,.15) 50%, rgba(139,92,246,.45)); } }

/* ---------- reveal (only when JS is on, so crawlers/noscript see everything) ---------- */
.js [data-reveal] { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal="left"] { transform: translate3d(-28px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(28px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- pricing ---------- */
.price-card { padding: 1.9rem; }
.price-card.featured { background: linear-gradient(180deg, rgba(99,102,241,.16), rgba(255,255,255,.03)); border-color: rgba(129,140,248,.45); }
.price-card ul { list-style: none; padding: 0; }
.price-card ul li { position: relative; padding-left: 1.6rem; }
.price-card ul li::before { content: ''; position: absolute; left: 0; top: .3rem; width: .9rem; height: .9rem; border-radius: 50%; background: rgba(52,211,153,.18) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 8.5l2.7 2.7L12 5.5' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat; }
.ribbon { position: absolute; top: -.7rem; right: 1.4rem; font-size: .7rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; background: linear-gradient(135deg, #2563eb, #7c3aed); }

/* ---------- code ---------- */
.code { background: #050a16; border: 1px solid rgba(255,255,255,.09); border-radius: 1rem; overflow: hidden; box-shadow: 0 30px 70px -30px rgba(79,70,229,.45); }
.code-bar { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid rgba(255,255,255,.07); font-size: .75rem; color: #9ca3af; }
.code pre { margin: 0; padding: 1.2rem 1.3rem; overflow-x: auto; font-size: .82rem; line-height: 1.7; color: #e2e8f0; text-align: left; }
.tk-c { color: #60a5fa; } .tk-s { color: #86efac; } .tk-k { color: #c4b5fd; } .tk-d { color: #94a3b8; }
.resp { margin-top: .4rem; border-top: 1px dashed rgba(255,255,255,.1); padding-top: .8rem; }

/* ---------- faq ---------- */
.faq details { border-radius: 1rem; }
.faq summary { list-style: none; cursor: pointer; padding: 1.1rem 1.3rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: #a5b4fc; transition: transform .3s var(--ease); flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p { padding: 0 1.3rem 1.2rem; color: #9ca3af; font-size: .92rem; }
.faq details[open] > p { animation: tin .45s var(--ease); }

/* ---------- cta ---------- */
.cta-box { position: relative; overflow: hidden; text-align: center; padding: 3.5rem 1.5rem; border-radius: 1.6rem; background: linear-gradient(135deg, rgba(37,99,235,.25), rgba(124,58,237,.25)); border: 1px solid rgba(165,180,252,.25); }
.cta-box::before { content: ''; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, rgba(139,92,246,.3), transparent 40%); animation: spin 14s linear infinite; }
.cta-box > * { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

footer a { transition: color .2s; }


footer a { transition: color .2s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js [data-reveal] { opacity: 1; transform: none; }
    .cta-box::before { display: none; }
}
@media (max-width: 640px) { .bg-blob { width: 28rem; height: 28rem; } }

/* ---------- inner pages: header, forms, alerts ---------- */
.page-head { text-align: center; padding: 3.5rem 1.25rem 1.5rem; max-width: 52rem; margin: 0 auto; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin: 1rem 0 .9rem; }
.page-head p { color: #9ca3af; max-width: 40rem; margin: 0 auto; }
.form-card { width: 100%; max-width: 28rem; margin: 0 auto; padding: 1.8rem; }
.form-wrap { min-height: calc(100vh - 12rem); display: flex; align-items: center; padding: 2.5rem 1.25rem 4rem; }
.form-card h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .4rem; }
.label { display: block; font-size: .82rem; font-weight: 500; color: #cbd5e1; margin-bottom: .35rem; }
.input { width: 100%; padding: .7rem .85rem; border-radius: .7rem; color: #f3f4f6; font: inherit; font-size: .95rem; background: rgba(3,7,18,.55); border: 1px solid rgba(255,255,255,.14); transition: border-color .2s, box-shadow .2s, background .2s; }
.input::placeholder { color: #6b7280; }
.input:hover { border-color: rgba(255,255,255,.26); }
.input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.28); background: rgba(3,7,18,.75); }
.input:-webkit-autofill { -webkit-text-fill-color: #f3f4f6; box-shadow: 0 0 0 100px #0b1220 inset; }
textarea.input { resize: vertical; min-height: 6rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.alert { padding: .75rem .9rem; border-radius: .75rem; font-size: .88rem; margin-bottom: 1rem; border: 1px solid; }
.alert-error { color: #fecaca; background: rgba(239,68,68,.12); border-color: rgba(248,113,113,.35); }
.alert-success { color: #bbf7d0; background: rgba(34,197,94,.12); border-color: rgba(74,222,128,.35); }
.alert-info { color: #c7d2fe; background: rgba(99,102,241,.14); border-color: rgba(129,140,248,.35); }
.text-link { color: #93c5fd; } .text-link:hover { color: #fff; text-decoration: underline; }

/* ---------- pricing page ---------- */
.cycle { display: inline-flex; padding: .25rem; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); font-size: .88rem; }
.cycle button { padding: .45rem 1.1rem; border-radius: 999px; font-weight: 600; color: #cbd5e1; transition: background .25s, color .25s; }
.cycle button[aria-pressed="true"] { color: #fff; background: linear-gradient(135deg, #2563eb, #7c3aed); box-shadow: 0 4px 18px -4px rgba(99,102,241,.7); }
.cycle button:not([aria-pressed="true"]):hover { color: #fff; }
.prose-block p { color: #9ca3af; margin-top: .8rem; line-height: 1.7; }
.prose-block code, .faq code { font-size: .85em; padding: .08rem .4rem; border-radius: .35rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); color: #e5e7eb; }

/* ---------- docs ---------- */
.docs-layout { max-width: 72rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
@media (min-width: 1024px) { .docs-layout { display: flex; gap: 3rem; padding-top: 3rem; } }
.toc { padding: .6rem; border-radius: 1rem; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); margin-bottom: 2rem; }
@media (min-width: 1024px) { .toc-wrap { width: 15.5rem; flex: none; } .toc { position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow-y: auto; margin-bottom: 0; } }
.toc-title { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #6b7280; padding: .4rem .75rem; }
.toc a { display: block; padding: .32rem .75rem; margin: 1px 0; border-radius: .5rem; color: #9ca3af; font-size: .86rem; border-left: 2px solid transparent; transition: color .2s, background .2s, border-color .2s; }
.toc a:hover { color: #fff; background: rgba(255,255,255,.05); }
.toc a.active { color: #fff; background: rgba(99,102,241,.14); border-left-color: #818cf8; }
.toc a.sub { padding-left: 1.5rem; font-size: .8rem; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.doc h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.doc h2 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-top: 3.5rem; margin-bottom: .75rem; scroll-margin-top: 5.5rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.08); }
.doc h3 { font-size: 1.15rem; font-weight: 600; margin-top: 2.4rem; margin-bottom: .5rem; scroll-margin-top: 5.5rem; }
.doc h4 { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: #818cf8; margin-top: 1.2rem; margin-bottom: .3rem; }
.doc p, .doc li { color: #cbd5e1; line-height: 1.7; }
.doc p { margin: .65rem 0; }
.doc ul { list-style: disc; padding-left: 1.4rem; margin: .6rem 0; }
.doc ol { list-style: decimal; padding-left: 1.4rem; margin: .6rem 0; }
.doc li::marker { color: #6b7280; }
.doc a { color: #93c5fd; text-decoration: underline; text-decoration-color: rgba(147,197,253,.3); text-underline-offset: 3px; }
.doc a:hover { color: #fff; text-decoration-color: #fff; }
.doc :not(pre) > code { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: .35rem; padding: .08rem .4rem; font-size: .85em; color: #e5e7eb; }
.doc .code { position: relative; margin: .6rem 0 1.1rem; box-shadow: 0 20px 50px -30px rgba(79,70,229,.45); }
.doc .code pre { margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto; font-size: .8rem; line-height: 1.65; color: #e2e8f0; }
.doc .code pre::-webkit-scrollbar, .toc::-webkit-scrollbar { height: 8px; width: 8px; }
.doc .code pre::-webkit-scrollbar-thumb, .toc::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.copy { position: absolute; top: .55rem; right: .55rem; font-size: .7rem; font-weight: 500; padding: .25rem .6rem; border-radius: .45rem; background: rgba(255,255,255,.07); color: #cbd5e1; border: 1px solid rgba(255,255,255,.14); cursor: pointer; transition: background .2s, color .2s; }
.copy:hover { background: rgba(255,255,255,.14); color: #fff; }
.doc table { width: 100%; border-collapse: collapse; font-size: .875rem; margin: .8rem 0 1.4rem; display: block; overflow-x: auto; }
.doc th { text-align: left; color: #9ca3af; font-weight: 600; padding: .5rem .9rem .5rem 0; border-bottom: 1px solid rgba(255,255,255,.14); white-space: nowrap; }
.doc td { padding: .55rem .9rem .55rem 0; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; color: #cbd5e1; }
.method { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: .4rem; margin-right: .6rem; font-family: 'JetBrains Mono', ui-monospace, monospace; vertical-align: .1em; }
.GET { background: rgba(16,185,129,.16); color: #6ee7b7; } .POST { background: rgba(59,130,246,.18); color: #93c5fd; }
.PUT { background: rgba(245,158,11,.16); color: #fcd34d; } .DELETE { background: rgba(239,68,68,.16); color: #fca5a5; }

/* entrance for form cards (no observer needed) */
.rise { animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 22px, 0) scale(.985); } }
.btn-block { width: 100%; }
.form-card h1 { line-height: 1.2; }
@media (max-width: 1023px) {
    .toc { display: flex; gap: .25rem; overflow-x: auto; white-space: nowrap; padding: .4rem; margin-bottom: 1.5rem; -webkit-overflow-scrolling: touch; }
    .toc-title, .toc a.sub { display: none; }
    .toc a { flex: none; border: 1px solid rgba(255,255,255,.08); }
}
