/* Imported from the khabot-new-design demo (read-only source). These files are ADDITIVE:
   the legacy assets/ui.css + assets/website.css stay untouched because the admin board and
   apps/ still load them. Never merge the two systems on one page. */
/* ==========================================================================
   Base — reset, typography, layout primitives, utilities. Loaded by every page.
   ========================================================================== */
@import url('/assets/fonts/fonts.css');

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03", "calt", "tnum";
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
code, pre, kbd, samp { font-family: var(--mono); font-size: .92em; }
pre { margin: 0; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.15; letter-spacing: var(--track-tight); font-weight: 600; }
h1 { font-size: clamp(34px, 4.6vw, 56px); }
h2 { font-size: clamp(28px, 3.6vw, 42px); }
h3 { font-size: 20px; letter-spacing: -.018em; }
h4 { font-size: 16px; letter-spacing: -.012em; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* Scrollbars — thin and theme-aware */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* ---- Type helpers ---- */
.display { font-size: clamp(42px, 6.2vw, 78px); line-height: .98; letter-spacing: -.045em; font-weight: 640; }
.display .serif, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.lead { font-size: clamp(16px, 1.4vw, 19px); line-height: 1.6; color: var(--text-2); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 640; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--cyan-400)); }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }
.small { font-size: var(--fs-sm); } .xs { font-size: var(--fs-xs); }
.mono { font-family: var(--mono); } .num { font-variant-numeric: tabular-nums; }
.tight { letter-spacing: var(--track-tight); }
.strong { font-weight: 600; color: var(--text); }
.center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gradient-text { background: linear-gradient(92deg, var(--accent), var(--cyan-400)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.container-wide { max-width: var(--maxw-wide); }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 28px; }
.grid { display: grid; gap: 16px; }
.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)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.section { padding: clamp(64px, 8vw, 112px) 0; }
.section-tight { padding: clamp(40px, 5vw, 64px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { margin: 12px 0 14px; }
.section-head p { color: var(--text-2); font-size: 16.5px; line-height: 1.6; }
.section-head.split { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); gap: 32px; align-items: end; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* ---- Brand mark (theme-aware PNG pair; SVG fallback in shared/icons.js) ---- */
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 680; font-size: 16px; letter-spacing: -.025em; text-decoration: none !important; }
.brand-mark { height: 26px; width: auto; }
.brand-mark--dark { display: none; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .brand-mark--light { display: none; } html:not([data-theme="light"]) .brand-mark--dark { display: block; } }
html[data-theme="dark"] .brand-mark--light, .theme-dark .brand-mark--light { display: none; }
html[data-theme="dark"] .brand-mark--dark, .theme-dark .brand-mark--dark { display: block; }
html[data-theme="light"] .brand-mark--light { display: block; }
html[data-theme="light"] .brand-mark--dark { display: none; }

/* ---- Motion ---- */
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes flow { to { stroke-dashoffset: -40; } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* Reveal-on-scroll arms itself only once the script is alive (html.reveal-ready).
   Without JS — or if a module fails to load — the content is simply visible instead
   of a page of invisible sections. */
.reveal-ready .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal-ready .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head.split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .display { font-size: clamp(38px, 12vw, 56px); }
}
