:root {
  /* Colors */
  --color-bg: #ffffff;
  --color-text: #171717;
  --color-text-secondary: #5c5c5c;
  --color-link: #2c64e3;
  --color-soft: #f3f3f3;
  --color-border: #f2f2f2;
  --color-dark-btn: #171717;
  --color-white: #ffffff;

  /* Radii */
  --radius-card: 24px;
  --radius-btn: 14px;
  --radius-chip: 12px;
  --radius-logo: 37px;

  /* Typography */
  --font-main: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-logo: 'Onest', sans-serif;

  --fs-hero-title: 32px;
  --fs-case-title: 40px;
  --fs-card-title: 20px;
  --fs-body: 18px;
  --fs-meta: 16px;
  --fs-small: 12px;

  /* Layout */
  --container-width: 822px; /* 774px контента из макета + 24px паддинг с каждой стороны */
  --page-padding: 24px;
  --gap-section: 80px;
}

html {
  scrollbar-gutter: stable;
  overflow-y: scroll;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-weight: 400;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding-left: var(--page-padding);
  padding-right: var(--page-padding);
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.container.is-loaded {
  opacity: 1;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--fs-body);
  font-weight: 500;
  border-radius: var(--radius-btn);
  padding: 11px 16px 10px;
  white-space: nowrap;
}

.btn-dark {
  background: var(--color-dark-btn);
  color: var(--color-white);
  padding-right: 20px;
}

.btn-soft {
  background: var(--color-soft);
  color: var(--color-text);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Logo */
.logo {
  width: 96px;
  height: 96px;
  display: block;
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 108px 0 48px;
  margin-top: auto;
  width: 100%;
}

/* Loading / error states */
.state-message {
  padding: 48px var(--page-padding);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--fs-body);
}

/* ---- Плавная замена контента при переключении вкладок ---- */
#page-content {
  transition: opacity 0.18s ease;
}

#page-content.is-leaving,
#page-content.is-entering {
  opacity: 0;
}

/* ---- Лоадер ---- */
.loader-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 420px;
}

.loader-wrap--compact {
  min-height: 160px;
}

.loader {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-text);
  animation: loader-spin 0.7s linear infinite;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

#page-content {
  width: 100%;
}

/* ---- Оверлей-лоадер при переходе между страницами ---- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  opacity: 1;
  transition: opacity 0.18s ease;
}

.container.is-loaded ~ .page-loader {
  opacity: 0;
  pointer-events: none;
}