/* ==========================================================================
   Agora — Base / reset / primitives
   ========================================================================== */

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

/* Ensure the hidden attribute always wins over component display rules */
[hidden] {
  display: none !important;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* static design — no smooth scroll */
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Language visibility helper: JS also swaps text nodes, but this guards the
   no-JS / flash case for blocks that ship both languages inline. */
html[data-lang="en"] [data-lang-only="ru"],
html[data-lang="ru"] [data-lang-only="en"] {
  display: none !important;
}

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

/* Default icon sizing (components override as needed) */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: middle;
  display: inline-block;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  color: var(--text);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { line-height: var(--lh-normal); }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

ul,
ol { padding-left: var(--sp-5); }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Consistent, visible keyboard focus everywhere */
:focus-visible {
  outline: var(--focus-ring-w) solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* Reduce motion / honor no-animation intent globally */
* {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition: none !important;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

.container--narrow { max-width: var(--container-narrow); }

.page {
  flex: 1 0 auto;
  padding-block: var(--sp-7);
}

.section { margin-bottom: var(--sp-7); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.grid { display: grid; gap: var(--sp-5); }

/* Utility */
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-center { text-align: center; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--accent);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.divider {
  height: var(--border-w);
  background: var(--border);
  border: 0;
  margin-block: var(--sp-5);
}

.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: -60px;
  background: var(--primary);
  color: var(--text-on-brand);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  z-index: 200;
}
.skip-link:focus { top: var(--sp-3); }
