/* ==========================================================================
   FreeModel Design System — fm.css
   Light + dark themes, fluid type, motion. No build step required.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;

  --brand: #5b3df5;
  --brand-strong: #4a2ee0;
  --brand-soft: #efebff;
  --cyan: #00b8f0;
  --mint: #12c99b;
  --amber: #f5a524;
  --rose: #f0466b;
  --grad: linear-gradient(100deg, #5b3df5 0%, #7a5cff 30%, #00b8f0 70%, #12c99b 100%);
  --grad-soft: linear-gradient(135deg, rgba(91,61,245,.12), rgba(0,184,240,.10) 55%, rgba(18,201,155,.10));

  --bg: #fbfbfd;
  --bg-2: #f4f4f8;
  --surface: #ffffff;
  --surface-2: #f8f8fb;
  --border: #e6e6ee;
  --border-strong: #d4d4e0;
  --text: #0b0b12;
  --text-2: #464657;
  --text-3: #7a7a8c;
  --code-bg: #0c0c14;
  --code-text: #e6e6f2;
  --ring: rgba(91,61,245,.35);
  --shadow-sm: 0 1px 2px rgba(16,16,40,.05);
  --shadow: 0 1px 2px rgba(16,16,40,.04), 0 8px 24px -8px rgba(16,16,40,.10);
  --shadow-lg: 0 2px 4px rgba(16,16,40,.04), 0 24px 60px -16px rgba(40,24,140,.22);
  --glass: rgba(255,255,255,.72);
  --grid-line: rgba(11,11,18,.06);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --container: 1200px;
  --nav-h: 64px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  color-scheme: light;
}

[data-theme="dark"] {
  --brand: #8b74ff;
  --brand-strong: #a594ff;
  --brand-soft: rgba(139,116,255,.14);
  --cyan: #38cfff;
  --mint: #35e0b0;
  --grad: linear-gradient(100deg, #8b74ff 0%, #a08cff 28%, #38cfff 68%, #35e0b0 100%);
  --grad-soft: linear-gradient(135deg, rgba(139,116,255,.16), rgba(56,207,255,.10) 55%, rgba(53,224,176,.08));

  --bg: #07070b;
  --bg-2: #0c0c13;
  --surface: #111119;
  --surface-2: #161621;
  --border: #22222f;
  --border-strong: #303042;
  --text: #f3f3f8;
  --text-2: #b0b0c4;
  --text-3: #74748a;
  --code-bg: #0a0a12;
  --ring: rgba(139,116,255,.45);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 30px 70px -20px rgba(80,60,220,.35);
  --glass: rgba(14,14,22,.72);
  --grid-line: rgba(255,255,255,.05);
  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font-sans); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
main { flex: 1; min-width: 0; }
html, body { overflow-x: clip; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
code, pre, kbd { font-family: var(--font-mono); }
::selection { background: rgba(91,61,245,.22); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 14px; }
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 820px; }
.container-md { max-width: 1000px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }
.section { padding: 88px 0; position: relative; }
.section-sm { padding: 56px 0; }
@media (max-width: 767px) { .section { padding: 64px 0; } .section-sm { padding: 44px 0; } }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.stack > * + * { margin-top: var(--stack, 16px); }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1023px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 639px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand);
}
.eyebrow::before { content: ""; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px; }
.display { font-size: clamp(2.5rem, 6.2vw, 4.6rem); line-height: 1.02; letter-spacing: -0.045em; font-weight: 600; }
.h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -0.04em; }
.h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); letter-spacing: -0.035em; }
.h3 { font-size: clamp(1.15rem, 1.6vw, 1.3rem); letter-spacing: -0.02em; }
.lead { font-size: clamp(1.02rem, 1.5vw, 1.18rem); color: var(--text-2); line-height: 1.65; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 14px; }
.xs { font-size: 12.5px; }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: gradShift 8s ease-in-out infinite; }
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; }
.section-head .h2 { margin-top: 12px; }
.section-head .lead { margin-top: 14px; }

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 44px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 18px; border-radius: 12px; font-size: 15px; font-weight: 550; white-space: nowrap;
  border: 1px solid transparent; transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, color .2s;
  isolation: isolate; overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; transition: transform .25s var(--ease); }
.btn:hover svg.arrow { transform: translateX(3px); }
.btn-sm { --btn-h: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { --btn-h: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-primary { color: #fff; background: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 18px -6px rgba(11,11,18,.45); }
[data-theme="dark"] .btn-primary { color: #0b0b12; background: #fff; box-shadow: 0 6px 22px -6px rgba(139,116,255,.55); }
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad); opacity: 0; transition: opacity .35s var(--ease);
}
.btn-primary:hover { box-shadow: 0 10px 30px -10px rgba(91,61,245,.65); color: #fff; }
.btn-primary:hover::before { opacity: 1; }
.btn-brand { color: #fff; background: var(--brand); box-shadow: 0 8px 24px -10px var(--brand); }
.btn-brand:hover { background: var(--brand-strong); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--bg-2); }
.btn .shine { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); }
.btn:hover .shine { transform: translateX(120%); transition: transform .9s var(--ease); }

.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--text-2); border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); border-color: var(--border); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.chip-brand { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.chip-mint { color: #08865f; background: rgba(18,201,155,.12); border-color: transparent; }
[data-theme="dark"] .chip-mint { color: var(--mint); }
.chip-amber { color: #a86500; background: rgba(245,165,36,.14); border-color: transparent; }
[data-theme="dark"] .chip-amber { color: var(--amber); }
.chip-rose { color: #c21f45; background: rgba(240,70,107,.12); border-color: transparent; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); position: relative; flex-shrink: 0; }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: inherit; opacity: .35; animation: ping 2s var(--ease) infinite; }
.dot-amber { background: var(--amber); } .dot-rose { background: var(--rose); }
@keyframes ping { 0% { transform: scale(.6); opacity: .5; } 80%,100% { transform: scale(1.8); opacity: 0; } }
.kbd { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 11.5px; font-family: var(--font-mono); color: var(--text-3); background: var(--bg-2); border: 1px solid var(--border); border-bottom-width: 2px; }

/* ---------- Cards ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-hover { transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
/* Pointer-tracked glow border */
.glow { --mx: 50%; --my: 50%; }
.glow::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(91,61,245,.55), rgba(0,184,240,.25) 35%, transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s var(--ease);
}
.glow:hover::before { opacity: 1; }
.icon-tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--brand); background: var(--brand-soft); }
.icon-tile svg { width: 22px; height: 22px; }

/* ---------- Navigation ---------- */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); transition: background .3s, border-color .3s, box-shadow .3s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: var(--glass); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom-color: var(--border); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 18px; letter-spacing: -0.03em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; overflow: hidden; flex-shrink: 0; box-shadow: 0 4px 14px -4px rgba(91,61,245,.5); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav-link { position: relative; padding: 8px 12px; border-radius: 9px; font-size: 14.5px; color: var(--text-2); transition: color .2s, background .2s; }
.nav-link:hover { color: var(--text); background: var(--bg-2); }
.nav-link[aria-current="page"] { color: var(--text); }
.nav-link[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--grad); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-search { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-3); font-size: 13.5px; transition: border-color .2s, box-shadow .2s; }
.nav-search:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.nav-search svg { width: 15px; height: 15px; }
.nav-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 6px 10px; border-radius: 999px; transition: background .2s; }
.nav-status:hover { background: var(--bg-2); }
.nav-burger { display: none; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (max-width: 1080px) { .nav-status { display: none; } }
/* the top bar may use a little more width than the page content, and drops extras before it can overflow */
.nav .nav-inner { max-width: 1320px; }
@media (max-width: 1439px) { .nav-search .kbd { display: none; } .nav-search { padding-right: 12px; } }
@media (max-width: 1360px) { .nav-status { display: none !important; } }
@media (max-width: 360px) { .brand > span:not(.brand-mark) { display: none; } }
/* 900–1240 px (small laptops / tablets landscape): search becomes an icon, links tighten, so the bar never overflows */
@media (max-width: 1240px) and (min-width: 901px) {
  .nav-inner { gap: 16px; }
  .nav-links { margin-left: 0; }
  .nav-link { padding: 8px 9px; font-size: 14px; }
  .nav-link[aria-current="page"]::after { left: 9px; right: 9px; }
  .nav-search .label, .nav-search .kbd { display: none; }
  .nav-search { padding: 0; width: 36px; justify-content: center; }
}
@media (max-width: 1000px) and (min-width: 901px) { .nav-right .btn-sm { padding: 0 12px; } .nav-link { padding: 8px 7px; font-size: 13.5px; } }
@media (max-width: 900px) {
  .nav-links, .nav-search .label, .nav-right .hide-m { display: none; }
  .nav-search { padding: 0; width: 38px; justify-content: center; }
  .nav-search .kbd { display: none; }
  .nav-burger { display: inline-grid; }
}
@media (max-width: 480px) {
  .nav-inner { gap: 12px; }
  .nav-right { gap: 4px; }
  .nav-right .theme-toggle { display: none; }
  .nav-right .btn-sm { padding: 0 12px; }
  .brand { font-size: 17px; }
}
.m-theme { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 4px; font-size: 18px; font-weight: 550; border-bottom: 1px solid var(--border); }
.m-theme .sw { position: relative; width: 46px; height: 26px; border-radius: 99px; background: var(--border-strong); transition: background .25s; }
.m-theme .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform .3s var(--ease-spring); }
[data-theme="dark"] .m-theme .sw { background: var(--brand); }
[data-theme="dark"] .m-theme .sw::after { transform: translateX(20px); }
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 49; background: var(--bg); padding: 16px 20px 32px; overflow-y: auto;
  opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .25s var(--ease), transform .3s var(--ease);
}
.mobile-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.mobile-menu a.m-link { display: flex; align-items: center; justify-content: space-between; padding: 16px 4px; font-size: 18px; font-weight: 550; border-bottom: 1px solid var(--border); }
.mobile-menu .m-cta { display: grid; gap: 10px; margin-top: 24px; }
body.menu-open { overflow: hidden; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 64px 0 32px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 32px; }
.footer h4 { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--text); margin-bottom: 14px; }
.footer ul { list-style: none; display: grid; gap: 10px; }
.footer li a { font-size: 14px; color: var(--text-2); transition: color .2s; }
.footer li a:hover { color: var(--text); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--text-3); }
.footer-word { font-size: clamp(64px, 16vw, 210px); font-weight: 700; letter-spacing: -0.06em; line-height: .8; margin-top: 48px; background: linear-gradient(180deg, var(--border-strong), transparent 85%); -webkit-background-clip: text; background-clip: text; color: transparent; user-select: none; text-align: center; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Background FX ---------- */
.fx-grid { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%); }
.fx-aurora { position: absolute; inset: -20% -10% auto; height: 120%; pointer-events: none; opacity: .6; overflow: hidden; contain: strict; }
[data-theme="dark"] .fx-aurora { opacity: .5; }
.fx-aurora span { position: absolute; border-radius: 50%; will-change: transform; }
.fx-aurora .a1 { width: 46vw; height: 46vw; max-width: 640px; max-height: 640px; left: 8%; top: -6%; background: radial-gradient(circle closest-side, rgba(91,61,245,.5), rgba(91,61,245,.18) 45%, transparent); animation: drift1 18s ease-in-out infinite; }
.fx-aurora .a2 { width: 40vw; height: 40vw; max-width: 560px; max-height: 560px; right: 4%; top: 4%; background: radial-gradient(circle closest-side, rgba(0,184,240,.42), rgba(0,184,240,.14) 45%, transparent); animation: drift2 22s ease-in-out infinite; }
.fx-aurora .a3 { width: 30vw; height: 30vw; max-width: 420px; max-height: 420px; left: 40%; top: 30%; background: radial-gradient(circle closest-side, rgba(18,201,155,.32), rgba(18,201,155,.1) 45%, transparent); animation: drift3 26s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(8%, 10%) scale(1.1); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-10%, 8%) scale(.92); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-14%, -10%); } }
.fx-spot { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(600px circle at var(--sx, 50%) var(--sy, 30%), rgba(91,61,245,.10), transparent 60%); transition: background .1s; }
.fx-noise { position: absolute; inset: 0; pointer-events: none; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; overflow: hidden; padding: 72px 0 48px; }
.page-hero .container { position: relative; }
.page-hero .h1 { margin-top: 14px; max-width: 820px; }
.page-hero .lead { margin-top: 16px; max-width: 680px; }
.page-hero.center .h1, .page-hero.center .lead { margin-inline: auto; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-3); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb svg { width: 14px; height: 14px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.reveal-scale { opacity: 0; transform: scale(.96) translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal-scale.in { opacity: 1; transform: none; }
.no-js .reveal, .no-js .reveal-scale { opacity: 1; transform: none; }
.split-word { display: inline-block; opacity: 0; transform: translateY(.45em); filter: blur(6px); animation: wordIn .9s var(--ease) forwards; animation-delay: calc(var(--i) * 70ms + 80ms); }
@keyframes wordIn { to { opacity: 1; transform: none; filter: blur(0); } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; }
.label { font-size: 13.5px; font-weight: 550; color: var(--text); }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 15px; transition: border-color .2s, box-shadow .2s, background .2s; outline: none;
}
.textarea { height: auto; padding: 12px 14px; min-height: 110px; resize: vertical; }
.input::placeholder { color: var(--text-3); }
.input:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-wrap .addon { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.hint { font-size: 12.5px; color: var(--text-3); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1px solid; margin-bottom: 16px; }
.alert-error { color: #b4233f; background: rgba(240,70,107,.08); border-color: rgba(240,70,107,.25); }
.alert-success { color: #08744f; background: rgba(18,201,155,.10); border-color: rgba(18,201,155,.3); }
[data-theme="dark"] .alert-error { color: #ff8aa3; } [data-theme="dark"] .alert-success { color: var(--mint); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.strength i { height: 4px; border-radius: 4px; background: var(--border); transition: background .3s; }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--rose); }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--amber); }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--cyan); }
.strength[data-score="4"] i { background: var(--mint); }

/* Segmented control */
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); position: relative; }
.seg button { position: relative; z-index: 1; height: 34px; padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 550; color: var(--text-2); transition: color .2s; }
.seg button[aria-selected="true"] { color: var(--text); }
.seg .seg-pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); transition: left .35s var(--ease), width .35s var(--ease); }

/* Range slider */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--brand) var(--p, 50%), var(--border) var(--p, 50%)); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); box-shadow: 0 4px 12px rgba(91,61,245,.35); cursor: grab; transition: transform .2s var(--ease-spring); }
.range::-webkit-slider-thumb:active { transform: scale(1.15); cursor: grabbing; }
.range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); cursor: grab; }

/* ---------- Code ---------- */
.code-card { border-radius: var(--radius-lg); background: var(--code-bg); color: var(--code-text); border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-lg); overflow: hidden; }
.code-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.02); }
.code-dots { display: flex; gap: 6px; } .code-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2c2c3a; }
.code-dots i:nth-child(1) { background: #ff5f57; } .code-dots i:nth-child(2) { background: #febc2e; } .code-dots i:nth-child(3) { background: #28c840; }
.code-tabs { display: flex; gap: 2px; margin-left: 6px; overflow-x: auto; scrollbar-width: none; }
.code-tabs::-webkit-scrollbar { display: none; }
.code-tab { height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; font-family: var(--font-mono); color: #8a8aa3; transition: color .2s, background .2s; white-space: nowrap; }
.code-tab:hover { color: #d6d6e6; }
.code-tab[aria-selected="true"] { color: #fff; background: rgba(255,255,255,.08); }
.code-body { position: relative; }
.code-body pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 13px; line-height: 1.75; tab-size: 2; }
.code-copy { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12px; color: #b9b9cc; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); opacity: 0; transition: opacity .2s, background .2s, color .2s; }
.code-body:hover .code-copy, .code-copy:focus-visible, .code-copy.done { opacity: 1; }
.code-copy:hover { background: rgba(255,255,255,.12); color: #fff; }
.code-copy svg { width: 14px; height: 14px; }
@media (hover: none) { .code-copy { opacity: 1; } }
.tk-c { color: #6b6b85; font-style: italic; } .tk-k { color: #c39bff; } .tk-s { color: #7ee2b8; } .tk-n { color: #ffb86b; } .tk-f { color: #7cc8ff; } .tk-p { color: #9a9ab0; }
.caret { display: inline-block; width: 8px; height: 1.1em; vertical-align: -0.18em; background: var(--mint); margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Marquee ---------- */
.marquee { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee var(--dur, 40s) linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee.reverse .marquee-track { animation-direction: reverse; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; padding: 14px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-family: var(--font-mono); font-size: 13.5px; white-space: nowrap; }

/* ---------- FAQ / accordion ---------- */
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: var(--border-strong); box-shadow: var(--shadow); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; font-weight: 550; font-size: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .pm { position: relative; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--bg-2); }
.faq summary .pm::before, .faq summary .pm::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.6px; background: var(--text-2); transform: translate(-50%,-50%); transition: transform .3s var(--ease); }
.faq summary .pm::after { transform: translate(-50%,-50%) rotate(90deg); }
.faq details[open] .pm::after { transform: translate(-50%,-50%) rotate(0); }
.faq .faq-a { padding: 0 20px 20px; color: var(--text-2); font-size: 15px; line-height: 1.7; }

/* ---------- Command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 12vh 16px 16px; background: rgba(8,8,14,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.cmdk.open { opacity: 1; pointer-events: auto; }
.cmdk-box { width: 100%; max-width: 640px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 40px 100px -20px rgba(0,0,0,.45); overflow: hidden; transform: translateY(-8px) scale(.98); transition: transform .25s var(--ease); }
.cmdk.open .cmdk-box { transform: none; }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.cmdk-input svg { width: 18px; height: 18px; color: var(--text-3); }
.cmdk-input input { flex: 1; height: 58px; border: 0; outline: 0; background: transparent; font-size: 16px; }
.cmdk-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 8px; }
.cmdk-group { padding: 10px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; color: var(--text-2); cursor: pointer; }
.cmdk-item .ci { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--bg-2); color: var(--text-2); flex-shrink: 0; }
.cmdk-item .ci svg { width: 15px; height: 15px; }
.cmdk-item .meta { margin-left: auto; font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.cmdk-item[aria-selected="true"] { background: var(--brand-soft); color: var(--text); }
.cmdk-item[aria-selected="true"] .ci { background: var(--brand); color: #fff; }
.cmdk-empty { padding: 32px; text-align: center; color: var(--text-3); font-size: 14px; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); background: var(--surface-2); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 120; transform: translate(-50%, 20px); opacity: 0; display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--shadow-lg); transition: opacity .25s, transform .35s var(--ease-spring); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scroll progress ---------- */
.progress-bar { position: fixed; top: 0; left: 0; right: 0; height: 2.5px; z-index: 60; background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- Prose (docs, blog, legal) ---------- */
.prose { font-size: 16.5px; line-height: 1.78; color: var(--text-2); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.6rem; color: var(--text); margin-top: 2.2em; letter-spacing: -0.03em; scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose h3 { font-size: 1.22rem; color: var(--text); margin-top: 1.9em; scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose h4 { font-size: 1.05rem; color: var(--text); margin-top: 1.6em; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose a { color: var(--brand); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--brand); }
.prose a.anchor { opacity: 0; margin-left: 8px; text-decoration: none; color: var(--text-3); transition: opacity .2s; }
.prose h2:hover a.anchor, .prose h3:hover a.anchor { opacity: 1; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--brand); }
.prose blockquote { margin: 1.6em 0; padding: 14px 20px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 12px 12px 0; color: var(--text); }
.prose :not(pre) > code { font-size: .86em; padding: .15em .45em; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); word-break: break-word; }
.prose pre { position: relative; margin: 1.5em 0; padding: 18px 20px; border-radius: 14px; background: var(--code-bg); color: var(--code-text); font-size: 13.5px; line-height: 1.7; overflow-x: auto; border: 1px solid rgba(255,255,255,.06); }
.code-body pre, .prose pre { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose .tscroll { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--border); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 0; }
.prose th, .prose td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose img { border-radius: 14px; border: 1px solid var(--border); margin: 1.6em 0; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.4em 0; }

/* Docs layout */
.docs-layout { display: grid; grid-template-columns: 240px minmax(0,1fr) 210px; gap: 48px; align-items: start; padding-top: 32px; padding-bottom: 80px; }
.docs-side { position: sticky; top: calc(var(--nav-h) + 24px); max-height: calc(100vh - var(--nav-h) - 48px); overflow-y: auto; padding-right: 8px; }
.docs-side h5 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 22px 0 8px; font-weight: 600; }
.docs-side h5:first-child { margin-top: 0; }
.docs-side a { display: block; padding: 7px 12px; border-radius: 9px; font-size: 14.5px; color: var(--text-2); transition: background .2s, color .2s; }
.docs-side a:hover { background: var(--bg-2); color: var(--text); }
.docs-side a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 550; }
.toc { position: sticky; top: calc(var(--nav-h) + 24px); font-size: 13.5px; }
.toc h5 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 10px; font-weight: 600; }
.toc ul { list-style: none; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-3); transition: color .2s, border-color .2s; }
.toc a.lvl-3 { padding-left: 26px; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--brand); border-left-color: var(--brand); }
.docs-mobile-nav { display: none; }
@media (max-width: 1180px) { .docs-layout { grid-template-columns: 230px minmax(0,1fr); } .toc-col { display: none; } }
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 16px; }
  .docs-side { display: none; }
  .docs-mobile-nav { display: block; }
}
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.pager a { display: block; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); transition: border-color .2s, transform .25s var(--ease), box-shadow .25s; }
.pager a:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.pager .dir { font-size: 12.5px; color: var(--text-3); }
.pager .ttl { font-weight: 600; margin-top: 2px; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: auto; } }

/* ---------- Utilities ---------- */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; } .mt-10 { margin-top: 40px; } .mt-12 { margin-top: 48px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.w-full { width: 100%; }
.relative { position: relative; }
.hide-sm { } @media (max-width: 639px) { .hide-sm { display: none !important; } }
.show-sm { display: none !important; } @media (max-width: 639px) { .show-sm { display: initial !important; } }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr { height: 1px; background: var(--border); border: 0; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal, .reveal-scale, .split-word { opacity: 1 !important; transform: none !important; filter: none !important; }
}

@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }

/* ==========================================================================
   Motion layer — kept deliberately light (transform/opacity only)
   ========================================================================== */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.ring-border { position: relative; isolation: isolate; }
.ring-border::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 3;
  background: conic-gradient(from var(--ang), transparent 0 60%, #5b3df5 74%, #00b8f0 86%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: angSpin 6s linear infinite;
}
@keyframes angSpin { to { --ang: 360deg; } }
.btn-primary .shine { animation: autoShine 5s ease-in-out infinite; }
@keyframes autoShine { 0%, 75% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.reveal { transform: translateY(18px); }
.reveal.in { transform: none; }
@media (prefers-reduced-motion: reduce) { .ring-border::after, .btn-primary .shine { animation: none !important; } }

/* ---------- Site-wide cursor field ----------
   One fixed layer behind every public page: faint dots appear around the cursor and the dots right
   under it light up. Only CSS custom properties change on pointer move; opaque sections simply cover it. */
@property --fx-x { syntax: "<length-percentage>"; inherits: true; initial-value: 50%; }
@property --fx-y { syntax: "<length-percentage>"; inherits: true; initial-value: 20%; }
@property --fx-on { syntax: "<number>"; inherits: true; initial-value: .6; }
.fx-field { position: fixed; inset: 0; z-index: -1; pointer-events: none; contain: strict; --fx-x: 50%; --fx-y: 20%; --fx-on: .6;
  transition: --fx-x .5s cubic-bezier(.2,.8,.2,1), --fx-y .5s cubic-bezier(.2,.8,.2,1), --fx-on .6s; animation: fxDrift 18s ease-in-out infinite alternate; }
.fx-field.on { animation: none; --fx-on: 1; }
@keyframes fxDrift { 0% { --fx-x: 18%; --fx-y: 16%; } 35% { --fx-x: 74%; --fx-y: 30%; } 70% { --fx-x: 40%; --fx-y: 46%; } 100% { --fx-x: 82%; --fx-y: 14%; } }
.fx-field i { position: absolute; inset: 0; display: block; background-size: 24px 24px; background-position: 12px 12px; }
.fx-field .d { background-image: radial-gradient(circle, rgba(11,11,18,.15) 1.1px, transparent 1.6px); opacity: var(--fx-on);
  -webkit-mask-image: radial-gradient(circle 620px at var(--fx-x) var(--fx-y), #000, rgba(0,0,0,.35) 45%, transparent 75%); mask-image: radial-gradient(circle 620px at var(--fx-x) var(--fx-y), #000, rgba(0,0,0,.35) 45%, transparent 75%); }
.fx-field .l { background-image: radial-gradient(circle, var(--brand) 1.9px, transparent 2.5px); opacity: calc(var(--fx-on) * .85);
  -webkit-mask-image: radial-gradient(circle 260px at var(--fx-x) var(--fx-y), #000, rgba(0,0,0,.45) 40%, transparent 72%); mask-image: radial-gradient(circle 260px at var(--fx-x) var(--fx-y), #000, rgba(0,0,0,.45) 40%, transparent 72%); }
.fx-field .g { background: radial-gradient(520px circle at var(--fx-x) var(--fx-y), rgba(91,61,245,.10), rgba(0,184,240,.04) 40%, transparent 65%); opacity: var(--fx-on); }
[data-theme="dark"] .fx-field .d { background-image: radial-gradient(circle, rgba(255,255,255,.10) 1.1px, transparent 1.6px); }
[data-theme="dark"] .fx-field .g { background: radial-gradient(520px circle at var(--fx-x) var(--fx-y), rgba(139,116,255,.16), rgba(56,207,255,.05) 40%, transparent 65%); }
/* Touch screens: a still, quiet field (no continuous repaint on phones). Reduced motion: no drift, cursor still works. */
@media (hover: none) { .fx-field { animation: none; --fx-y: 8%; --fx-on: .5; } }
@media (prefers-reduced-motion: reduce) { .fx-field { animation: none !important; transition-duration: .5s, .5s, .6s !important; } }
@media print { .fx-field { display: none; } }
/* Auth pages: keep the field over the form half (the right half is the dark showcase panel). */
body:has(main.auth) .fx-field { --fx-x: 26%; --fx-y: 34%; animation-name: fxDriftAuth; }
body:has(main.auth) .fx-field.on { animation: none; }
@keyframes fxDriftAuth { 0% { --fx-x: 12%; --fx-y: 22%; } 40% { --fx-x: 40%; --fx-y: 40%; } 75% { --fx-x: 20%; --fx-y: 62%; } 100% { --fx-x: 38%; --fx-y: 18%; } }
@media (max-width: 980px) { body:has(main.auth) .fx-field { --fx-x: 50%; } }
/* Logo strip keeps moving even with "reduce motion" on — slowly, and it pauses on hover. */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation-duration: calc(var(--dur, 40s) * 1.6) !important; animation-iteration-count: infinite !important; }
}
/* Top bar: status pill never wraps; on laptop widths only the dot shows */
.nav-status { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 1320px) { .nav-status .txt { display: none; } .nav-status { padding: 8px; } }
.nav-right { flex-wrap: nowrap; }
.nav-right > * { flex-shrink: 0; }
.nav-dash { gap: 6px; }
.nav-dash svg { transition: transform .2s var(--ease); }
.nav-dash:hover svg { transform: translateX(2px); }

/* ---------- Sideways strips (fm.js initHScroll): fade only where there is more, arrows on desktop ---------- */
.hs { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.hs::-webkit-scrollbar { display: none; }
.hs.hs-drag { cursor: grabbing; user-select: none; scroll-snap-type: none; }
.hs.hs-r:not(.hs-l) { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
.hs.hs-l:not(.hs-r) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); mask-image: linear-gradient(90deg, transparent, #000 44px); }
.hs.hs-l.hs-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
.hs-wrap { position: relative; min-width: 0; }
.hs[data-hscroll="nofade"] { -webkit-mask-image: none !important; mask-image: none !important; }
.hs-btn { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); color: var(--text); cursor: pointer; transition: transform .15s; }
.hs-btn:hover { transform: scale(1.06); }
.hs-btn.l { left: -4px; } .hs-btn.r { right: -4px; }
.hs-btn svg { width: 15px; height: 15px; }
.hs-btn[hidden] { display: none; }

/* ---------- Phone: data tables as stacked cards (fm.js initCards, opt-in with data-cards) ---------- */
@media (max-width: 640px) {
  .dt-wrap:has(> table.cards), .table-wrap:has(> table.cards), .tscroll:has(> table.cards), .lp-tablewrap:has(> table.cards) { overflow: visible; }
  .prose table.cards { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
  table.cards, table.cards tbody { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tbody > tr { position: relative; display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 9px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  table.cards tbody > tr:last-child { border-bottom: 0; }
  table.cards tbody > tr > td { display: block; min-width: 0 !important; max-width: none !important; padding: 0 !important; border: 0 !important; text-align: left !important; white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
  table.cards td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 3px; font: 600 10.5px/1.25 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.cards td.c-t, table.cards td.c-f, table.cards td.c-x, table.cards td[colspan] { grid-column: 1 / -1; }
  table.cards td.c-t { order: -1; font-size: 14px; font-weight: 600; }
  table.cards tr:has(> td.c-e) > td.c-t { padding-right: 110px !important; }
  table.cards td.c-e { position: absolute; top: 13px; right: 16px; }
  table.cards td.c-h { display: none; }
  table.cards td .tag, table.cards td .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* Touch screens: the copy button is always shown, so the code starts below it instead of under it */
@media (hover: none) {
  .code-body:has(> .code-copy) > pre { padding-top: 50px !important; }
  .code-copy { top: 9px; right: 9px; }
}

/* Touch screens: no dot field at all (there is no cursor to light it) — just the soft glow */
@media (hover: none) { .fx-field .d, .fx-field .l { display: none; } }

/* ---------- Phones: comfortable taps, no iOS zoom on focus, code samples that never collide ---------- */
@media (max-width: 640px) {
  input.input, select.input, textarea.input, .input, .select, .tb-select, input[type="search"], input[type="email"], input[type="password"], input[type="text"], textarea, select { font-size: 16px !important; }
  .footer ul { gap: 0; }
  .footer li a { display: inline-block; padding: 7px 0; }
  .code-copy { min-height: 32px; }
}
@media (hover: none) { .hide-touch { display: none !important; } }
