/* Драгоценности из пламени — стили сайта.
   Токены (размеры, цвета, отступы) сняты с исходного сайта на конструкторе Рег.ру. */

@font-face { font-family: Geologica; src: url('/assets/fonts/Geologica-Light.woff2') format('woff2');    font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: Geologica; src: url('/assets/fonts/Geologica-Regular.woff2') format('woff2');  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Geologica; src: url('/assets/fonts/Geologica-Medium.woff2') format('woff2');   font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Geologica; src: url('/assets/fonts/Geologica-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Geologica; src: url('/assets/fonts/Geologica-Bold.woff2') format('woff2');     font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --accent: #661eb7;
  --ink: #232323;
  --muted: #585858;
  --faint: #9c9c9c;
  --line: #ededed;
  --surface: #f7f7f7;
  --surface-soft: #fafafa;

  --container: 1140px;
  --page-pad: 24px;
  --header-h: 72px;

  --gap-sm: 16px;
  --gap-md: 32px;
  --gap-lg: 52px;

  --radius-card: 24px;
  --radius-btn: 12px;
  --radius-pill: 22px;
}

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

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

body {
  margin: 0;
  font-family: Geologica, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }

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

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  padding: 10px 16px; background: #fff; border-radius: var(--radius-btn);
  box-shadow: 0 4px 16px rgb(0 0 0 / 15%);
}
.skip-link:focus { left: 16px; }

/* ------------------------------------------------------------ раскладка */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--page-pad) * 2);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}
.container--wide { max-width: 100%; }

.gap-top-sm { padding-top: var(--gap-sm); }
.gap-top-md { padding-top: var(--gap-md); }
.gap-top-lg { padding-top: var(--gap-lg); }
.gap-bottom-sm { padding-bottom: var(--gap-sm); }
.gap-bottom-md { padding-bottom: var(--gap-md); }
.gap-bottom-lg { padding-bottom: var(--gap-lg); }

.block { position: relative; }
.block--tinted { background: var(--features-bg, var(--surface)); }

.block-head { text-align: center; }
.block-head + * { margin-top: 64px; }

.block-title {
  margin: 0;
  font-size: 44px;
  line-height: 44px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.block-subtitle {
  margin-top: var(--gap-sm);
  font-size: 18px;
  line-height: 26px;
  color: var(--ink);
}

/* ------------------------------------------------------------- кнопки */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  font-size: 18px;
  line-height: 26px;
  border-radius: var(--radius-btn);
  transition: background-color .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.button--primary { background: var(--accent); color: #fff; }
.button--primary:hover { opacity: .88; }

/* -------------------------------------------------------------- шапка */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  width: min(100% - var(--page-pad) * 2, 1280px);
  margin-inline: auto;
}

.logo { flex: none; display: block; }
.logo img { width: 84px; height: 56px; object-fit: contain; object-position: left center; }

.nav { flex: 1 1 auto; min-width: 0; }
.nav__list { display: flex; align-items: center; gap: 16px; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  font-size: 18px;
  line-height: 26px;
  color: var(--muted);
  transition: color .15s ease;
}
.nav__link:hover { color: var(--ink); }
.nav__chevron { display: block; font-size: 20px; transition: transform .18s ease; }
.nav__item--open .nav__chevron { transform: rotate(180deg); }

.nav__group {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 268px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  box-shadow: 0 12px 32px rgb(0 0 0 / 10%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.nav__item--open .nav__group { opacity: 1; visibility: visible; transform: none; }
.nav__group a {
  display: block;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 22px;
  color: var(--muted);
  border-radius: 8px;
}
.nav__group a:hover { background: var(--surface); color: var(--ink); }
.nav__group a[aria-current] { color: var(--accent); }

.site-header__cta { flex: none; max-width: 240px; overflow: hidden; text-overflow: ellipsis; display: block; }

.burger { display: none; flex: none; width: 40px; height: 40px; padding: 8px; }
.burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.burger span + span { margin-top: 5px; }
.burger[aria-expanded='true'] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded='true'] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 39;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px var(--page-pad) 40px;
  background: #fff;
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__list { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu__link { display: block; padding: 12px 0; font-size: 20px; line-height: 28px; font-weight: 500; }
.mobile-menu__group { display: flex; flex-direction: column; gap: 2px; padding: 0 0 8px 16px; }
.mobile-menu__group a { display: block; padding: 8px 0; font-size: 16px; line-height: 22px; color: var(--muted); }
.mobile-menu__cta { align-self: flex-start; }

/* -------------------------------------------------- блок: карточки */

.cards { position: relative; }
.cards__viewport { overflow: hidden; }
.cards__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 12px * 2) / 3);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.cards__track::-webkit-scrollbar { display: none; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  background: #fff;
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* «full» — фотография во всю карточку, текст поверх */
.card--full { min-height: 586px; justify-content: flex-end; }
.card--full .card__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card--full::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0%) 28%, rgb(0 0 0 / 62%) 100%);
}
.card--full .card__body { position: relative; z-index: 1; padding: 0 40px 40px; color: #fff; }
.card--full .card__title { color: #fff; }
.card--full .card__text { color: #fff; }
.card--full .card__button { background: rgb(255 255 255 / 12%); color: #fff; backdrop-filter: blur(6px); }
.card--full .card__button:hover { background: rgb(255 255 255 / 22%); }

/* «half» — фотография сверху, текст на светлой плашке */
.card--half { background: var(--surface); }
.card--half .card__image { width: 100%; aspect-ratio: 245 / 190; object-fit: cover; border-radius: var(--radius-card); }
/* Кнопки в ряду карточек выравниваются по нижнему краю независимо от длины текста */
.card--half .card__body { flex: 1 1 auto; display: flex; flex-direction: column; padding: 24px; text-align: center; }
.card--half .card__button { margin-top: auto; }
.card--half .card__button { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.card--half .card__button:hover { background: #fff; border-color: #ddd; }

/* В оригинале заголовок и описание обрезаны тремя строками — карточки в ряду
   держат одинаковую высоту независимо от длины текста. */
.card__title,
.card__text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__title { margin: 0; font-size: 24px; line-height: 26px; font-weight: 500; -webkit-line-clamp: 3; }
.card__text { margin-top: 8px; font-size: 16px; line-height: 22px; -webkit-line-clamp: 3; }
.card__button {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  padding: 13px 12px;
  font-size: 16px;
  line-height: 22px;
  border-radius: var(--radius-btn);
  transition: background-color .15s ease;
}

.cards__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 28px;
  color: var(--ink);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgb(0 0 0 / 14%);
  transform: translateY(-50%);
  transition: opacity .15s ease;
}
.cards__arrow--prev { left: -18px; }
.cards__arrow--next { right: -18px; }
.cards__arrow[disabled] { opacity: .35; cursor: default; }

.cards__dots { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.cards__dots button { width: 8px; height: 8px; border-radius: 50%; background: #d4d4d4; transition: background-color .15s ease; }
.cards__dots button[aria-current='true'] { background: var(--ink); }

/* ---------------------------------------------- блок: фичи с иконками */

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.feature { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.feature__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  font-size: 24px;
  color: var(--accent);
  background: var(--surface-soft);
  border-radius: 14px;
}
.feature__body { display: flex; flex-direction: column; gap: 8px; }
.feature__title { font-size: 24px; line-height: 26px; font-weight: 500; color: var(--ink); }
.feature__text { font-size: 16px; line-height: 22px; color: var(--muted); }

/* ------------------------------------------------- блок: три колонки */

.columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.columns--left { text-align: left; }
.columns--center { text-align: center; }
.columns__item p { font-size: 20px; line-height: 28px; color: var(--ink); }
.columns__item strong { font-weight: 700; }

/* ----------------------------------------------------- блок: соцсети */

.socials { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.social {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 80px;
  padding: 27px 20px;
  font-size: 18px;
  line-height: 26px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  transition: background-color .15s ease;
}
.social:hover { background: #efefef; }
.social__icon { flex: none; font-size: 24px; color: var(--ink); }
.social__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------- блок: карта */

.map { position: relative; height: 564px; border-radius: 14px; overflow: hidden; background: var(--surface); }
.map__frame { display: block; width: 100%; height: 100%; border: 0; }
.map__address {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 16px);
  padding: 12px 18px 12px 12px;
  font-size: 16px;
  line-height: 22px;
  color: var(--ink);
  background: rgb(255 255 255 / 80%);
  backdrop-filter: blur(4px);
  border-radius: 10px;
}
.map__pin { font-size: 18px; flex: none; }
.map__text { margin-top: var(--gap-md); font-size: 18px; line-height: 26px; color: var(--muted); }

.map-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: var(--gap-md);
  padding-top: var(--gap-md);
  border-top: 1px solid var(--line);
}
.map-feature { display: flex; align-items: flex-start; gap: 16px; }
.map-feature__icon { flex: none; margin-top: 2px; font-size: 20px; color: var(--ink); }
.map-feature__title { display: block; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--ink); }
.map-feature__text { margin-top: 4px; font-size: 16px; line-height: 22px; color: var(--muted); overflow-wrap: anywhere; }

/* ----------------------------------------------------- блок: галерея */

/* Лента выходит за пределы контейнера, поэтому отступ от заголовка задаётся явно —
   правило .block-head + * здесь не срабатывает, они не соседи. */
.block--gallery .container + .gallery { margin-top: 64px; }
.gallery { overflow: hidden; }
.gallery__track { display: flex; gap: 24px; width: max-content; }
.gallery--auto .gallery__track { animation: gallery-scroll var(--gallery-duration, 40s) linear infinite; }
.gallery--auto:hover .gallery__track { animation-play-state: paused; }
.gallery__item { flex: none; width: 332px; height: 408px; border-radius: 16px; overflow: hidden; background: var(--surface); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }

/* лента продублирована ровно один раз — сдвиг на половину замыкает цикл */
@keyframes gallery-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(calc(-50% - 12px), 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gallery--auto .gallery__track { animation: none; }
  .gallery { overflow-x: auto; }
}

/* -------------------------------------------------------- блок: текст */

.text p { font-size: 20px; line-height: 28px; color: var(--ink); }
.text strong { font-weight: 700; }
.text--center { text-align: center; }
.text--right { text-align: right; }
.text .button { margin-top: var(--gap-md); }

/* -------------------------------------------------------------- подвал */

.site-footer { padding-top: var(--gap-lg); border-top: 1px solid var(--line); }

.site-footer__top { display: flex; gap: 32px; align-items: flex-start; padding-bottom: var(--gap-md); }
.site-footer__nav { display: grid; grid-template-columns: repeat(3, 156px); gap: 24px; margin-left: auto; }
.site-footer__group-title { display: block; margin-bottom: 16px; font-size: 16px; line-height: 22px; font-weight: 500; color: var(--ink); }
.site-footer__group ul { display: flex; flex-direction: column; gap: 16px; }
.site-footer__group a { font-size: 16px; line-height: 22px; color: var(--faint); transition: color .15s ease; }
.site-footer__group a:hover { color: var(--ink); }
.site-footer__socials { flex-direction: row !important; gap: 12px !important; }
.site-footer__socials a { display: grid; place-items: center; width: 40px; height: 40px; font-size: 22px; color: var(--faint); border-radius: 10px; }
.site-footer__socials a:hover { color: var(--ink); background: var(--surface); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
}
.site-footer__copyright { font-size: 16px; line-height: 22px; color: var(--faint); }
.site-footer__attachment { font-size: 16px; line-height: 22px; color: var(--faint); text-decoration: underline; }
.site-footer__attachment:hover { color: var(--ink); }

/* ---------------------------------------------------------- адаптив */

@media (max-width: 1100px) {
  .block-title { font-size: 36px; line-height: 40px; }
  .cards__arrow--prev { left: 4px; }
  .cards__arrow--next { right: 4px; }
}

@media (max-width: 900px) {
  .nav, .site-header__cta { display: none; }
  .burger { display: block; }
  .site-header__inner { justify-content: space-between; }

  .block-head + *, .block--gallery .container + .gallery { margin-top: 40px; }
  .cards__track { grid-auto-columns: calc((100% - 12px) / 2); }
  .features, .columns, .map-features { grid-template-columns: repeat(2, 1fr); }
  .socials { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .site-footer__top { flex-direction: column; }
  .site-footer__nav { margin-left: 0; grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

@media (max-width: 640px) {
  :root { --gap-lg: 40px; --gap-md: 28px; }

  .block-title { font-size: 28px; line-height: 32px; }
  .block-subtitle { font-size: 16px; line-height: 24px; }

  .cards__track { grid-auto-columns: 100%; }
  .card--full { min-height: 480px; }
  .card--full .card__body { padding: 0 24px 24px; }
  .cards__arrow { display: none; }

  .features, .columns, .socials, .map-features { grid-template-columns: minmax(0, 1fr); }
  .columns { gap: 20px; }
  .columns__item p, .text p { font-size: 18px; line-height: 26px; }

  .map { height: 380px; }
  .gallery__item { width: 240px; height: 300px; }

  .site-footer__nav { grid-template-columns: 1fr; }
}
