/* ------------------------------------------------------------------
   AVI-OS — Base reset & typography
   ------------------------------------------------------------------ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Typography scale */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
}
h1 { font-size: var(--fs-4xl); font-weight: 700; }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); color: var(--text-muted); letter-spacing: var(--tracking-caps); text-transform: uppercase; }

p    { color: var(--text-soft); line-height: var(--lh-loose); }
small{ font-size: var(--fs-xs); }
strong{ font-weight: 600; color: var(--text); }
code, pre { font-family: var(--font-mono); font-size: var(--fs-sm); }
pre  { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 16px; overflow: auto; }

a { color: var(--text-soft); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--text); }

ul, ol { list-style: none; }

img, svg { display: block; max-width: 100%; }

::selection { background: rgba(255,255,255,.18); color: var(--text); }

/* Focus visible */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Utility classes */
.u-muted   { color: var(--text-muted); }
.u-soft    { color: var(--text-soft); }
.u-faint   { color: var(--text-faint); }
.u-caps    { font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-muted); }
.u-mono    { font-family: var(--font-mono); }
.u-truncate{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-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; }
.u-flex    { display: flex; }
.u-flex-col{ display: flex; flex-direction: column; }
.u-gap-2   { gap: 8px; }
.u-gap-3   { gap: 12px; }
.u-gap-4   { gap: 16px; }
.u-center  { display: flex; align-items: center; justify-content: center; }
.u-between { display: flex; align-items: center; justify-content: space-between; }
.u-w-full  { width: 100%; }
.u-mt-1    { margin-top: 4px; }
.u-mt-2    { margin-top: 8px; }
.u-mt-3    { margin-top: 12px; }
.u-mt-4    { margin-top: 16px; }
.u-mt-6    { margin-top: 24px; }
.u-mb-4    { margin-bottom: 16px; }
.u-mb-6    { margin-bottom: 24px; }
.u-p-4     { padding: 16px; }
.u-rounded { border-radius: var(--r-md); }
.u-glass   {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* Divider */
.sep { height: 1px; background: var(--border); }
.sep--v { width: 1px; background: var(--border); }

/* Page wrapper */
.page { padding: 28px 32px; max-width: var(--content-max); margin: 0 auto; }
@media (max-width: 768px) { .page { padding: 16px; } }

/* Section header */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.section-head h2 { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: var(--tracking-tight); }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px)  { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }
