/* base.css — reset, typography, layout primitives. No hex values here. */

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--vs-font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--vs-blue);
  background: var(--vs-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: var(--lh-head);
  letter-spacing: -0.01em;
  font-weight: 700;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 calc(var(--vs-space) * 2); }

a {
  color: var(--vs-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--vs-transition), opacity var(--vs-transition);
}
a:hover { color: var(--vs-blue-light); }

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--vs-red);
  outline-offset: 2px;
}
.on-dark :focus-visible,
.vs-topbar :focus-visible {
  outline: 2px solid var(--vs-white);
}

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

/* ---------- layout ---------- */

.vs-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.vs-wrap {
  width: 100%;
  max-width: var(--vs-maxw);
  margin: 0 auto;
  padding: 0 var(--vs-margin);
}

.vs-main {
  flex: 1 0 auto;
  padding: calc(var(--vs-space) * 4) 0 calc(var(--vs-space) * 8);
}

.vs-section { margin-bottom: calc(var(--vs-space) * 4); }

.vs-stack > * + * { margin-top: calc(var(--vs-space) * 2); }

.vs-row {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--vs-space) * 2);
  align-items: center;
}

.vs-between {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--vs-space) * 2);
  align-items: flex-start;
  justify-content: space-between;
}

.vs-muted { color: var(--vs-blue-70); }
.vs-caption { font-size: var(--fs-caption); }
.vs-nowrap { white-space: nowrap; }
.vs-num { font-variant-numeric: tabular-nums; }
.vs-right { text-align: right; }
.vs-hidden { display: none !important; }

.vs-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- topbar ---------- */

.vs-topbar {
  background: var(--vs-grad);
  color: var(--vs-white);
}
/* Three zones: logo left, nav centred, session right (Grigory, 16.09).
   The side zones share an equal basis so the nav lands on the true centre. */
.vs-topbar .vs-wrap {
  display: flex;
  align-items: center;
  gap: calc(var(--vs-space) * 2);
  min-height: 64px;
}
.vs-topbar-side {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: calc(var(--vs-space) * 2);
  min-width: 0;
}
.vs-topbar-side--right { justify-content: flex-end; }

.vs-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--vs-space);
  font-weight: 700;
  font-size: var(--fs-h3);
  color: var(--vs-white);
  text-decoration: none;
  white-space: nowrap;
}
.vs-brand-logo { height: 28px; width: auto; display: block; }
.vs-brand-sub {
  font-weight: 400;
  font-size: var(--fs-caption);
  color: var(--vs-white-80);
  white-space: nowrap;
}
.vs-nav {
  display: flex;
  gap: calc(var(--vs-space) * 2);
  flex-wrap: wrap;
  justify-content: center;
  flex: 0 0 auto;
}
.vs-nav a {
  color: var(--vs-white);
  text-decoration: none;
  padding: calc(var(--vs-space) * 1) calc(var(--vs-space) * 1.5);
  border-radius: var(--vs-radius);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition: background-color var(--vs-transition);
}
.vs-nav a:hover { background: var(--vs-white-15); color: var(--vs-white); }
.vs-nav a[aria-current="page"] {
  background: var(--vs-white);
  color: var(--vs-blue);
  font-weight: 700;
}

.vs-demo-badge {
  border: 2px solid var(--vs-red);
  background: var(--vs-white);
  color: var(--vs-red);
  font-weight: 700;
  font-size: var(--fs-caption);
  letter-spacing: 0.04em;
  padding: 4px calc(var(--vs-space) * 1.5);
  border-radius: var(--vs-radius);
}

.vs-user {
  display: flex;
  align-items: center;
  gap: var(--vs-space);
  font-size: var(--fs-caption);
  color: var(--vs-white);
}

.vs-footer {
  border-top: 1px solid var(--vs-blue-12);
  padding: calc(var(--vs-space) * 2) 0;
  font-size: var(--fs-caption);
  color: var(--vs-blue-70);
}

@media (max-width: 1024px) {
  .vs-topbar .vs-wrap { flex-wrap: wrap; }
  .vs-nav { order: 3; width: 100%; justify-content: flex-start; }
  .vs-topbar-side { flex: 1 1 auto; }
}

@media (max-width: 768px) {
  :root {
    --vs-margin: 16px;
    --fs-h1: 28px;
    --fs-h2: 22px;
    --fs-h3: 18px;
    --fs-kpi: 26px;
  }
  .vs-topbar .vs-wrap { min-height: 56px; padding-top: var(--vs-space); padding-bottom: var(--vs-space); }
  .vs-brand-sub { display: none; }
}
