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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: var(--leading);
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
  transition:
    background-color var(--dur-theme) var(--ease-out),
    color var(--dur-theme) var(--ease-out);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
}

h1 {
  font-size: var(--text-h1);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

h2 {
  font-size: var(--text-l);
}

h3 {
  font-size: var(--text-m);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--text-2);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

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

/* Деньги и даты — табличными цифрами: столбец сумм читается по разрядам. */
.num,
.money,
time {
  font-variant-numeric: tabular-nums;
}

.muted,
.faint {
  color: var(--text-2);
}

.small {
  font-size: var(--text-s);
}

.nowrap {
  white-space: nowrap;
}

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

.stack {
  display: grid;
  gap: var(--space-3);
}

.spacer {
  flex: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  70% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
