/* ==========================================================================
   AVENLEO — BASE
   Reset plus the root element. Depends on tokens.css.

   The page has no background artwork. There used to be a fixed three-point
   radial mesh behind every screen; it painted a full-viewport gradient layer on
   every scroll and repaint, and it is the single most recognisable "AI product"
   flourish there is. A financial interface's background is a colour.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-snug);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `cv01` gives Inter the single-storey figures that read cleanly at small
     sizes; `tnum` keeps every number in the interface on a common width, so a
     balance that ticks up does not nudge the text beside it. */
  font-feature-settings: "cv01" 1, "cv11" 1;
  min-height: 100dvh;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
svg { fill: none; }

input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: none; cursor: pointer; }
:disabled { cursor: not-allowed; }

a {
  color: var(--color-primary-fg);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-primary-hover); }

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* ---- Headings -----------------------------------------------------------
   One family, separated by weight and tracking. The scale is compact on
   purpose: these sit above dense screens, not above a landing page. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}
h1 { font-size: var(--text-3xl); letter-spacing: var(--tracking-tighter); }
h2 { font-size: var(--text-2xl); letter-spacing: var(--tracking-tighter); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); font-weight: var(--weight-medium); }

code, pre, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }

hr { border: none; height: 1px; background: var(--color-border); }

::selection { background: var(--color-primary-soft-hover); color: var(--color-text); }

/* ---- Focus — visible for keyboard users only --------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ---- Scrollbars — present, not decorative ------------------------------ */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--color-text-faint); background-clip: padding-box; }

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

/* ---- Visually hidden but accessible ------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -60px; left: var(--space-4);
  z-index: var(--z-max);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); color: var(--color-primary-contrast); }

/* The `hidden` attribute has to win.
   Its default (`display: none`) comes from the user-agent stylesheet, so any
   component rule that sets a display — `.alert { display: flex }` is the one
   that caught us — silently outranks it and the element renders as an empty
   box. Every `hidden` in this app is a real "not now", so it gets the
   importance to say so. */
[hidden] { display: none !important; }
