/* ==========================================================================
   Interaction and responsive refinements
   Loaded after page styles so component behaviour remains predictable.
   ========================================================================== */

/* Header + first block form one continuous surface */
site-header {
  display: block;
}

.site-header {
  border-radius: 0;
}

main > .section-shell:first-child,
main > .page-first {
  margin-top: 0;
  border-radius: 0 0 var(--radius-section) var(--radius-section);
}

.page-first {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Header interactions */
.desktop-nav a,
.footer-nav a {
  display: inline-block;
  transition: color var(--transition), transform var(--transition);
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  transform: translateY(-2px);
}

.header-phone {
  background: var(--color-surface);
  transition:
    color var(--transition),
    background-color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.header-phone:hover,
.header-phone:focus-visible {
  color: var(--color-emerald);
  background: var(--color-white);
  transform: translateY(-2px);
}

/* Secondary and mini buttons */
.button--secondary {
  color: #373737;
  background: var(--color-surface);
  border-color: var(--color-line);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  color: #373737;
  background: var(--color-white);
  border-color: var(--color-line);
}

.mini-button {
  background: var(--color-surface);
  margin: 0px 22px 16px 22px;
  align-self: end;
  justify-self: end;
}

.case-tab {
  background: var(--color-surface);
  transition:
    color var(--transition),
    background-color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.case-tab:not(.is-active):hover,
.case-tab:not(.is-active):focus-visible {
  color: var(--color-graphite);
  background: var(--color-white);
  border-color: var(--color-line);
  transform: translateY(-2px);
}

/* Phone and messenger text links */
.footer-contact-list a,
.mobile-menu-contacts a:not(.button),
.contact-card h2 a {
  transition: color var(--transition), transform var(--transition);
}

.footer-contact-list a:hover,
.footer-contact-list a:focus-visible,
.mobile-menu-contacts a:not(.button):hover,
.mobile-menu-contacts a:not(.button):focus-visible,
.contact-card h2 a:hover,
.contact-card h2 a:focus-visible {
  color: var(--color-emerald);
}

/* Slider shadows are clipped by an outer viewport with extra breathing room. */
.slider-viewport {
  margin: -20px -22px -30px;
  padding: 20px 22px 30px;
  overflow: hidden;
}

.slider-viewport > .swiper,
.services-swiper,
.reviews-swiper,
.cases-swiper,
.service-gallery-swiper {
  overflow: visible !important;
}

.cases-section,
.reviews-section {
  overflow: visible;
}

/* Owner badges: staged entrance and desktop hover lift */
.js .owner-badges:not(.is-stagger-visible) article {
  opacity: 0;
  transform: translateY(24px);
}

.owner-badges.is-stagger-visible article {
  animation: stagger-rise 560ms cubic-bezier(.2, .72, .2, 1) backwards;
}

.owner-badges.is-stagger-visible article:nth-child(2) { animation-delay: 130ms; }
.owner-badges.is-stagger-visible article:nth-child(3) { animation-delay: 260ms; }

/* Steps: staged entrance, including arrows */
.js .steps-list:not(.is-stagger-visible) li {
  opacity: 0;
  transform: translateY(26px);
}

.js .steps-list:not(.is-stagger-visible) li::after {
  opacity: 0;
}

.steps-list.is-stagger-visible li {
  animation: stagger-rise 560ms cubic-bezier(.2, .72, .2, 1) backwards;
}

.steps-list.is-stagger-visible li::after {
  animation: arrow-reveal 380ms ease backwards;
}

.steps-list.is-stagger-visible li:nth-child(1) { animation-delay: 0ms; }
.steps-list.is-stagger-visible li:nth-child(1)::after { animation-delay: 90ms; }
.steps-list.is-stagger-visible li:nth-child(2) { animation-delay: 150ms; }
.steps-list.is-stagger-visible li:nth-child(2)::after { animation-delay: 240ms; }
.steps-list.is-stagger-visible li:nth-child(3) { animation-delay: 300ms; }
.steps-list.is-stagger-visible li:nth-child(3)::after { animation-delay: 390ms; }
.steps-list.is-stagger-visible li:nth-child(4) { animation-delay: 450ms; }
.steps-list.is-stagger-visible li:nth-child(4)::after { animation-delay: 540ms; }
.steps-list.is-stagger-visible li:nth-child(5) { animation-delay: 600ms; }

/* Guarantee: top-to-bottom staged entrance */
.js .guarantee-section ul:not(.is-stagger-visible) li {
  opacity: 0;
  transform: translateY(-18px);
}

.guarantee-section ul.is-stagger-visible li {
  animation: guarantee-drop 520ms cubic-bezier(.2, .72, .2, 1) backwards;
}

.guarantee-section ul.is-stagger-visible li:nth-child(2) { animation-delay: 120ms; }
.guarantee-section ul.is-stagger-visible li:nth-child(3) { animation-delay: 240ms; }
.guarantee-section ul.is-stagger-visible li:nth-child(4) { animation-delay: 360ms; }

@keyframes stagger-rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes arrow-reveal {
  from { opacity: 0; transform: translate(-10px, -50%); }
  to { opacity: 1; transform: translate(0, -50%); }
}

@keyframes guarantee-drop {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hover lifts only on devices with a precise pointing device. */
@media (hover: hover) and (pointer: fine) {
  .owner-badges article,
  .steps-list li,
  .review-card,
  .timeline li,
  .principles-grid article {
    transition: transform 220ms ease, box-shadow 220ms ease;
  }

  .owner-badges article:hover,
  .steps-list li:hover,
  .review-card:hover,
  .timeline li:hover,
  .principles-grid article:hover {
    transform: translateY(-6px);
    box-shadow: 4px 10px 20px rgb(0 0 0 / .16);
  }
}

/* Estimate form: two-line headings and vertical separators */
.estimate-form {
  column-gap: 0;
}

.estimate-form > .form-field {
  position: relative;
  padding-inline: 16px;
}

.estimate-form > label.form-field:first-of-type {
  padding-left: 0;
}

.estimate-form > .form-field:nth-of-type(n + 2)::before, div.form-field:first-of-type::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgb(45 45 45 / .22);
}

.estimate-form > .form-field > span {
  min-height: 36px;
  display: flex;
  align-items: flex-end;
  line-height: 1.08;
}

.estimate-form > .button {
  align-self: flex-start;
  margin-top: 40px;
  margin-left: 16px;
}

.estimate-form .filepond--root,
.estimate-form .filepond--drop-label {
  min-height: 48px;
}

.estimate-form .filepond--drop-label {
  height: 48px;
}

/* Accordion smooth open/close */
.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0 18px;
  opacity: 0;
  overflow: hidden;
  transition:
    grid-template-rows 320ms cubic-bezier(.2, .7, .2, 1),
    opacity 220ms ease;
}

.accordion-panel__inner {
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
  transition: padding-bottom 320ms cubic-bezier(.2, .7, .2, 1);
}

.accordion-item.is-open .accordion-panel {
  grid-template-rows: 1fr;
  opacity: 1;
}

.accordion-item.is-open .accordion-panel__inner {
  padding-bottom: 18px;
}

/* Modal: rounded clipping, internal scrollbar and close interaction */
.modal-dialog {
  overflow: hidden;
  padding: 0;
}

.modal-scroll {
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 34px;
}

.modal-scroll::-webkit-scrollbar {
  width: 10px;
}

.modal-scroll::-webkit-scrollbar-track {
  background: rgb(45 45 45 / .06);
}

.modal-scroll::-webkit-scrollbar-thumb {
  background: rgb(7 74 73 / .55);
  border: 2px solid var(--color-surface);
  border-radius: 999px;
}

.modal-close {
  transition:
    background-color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.modal-close img {
  transition: filter var(--transition), transform var(--transition);
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--color-emerald);
  border-color: var(--color-emerald);
  transform: rotate(5deg);
}

.modal-close:hover img,
.modal-close:focus-visible img {
  filter: brightness(0) invert(1);
  transform: rotate(85deg);
}

/* Success and error animated symbols */
.request-state-dialog {
  width: min(100%, 520px);
}

.success-animation,
.error-animation {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border: 5px solid var(--color-emerald);
  border-radius: 50%;
  animation: symbol-pop 420ms cubic-bezier(.2, .8, .2, 1) both;
}

.success-animation span {
  position: absolute;
  left: 37px;
  top: 40px;
  width: 43px;
  height: 23px;
  border-left: 6px solid var(--color-emerald);
  border-bottom: 6px solid var(--color-emerald);
  transform: rotate(-45deg) scale(0);
  transform-origin: left bottom;
  animation: check-draw 480ms 260ms cubic-bezier(.2, .8, .2, 1) forwards;
}

.error-animation {
  border-color: var(--color-error);
}

.error-animation span {
  position: absolute;
  left: 22px;
  top: 43px;
  width: 43px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-error);
  transform: scaleX(0) rotate(45deg);
  animation: cross-draw-a 360ms 220ms ease forwards;
}

.error-animation span:last-child {
  transform: scaleX(0) rotate(-45deg);
  animation-name: cross-draw-b;
}

@keyframes symbol-pop {
  from { opacity: 0; transform: scale(.72); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes check-draw {
  to { transform: rotate(-45deg) scale(1); }
}

@keyframes cross-draw-a {
  to { transform: scaleX(1) rotate(45deg); }
}

@keyframes cross-draw-b {
  to { transform: scaleX(1) rotate(-45deg); }
}

/* Service price is informational, not a button. */
.service-price {
  display: block;
  margin: 12px 0 24px;
  padding: 0;
  border-radius: 0;
  font-size: 21px;
  font-weight: 800;
  color: var(--color-emerald);
  background: transparent;
}

/* Contact page phone button: emerald hover and white phone asset. */
.contact-phone-button:hover,
.contact-phone-button:focus-visible {
  color: var(--color-white);
  background: var(--color-emerald);
  border-color: var(--color-emerald);
}

.contact-phone-icon {
  position: relative;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
}

.contact-phone-icon img {
  position: absolute;
  inset: 0;
  width: 25px;
  height: 25px;
  transition: opacity var(--transition), transform var(--transition);
}

.contact-phone-icon__light {
  opacity: 0;
  transform: scale(.84);
}

.contact-phone-button:hover .contact-phone-icon__dark,
.contact-phone-button:focus-visible .contact-phone-icon__dark {
  opacity: 0;
  transform: scale(.84);
}

.contact-phone-button:hover .contact-phone-icon__light,
.contact-phone-button:focus-visible .contact-phone-icon__light {
  opacity: 1;
  transform: scale(1);
}


/* Service galleries */
.service-gallery-mobile {
  display: none;
}

.service-gallery-swiper .swiper-slide {
  display: block;
  overflow: hidden;
  border-radius: 20px;
  background: #ddd;
}

.service-gallery-swiper img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Four-line burger with equal 2.5px strokes */
.menu-toggle {
  position: relative;
  border-width: 1.5px;
  overflow: hidden;
}

.menu-toggle span {
  position: absolute;
  left: 50%;
  width: 23px;
  height: 2.5px;
  margin: 0;
  border-radius: 999px;
  background: var(--color-dark);
  transform: translateX(-50%);
  transition:
    top 240ms ease,
    transform 240ms ease,
    opacity 180ms ease;
}

.menu-toggle::before,
.menu-toggle::after {
  content: none;
}

.menu-toggle span:nth-child(1) { top: 11px; }
.menu-toggle span:nth-child(2) { top: 17px; }
.menu-toggle span:nth-child(3) { top: 23px; }
.menu-toggle span:nth-child(4) { top: 29px; }

.menu-toggle.is-active span:nth-child(1),
.menu-toggle.is-active span:nth-child(4) {
  opacity: 0;
  transform: translateX(-50%) scaleX(.2);
}

.menu-toggle.is-active span:nth-child(2) {
  top: 20px;
  transform: translateX(-50%) rotate(45deg);
}

.menu-toggle.is-active span:nth-child(3) {
  top: 20px;
  transform: translateX(-50%) rotate(-45deg);
}

.mobile-menu-scrim {
  border: 0;
  background: transparent;
}

.mobile-menu-panel {
  box-shadow: -18px 0 48px rgb(0 0 0 / .2);
}

/* Mobile scale and spacing */
@media (max-width: 1100px) {
  .estimate-form {
    column-gap: 14px;
  }

  .estimate-form > .form-field {
    padding-inline: 0;
  }

  .estimate-form > .form-field::before {
    display: none;
  }

  .estimate-form > .button {
    margin-left: 0;
    margin-top: 10px
  }
}

@media (max-width: 850px) {
  .hero__image {
    display: none;
  }

  .service-gallery--desktop {
    display: none;
  }

  .service-gallery-mobile {
    display: block;
    min-width: 0;
  }

  .service-detail {
    gap: 26px;
  }

  .service-detail__copy {
    order: 0 !important;
  }
}

@media (max-width: 760px) {
  :root {
    --page-gutter: 8px;
    --radius-section: 24px;
    --radius-card: 17px;
  }

  body {
    font-size: 14px;
    line-height: 1.42;
  }

  h1,
  .hero__copy h1,
  .legal-page h1,
  .error-page h1 {
    font-size: clamp(22px, 8.2vw, 24px);
    line-height: 1.08;
  }

  h2,
  .estimate-copy h2,
  .faq-copy h2 {
    font-size: clamp(22px, 6.2vw, 27px);
    line-height: 1.12;
  }

  h3 {
    font-size: 16px;
  }

  .eyebrow {
    margin-bottom: 9px;
    font-size: 11px;
  }

  .section-shell,
  .service-detail {
    margin-top: 14px;
    padding: 26px 14px;
  }

  main > .section-shell:first-child,
  main > .page-first {
    margin-top: 0;
    padding-top: 22px;
  }

  .page-intro {
    min-height: 230px;
  }

  .page-intro p,
  .hero__copy p,
  .error-page p {
    font-size: 16px;
    line-height: 1.38;
  }

  .hero {
    min-height: auto;
    gap: 18px;
  }

  .button {
    min-height: 48px;
    padding: 11px 16px;
    font-size: 14px;
  }

  .section-heading,
  .cases-heading {
    gap: 16px;
    margin-bottom: 22px;
  }

  .about-preview__grid,
  .about-preview__cta,
  .form-section,
  .principles,
  .guarantee-section,
  .contacts-grid {
    gap: 22px;
  }

  .about-preview__copy .lead,
  .about-preview blockquote,
  .about-preview__cta p {
    font-size: 17px;
  }

  .owner-badges {
    gap: 10px;
  }

  .owner-badges article,
  .steps-list li,
  .review-card,
  .timeline li,
  .principles article,
  .contact-card {
    padding: 18px 14px;
  }

  .steps-list {
    gap: 16px;
  }

  .steps-list li {
    min-height: auto;
  }

  .review-card {
    min-height: auto;
  }

  .owner-badges strong,
  .steps-list strong {
    font-size: 14px;
  }

  .owner-badges p,
  .steps-list p,
  .review-card blockquote,
  .timeline p {
    font-size: 12px;
  }

  .owner-badges article:hover,
  .steps-list li:hover,
  .review-card:hover,
  .timeline li:hover,
  .principles-grid article:hover {
    transform: none;
    box-shadow: var(--shadow-card);
  }


  .case-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
    overflow: visible;
  }

  .case-tab {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 8px 4px;
    font-size: 12px;
  }

  .slider-viewport {
    margin: -16px -12px -24px;
    padding: 16px 12px 24px;
  }

  .estimate-section {
    gap: 20px;
  }

  .estimate-form,
  .lead-form {
    gap: 13px;
  }

  .estimate-form > .form-field > span {
    min-height: auto;
  }

  .form-field > span {
    font-size: 13px;
  }

  .accordion-trigger {
    min-height: 50px;
    padding: 11px 13px;
    font-size: 14px;
    line-height: 1.3;
  }

  .accordion-panel {
    padding-inline: 13px;
    font-size: 13px;
  }

  .accordion-item.is-open .accordion-panel__inner {
    padding-bottom: 14px;
  }

  .modal-scroll {
    max-height: calc(100vh - 20px);
    padding: 22px 15px;
  }

  .footer-main,
  .footer-bottom {
    padding-inline: 18px;
  }

  .footer-main {
    gap: 24px;
  }

  .footer-main p,
  .footer-main a,
  .footer-main span {
    font-size: 13px;
  }

  .mobile-nav {
    margin-top: 32px;
  }

  .mobile-nav a {
    padding: 11px 0;
    font-size: 17px;
  }
}

@media (max-width: 480px) {
  .site-header {
    height: 78px;
    padding-inline: 14px;
  }

  .site-logo {
    width: 150px;
  }

  .site-logo img {
    width: 66px;
  }

  .site-logo__descriptor {
    font-size: 8px;
  }

  .menu-toggle {
    width: 46px;
    height: 42px;
  }

  .mobile-menu-panel {
    width: 76%;
    padding: 18px;
  }

  .mobile-menu-scrim {
    right: 76%;
  }

  .section-shell,
  .service-detail {
    padding-inline: 12px;
  }

  .case-card__body {
    padding: 14px;
  }

  .contact-card h2 {
    font-size: 23px;
  }

  .success-animation,
  .error-animation {
    width: 82px;
    height: 82px;
  }

  .success-animation span {
    left: 21px;
    top: 36px;
    width: 36px;
    height: 20px;
  }

  .error-animation span {
    left: 18px;
    top: 36px;
    width: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .owner-badges article,
  .steps-list li,
  .steps-list li::after,
  .guarantee-section li,
  .success-animation,
  .success-animation span,
  .error-animation,
  .error-animation span {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Final small specificity refinements */
main > .page-first.legal-page {
  max-width: var(--container);
}

.footer-cta .button:hover,
.footer-cta .button:focus-visible {
  color: #373737;
  background: var(--color-white);
  border-color: var(--color-white);
}

.contact-card--max .button:hover,
.contact-card--max .button:focus-visible {
  color: var(--color-emerald);
  background: var(--color-white);
  border-color: var(--color-white);
}

