/* ==========================================================================
   DocsLit site kit: tokens, fonts, nav, buttons, footer and motion utilities.
   Shared by the landing page, the blog, /cloud/ and the account pages.
   Theme: <html class="light|dark"> (set by the inline head script + site.js).
   Header and footer markup come from scripts/chrome.mjs.
   ========================================================================== */

@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter Display'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/inter-display-600.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/jbmono-400.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/jbmono-500.woff2') format('woff2'); }
/* Metric-matched fallbacks so the swap does not shift layout */
@font-face { font-family: 'Inter Fallback'; src: local('Arial'), local('Helvetica Neue'), local('Liberation Sans'); size-adjust: 107%; ascent-override: 90%; descent-override: 22%; line-gap-override: 0%; }
@font-face { font-family: 'Mono Fallback'; src: local('Menlo'), local('Consolas'), local('DejaVu Sans Mono'), local('Courier New'); size-adjust: 100%; ascent-override: 102%; descent-override: 30%; line-gap-override: 0%; }

:root {
  color-scheme: light;
  /* Neutral, near-monochrome canvas; the brand gradient is used sparingly */
  --bg: #ffffff;
  --bg-2: #f5f6f8;
  --bg-3: #eceef2;
  --surface: #ffffff;
  --ink: #0c0e12;
  --ink-2: #3d4350;
  --ink-3: #636b79;
  --line: rgba(12, 14, 18, 0.08);
  --line-2: rgba(12, 14, 18, 0.15);
  --accent: #00717a;
  --accent-strong: #005b62;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 113, 122, 0.08);
  --flame-1: #324fff;
  --flame-2: #00bcd4;
  --tonal: rgba(12, 14, 18, 0.06);
  --tonal-hover: rgba(12, 14, 18, 0.1);
  --focus: #1a4fd6;
  --term-bg: #0b0e13;
  --term-bar: #11161e;
  --term-line: #1e2530;
  --term-fg: #d7dee8;
  --term-mute: #8b98aa;
  --term-accent: #5fe0ea;
  --term-ok: #7be0a0;
  --term-warn: #f2c26b;
  --term-err: #ff8f8f;
  --term-str: #b7e38a;
  --term-key: #8fb4ff;
  --wm-base: #eceef2;
  --wm-1: #324fff;
  --wm-2: #00a3c4;
  --wm-3: #0c0e12;
  --shadow-1: 0 1px 2px rgba(12, 14, 18, 0.04), 0 8px 24px rgba(12, 14, 18, 0.05);
  --shadow-2: 0 2px 6px rgba(12, 14, 18, 0.05), 0 40px 80px -24px rgba(12, 14, 18, 0.25);
  --font-sans: 'Inter', 'Inter Fallback', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter Display', 'Inter', 'Inter Fallback', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Mono Fallback', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(.19, 1, .22, 1);
  --ease-soft: cubic-bezier(.23, 1, .32, 1);
  --radius-card: 28px;
  --nav-h: 68px;
}

html.dark {
  color-scheme: dark;
  --bg: #07080a;
  --bg-2: #0e1013;
  --bg-3: #16191e;
  --surface: #111317;
  --ink: #f2f4f7;
  --ink-2: #c3c9d3;
  --ink-3: #939cab;
  --line: rgba(242, 244, 247, 0.08);
  --line-2: rgba(242, 244, 247, 0.16);
  --accent: #55d7e2;
  --accent-strong: #8ae6ee;
  --accent-ink: #04242a;
  --accent-soft: rgba(85, 215, 226, 0.1);
  --tonal: rgba(242, 244, 247, 0.07);
  --tonal-hover: rgba(242, 244, 247, 0.12);
  --focus: #8fb4ff;
  --term-bg: #0b0d11;
  --term-bar: #12151b;
  --term-line: #1d222b;
  --wm-base: #121418;
  --wm-1: #5a74ff;
  --wm-2: #2fd3e6;
  --wm-3: #f2f4f7;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.4), 0 40px 80px -24px rgba(0, 0, 0, 0.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, picture { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code, kbd, pre, samp { font-family: var(--font-mono); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--flame-2) 24%, transparent); }

.dl-skip {
  position: absolute; left: 12px; top: -80px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; text-decoration: none;
}
.dl-skip:focus { top: 12px; }
.dl-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.dl-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 760px) { .dl-wrap { padding: 0 20px; } }

/* ---------- Buttons: pills ---------- */
.dl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: .005em; text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .3s var(--ease-out), box-shadow .3s;
  white-space: nowrap;
}
.dl-btn-primary { background: var(--ink); color: var(--bg); }
.dl-btn-primary:hover { background: color-mix(in srgb, var(--ink) 84%, var(--bg)); }
.dl-btn-outline { background: transparent; color: var(--ink); border-color: var(--line-2); }
.dl-btn-outline:hover { background: var(--tonal); }
.dl-btn-ghost, .dl-btn-tonal { background: var(--tonal); color: var(--ink); }
.dl-btn-ghost:hover, .dl-btn-tonal:hover { background: var(--tonal-hover); }
.dl-btn-lg { min-height: 54px; padding: 0 26px; font-size: 16px; }
.dl-btn svg { width: 17px; height: 17px; flex: none; }
.dl-gh svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dl-mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: -0.01em; }
.dl-btn:active { transform: scale(.98); }

/* ---------- Nav ---------- */
.dl-nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.dl-nav.is-scrolled, .dl-nav.open, html:not(.js) .dl-nav {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: var(--line);
}
.dl-nav-in { height: 100%; display: flex; align-items: center; gap: 24px; }
.dl-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.025em; text-decoration: none; }
.dl-brand img { width: 28px; height: 28px; border-radius: 8px; }
.dl-nav-menu { flex: 1; display: flex; justify-content: center; }
.dl-nav-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 4px; }
.dl-nav-links a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-decoration: none; transition: background-color .2s, color .2s; }
.dl-nav-links a:hover { color: var(--ink); background: var(--tonal); }
.dl-nav-links a[aria-current="page"] { color: var(--ink); background: var(--tonal); }
.dl-nav-mobile-only { display: none; }
.dl-nav-right { display: flex; align-items: center; gap: 8px; }
.dl-icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 999px;
  border: 0; background: var(--tonal); cursor: pointer; color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.dl-icon-btn:hover { color: var(--ink); background: var(--tonal-hover); }
.dl-icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dl-icon-btn .i-sun { display: none; }
html.dark .dl-icon-btn .i-sun { display: block; }
html.dark .dl-icon-btn .i-moon { display: none; }
.dl-menu-btn { display: none; }
.dl-nav-right .dl-btn { min-height: 42px; padding: 0 18px; font-size: 14.5px; }

@media (max-width: 1060px) {
  .dl-nav-menu { flex: 0; }
  .dl-nav-links {
    position: absolute; left: 0; right: 0; top: var(--nav-h);
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 20px 20px;
    display: none;
  }
  .dl-nav.open .dl-nav-links { display: flex; }
  .dl-nav-links a { min-height: 50px; font-size: 17px; padding: 0 16px; }
  .dl-nav-mobile-only { display: block; }
  .dl-menu-btn { display: inline-grid; }
  .dl-nav-right { margin-left: auto; }
  html:not(.js) .dl-nav { height: auto; }
  html:not(.js) .dl-nav-in { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  html:not(.js) .dl-nav-links { position: static; display: flex; flex-direction: row; flex-wrap: wrap; order: 5; width: 100%; border: 0; padding: 0; background: none; }
  html:not(.js) .dl-menu-btn { display: none; }
}
@media (max-width: 640px) {
  .dl-nav-right .dl-gh { display: none; }
}
@media (max-width: 380px) {
  .dl-nav-in { gap: 10px; }
  .dl-nav-right { gap: 6px; }
  .dl-nav-right .dl-btn { padding: 0 14px; }
}

/* ---------- Footer ---------- */
.dl-footer { position: relative; margin-top: 140px; border-top: 1px solid var(--line); overflow: hidden; }
.dl-footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(5, minmax(0, 1fr)); gap: 40px 32px; padding: 72px 0 56px; }
.dl-footer-tag { margin: 0 0 24px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 2.2vw, 1.9rem); line-height: 1.15; letter-spacing: -0.03em; color: var(--ink); max-width: 16ch; }
.dl-footer-cmd {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px 0 16px;
  border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  font: 500 14px/1 var(--font-mono); color: var(--ink);
  transition: background-color .2s;
}
.dl-footer-cmd:hover { background: var(--tonal); }
.dl-footer-cmd > span:first-child { color: var(--ink-3); }
.dl-footer-copy { padding: 7px 11px; border-radius: 999px; background: var(--tonal); font: 600 12px/1 var(--font-sans); color: var(--ink-2); }
.dl-footer-cmd.is-copied .dl-footer-copy { color: var(--accent); }
.dl-footer h2 { font: 500 13px/1.3 var(--font-sans); color: var(--ink-3); margin: 0 0 16px; }
.dl-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dl-footer li a { display: inline-block; padding: 5px 0; color: var(--ink); font-size: 14.5px; text-decoration: none; transition: color .2s; }
.dl-footer li a:hover { color: var(--ink-3); }
.dl-footer-bottom { border-top: 1px solid var(--line); padding: 22px 0; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; color: var(--ink-3); font-size: 13.5px; }
.dl-footer-meta { display: inline-flex; gap: 22px; }
.dl-footer-bottom a { color: var(--ink-2); text-decoration: none; }
.dl-footer-bottom a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Big wordmark: grey base, and a gradient copy revealed by a light sweep (site.js sets --wm-p 0..1). */
.dl-wordmark { padding: 8px 12px 0; margin-bottom: -1.6vw; pointer-events: none; user-select: none; }
.dl-wordmark svg { width: 100%; height: auto; overflow: visible; }
.dl-wordmark text { font-family: var(--font-display); font-weight: 600; font-size: 268px; letter-spacing: -0.04em; }
.dl-wordmark .wm-base { fill: var(--wm-base); }
.dl-wordmark .wm-s1 { stop-color: var(--wm-1); }
.dl-wordmark .wm-s2 { stop-color: var(--wm-2); }
.dl-wordmark .wm-s3 { stop-color: var(--wm-3); }
.dl-wordmark .wm-sweep { transform: scaleX(var(--wm-p, 1)); transform-box: fill-box; transform-origin: 0 50%; }
.dl-wordmark .wm-glow { opacity: .4; }
html.dark .dl-wordmark .wm-glow { opacity: .55; }

@media (max-width: 1060px) {
  .dl-footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dl-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .dl-footer { margin-top: 96px; }
  .dl-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; padding-top: 52px; }
}

/* Account / app pages share the same footer but sit tighter */
.dl-footer.compact { margin-top: 0; }

/* ---------- Motion utilities ----------
   site.js adds .motion to <html> when motion is allowed, then .is-in to each [data-reveal]
   as it scrolls into view. Without JS (or with reduced motion) everything is simply visible. */
.motion [data-reveal] {
  opacity: 0; transform: translate3d(0, 32px, 0);
  transition: opacity 1s var(--ease-soft), transform 1.2s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.motion [data-reveal].is-in { opacity: 1; transform: none; }
.motion [data-reveal="fade"] { transform: none; }
.motion [data-reveal="scale"] { transform: scale(.96); }

/* Pointer-tracked soft highlight on cards: site.js sets --mx/--my on [data-spot] */
[data-spot] { position: relative; isolation: isolate; }
[data-spot]::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--flame-2) 12%, transparent), transparent 60%);
  opacity: 0; transition: opacity .4s;
}
[data-spot]:hover::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
