/* Reset, typography, icons, motion primitives */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--vm-font);
  font-size: 14px;
  line-height: normal;
  color: var(--vm-text-primary);
  background: var(--vm-surface-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(46, 91, 255, 0.18); }

:focus-visible { outline: 2px solid var(--vm-accent-primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- Scrollbars ----------
   Thin rounded thumb on a clear track, no arrow buttons; darker while the area is hovered or dragged.
   Chromium/Safari use the ::-webkit pseudos (standard scrollbar-* properties would switch them off, so they
   are only set where the pseudos don't exist, i.e. Firefox). */
::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb { min-height: 40px; border: 4px solid transparent; border-radius: 12px; background: rgba(26, 25, 23, 0.14) padding-box; }
:hover::-webkit-scrollbar-thumb { background-color: rgba(26, 25, 23, 0.22); }
::-webkit-scrollbar-thumb:hover { border-width: 3px; background-color: rgba(26, 25, 23, 0.34); }
::-webkit-scrollbar-thumb:active { border-width: 3px; background-color: rgba(26, 25, 23, 0.46); }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: rgba(26, 25, 23, 0.2) transparent; }
}

/* ---------- Typography (Figma text styles) ---------- */
.t-h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.52px; }        /* Heading/26 */
.t-h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }         /* Heading/20 */
.t-h3 { font-size: 16px; font-weight: 600; }                                 /* Heading/16 */
.t-body { font-size: 14px; font-weight: 400; }                               /* Body/14 Regular */
.t-body-m { font-size: 14px; font-weight: 500; }                             /* Body/14 Medium */
.t-para { font-size: 14px; font-weight: 400; line-height: 1.5; }             /* Body/14 Paragraph */
.t-cap { font-size: 12px; font-weight: 400; }                                /* Caption/12 Regular */
.t-cap-m { font-size: 12px; font-weight: 500; }                              /* Caption/12 Medium */
.c-primary { color: var(--vm-text-primary); }
.c-secondary { color: var(--vm-text-secondary); }
.c-tertiary { color: var(--vm-text-tertiary); }
.c-positive { color: var(--vm-text-positive); }
.c-info { color: var(--vm-text-info); }
.c-warning { color: var(--vm-text-warning); }
.c-danger { color: var(--vm-text-danger); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Icons ----------
   Figma SVGs are used as CSS masks so they inherit currentColor and can animate.
   <span class="ic" style="--ic:url(/assets/icons/home.svg)"></span>
   Size defaults to 18px; override with --s (e.g. style="--s:20px"). */
.ic {
  display: inline-block;
  flex-shrink: 0;
  width: var(--s, 18px);
  height: var(--s, 18px);
  background-color: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat;
  mask: var(--ic) center / contain no-repeat;
  /* color too: the mask paints with currentColor, which only animates if color itself transitions */
  transition: transform 420ms var(--ease-out), background-color var(--dur-2) ease, color var(--dur-2) ease;
}
/* Multi-colour or raster icons keep their own colours */
.ic-img { display: block; flex-shrink: 0; width: var(--s, 18px); height: var(--s, 18px); }

/* ---------- Motion ---------- */
@keyframes vm-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes vm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vm-pop { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes vm-pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 157, 108, 0.45); } 70% { box-shadow: 0 0 0 6px rgba(31, 157, 108, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 157, 108, 0); } }
@keyframes vm-spin { to { transform: rotate(360deg); } }
@keyframes vm-shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

/* Staggered entrance: put data-reveal on a container — its direct children rise in.
   app.js assigns --i per child. */
[data-reveal] > * { animation: vm-rise var(--dur-4) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 40ms); }
.no-reveal [data-reveal] > * { animation: none; }

/* Cross-document page transitions (Chrome/Edge 126+, Safari 18.2+).
   The shell stays put; only the canvas content swaps. */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 260ms; animation-timing-function: var(--ease-out); }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(canvas) { animation: vm-vt-out 160ms ease both; }
::view-transition-new(canvas) { animation: vm-fade 220ms ease both; }
::view-transition-group(canvas) { animation: none; }
@keyframes vm-vt-out { to { opacity: 0; } }
/* Leaving-page fallback for browsers without cross-document view transitions */
.is-leaving .canvas-scroll, .is-leaving .auth-main { opacity: 0; transition: opacity 140ms ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
