/* ============================================================================
   АгроМест — база (reset, типографика, утилиты)
   ============================================================================ */

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

* { margin: 0; }

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

::selection { background: var(--green-200); color: var(--gray-900); }

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

/* ---------- Утилиты типографики ---------- */
.t-display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.t-h1 { font-size: var(--text-4xl); line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; }
.t-h2 { font-size: var(--text-3xl); line-height: var(--leading-tight); }
.t-h3 { font-size: var(--text-2xl); line-height: var(--leading-snug); }
.t-h4 { font-size: var(--text-xl); line-height: var(--leading-snug); }
.t-body-lg { font-size: var(--text-lg); line-height: var(--leading-base); }
.t-body { font-size: var(--text-base); }
.t-body-sm { font-size: var(--text-sm); }
.t-caption { font-size: var(--text-xs); line-height: var(--leading-snug); }
.t-muted { color: var(--text-secondary); }
.t-tertiary { color: var(--text-tertiary); }
.t-brand { color: var(--brand-strong); }
.t-semibold { font-weight: var(--weight-semibold); }
.t-medium { font-weight: var(--weight-medium); }
.t-uppercase { text-transform: uppercase; letter-spacing: 0.06em; }

@media (max-width: 767px) {
  .t-h1 { font-size: 30px; }
  .t-h2 { font-size: 24px; }
  .t-h3 { font-size: 22px; }
  .t-h4 { font-size: 18px; }
}

/* ---------- Утилиты компоновки ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.align-start { align-items: flex-start; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-5 { gap: var(--sp-5); } .gap-6 { gap: var(--sp-6); }
.gap-7 { gap: var(--sp-7); }

.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); } .mt-7 { margin-top: var(--sp-7); }
.mt-8 { margin-top: var(--sp-8); }

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

.divider { border-top: 1px solid var(--border); }

/* ---------- Иконки (единый стиль: штрих 1.6, скруглённые концы) ---------- */
.icon {
  width: 20px; height: 20px; flex: none;
  stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  fill: none;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ---------- Плавное появление (уважает prefers-reduced-motion) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .reveal > * { animation: rise .45s cubic-bezier(.2,.7,.3,1) both; }
  .reveal > *:nth-child(2) { animation-delay: .04s; }
  .reveal > *:nth-child(3) { animation-delay: .08s; }
  .reveal > *:nth-child(4) { animation-delay: .12s; }
  .reveal > *:nth-child(5) { animation-delay: .16s; }
  .reveal > *:nth-child(6) { animation-delay: .20s; }
  .reveal > *:nth-child(n+7) { animation-delay: .24s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}
