/* =====================================================
   Ремонт квартир в Самаре — lipo
   Светлый журнальный стиль + тёмные hero и футер
   ===================================================== */

:root {
  --ink: #1b1712;
  --ink-soft: #26201a;
  --paper: #f4f0e8;
  --paper-2: #faf7f1;
  --card: #fffdf8;
  --text: #29231a;
  --muted: #7d7365;
  --line: #e2dbc9;
  --line-dark: rgba(244, 240, 232, 0.16);
  --clay: #c05f2e;
  --clay-dark: #a34d20;
  --light: #f4f0e8;
  --muted-light: #a89d8b;
  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font-body: "Golos Text", "Segoe UI", Arial, sans-serif;
  --container: 1240px;
  --gutter: 24px;
  --header-h: 76px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: 96px 0; }

/* ---------- Типографика ---------- */

.overline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay);
}

.overline::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--clay);
}

.overline--light { color: var(--clay); }

.section__head {
  max-width: 720px;
  margin-bottom: 56px;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin-top: 18px;
  text-transform: uppercase;
}

.section__note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 17px;
  max-width: 560px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn--accent {
  background: var(--clay);
  color: #fff;
}

.btn--accent:hover { background: var(--clay-dark); }

.btn--outline-light {
  border-color: var(--line-dark);
  color: var(--light);
  background: transparent;
}

.btn--outline-light:hover {
  border-color: var(--light);
  background: rgba(244, 240, 232, 0.06);
}

.btn--solid-light {
  background: var(--light);
  color: var(--ink);
}

.btn--solid-light:hover { background: #fff; }

.btn--ghost {
  border-color: var(--line-dark);
  color: var(--light);
}

.btn--ghost:hover { border-color: var(--light); }

.btn--sm { padding: 11px 20px; font-size: 12px; }

/* ---------- Шапка ---------- */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.3s, box-shadow 0.3s;
}

.header--solid {
  background: rgba(27, 23, 18, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line-dark);
}

.header__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--light);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--clay);
  color: #fff;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  flex: 0 0 auto;
}

.brand__text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.25;
}

.brand__text small {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--muted-light);
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-light);
  transition: color 0.25s;
}

.nav a:hover { color: var(--light); }

.nav__phone { font-weight: 600; }

.header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--line-dark);
  cursor: pointer;
}

.burger span {
  display: block;
  height: 2px;
  background: var(--light);
  transition: transform 0.3s, opacity 0.3s;
}

.burger--open span:first-child { transform: translateY(4px) rotate(45deg); }
.burger--open span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  background: var(--ink);
  color: var(--light);
  padding: calc(var(--header-h) + 72px) 0 0;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
  padding-bottom: 88px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.18;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin-top: 22px;
}

.hero__lead {
  margin-top: 26px;
  max-width: 520px;
  font-size: 17px;
  color: var(--muted-light);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.hero__phone-link {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--light);
  border-bottom: 1px solid var(--line-dark);
  padding-bottom: 4px;
  transition: border-color 0.25s, color 0.25s;
}

.hero__phone-link:hover { color: #fff; border-color: var(--clay); }

.hero__media {
  position: relative;
  padding: 0 0 56px 56px;
}

.hero__photo-main {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.hero__photo-main img,
.hero__photo-sub img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__photo-sub {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 6px solid var(--ink);
}

.hero__badge {
  position: absolute;
  top: 20px;
  right: -12px;
  background: var(--clay);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 16px;
}

.hero__facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-dark);
}

.hero__facts li {
  padding: 26px 24px 34px 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted-light);
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.hero__facts li::before {
  content: "—";
  color: var(--clay);
  flex: 0 0 auto;
}

/* ---------- Проекты: карточки ---------- */

.projects {
  background: var(--paper);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  border-color: #cfc5ae;
  box-shadow: 0 18px 44px -30px rgba(41, 35, 26, 0.45);
}

.project-card__body {
  padding: 22px 26px 28px;
}

.project-card__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.project-card__num {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--clay);
}

.project-card__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.project-card__desc {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Карусель в карточке ---------- */

.carousel { display: flex; flex-direction: column; }

.carousel__viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--paper-2);
  outline-offset: -4px;
  touch-action: pan-y;
}

.carousel__track {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.carousel__slide {
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .carousel__slide img { transform: scale(1.03); }

/* Счётчик поверх фото */
.carousel__count {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  background: rgba(27, 23, 18, 0.72);
  color: var(--light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  backdrop-filter: blur(4px);
}

/* Точки поверх фото */
.carousel__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 7px;
}

.carousel__dot {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.carousel__dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: rgba(244, 240, 232, 0.55);
  transition: background 0.25s, transform 0.25s;
}

.carousel__dot--active::after {
  background: var(--clay);
  transform: scale(1.25);
}

/* Стрелки поверх фото */
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: rgba(27, 23, 18, 0.55);
  color: var(--light);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s, background 0.25s;
  backdrop-filter: blur(4px);
}

.carousel__arrow--prev { left: 0; }
.carousel__arrow--next { right: 0; }

.carousel__viewport:hover .carousel__arrow,
.carousel__arrow:focus-visible { opacity: 1; }

.carousel__arrow:hover { background: var(--clay); }

@media (hover: none) {
  .carousel__arrow { opacity: 1; width: 40px; height: 40px; }
}

/* ---------- Услуги: список + крупное фото ---------- */

.services {
  background: var(--paper);
}

.services__layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 72px;
  align-items: start;
}

.service {
  display: flex;
  align-items: baseline;
  gap: 24px;
  width: 100%;
  padding: 26px 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.services__list .service:last-child {
  border-bottom: 1px solid var(--line);
}

.service__num {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
  transition: color 0.3s;
}

.service__text { display: block; }

.service__title {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
  transition: color 0.3s;
}

.service__desc {
  display: block;
  margin-top: 10px;
  max-width: 560px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
  transition: max-height 0.45s ease, opacity 0.45s ease;
}

.service:hover .service__title { color: var(--clay); }

.service.is-active .service__num { color: var(--clay); }

.service.is-active .service__desc {
  max-height: 160px;
  opacity: 1;
}

.services__photo {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  background: var(--paper-2);
}

.services__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.services__photo img.is-active { opacity: 1; }

/* ---------- Этапы ---------- */

.steps {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

.steps__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  counter-reset: step;
}

.step {
  padding: 28px 24px 8px 0;
  margin-left: 24px;
  border-top: 1px solid var(--text);
}

.step:first-child { margin-left: 0; }

.step__num {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--clay);
}

.step h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 14px;
}

.step p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- CTA / контакты ---------- */

.cta {
  background: var(--ink);
  color: var(--light);
  padding: 96px 0 110px;
}

.cta__in {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cta__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.8vw, 3rem);
  line-height: 1.15;
  text-transform: uppercase;
  margin-top: 22px;
  max-width: 760px;
}

.cta__lead {
  margin-top: 22px;
  max-width: 540px;
  color: var(--muted-light);
  font-size: 17px;
}

.cta__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 40px;
}

.cta__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line-dark);
  width: 100%;
}

.cta__vk {
  font-weight: 600;
  color: var(--light);
  border-bottom: 1px solid var(--line-dark);
  padding-bottom: 2px;
  transition: border-color 0.25s;
}

.cta__vk:hover { border-color: var(--clay); }

.cta__city {
  color: var(--muted-light);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Футер ---------- */

.footer {
  background: var(--ink);
  color: var(--muted-light);
  border-top: 1px solid var(--line-dark);
  padding: 34px 0;
}

.footer__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand--footer .brand__mark { width: 34px; height: 34px; font-size: 14px; }
.brand--footer .brand__text { font-size: 11px; }

.footer__nav {
  display: flex;
  gap: 24px;
  font-size: 14px;
}

.footer__nav a { transition: color 0.25s; }
.footer__nav a:hover { color: var(--light); }

.footer__note {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 13px;
}

.footer__note a { transition: color 0.25s; }
.footer__note a:hover { color: var(--light); }

/* ---------- Тёмная кнопка ---------- */

.btn--ink {
  background: var(--ink);
  color: var(--light);
}

.btn--ink:hover { background: var(--clay); }

/* ---------- Отзывы (карточки) ---------- */

.reviews {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

.reviews__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 48px;
}

.reviews__head .section__title { margin-top: 18px; }

.reviews__head .section__note {
  margin-top: 14px;
  max-width: 520px;
}

.reviews__vk { flex: 0 0 auto; }

.reviews__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.review-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 34px 36px 30px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.review-card:hover {
  border-color: #cfc5ae;
  box-shadow: 0 18px 44px -30px rgba(41, 35, 26, 0.45);
  transform: translateY(-3px);
}

.review-card__quote {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 0.55;
  color: var(--clay);
  margin-bottom: 22px;
}

.review-card blockquote {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  flex: 1;
}

.review-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.review-card figcaption strong {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.review-card figcaption span {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Акцентная тёмная карточка */
.review-card--dark {
  background: var(--ink);
  border-color: var(--ink);
}

.review-card--dark:hover {
  border-color: var(--ink);
  box-shadow: 0 22px 50px -28px rgba(27, 23, 18, 0.65);
}

.review-card--dark blockquote { color: var(--light); }

.review-card--dark figcaption { border-color: var(--line-dark); }
.review-card--dark figcaption span { color: var(--muted-light); }

/* ---------- FAQ ---------- */

.faq {
  background: var(--paper);
}

.faq__list { border-bottom: 1px solid var(--line); }

.faq__item { border-top: 1px solid var(--line); }

.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 600;
  transition: color 0.25s;
}

.faq__item summary::-webkit-details-marker { display: none; }

.faq__item summary:hover { color: var(--clay); }

.faq__icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  background: var(--clay);
  transition: transform 0.3s;
}

.faq__icon::before { left: 0; right: 0; top: 8px; height: 2px; }
.faq__icon::after { top: 0; bottom: 0; left: 8px; width: 2px; }

.faq__item[open] .faq__icon::after { transform: scaleY(0); }

.faq__answer {
  padding: 0 48px 26px 0;
  max-width: 780px;
  color: var(--muted);
  font-size: 15.5px;
}

/* ---------- Гарантия ---------- */

.guarantee {
  background: var(--ink);
  color: var(--light);
}

.section__title--light { color: var(--light); }

.section__note--ondark { color: var(--muted-light); }

.guarantee__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.guarantee__item {
  border-top: 1px solid var(--line-dark);
  padding-top: 26px;
}

.guarantee__num {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--clay);
}

.guarantee__item h3 {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
  margin-top: 16px;
}

.guarantee__item p {
  margin-top: 12px;
  font-size: 14.5px;
  color: var(--muted-light);
}

/* ---------- Появление при скролле ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal--in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .carousel__track { transition: none; }
}

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

@media (max-width: 1024px) {
  .hero__grid { gap: 40px; }
  .projects__grid { gap: 24px; }
  .steps__grid { grid-template-columns: repeat(3, 1fr); row-gap: 36px; }
  .step:nth-child(4) { margin-left: 0; }
  .services__layout { gap: 40px; }
  .guarantee__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .section { padding: 72px 0; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(27, 23, 18, 0.98);
    backdrop-filter: blur(12px);
    padding: 8px 24px 24px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .nav--open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav a {
    padding: 15px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--line-dark);
  }

  .nav a:last-child { border-bottom: 0; }

  .burger { display: flex; }

  .header__phone { display: none; }

  .hero { padding-top: calc(var(--header-h) + 40px); }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-bottom: 56px;
  }

  .hero__media {
    max-width: 480px;
    padding: 0 0 40px 40px;
  }

  .hero__facts { grid-template-columns: 1fr 1fr; }
  .hero__facts li { padding: 20px 16px 20px 0; }

  .projects__grid { grid-template-columns: 1fr; }

  .reviews__grid { grid-template-columns: 1fr; }
  .reviews__head { flex-wrap: wrap; }

  .faq__item summary { font-size: 15.5px; padding: 20px 0; }
  .faq__answer { padding-right: 0; }

  .guarantee__grid { grid-template-columns: 1fr; gap: 24px; }

  .services__layout { grid-template-columns: 1fr; gap: 32px; }
  .services__photo { position: relative; top: 0; aspect-ratio: 4 / 3; }

  .steps__grid { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .step:nth-child(odd) { margin-left: 0; }

  .cta { padding: 80px 0; }

  .footer__in { flex-direction: column; align-items: flex-start; }
  .footer__note { align-items: flex-start; }
}

@media (max-width: 520px) {
  .hero__cta .btn { width: 100%; }
  .cta__buttons .btn { width: 100%; }
  .hero__media { padding: 0 0 28px 28px; }
  .project-card__body { padding: 18px 20px 24px; }
  .carousel__arrow { width: 38px; height: 38px; }
  .steps__grid { grid-template-columns: 1fr; }
  .step { margin-left: 0; }
}
