/* ==========================================================================
   Чисто-Про 20 — собственные стили (переписано с нуля, без конструктора).
   Значения подобраны по реальному рендеру оригинала.
   ========================================================================== */

/* ---- Design tokens ---- */
:root {
  --navy-1: #121844;   /* hero gradient bottom */
  --navy-2: #5a67c5;   /* hero gradient top    */
  --serv-1: #1c2566;   /* services gradient    */
  --serv-2: #070915;
  --dark: #1d1d1d;     /* cta / bottom bar     */
  --footer: #041427;
  --partners: #242424;
  --light-bg: #f7f7f7;
  --about-1: #fcfcfc;
  --about-2: #efefef;
  --contact-box: #f6f6f6;

  --text: #000;
  --text-light: rgba(255, 255, 255, .93);
  --muted: #a7a7a7;
  --muted-2: #7b7b7b;

  --btn-bg: #f7f7f7;
  --btn-bg-hover: #cccccc;
  --btn-dark: #0e0e0e;
  --btn-dark-hover: #3a3a3a;

  --container: 1300px;
  --font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --nav-h: 90px;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.07rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; }
p { margin: 0; }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 30px;
}
.container--narrow { max-width: 900px; }
.container--mid { max-width: 1000px; }
.section { padding: 80px 0; }
.text-center { text-align: center; }
.spacer-20 { height: 20px; }
.spacer-40 { height: 40px; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 32px;
  border: 0;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
  white-space: nowrap;
}
.btn--light { background: var(--btn-bg); color: #000; }
.btn--light:hover { background: var(--btn-bg-hover); }
.btn--dark { background: var(--btn-dark); color: var(--light-bg); }
.btn--dark:hover { background: var(--btn-dark-hover); }

/* строка доверия рядом с CTA */
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 20px 0 0; padding: 0; font-size: 14px; }
.trust li { position: relative; padding-left: 22px; color: rgba(255, 255, 255, .85); }
.trust li::before { content: "\2713"; position: absolute; left: 0; color: #5fd08a; font-weight: 700; }
.cta .trust { justify-content: center; }

/* ==========================================================================
   Navbar
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
.nav__inner {
  height: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  align-items: center;
}
.nav__brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.nav__brand img { height: 60px; width: auto; }
.nav__brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.nav__name { font-size: 1.3rem; font-weight: 700; letter-spacing: .2px; color: var(--navy-1); white-space: nowrap; }
.nav__tagline { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: #8a8a8a; margin-top: 3px; }
.nav__phone { display: inline-flex; align-items: center; gap: 8px; margin-left: 24px; padding: 9px 18px; background: var(--navy-1); color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; border-radius: 999px; transition: background .2s; }
.nav__phone:hover { background: var(--navy-2); color: #fff; }
.nav__phone svg { width: 18px; height: 18px; fill: currentColor; }

.nav__menu { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav__menu > li { position: relative; }
.nav__menu a {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(0, 0, 0, .9);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background-color .2s, color .2s;
}
.nav__menu a:hover { background: rgba(90, 103, 197, .14); color: var(--navy-1); }
.nav__caret { width: 9px; height: 9px; transition: transform .2s; }
.nav__has-sub:hover .nav__caret, .nav__has-sub.is-open .nav__caret { transform: rotate(180deg); }

/* dropdown */
.nav__sub {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 190px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .14);
  padding: 8px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, transform .18s ease;
}
.nav__has-sub:hover .nav__sub,
.nav__has-sub.is-open .nav__sub { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav__sub a { display: block; padding: 8px 22px; font-weight: 600; letter-spacing: .3px; border-radius: 0; }

.nav__burger {
  display: none;
  width: 40px; height: 40px;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; justify-content: center; gap: 5px;
}
.nav__burger span { display: block; height: 2px; background: #111; border-radius: 2px; transition: .3s; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  color: var(--text-light);
  background: linear-gradient(0deg, var(--navy-1), var(--navy-2));
  overflow: hidden;
}
.hero__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: clamp(620px, 86vh, 880px);
  padding-top: 70px;
  padding-bottom: 70px;
}
.hero__copy { flex: 0 0 35%; max-width: 520px; }
.hero__copy h1 {
  font-size: clamp(2.1rem, 1rem + 3.4vw, 3.17rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: .025em;
  margin-bottom: 18px;
}
.hero__copy p { font-size: 16px; line-height: 1.4; margin-bottom: 28px; }

.hero__media { flex: 1 1 auto; position: relative; align-self: stretch; min-height: 480px; }
.hero__media img { position: absolute; border-radius: 2px; }
.hero__media .m1 { width: 120%; left: 38%; top: 8%; }
.hero__media .m2 { width: 58%; left: 10%; top: 52%; box-shadow: 3em 3em 5em rgba(22, 22, 22, .2); }
.hero__media .m3 { width: 58%; left: 86%; top: 52%; box-shadow: 3em 3em 5em rgba(22, 22, 22, .2); }

/* ==========================================================================
   Services
   ========================================================================== */
.services {
  background: linear-gradient(0deg, var(--serv-1), var(--serv-2));
  color: var(--text-light);
  text-align: center;
}
.services h2 { margin-bottom: 16px; }
.services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px;
  text-align: left;
}
.service__icon { width: 32px; height: 32px; margin-bottom: 14px; }
.service h3 { font-size: 1.375rem; font-weight: 600; margin-bottom: 12px; }
.service p { font-size: 16px; line-height: 1.6; color: var(--muted); }
.services__cta { margin-top: 48px; text-align: center; }

/* section headings shared */
.h-section {
  font-size: clamp(1.85rem, 1rem + 2.6vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.025em;
}

/* ==========================================================================
   Projects (3 image tiles)
   ========================================================================== */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1300px; margin: 0 auto; padding: 60px 30px; }
.project {
  position: relative;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
  color: var(--text-light);
  overflow: hidden;
  border-radius: 16px;
}
.project__bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: 50% 50%;
  z-index: 0;
}
.project::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .42); z-index: 1; }
.project > :not(.project__bg) { position: relative; z-index: 2; }
.project h3 { font-size: 1.7rem; font-weight: 700; letter-spacing: .3px; margin: 0; text-shadow: 0 2px 14px rgba(0, 0, 0, .55); }

/* ==========================================================================
   CTA
   ========================================================================== */
.cta {
  background: var(--dark);
  color: var(--text-light);
  text-align: center;
  min-height: 450px;
  display: flex;
  align-items: center;
}
.cta__inner { max-width: 700px; margin: 0 auto; padding: 60px 30px; }
.cta h2 { font-weight: 600; line-height: 1.05; margin-bottom: 20px; }
.cta p { font-size: 16px; line-height: 1.6; font-weight: 300; margin-bottom: 28px; }

/* ==========================================================================
   About ("Почему мы")
   ========================================================================== */
.about { background: linear-gradient(0deg, var(--about-2), var(--about-1)); }
.about__head { margin-bottom: 30px; }
.about__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; align-items: start; }
.about__item img { width: 100%; height: auto; border-radius: 600px; margin-bottom: 18px; }
.about__num { font-size: 2rem; font-weight: 600; margin-bottom: 10px; }
.about__item p { font-size: 16px; line-height: 1.6; }

/* ==========================================================================
   Price
   ========================================================================== */
.price { display: grid; grid-template-columns: 2fr 1fr; background: var(--light-bg); }
.price__plans { background: var(--light-bg); padding: 80px 0; }
.price__plans .container { max-width: 900px; margin: 0 auto; }
.price__head { margin-bottom: 40px; }
.price__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.plan h3 { font-size: 1.4375rem; font-weight: 400; margin-bottom: 18px; }
.plan__desc { color: var(--muted-2); margin-bottom: 16px; }
.plan ul { list-style: disc; padding-left: 20px; font-size: 16px; line-height: 1.4; }
.plan ul li { margin-bottom: 6px; }
.plan__min { display: block; margin: 14px 0; font-size: 16px; }
.plan__big { font-size: clamp(2.4rem, 1rem + 3vw, 3.17rem); font-weight: 300; line-height: 1.1; margin: 6px 0 18px; display: block; }
.price__photo { background-size: cover; background-position: 50% 50%; min-height: 420px; margin: 24px; border-radius: 16px; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq { padding: 90px 0; }
.faq h2 { text-align: center; margin-bottom: 60px; font-size: clamp(1.75rem, 1rem + 2.3vw, 2.25rem); }
.faq__item { margin-bottom: 28px; }
.faq__item h3 { font-size: 1.375rem; font-weight: 400; margin-bottom: 8px; }
.faq__item p { font-size: 16px; line-height: 1.4; }

/* ==========================================================================
   Partners
   ========================================================================== */
.partners { background: var(--partners); color: var(--text-light); }
.partners__inner { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.partners__copy { flex: 0 0 29%; min-width: 250px; }
.partners__copy h2 { margin-bottom: 20px; }
.partners__copy p { font-size: 16px; line-height: 1.6; }
.partners__logos { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px 40px; align-items: center; justify-items: center; }
.partners__logos img { width: auto; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { display: grid; grid-template-columns: 1fr 1.4fr; }
.contact__info { background: var(--contact-box); padding: 80px 0; }
.contact__info .container { max-width: 460px; }
.contact__info h2 { font-size: clamp(1.6rem, 1rem + 1.8vw, 1.92rem); font-weight: 300; letter-spacing: -.025em; margin-bottom: 20px; }
.contact__form-wrap { padding: 80px 0; }
.contact__form-wrap .container { max-width: 640px; }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-block { display: flex; flex-direction: column; }
.form-block label { font-size: 16px; font-weight: 300; margin-bottom: 6px; }
.form-input {
  font: inherit; font-size: 16px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--navy-2); }
.form-consent { flex-direction: row; align-items: flex-start; gap: 10px; font-size: 14px; color: #555; }
.form-consent a { text-decoration: underline; }
.form-submit {
  align-self: flex-start;
  font: inherit; font-size: 15px;
  padding: 10px 26px;
  border: 0; border-radius: 100px;
  background: #e5e7eb; color: #4b5563;
  cursor: pointer; transition: background .25s;
}
.form-submit:hover { background: #d8dbe0; }

/* ==========================================================================
   Map
   ========================================================================== */
.map { line-height: 0; }
.map__embed { position: relative; line-height: 0; }
.map iframe { width: 100%; height: 900px; border: 0; display: block; }
.map__guard { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: transparent; border: 0; cursor: pointer; }
.map__guard::after { content: "Нажмите, чтобы управлять картой"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(29, 29, 29, .82); color: #fff; font-size: 14px; line-height: 1.2; padding: 10px 18px; border-radius: 999px; white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none; }
.map__guard:hover::after { opacity: 1; }
.map__embed.is-active .map__guard { display: none; }

/* ==========================================================================
   Footer + bottom bar
   ========================================================================== */
.footer { background: var(--footer); color: var(--text-light); text-align: center; padding: 60px 0; }
.footer h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: .55px; margin-bottom: 6px; }
.footer__addr { font-weight: 600; }
.footer__social { display: flex; justify-content: center; gap: 30px; margin: 22px 0; }
.footer__social a { color: var(--text-light); transition: opacity .2s; }
.footer__social a:hover { opacity: .7; }
.footer__social svg { width: 26px; height: 26px; fill: currentColor; }
.footer__copy { font-size: 14px; }

.bottombar { background: var(--dark); color: var(--text-light); text-align: center; padding: 15px 0; }
.bottombar a { font-size: 14px; text-decoration: none; opacity: .9; }
.bottombar a:hover { opacity: 1; }

/* ==========================================================================
   Cookie notice
   ========================================================================== */
.cookie {
  position: fixed; left: 16px; bottom: 16px; z-index: 200;
  max-width: 360px;
  display: flex; align-items: center; gap: 14px;
  background: rgba(245, 245, 245, .97);
  color: #333;
  padding: 14px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
  font-size: 13px;
}
.cookie a { text-decoration: underline; }
.cookie button {
  flex: 0 0 auto;
  background: var(--dark); color: #fff;
  border: 0; border-radius: 8px;
  padding: 8px 16px; cursor: pointer; font: inherit; font-size: 13px;
}
.cookie.is-hidden { display: none; }

/* ==========================================================================
   Scroll-reveal (progressive enhancement — visible without JS)
   ========================================================================== */
.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); gap: 30px 40px; }
}
@media (max-width: 900px) {
  .nav__menu { display: none; }
  .nav__burger { display: flex; margin-left: 8px; }
  .nav__phone-num { display: none; }
  .nav__phone { margin-left: 10px; padding: 9px 11px; }
  .nav { position: sticky; }

  /* mobile slide-down menu */
  .nav.is-open .nav__menu {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: #fff; padding: 10px 24px 24px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .12);
  }
  .nav.is-open .nav__menu > li { width: 100%; border-top: 1px solid #eee; }
  .nav__sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding: 0 0 6px 14px; min-width: 0; }
  .nav__has-sub:hover .nav__sub,
  .nav__has-sub.is-open .nav__sub { transform: none; }
  .nav__caret { display: none; }

  .hero__inner { flex-direction: column; align-items: flex-start; min-height: 0; }
  .hero__copy { flex: none; max-width: 640px; }
  .hero__media { width: 100%; min-height: 380px; margin-top: 10px; }

  .projects { grid-template-columns: 1fr; }
  .project { min-height: 460px; }

  .about__grid { grid-template-columns: 1fr; gap: 30px; max-width: 460px; }
  .about__item img { max-width: 460px; }

  .price { grid-template-columns: 1fr; }
  .price__cols { grid-template-columns: 1fr; gap: 40px; }
  .price__photo { display: none; } /* в одну колонку картинка-сбоку теряет смысл */

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

  .partners__inner { flex-direction: column; align-items: flex-start; }
  .partners__logos { width: 100%; }
}
@media (max-width: 600px) {
  .container { padding: 0 20px; }
  .nav__tagline { display: none; }
  .nav__inner { padding: 0 14px; }
  .nav__brand img { height: 36px; }
  .nav__name { font-size: 1.05rem; }
  .map iframe { height: 480px; }
  .services__grid { grid-template-columns: 1fr; }
  .partners__logos { grid-template-columns: 1fr; gap: 24px; }
  .section { padding: 60px 0; }
  .cookie { left: 10px; right: 10px; bottom: 10px; max-width: none; }
}


/* ==========================================================================
   Модальное окно (политика конфиденциальности)
   ========================================================================== */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.modal__dialog { position: relative; z-index: 1; width: 100%; max-width: 760px; max-height: 86vh; overflow-y: auto; background: #fff; color: #1d1d1d; border-radius: 14px; padding: 44px clamp(20px, 4vw, 48px); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.modal__close { position: absolute; top: 12px; right: 16px; width: 40px; height: 40px; background: none; border: 0; font-size: 30px; line-height: 1; color: #999; cursor: pointer; }
.modal__close:hover { color: #111; }
.modal__content h2 { font-size: 1.7rem; margin-bottom: 6px; }
.modal__upd { font-size: 13px; color: #888; margin-bottom: 18px; }
.modal__content h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.modal__content p, .modal__content li { font-size: 15px; line-height: 1.6; color: #333; }
.modal__content ul { padding-left: 22px; list-style: disc; margin: 8px 0; }
.modal__content a { color: var(--navy-2); text-decoration: underline; }
body.modal-open { overflow: hidden; }


/* подзаголовок услуг + центрирование CTA-кнопок */
.services__sub { max-width: 760px; margin: 0 auto 44px; font-size: 16px; line-height: 1.6; color: var(--muted); }
.hero__copy .btn { display: block; width: fit-content; margin-left: auto; margin-right: auto; }
.hero .trust { justify-content: center; }
.price__cta { text-align: center; margin-top: 8px; }

.partners__logos a { display: inline-flex; transition: opacity .2s; }
.partners__logos a:hover { opacity: .7; }


/* ==========================================================================
   Полный комплекс клининга
   ========================================================================== */
.cleaning { background: var(--light-bg); text-align: center; }
.cleaning .h-section { margin-bottom: 16px; }
.cleaning__lead { max-width: 780px; margin: 0 auto 40px; font-size: 17px; line-height: 1.6; color: #333; }
.cleaning__list { list-style: none; max-width: 840px; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 36px; text-align: left; }
.cleaning__list li { position: relative; padding-left: 30px; font-size: 16px; line-height: 1.5; color: #1d1d1d; }
.cleaning__list li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: #5fd08a; font-weight: 700; font-size: 18px; }
@media (max-width: 600px) { .cleaning__list { grid-template-columns: 1fr; } }

.js-mail { cursor: pointer; }
.js-mail:hover { text-decoration: underline; }

/* контактная форма: honeypot, textarea, статус */
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
textarea.form-input { min-height: 120px; resize: vertical; font-family: inherit; }
.form-status { margin: 4px 0 0; font-size: 14px; min-height: 1.2em; }
.form-status.is-ok { color: #2e7d32; }
.form-status.is-err { color: #c62828; }

/* ==========================================================================
   Мобильная оптимизация
   ========================================================================== */
@media (max-width: 900px) {
  /* геро-«док» из абсолютных картинок -> аккуратная сетка */
  .hero__media { position: static; min-height: 0; margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero__media .m1, .hero__media .m2, .hero__media .m3 { position: static; left: auto; top: auto; width: 100%; height: auto; border-radius: 12px; box-shadow: none; }
  .hero__media .m1 { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  /* CTA-кнопки на всю ширину (длинный текст не вылезает) */
  .hero__copy .btn,
  .services__cta .btn,
  .cta .btn,
  .price__cta .btn { display: block; width: 100%; white-space: normal; padding: 12px 18px; }
}
@media (max-width: 600px) {
  /* убрать избыточные вертикальные отступы на мобильном */
  .contact__info, .contact__form-wrap { padding: 44px 0; }
  .price__plans { padding: 50px 0; }
  .hero__inner { padding-top: 48px; padding-bottom: 48px; }
  .form-submit { align-self: center; }
}

/* мобильное меню: плоский единый список без «Еще» */
@media (max-width: 900px) {
  .nav.is-open .nav__has-sub > a { display: none; }
  .nav.is-open .nav__menu > .nav__has-sub { border-top: none; }
  .nav.is-open .nav__sub { padding: 0; }
  .nav.is-open .nav__sub li { width: 100%; border-top: 1px solid #eee; }
  .nav.is-open .nav__sub a { padding: 8px 14px; font-weight: 700; letter-spacing: 1px; }
}

/* контакты: телефон и e-mail с иконками */
.contact__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.contact__list li { display: flex; align-items: center; gap: 12px; font-size: 17px; }
.contact__ico { width: 22px; height: 22px; flex: 0 0 auto; fill: var(--navy-2); }
.contact__list a { color: #1d1d1d; }
.contact__list a:hover { color: var(--navy-2); }

/* отступ для якорей под фиксированной шапкой */
section { scroll-margin-top: calc(var(--nav-h) + 12px); }


/* ==========================================================================
   Кнопка «наверх»
   ========================================================================== */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 150;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy-1); color: #fff;
  border: 0; border-radius: 50%; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, background .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--navy-2); }
.to-top svg { width: 22px; height: 22px; fill: currentColor; }

@media (max-width: 600px) { .projects { padding: 40px 16px; gap: 16px; } }

/* ховер ссылки автора в подвале */
.footer__copy a { transition: color .2s; }
.footer__copy a:hover { color: #a8b4ff; }

/* ==========================================================================
   До и после (горизонтальная лента)
   ========================================================================== */
.ba { background: #fff; }
.ba .container { text-align: center; }
.ba .h-section { margin-bottom: 10px; }
.ba__sub { max-width: 660px; margin: 0 auto 32px; font-size: 16px; line-height: 1.6; color: var(--muted-2); }
/* «док»-галерея: квадратные превью, при наведении — увеличение (как в macOS-доке) */
.ba__dock { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 44px 16px 16px; }
.ba__item { appearance: none; background: none; border: 0; padding: 0; cursor: pointer; display: block; position: relative; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ba__thumb { display: block; width: clamp(84px, 16vw, 156px); aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; background: var(--light-bg); box-shadow: 0 8px 22px rgba(0, 0, 0, .12); transition: transform .25s cubic-bezier(.34, 1.3, .5, 1), box-shadow .25s; transform-origin: center; will-change: transform; }
.ba__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* hover-эффекты только для мыши: на тач-экранах тап сразу открывает модал (не «зависает» на ховере) */
/* увеличение + подпись-описание при наведении — ТОЛЬКО для мыши.
   На тач-устройствах ::after не создаётся (иначе у крайних плиток он распирал бы страницу). */
@media (hover: hover) {
  .ba__item:hover { z-index: 3; }
  .ba__item:hover .ba__thumb { transform: scale(1.22); box-shadow: 0 16px 38px rgba(0, 0, 0, .22); }
  .ba__item::after {
    content: attr(data-desc);
    position: absolute; left: 50%; bottom: calc(100% + 22px);
    transform: translateX(-50%) translateY(6px);
    width: max-content; max-width: 240px;
    padding: 8px 12px;
    background: var(--navy-1); color: #fff;
    font-size: 12.5px; font-weight: 500; line-height: 1.35; text-align: center;
    border-radius: 8px; box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
    opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 4;
  }
  .ba__item:hover::after, .ba__item:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.ba__item:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 4px; border-radius: 18px; }
.ba__label { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .3px; padding: 3px 9px; border-radius: 6px; }
.ba__label--after { background: var(--navy-1); }

@media (max-width: 600px) {
  .ba__dock { gap: 10px; padding: 8px 16px; }
}

/* модал «До и после»: равные квадратные кадры (обрезка cover) */
.ba-modal__dialog { max-width: 1180px; min-width: 0; padding: 24px; max-height: 94vh; overflow: hidden; }
.ba-modal__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: center; }
.ba-modal__photo { position: relative; margin: 0 auto; width: 100%; max-width: 74vh; aspect-ratio: 1 / 1; background: #f4f5f8; border-radius: 10px; overflow: hidden; }
.ba-modal__photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s ease; }
.ba-modal__desc { margin-top: 18px; font-size: 16px; line-height: 1.6; color: #333; text-align: center; }
.ba-modal__desc b { color: #1d1d1d; }
/* заметная кнопка закрытия (тёмный кружок поверх фото) */
.ba-modal__dialog .modal__close {
  top: 8px; right: 8px; z-index: 5; padding: 0;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); color: #fff; border-radius: 50%; font-size: 26px; line-height: 1;
}
.ba-modal__dialog .modal__close:hover { background: rgba(0, 0, 0, .78); color: #fff; }
@media (max-width: 600px) {
  .modal { padding: 14px; }
  .ba-modal__dialog { padding: 14px; }
  .ba-modal__pair { grid-template-columns: 1fr; gap: 10px; }
  .ba-modal__photo { max-width: 34vh; }
  .ba-modal__desc { margin-top: 14px; font-size: 15px; }
}
