/* ============================================================
   _base.css — фундамент публичной части сайта.

   Содержит: @font-face (Inter + PT Serif), CSS-переменные палитры,
   reset, базовую типографику (.label, .gradient-text, .underline-accent),
   все варианты .btn, scroll-reveal анимации ([data-a]/[data-stagger]),
   scroll-progress-индикатор.

   Подключается ПЕРВЫМ в base.html — остальные компонентные файлы
   опираются на --bg/--dark/--accent-1/--accent-2 и .btn.
   ============================================================ */

/* ── Inter — 6 весов ─────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/static/fonts/inter/inter-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/inter/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/inter/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/inter/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/inter/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/static/fonts/inter/inter-800.woff2') format('woff2');
}

/* ── PT Serif — заголовочный шрифт ──────────────────────── */
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/ptserif/ptserif-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/ptserif/ptserif-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/ptserif/ptserif-700-normal.woff2') format('woff2');
}

:root {
  --font-serif: 'PT Serif', Georgia, 'Times New Roman', serif;
}

/* ── Reset + scroll progress ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

#scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 10000;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 0.08s linear;
  pointer-events: none;
}

:root {
  --bg:        #F4EFE6;
  --bg-alt:    #E0D5BE;
  --dark:      #1C120A;
  --dark-2:    #2A1C10;
  --border:    #D4C9B0;
  --border-dk: rgba(255,255,255,0.08);
  --text:      #1C120A;
  --muted:     #6B5540;
  --faint:     #6B5540;
  --accent-1:  #8B1A2C;
  --accent-2:  #C27D2A;
  --white:     #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
}

html { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); scroll-behavior: smooth; scroll-padding-top: 80px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Убираем браузерные подсветки при тапе/клике (синий tap-highlight на iOS/Android
   + дефолтный синий focus-outline у <button>). Кастомные focus-стили для
   клавиатурной навигации сохраняем через :focus-visible. */
a, button {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Типографика helpers ─────────────────────────────────── */
.label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint);
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.underline-accent {
  position: relative; display: inline-block;
}
.underline-accent::after {
  content: ''; position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  background-size: 200% 100%;
  animation: shimmerGrad 4s linear infinite;
}
@keyframes shimmerGrad {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── Кнопки ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
  transition: all 0.2s; cursor: pointer; border: none;
  text-decoration: none;
}
.btn-dark {
  background: var(--dark); color: var(--white);
  box-shadow: 0 2px 12px rgba(28,18,10,0.15);
  position: relative; overflow: hidden;
}
.btn-dark::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(139,26,44,0.18), rgba(194,125,42,0.18));
  opacity: 0; transition: opacity 0.3s;
}
.btn-dark:hover {
  background: var(--dark-2); transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(28,18,10,0.22);
}
.btn-dark:hover::after { opacity: 1; }

.btn-ghost {
  background: transparent; color: var(--text);
  padding: 12px 22px;
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  color: var(--accent-1);
  border-color: var(--accent-1);
  background: rgba(139,26,44,0.04);
  transform: translateY(-1px);
}

/* Главная CTA — карминовый pill, основное действие на сайте */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 26px;
  background: linear-gradient(135deg, var(--accent-1) 0%, #6e1422 100%);
  color: #fff !important;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(139,26,44,0.32),
              inset 0 1px 0 rgba(255,255,255,0.10);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s,
              background 0.3s;
}
.btn-primary em {
  font-style: normal;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-block;
}
.btn-primary:hover {
  color: #fff !important;
  background: linear-gradient(135deg, #a31f35 0%, var(--accent-1) 100%);
  box-shadow: 0 8px 28px rgba(139,26,44,0.45),
              0 0 0 1px rgba(194,125,42,0.4) inset,
              inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.btn-primary:hover em { transform: translateX(4px); }
.btn-primary:active { transform: translateY(0); }

.btn.magnetic,
[data-magnetic] {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s, color 0.2s, background 0.2s;
  will-change: transform;
}

.trial-btn-wrap {
  position: relative;
  display: inline-flex;
}
.trial-badge {
  /* Бейдж сверху по центру кнопки — не торчит сбоку, не наезжает на соседнюю */
  position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  background: var(--accent-2); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 12px; border-radius: 99px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(194,125,42,0.35);
}

/* Якорные переходы — учитывают фиксированный nav (68px + 20px воздуха) */
[id] { scroll-margin-top: 88px; }

/* ── Scroll reveal (data-a / data-stagger) ───────────────── */
[data-a] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Hero виден сразу — анимация задержки 1-2 сек создаёт ощущение «не догрузилось».
   Для элементов внутри hero отключаем стартовое opacity:0 / translate. */
.page-hero [data-a],
.hero-wrap [data-a],
.page-hero [data-stagger],
.hero-wrap [data-stagger],
.page-hero [data-stagger] > *,
.hero-wrap [data-stagger] > * {
  opacity: 1;
  transform: none;
}
[data-a].visible {
  opacity: 1;
  transform: translateY(0);
}
[data-a="left"] { transform: translateX(-28px); }
[data-a="left"].visible { transform: translateX(0); }
[data-a="right"] { transform: translateX(28px); }
[data-a="right"].visible { transform: translateX(0); }

[data-stagger] > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-stagger].visible > * { opacity: 1; transform: none; }
[data-stagger].visible > *:nth-child(1) { transition-delay: 0.00s; }
[data-stagger].visible > *:nth-child(2) { transition-delay: 0.08s; }
[data-stagger].visible > *:nth-child(3) { transition-delay: 0.16s; }
[data-stagger].visible > *:nth-child(4) { transition-delay: 0.24s; }
[data-stagger].visible > *:nth-child(5) { transition-delay: 0.32s; }
[data-stagger].visible > *:nth-child(6) { transition-delay: 0.40s; }
[data-stagger].visible > *:nth-child(7) { transition-delay: 0.48s; }
[data-stagger].visible > *:nth-child(8) { transition-delay: 0.56s; }
