/* ============================================================
   PROTOCOL — премиум-эстетика
   HTML / CSS / vanilla JS · без фреймворков
   ============================================================ */

:root {
  --bg:         #050505;
  --bg-alt:     #0C0C0C;
  --bg-deep:    #030303;
  --surface:    #0A0A0A;

  --red:        #C41E1E;
  --red-dark:   #8B0000;

  --text:       #F0EBE3; /* тёплый белый */
  --text-dim:   #8A8078;

  --line:       rgba(255, 255, 255, 0.08);
  --line-soft:  rgba(255, 255, 255, 0.06);
  --line-faint: rgba(255, 255, 255, 0.10);

  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --dur:        300ms;
  --maxw:       1160px;

  --font-head:  "Manrope", sans-serif;
  --font-body:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, monospace;
}

/* ---------- reset / base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}
.container-narrow { max-width: 780px; }

/* ============================================================
   ЗАГРУЗОЧНАЯ ЗАСТАВКА
   ============================================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 500ms var(--ease), visibility 500ms var(--ease);
}
.preloader.hide {
  opacity: 0;
  visibility: hidden;
}
.preloader-logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(20px, 4vw, 30px);
  letter-spacing: 0.5em;
  padding-left: 0.5em; /* компенсация трекинга справа */
  color: var(--text);
  animation: pulseLogo 800ms var(--ease);
}
@keyframes pulseLogo {
  0%   { opacity: 0; letter-spacing: 0.9em; }
  60%  { opacity: 1; }
  100% { opacity: 1; letter-spacing: 0.5em; }
}

/* ============================================================
   КАСТОМНЫЙ КУРСОР
   ============================================================ */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--red);
  border-radius: 50%;
  pointer-events: none;
  z-index: 300;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 180ms var(--ease), background var(--dur) var(--ease), opacity var(--dur) var(--ease);
  opacity: 0;
  mix-blend-mode: screen;
}
.cursor-dot.active { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cursor-dot.grow {
  transform: translate(-50%, -50%) scale(1.7);
  background: rgba(196, 30, 30, 0.15);
}
/* показываем только там, где есть точный указатель */
@media (hover: none), (pointer: coarse) {
  .cursor-dot { display: none; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.28em;
  font-size: 17px;
  padding-left: 0.28em;
}
.nav {
  display: flex;
  gap: 40px;
  font-size: 15px;
  color: var(--text-dim);
}
.nav a { position: relative; transition: color var(--dur) var(--ease); }
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1px;
  background: var(--red);
  transition: width var(--dur) var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { width: 100%; }

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
  line-height: 1.2;
  isolation: isolate;
}
.btn-primary {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: var(--text);
  box-shadow: 0 10px 40px -14px rgba(196, 30, 30, 0.75);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 50px -14px rgba(196, 30, 30, 0.9);
}
.btn-primary:active { transform: translateY(0); }

/* light-sweep */
.btn-primary::before {
  content: "";
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  z-index: -1;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 600ms var(--ease);
}
.btn-primary:hover::before { left: 130%; }

.btn-lg { padding: 18px 36px; font-size: 16px; letter-spacing: 0.01em; }
.btn-block { width: 100%; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg);
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-img {
  position: absolute;
  top: 0; right: 0;
  width: 62%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* затемнение слева-направо + красноватый низ */
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 30%, rgba(5,5,5,0.5) 60%, rgba(5,5,5,0.15) 100%),
    linear-gradient(0deg, rgba(139,0,0,0.22), transparent 45%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 120px 32px;
}
.hero-logo {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
  color: var(--red);
  margin-bottom: 28px;
}
.hero-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(46px, 8vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 26px;
  max-width: 14ch;
}
.hero-subtitle {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-dim);
  max-width: 44ch;
  margin: 0 0 42px;
}
.hero-note {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--text-dim);
}

/* ============================================================
   СЕКЦИИ
   ============================================================ */
.section { padding: 120px 0; }
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 64px;
}

/* ============================================================
   FEATURES 2x3
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft); /* тонкие разделители между карточками */
  border: 1px solid var(--line);
}
.feature-card {
  background: var(--bg);
  padding: 40px 34px;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.feature-card:hover {
  background: var(--surface);
  transform: translateY(-6px);
  box-shadow: 0 24px 50px -30px rgba(196,30,30,0.55), inset 0 0 0 1px var(--red);
  position: relative;
  z-index: 1;
}
.feature-icon {
  display: inline-flex;
  color: var(--red);
  margin-bottom: 24px;
}
.feature-icon svg { width: 32px; height: 32px; }
.feature-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  margin: 0 0 10px;
  color: var(--text);
}
.feature-desc {
  margin: 0;
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============================================================
   ТАРИФ — сетка из четырёх карточек
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  border: 1px solid var(--line-faint);
  border-radius: 8px;
  padding: 36px 26px 28px;
  text-align: center;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.plan-card:hover {
  transform: translateY(-6px);
  border-color: rgba(196, 30, 30, 0.55);
  box-shadow: 0 26px 60px -30px rgba(196, 30, 30, 0.55);
}
.plan-card:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(196, 30, 30, 0.4);
}

/* выделенные тарифы: 3 месяца и 12 месяцев */
.plan-card.is-featured {
  border-color: rgba(196, 30, 30, 0.6);
  box-shadow: 0 0 0 1px rgba(196, 30, 30, 0.18), 0 0 60px -24px rgba(196, 30, 30, 0.5);
}
.plan-card.is-featured:hover {
  box-shadow: 0 26px 70px -28px rgba(196, 30, 30, 0.7), 0 0 60px -20px rgba(139, 0, 0, 0.5);
}
.plan-card.is-max {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(196, 30, 30, 0.3), 0 0 70px -20px rgba(196, 30, 30, 0.65);
}

/* плашка сверху */
.plan-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 24px -10px rgba(196, 30, 30, 0.9);
}

.plan-term {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.01em;
  margin: 6px 0 18px;
  color: var(--text);
}
.plan-price { margin-bottom: 6px; }
.plan-number {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(30px, 3vw, 38px);
  letter-spacing: -0.02em;
  color: var(--text);
}
.plan-save {
  min-height: 20px;
  margin: 0 0 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--red);
}

.plan-list {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  text-align: left;
  flex: 1 1 auto;
}
.plan-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.45;
}
.plan-list li:last-child { border-bottom: none; }

.check {
  flex: none;
  display: inline-flex;
  color: var(--red);
  margin-top: 2px;
}
.check svg { width: 18px; height: 18px; }

/* «кнопка» внутри карточки — визуальная, клик ловит вся карточка */
.plan-btn {
  margin-top: auto;
  padding: 13px 20px;
  font-size: 15px;
  pointer-events: none; /* клик обрабатывает вся карточка */
}

.price-note {
  margin: 36px 0 0;
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  text-align: center;
}

/* ============================================================
   ФОТО-ГАЛЕРЕЯ
   ============================================================ */
.gallery {
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.gallery-item {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.gallery-item img {
  width: 100%;
  height: 115%; /* запас для parallax-смещения */
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter var(--dur) var(--ease), transform 600ms var(--ease);
  will-change: transform;
}
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(139,0,0,0.5));
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.gallery-item:hover img { filter: grayscale(0) contrast(1.05); transform: scale(1.04); }
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* ============================================================
   FAQ
   ============================================================ */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 500;
  text-align: left;
  padding: 26px 4px;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}
.faq-question:hover { color: var(--red); }

.faq-icon {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  transition: transform var(--dur) var(--ease);
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  background: var(--red);
  transition: opacity var(--dur) var(--ease);
}
.faq-icon::before { top: 9px; left: 0; width: 20px; height: 1.5px; }
.faq-icon::after  { left: 9px; top: 0; width: 1.5px; height: 20px; }
/* "+" поворачивается в "×" */
.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur) var(--ease);
}
.faq-answer p {
  margin: 0;
  padding: 0 4px 28px;
  color: var(--text-dim);
  font-size: 16px;
}

/* ============================================================
   ПОДВАЛ
   ============================================================ */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--line-faint);
  padding: 80px 0 44px;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.footer-heading {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 20px;
}
.footer-col p,
.footer-col a {
  display: block;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text-dim);
}
.footer-col a { transition: color var(--dur) var(--ease); }
.footer-col a:hover { color: var(--red); }
.footer-brand {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.28em;
  color: var(--text) !important;
  margin-top: 20px !important;
}
.footer-copy {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
}
.footer-copy p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ============================================================
   МОДАЛЬНОЕ ОКНО
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  animation: fadeIn var(--dur) var(--ease);
}
.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--bg-alt);
  border: 1px solid var(--line-faint);
  border-radius: 10px;
  padding: 44px 40px 40px;
  box-shadow: 0 50px 120px -30px rgba(0,0,0,0.9), 0 0 60px -20px rgba(196,30,30,0.3);
  animation: popIn 260ms var(--ease);
}
.modal-close {
  position: absolute;
  top: 16px; right: 18px;
  width: 38px; height: 38px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}
.modal-close:hover { color: var(--red); }
.modal-title {
  font-family: var(--font-head);
  font-weight: 800;
  margin: 0 0 6px;
  font-size: 25px;
}
.modal-sub {
  margin: 0 0 30px;
  font-size: 14px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.pay-form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field-input {
  width: 100%;
  padding: 15px 16px;
  background: var(--bg);
  border: 1px solid var(--line-faint);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color var(--dur) var(--ease);
}
.field-input::placeholder { color: #4a4640; }
.field-input:focus { outline: none; border-color: var(--red); }
.field-input.invalid { border-color: var(--red); }
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  cursor: pointer;
}
.checkbox input {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 1px;
  accent-color: var(--red);
  cursor: pointer;
}
.checkbox a { color: var(--red); }
.checkbox.invalid span { color: var(--red); }
.modal-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.modal-note a { color: var(--red); }

/* ============================================================
   ПРАВОВЫЕ СТРАНИЦЫ (oferta / privacy / consent)
   ============================================================ */
.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 96px 32px 120px;
}
.legal-page .back-link {
  display: inline-block;
  margin-bottom: 36px;
  color: var(--red);
  font-size: 15px;
  transition: color var(--dur) var(--ease);
}
.legal-page .back-link:hover { color: var(--text); }
.legal-page h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -0.01em;
  margin: 0 0 28px;
}
.legal-page .placeholder {
  color: var(--text-dim);
  font-size: 17px;
}

/* ============================================================
   АНИМАЦИИ ПОЯВЛЕНИЯ
   ============================================================ */
/* hero: fade-in-up при загрузке */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 800ms var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
/* по скроллу через IntersectionObserver */
.fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.fade-up.in { opacity: 1; transform: none; }
/* staggered для карточек */
.features-grid .fade-up:nth-child(1) { transition-delay: 0ms; }
.features-grid .fade-up:nth-child(2) { transition-delay: 80ms; }
.features-grid .fade-up:nth-child(3) { transition-delay: 160ms; }
.features-grid .fade-up:nth-child(4) { transition-delay: 240ms; }
.features-grid .fade-up:nth-child(5) { transition-delay: 320ms; }
.features-grid .fade-up:nth-child(6) { transition-delay: 400ms; }

@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   АДАПТИВ — планшет: тарифы 2x2
   ============================================================ */
@media (max-width: 1024px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   АДАПТИВ (768px)
   ============================================================ */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .container { padding: 0 20px; }

  .nav { display: none; }

  .section { padding: 84px 0; }
  .section-title { margin-bottom: 44px; }

  /* HERO: фото фоном на весь экран, текст поверх */
  .hero-img { width: 100%; opacity: 0.55; }
  .hero-scrim {
    background:
      linear-gradient(180deg, rgba(5,5,5,0.55) 0%, rgba(5,5,5,0.85) 100%),
      linear-gradient(0deg, rgba(139,0,0,0.3), transparent 50%);
  }
  .hero-inner { padding: 100px 20px; }
  .hero-title { max-width: 100%; }

  /* 2x3 → 1x6 */
  .features-grid { grid-template-columns: 1fr; }

  /* тарифы в одну колонку */
  .pricing-grid { grid-template-columns: 1fr; gap: 28px; }

  /* галерея вертикально */
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item { aspect-ratio: 16 / 10; }

  /* подвал в колонку */
  .footer-inner { grid-template-columns: 1fr; gap: 36px; }

  .btn-lg { padding: 16px 28px; font-size: 15px; }
}

/* ============================================================
   PREFERS-REDUCED-MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .fade-up { opacity: 1; transform: none; }
  .cursor-dot { display: none; }
}
