/* ============================================================
   ГАВАНЬ — base.css
   Сброс, дизайн-токены, типографика, утилиты
   ============================================================ */

/* ---------- 1. Токены ---------- */
:root {
  /* Палитра — светлая тема */
  --bg:            #FAFAF7;
  --bg-alt:        #F1F2EE;
  --surface:       #FFFFFF;
  --surface-2:     #F7F8F5;
  --surface-3:     #EDEFE9;

  --text:          #14181B;
  --text-2:        #4C555D;
  --text-3:        #7B858E;

  --border:        #E2E5DF;
  --border-2:      #CFD4CC;

  --accent:        #0E5245;
  --accent-hover:  #0A3E34;
  --accent-soft:   #E6EFEB;
  --accent-line:   #BCD3CB;
  --on-accent:     #FFFFFF;

  --danger:        #A33A24;
  --danger-soft:   #FBEDE9;
  --warn:          #855200;
  --warn-soft:     #FBF1DD;
  --ok:            #1E6B4A;
  --ok-soft:       #E6F1EA;

  --dark:          #101B18;

  /* Скругления */
  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  /* Тени */
  --sh-xs: 0 1px 2px rgba(16, 27, 24, .05);
  --sh-sm: 0 1px 3px rgba(16, 27, 24, .07), 0 1px 2px rgba(16, 27, 24, .04);
  --sh-md: 0 4px 14px rgba(16, 27, 24, .08), 0 1px 3px rgba(16, 27, 24, .05);
  --sh-lg: 0 16px 40px rgba(16, 27, 24, .13), 0 4px 10px rgba(16, 27, 24, .06);
  --sh-focus: 0 0 0 3px var(--accent-line);

  /* Раскладка */
  --container: 1220px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;

  /* Плавность */
  --t-fast: .14s cubic-bezier(.4, 0, .2, 1);
  --t: .22s cubic-bezier(.4, 0, .2, 1);

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-num: "SF Mono", "Segoe UI Mono", "Roboto Mono", ui-monospace, monospace;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:            #0E1113;
  --bg-alt:        #14181A;
  --surface:       #171B1E;
  --surface-2:     #1D2225;
  --surface-3:     #252B2F;

  --text:          #E7EAE6;
  --text-2:        #A6AFAB;
  --text-3:        #7E8884;

  --border:        #272D31;
  --border-2:      #353C41;

  --accent:        #4FA893;
  --accent-hover:  #63BCA6;
  --accent-soft:   #16302B;
  --accent-line:   #2C5D53;
  --on-accent:     #08201C;

  --danger:        #E08268;
  --danger-soft:   #2E1B16;
  --warn:          #D8A657;
  --warn-soft:     #2C2415;
  --ok:            #6BBF95;
  --ok-soft:       #14291F;

  --dark:          #0A0D0E;

  --sh-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --sh-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --sh-md: 0 4px 16px rgba(0, 0, 0, .45);
  --sh-lg: 0 18px 44px rgba(0, 0, 0, .6);

  color-scheme: dark;
}

/* ---------- 2. Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: "kern" 1, "liga" 1, "tnum" 0;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.021em;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: clamp(30px, 5.2vw, 50px); letter-spacing: -.03em; }
h2 { font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.026em; }
h3 { font-size: clamp(17px, 2vw, 20px); }
h4 { font-size: 15px; }

p  { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--accent-hover); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; background: none; border: none; padding: 0; }

fieldset { margin: 0; padding: 0; border: none; }
legend { padding: 0; }

::selection { background: var(--accent); color: var(--on-accent); }

/* Фокус — только для клавиатуры */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Скроллбар */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: var(--r-full);
  border: 3px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ---------- 3. Иконки ---------- */
.ic {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic--sm { width: 17px; height: 17px; stroke-width: 1.8; }
.ic--xs { width: 14px; height: 14px; stroke-width: 2; }
.ic--lg { width: 24px; height: 24px; }
.ic--xl { width: 40px; height: 40px; stroke-width: 1.3; }

/* ---------- 4. Раскладка ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(56px, 8vw, 96px); }
.section--alt { background: var(--bg-alt); }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(20px, 4vw, 56px);
  margin-bottom: clamp(28px, 4vw, 44px);
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.section__desc {
  max-width: 46ch;
  color: var(--text-2);
  font-size: 15px;
}

.page-head {
  padding-block: clamp(26px, 4vw, 46px) clamp(22px, 3vw, 34px);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.page-head h1 { font-size: clamp(26px, 4vw, 40px); margin-bottom: 10px; }
.page-head p { color: var(--text-2); max-width: 62ch; font-size: 15px; }

/* ---------- 5. Типографские утилиты ---------- */
.eyebrow {
  display: inline-flex;
  align-items: flex-start; /* при переносе на две строки точка держится у первой */
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.eyebrow .dot {
  flex: none;
  width: 6px; height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-3);
}
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span[aria-current] { color: var(--text); }

.lead {
  font-size: clamp(16px, 1.6vw, 18px);
  color: var(--text-2);
  max-width: 56ch;
  line-height: 1.62;
}

.hint {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.5;
}

.note {
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-top: 14px;
}

.error {
  font-size: 12.5px;
  color: var(--danger);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.req { color: var(--danger); }

.num { font-variant-numeric: tabular-nums; }

.linklike {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font: inherit;
}
.linklike:hover { color: var(--accent-hover); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
}
.link-arrow .ic { transition: transform var(--t); }
.link-arrow:hover .ic { transform: translateX(3px); }

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-size: 14px;
  transition: top var(--t);
}
.skip-link:focus { top: 12px; color: var(--on-accent); }

/* ---------- 6. Служебное ---------- */
[hidden] { display: none !important; }

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

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