/* ═══════════════════════════════════════════════════════════════
   RZGAS v3 — Base styles (reset + elements)
   ═══════════════════════════════════════════════════════════════ */

@layer reset {
  /* ─── Minimal reset ─── */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
    padding: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
  }

  body {
    min-height: 100vh;
    line-height: var(--rz-lh-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
    height: auto;
  }

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

  button {
    background: none;
    border: none;
    cursor: pointer;
  }

  ul,
  ol {
    list-style: none;
  }

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

  /* ─── Focus visible (accessibility) ─── */
  :focus {
    outline: none;
  }

  :focus-visible {
    outline: 2px solid var(--rz-primary);
    outline-offset: 2px;
    border-radius: 4px;
  }

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

@layer base {
  /* ─── Body ─── */
  body {
    font-family: var(--rz-font-body);
    font-size: var(--rz-fs-body);
    font-weight: var(--rz-fw-regular);
    line-height: var(--rz-lh-normal);
    color: var(--rz-text-primary);
    background:
      radial-gradient(1200px 600px at 80% -10%, rgba(149, 193, 31, 0.08), transparent 60%),
      radial-gradient(900px 500px at -10% 30%, rgba(88, 128, 192, 0.06), transparent 60%),
      radial-gradient(700px 500px at 50% 110%, rgba(217, 180, 120, 0.10), transparent 60%),
      var(--rz-bg-page);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  /* ─── Headings base (без size — задаётся классами) ─── */
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--rz-font-heading);
    font-weight: var(--rz-fw-medium);
    line-height: var(--rz-lh-snug);
    color: var(--rz-text-primary);
    text-wrap: balance;
  }

  h1 {
    font-size: var(--rz-fs-h1);
    font-weight: var(--rz-fw-bold);
    line-height: var(--rz-lh-tight);
    letter-spacing: var(--rz-ls-tight);
  }

  h2 {
    font-size: var(--rz-fs-h2);
    line-height: var(--rz-lh-snug);
  }

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

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

  /* ─── Paragraphs ─── */
  p {
    line-height: var(--rz-lh-normal);
    text-wrap: pretty;
  }

  /* ─── Links ─── */
  a {
    transition: color var(--rz-transition);
  }

  /* ─── Selection ─── */
  ::selection {
    background: var(--rz-accent);
    color: var(--rz-text-primary);
  }

  /* ─── Scrollbar (Webkit) ─── */
  ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }

  ::-webkit-scrollbar-track {
    background: var(--rz-bg-page);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--rz-border-dark);
    border-radius: var(--rz-radius-pill);
    border: 3px solid var(--rz-bg-page);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--rz-text-muted);
  }

  /* ─── Container utility ─── */
  .container-rz {
    width: 100%;
    max-width: var(--rz-container-max);
    margin-inline: auto;
    padding-inline: var(--rz-container-padding);
  }

  @media (min-width: 640px) {
    .container-rz {
      padding-inline: 1.5rem;
    }
  }

  @media (min-width: 1024px) {
    .container-rz {
      padding-inline: 2rem;
    }
  }

  /* ─── Section paddings ─── */
  .section {
    padding-block: var(--rz-section-y);
  }

  .section-xs {
    padding-block: var(--rz-section-xs-y);
  }

  .section-sm {
    padding-block: var(--rz-section-sm-y);
  }

  .section-lg {
    padding-block: var(--rz-section-lg-y);
  }

  @media (min-width: 1024px) {
    .section    { padding-block: var(--rz-section-y-lg); }
    .section-xs { padding-block: var(--rz-section-xs-y-lg); }
    .section-sm { padding-block: var(--rz-section-sm-y-lg); }
    .section-lg { padding-block: var(--rz-section-lg-y-lg); }
  }

  /* ─── Section backgrounds ─── */
  .section--alt {
    background: transparent;
  }

  .section--dark {
    background: var(--rz-bg-hero);
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
  }

  /* ─── Display utilities ─── */
  .hidden { display: none; }

  @media (min-width: 1024px) {
    .lg\:block { display: block; }
  }
}
