/* Стили сайта КАДУЦЕЙ — hero-секция в стиле референса */

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

:root {
  --color-bg:        #0a0f14;
  --color-bg-card:   #111a22;
  --color-bg-hover:  #1a2836;

  --color-accent:    #2dd4bf;
  --color-accent-dim:#14b8a6;
  --color-gold:      #d4a853;

  --color-text:      #e8edf2;
  --color-text-muted:#8a9bb0;

  --header-height:   104px;
  --radius:          12px;
  --transition:      0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Шапка */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(10, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(45, 212, 191, 0.15);
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}

.logo-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
}

.logo__emblem {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 0 5px rgba(45, 212, 191, 0.5));
  animation: emblemGlow 3s ease-in-out infinite;
}

.logo__text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--color-accent);
}

.logo__contacts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 1.25rem;
  margin-left: calc(80px + 0.75rem);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.header__nav a,
.header__nav-btn {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: color var(--transition);
}

.header__nav a:hover,
.header__nav-btn:hover {
  color: var(--color-accent);
}

.header__nav-btn {
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.header__contact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: color var(--transition);
}

.header__contact:hover {
  color: var(--color-accent);
}

.header__contact-icon {
  font-size: 1rem;
}

/* Hero */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 2rem) 2rem 4rem;
  overflow: hidden;
  /* Откат: заменить строку ниже на "background-color: var(--color-bg);" */
  background: radial-gradient(circle 280px at 74% 58%, rgba(180, 220, 255, 0.4), rgba(180, 220, 255, 0) 70%), linear-gradient(rgba(10, 15, 20, 0.27), rgba(10, 15, 20, 0.33)), url("images/raznoe-lyudi-kostyum-himzaschita-chelove-1514455.jpg") center / cover no-repeat, var(--color-bg);
  /* WebP-версия фона для браузеров, которые её понимают (в 4 раза легче jpg); остальным остаётся строка выше */
  background-image: radial-gradient(circle 280px at 74% 58%, rgba(180, 220, 255, 0.4), rgba(180, 220, 255, 0) 70%), linear-gradient(rgba(10, 15, 20, 0.27), rgba(10, 15, 20, 0.33)), image-set(url("images/hero-bg.webp") type("image/webp"), url("images/raznoe-lyudi-kostyum-himzaschita-chelove-1514455.jpg") type("image/jpeg"));
}

.hero__glow {
  position: absolute;
  top: 20%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 6s ease-in-out infinite;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.hero__badge,
.hero__title,
.hero__subtitle,
.hero__services {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero__badge.visible  { transition-delay: 0.1s; }
.hero__title.visible  { transition-delay: 0.25s; }
.hero__subtitle.visible { transition-delay: 0.4s; }
.hero__services.visible { transition-delay: 0.55s; }

.hero__badge.visible,
.hero__title.visible,
.hero__subtitle.visible,
.hero__services.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero__badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero__title-accent {
  color: var(--color-accent);
  animation: textShimmer 4s ease-in-out infinite;
}

.hero__subtitle {
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 2rem;
  max-width: 520px;
}

.hero__services {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin-bottom: 1.5rem;
}

.service-card {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.4rem 1.25rem;
  background: var(--color-bg-card);
  border: 1px solid rgba(45, 212, 191, 0.15);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.service-card:hover,
.service-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--color-accent);
  background: var(--color-bg-hover);
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.12);
  outline: none;
}

.service-card strong {
  font-size: 1.25rem;
  color: var(--color-accent);
  animation: titleGlow 3s ease-in-out infinite;
}

.service-card:nth-child(2) strong {
  animation-delay: 0.4s;
}

.service-card:nth-child(3) strong {
  animation-delay: 0.8s;
}

.service-card:nth-child(4) strong {
  animation-delay: 1.2s;
}

.service-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--color-accent);
  background: var(--color-bg-hover);
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.12);
}

.service-card__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
  outline: none;
}

/* Частицы */

.hero__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s;   animation-duration: 7s;  }
.particle:nth-child(2) { left: 25%; top: 60%; animation-delay: 1.5s; animation-duration: 9s;  }
.particle:nth-child(3) { left: 50%; top: 30%; animation-delay: 3s;   animation-duration: 8s;  }
.particle:nth-child(4) { left: 70%; top: 70%; animation-delay: 0.5s; animation-duration: 10s; }
.particle:nth-child(5) { left: 85%; top: 15%; animation-delay: 2s;   animation-duration: 7s;  }
.particle:nth-child(6) { left: 40%; top: 85%; animation-delay: 4s;   animation-duration: 9s;  }
.particle:nth-child(7) { left: 15%; top: 50%; animation-delay: 2.5s; animation-duration: 8.5s; }
.particle:nth-child(8) { left: 60%; top: 10%; animation-delay: 5s;   animation-duration: 7.5s; }
.particle:nth-child(9) { left: 92%; top: 55%; animation-delay: 1s;   animation-duration: 9.5s; }
.particle:nth-child(10) { left: 5%; top: 78%; animation-delay: 3.5s; animation-duration: 8s;   }
.particle:nth-child(11) { left: 30%; top: 25%; animation-delay: 0.8s; animation-duration: 8.2s; }
.particle:nth-child(12) { left: 45%; top: 65%; animation-delay: 3.2s; animation-duration: 9.2s; }
.particle:nth-child(13) { left: 65%; top: 45%; animation-delay: 1.8s; animation-duration: 7.8s; }
.particle:nth-child(14) { left: 80%; top: 80%; animation-delay: 4.5s; animation-duration: 8.8s; }
.particle:nth-child(15) { left: 95%; top: 30%; animation-delay: 2.2s; animation-duration: 9.8s; }
.particle:nth-child(16) { left: 20%; top: 90%; animation-delay: 0.3s; animation-duration: 7.3s; }
.particle:nth-child(17) { left: 55%; top: 85%; animation-delay: 5.5s; animation-duration: 8.4s; }
.particle:nth-child(18) { left: 8%;  top: 35%; animation-delay: 3.8s; animation-duration: 9.4s; }
.particle:nth-child(19) { left: 75%; top: 20%; animation-delay: 1.2s; animation-duration: 7.6s; }
.particle:nth-child(20) { left: 35%; top: 5%;  animation-delay: 4.2s; animation-duration: 8.6s; }

/* Keyframes */

@keyframes emblemGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(45, 212, 191, 0.4)); }
  50%       { filter: drop-shadow(0 0 14px rgba(45, 212, 191, 0.85)); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

@keyframes textShimmer {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 4px rgba(45, 212, 191, 0.25); }
  50%       { text-shadow: 0 0 12px rgba(45, 212, 191, 0.75); }
}

@keyframes particleFloat {
  0%   { opacity: 0;   transform: translateY(0) scale(1); }
  20%  { opacity: 0.6; }
  80%  { opacity: 0.3; }
  100% { opacity: 0;   transform: translateY(-120px) scale(0.5); }
}

/* Модальное окно услуги */

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal__box {
  position: relative;
  max-width: 480px;
  width: 90%;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 2rem;
  color: var(--color-text);
  opacity: 0;
  transform: scale(0.92);
  animation: modalIn 0.25s ease-out forwards;
}

@keyframes modalIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal__close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.modal__title {
  margin-bottom: 0.8rem;
  color: var(--color-accent);
}

.modal__description {
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* Модалка «О нас» — контента больше, чем в карточке услуги, поэтому шире и со скроллом.
   Фон под modal__box--about пользователь добавит отдельно позже. */

.modal__box--about {
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal__body p {
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: 0.9rem;
}

.modal__body p.modal__inn {
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  margin-bottom: 1rem;
}

.modal__body h3 {
  margin: 1.4rem 0 0.6rem;
  color: var(--color-accent);
  font-size: 1.05rem;
}

.modal__body h3:first-child {
  margin-top: 0;
}

.modal__body ul,
.modal__body ol {
  margin: 0 0 0.9rem 1.25rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.modal__body li {
  margin-bottom: 0.4rem;
}

/* Модалка «Контакты» */

.modal__contacts {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.modal__contact-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.05rem;
  transition: color var(--transition);
}

.modal__contact-link:hover {
  color: var(--color-accent);
}

/* Модалка «Меню» — дублирует пункты хедера */

.modal__box--menu {
  max-width: 360px;
}

.menu-list {
  display: flex;
  flex-direction: column;
}

.menu-list__item {
  display: block;
  width: 100%;
  padding: 0.9rem 0.25rem;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(45, 212, 191, 0.15);
  font-family: inherit;
  font-size: 1.05rem;
  text-align: left;
  text-decoration: none;
  color: var(--color-text);
  cursor: pointer;
  transition: color var(--transition);
}

.menu-list__item:last-child {
  border-bottom: none;
}

.menu-list__item:hover,
.menu-list__item:focus-visible {
  color: var(--color-accent);
  outline: none;
}

/* Адаптив */

@media (max-width: 900px) {
  .hero {
    text-align: center;
    padding-top: calc(var(--header-height) + 1.5rem);
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__services {
    justify-content: center;
  }
}

/* Хедер не помещается в одну строку раньше, чем hero меняет колонки —
   поэтому у него собственный, более широкий брейкпоинт. */
@media (max-width: 860px) {
  :root {
    --header-height: 118px;
  }

  .header {
    padding: 0 1rem;
  }

  .header__nav {
    gap: 0.85rem;
  }

  .header__nav a,
  .header__nav-btn {
    display: none;
  }

  .header__menu-btn {
    display: inline-block;
  }

  .logo__emblem {
    width: 56px;
    height: 56px;
  }

  .logo__text {
    font-size: 1.05rem;
  }

  .logo__contacts {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin-left: 0;
  }

  .header__contact {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .service-card {
    flex: 1 1 100%;
  }
}

/* Страница «Автострахование ОСАГО» (и другие простые внутренние страницы) */

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: calc(var(--header-height) + 3rem) 2rem 4rem;
}

.page__content {
  width: 100%;
  max-width: 760px;
}

.breadcrumbs {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-accent);
}

.page__badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: 999px;
  color: var(--color-accent);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.page__title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.page__subtitle {
  color: #ffffff;
  margin-bottom: 2rem;
  max-width: 60ch;
}

.osago-embed {
  background: var(--color-bg-card);
  border: 1px solid rgba(45, 212, 191, 0.15);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.osago-embed__frame {
  width: 100%;
  border: none;
  height: 650px;
  min-width: 320px;
  overflow: hidden;
}

@media (max-width: 480px) {
  .page {
    padding: calc(var(--header-height) + 2rem) 1rem 3rem;
  }

  .page__title {
    font-size: 1.75rem;
  }
}

/* Статичные текстовые секции (О компании, Услуги, FAQ) — дублируют контент
   соответствующих модалок в обычной верстке страницы, а не только внутри
   hidden-модалок, чтобы текст был виден краулерам без выполнения JS.
   При правке текста в data/about.js и data/servicesOverview.js не забывай
   синхронизировать копию здесь. */

.content-section {
  display: flex;
  justify-content: center;
  padding: 3rem 2rem;
  border-top: 1px solid rgba(45, 212, 191, 0.1);
}

.content-section__inner {
  width: 100%;
  max-width: 760px;
  background-color: var(--color-bg-card);
  border: 1px solid rgba(45, 212, 191, 0.15);
  border-radius: var(--radius);
  padding: 2rem;
}

@media (max-width: 480px) {
  .content-section__inner {
    padding: 1.25rem;
  }
}

.content-section__title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

.content-section__title .content-section__title-accent {
  color: var(--color-accent);
}

.content-section--flush {
  padding-left: 0;
  padding-right: 0;
}

@media (max-width: 480px) {
  .content-section {
    padding: 2rem 1rem;
  }
}

/* FAQ — нативный <details>/<summary>, без JS */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--color-bg-card);
  border: 1px solid rgba(45, 212, 191, 0.15);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}

.faq-item__q {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
}

.faq-item__q::-webkit-details-marker {
  display: none;
}

.faq-item__q::before {
  content: "+";
  display: inline-block;
  width: 1.1rem;
  color: var(--color-accent);
  font-weight: 800;
}

.faq-item[open] .faq-item__q::before {
  content: "\2212";
}

.faq-item__a {
  padding-top: 0.6rem;
}

.faq-item__a p {
  margin-bottom: 0;
}

/* Подвал сайта — видимые реквизиты компании и ссылка на политику
   конфиденциальности (важно для доверия и для факторов "владелец сайта") */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 2rem 1rem 4.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  border-top: 1px solid rgba(45, 212, 191, 0.1);
}

.site-footer a {
  color: var(--color-accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer__links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Копирайт в углу */

.site-copyright {
  position: fixed;
  right: 1rem;
  bottom: 0.75rem;
  z-index: 50;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  opacity: 0.6;
  letter-spacing: 0.02em;
  pointer-events: none;
}
