/* ==========================================================================
   ASTROLABE — base: reset, типографика, ночной фон, доступность
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-text);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 78% -12%, rgba(124, 134, 217, 0.14), transparent 62%),
    radial-gradient(820px 520px at 8% 4%, rgba(201, 161, 90, 0.1), transparent 58%),
    radial-gradient(700px 700px at 50% 120%, rgba(21, 29, 51, 0.7), transparent 70%);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(1000px 560px at 80% -10%, rgba(124, 134, 217, 0.12), transparent 60%),
    radial-gradient(760px 480px at 6% 2%, rgba(201, 161, 90, 0.16), transparent 56%);
}

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

a {
  color: var(--accent-text-strong);
  text-decoration: none;
  text-underline-offset: 0.18em;
  transition: color var(--transition-fast);
}

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

p {
  margin: 0 0 var(--space-4);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: 0.01em;
  color: var(--text-strong);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-52);
}

h2 {
  font-size: var(--fs-36);
}

h3 {
  font-size: var(--fs-28);
}

h4 {
  font-size: var(--fs-22);
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.35em;
}

li+li {
  margin-top: var(--space-2);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-6) 0;
}

code,
kbd,
samp,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code {
  padding: 0.12em 0.36em;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: rgba(10, 14, 26, 0.45);
}

blockquote {
  margin: var(--space-5) 0;
  padding: var(--space-2) var(--space-5);
  border-left: 2px solid var(--gold-500);
  color: var(--text-muted);
  font-style: italic;
}

::selection {
  background: rgba(201, 161, 90, 0.32);
  color: var(--text-strong);
}

/* Доступный фокус */
:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: var(--radius-xs);
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--gold-500);
  color: var(--on-gold);
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  text-decoration: none;
}

/* Сетка-контейнер */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

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

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

.center {
  text-align: center;
}

.lead {
  font-size: var(--fs-18);
  line-height: var(--lh-loose);
  color: var(--text-muted);
}

.eyebrow {
  display: inline-block;
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-text-strong);
}

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

.text-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.gold {
  color: var(--accent-text);
}

.link-quiet {
  color: var(--text-muted);
}

/* Основные области */
.site-main {
  position: relative;
  z-index: 1;
  min-height: 60vh;
  padding-block: var(--space-7) var(--space-9);
}

.site-main--flush {
  padding-block: 0 var(--space-9);
}

.section {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.section--tight {
  padding-block: clamp(2rem, 4vw, 3.5rem);
}

.section-head {
  max-width: 62ch;
  margin-bottom: var(--space-6);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

/* Звёздное поле */
.starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.page-enter {
  animation: rise-in 280ms ease both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stagger>* {
  animation: rise-in 300ms ease both;
}

.stagger>*:nth-child(1) {
  animation-delay: 0ms;
}

.stagger>*:nth-child(2) {
  animation-delay: 40ms;
}

.stagger>*:nth-child(3) {
  animation-delay: 80ms;
}

.stagger>*:nth-child(4) {
  animation-delay: 120ms;
}

.stagger>*:nth-child(5) {
  animation-delay: 160ms;
}

.stagger>*:nth-child(6) {
  animation-delay: 200ms;
}

.stagger>*:nth-child(7) {
  animation-delay: 240ms;
}

.stagger>*:nth-child(8) {
  animation-delay: 280ms;
}

@media print {
  body {
    background: #fff;
    color: #000;
    background-image: none;
  }
  .site-header,
  .site-footer,
  .starfield,
  .no-print,
  .flash-stack,
  .skip-link {
    display: none !important;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
  a[href^="/"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #444;
  }
  .site-main {
    padding-block: 0;
  }
  .prose {
    max-width: none;
  }
  h1,
  h2,
  h3,
  h4 {
    break-after: avoid;
  }
  img,
  table,
  .card,
  .price-card,
  .report-part {
    break-inside: avoid;
  }
  .card,
  .price-card,
  .faq-item,
  .system-price {
    box-shadow: none;
    border-color: #999;
  }
}
