:root {
  --reveal-duration: 0.8s;
  --reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Поява при скролі --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity var(--reveal-duration) var(--reveal-ease) var(--reveal-delay, 0ms),
    transform var(--reveal-duration) var(--reveal-ease) var(--reveal-delay, 0ms);
}

[data-reveal="zoom"] {
  transform: translateY(28px) scale(0.96);
}

[data-reveal].reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="zoom"].reveal-visible {
  transform: translateY(0) scale(1);
}

[data-reveal="slide-left"] {
  transform: translateX(-28px);
}

[data-reveal="slide-left"].reveal-visible {
  transform: translateX(0);
}

[data-reveal="slide-right"] {
  transform: translateX(28px);
}

[data-reveal="slide-right"].reveal-visible {
  transform: translateX(0);
}

/* --- Hero --- */
@media (prefers-reduced-motion: no-preference) {
  .hero-intro {
    animation: heroIntro 1.05s var(--reveal-ease) both;
  }

  .hero-pulse-dot {
    animation: heroDotPulse 2.2s ease-in-out infinite;
  }

  .hero-bg-motion {
    animation: heroBgKen 28s ease-in-out infinite alternate;
  }

  @keyframes heroIntro {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes heroDotPulse {
    0%,
    100% {
      opacity: 1;
      transform: scale(1);
    }
    50% {
      opacity: 0.65;
      transform: scale(1.25);
    }
  }

  @keyframes heroBgKen {
    from {
      background-position: center 42%;
    }
    to {
      background-position: center 58%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-intro,
  .hero-pulse-dot,
  .hero-bg-motion {
    animation: none;
  }
}

/* --- Шапка --- */
#site-header {
  transition:
    box-shadow 0.35s var(--reveal-ease),
    border-color 0.35s ease,
    background-color 0.35s ease;
}

#site-header.is-scrolled {
  box-shadow: 0 10px 40px -12px rgba(15, 23, 42, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
}

@media (prefers-reduced-motion: no-preference) {
  #site-header nav a {
    position: relative;
  }

  #site-header nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    border-radius: 1px;
    background: linear-gradient(90deg, #059669, #34d399);
    transition: width 0.28s var(--reveal-ease);
  }

  #site-header nav a:hover::after,
  #site-header nav a:focus-visible::after {
    width: 100%;
  }
}

/* --- Картки --- */
.card-elevated {
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px -6px rgba(5, 46, 22, 0.08);
  transition:
    transform 0.35s var(--reveal-ease),
    box-shadow 0.35s var(--reveal-ease),
    border-color 0.25s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .card-elevated:hover {
    transform: translateY(-4px);
    box-shadow:
      0 4px 6px rgba(15, 23, 42, 0.05),
      0 20px 44px -12px rgba(5, 46, 22, 0.14);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-elevated:hover {
    box-shadow:
      0 4px 6px rgba(15, 23, 42, 0.06),
      0 14px 36px -10px rgba(5, 46, 22, 0.1);
  }
}

/* --- Галерея --- */
@media (prefers-reduced-motion: no-preference) {
  .galeriya-img {
    transition:
      transform 0.55s var(--reveal-ease),
      box-shadow 0.35s ease;
  }

  @media (min-width: 640px) {
    .galeriya-img.reveal-visible:hover {
      transform: translateY(0) scale(1.04);
      box-shadow: 0 16px 40px -14px rgba(5, 46, 22, 0.2);
    }
  }
}

/* --- Кнопки CTA --- */
@media (prefers-reduced-motion: no-preference) {
  .btn-motion {
    transition:
      transform 0.22s var(--reveal-ease),
      box-shadow 0.22s ease,
      background-color 0.2s ease;
  }

  .btn-motion:hover {
    transform: translateY(-2px);
  }

  .btn-motion:active {
    transform: translateY(0);
  }
}

/* --- Попап подяки --- */
.popup-backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: no-preference) {
  #thank-popup.flex:not(.hidden) {
    animation: thanksBackdrop 0.35s ease both;
  }

  #thank-popup.flex:not(.hidden) .thanks-dialog {
    animation: thanksPanel 0.45s var(--reveal-ease) both;
  }

  @keyframes thanksBackdrop {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes thanksPanel {
    from {
      opacity: 0;
      transform: scale(0.92) translateY(16px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }
}

/* --- FAQ --- */
.faq-details summary {
  list-style: none;
  transition:
    background-color 0.25s ease,
    color 0.2s ease;
}

.faq-details summary::-webkit-details-marker {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .faq-details summary span:last-child {
    transition: transform 0.35s var(--reveal-ease);
  }

  .faq-details .faq-answer {
    animation: none;
  }

  .faq-details[open] .faq-answer {
    animation: faqOpen 0.4s var(--reveal-ease) both;
  }

  @keyframes faqOpen {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* --- Фон hero --- */
.hero-bg {
  background-image: linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.94) 0%,
      rgba(240, 253, 244, 0.88) 42%,
      rgba(255, 255, 255, 0.92) 100%
    ),
    url("https://images.unsplash.com/photo-1625246333195-78d9c38ad449?q=85&w=2400&auto=format&fit=crop");
  background-size: cover;
  background-position: center;
}

.hero-bg.hero-bg-motion {
  background-size: 110% auto;
}

@media (min-width: 1024px) {
  .hero-bg {
    background-image: linear-gradient(
        112deg,
        rgba(5, 46, 22, 0.34) 0%,
        rgba(22, 101, 52, 0.22) 34%,
        rgba(255, 255, 255, 0.18) 62%,
        rgba(255, 255, 255, 0.84) 100%
      ),
      url("https://images.unsplash.com/photo-1625246333195-78d9c38ad449?q=85&w=2400&auto=format&fit=crop");
    background-position: center 36%;
  }

  .hero-intro {
    border-color: rgba(255, 255, 255, 0.7);
    background-color: rgba(255, 255, 255, 0.86);
  }
}

@media (max-width: 768px) {
  .hero-bg {
    background-position: center 25%;
  }

  .hero-bg.hero-bg-motion {
    background-size: cover;
  }
}

/* --- CTA-смуги між секціями --- */
@media (prefers-reduced-motion: no-preference) {
  .cta-strip > div {
    transition:
      transform 0.35s var(--reveal-ease),
      box-shadow 0.35s ease;
  }

  .cta-strip:hover > div {
    transform: translateY(-3px);
  }

  .cta-strip:not(.cta-strip--dark):hover > div {
    box-shadow: 0 14px 44px -18px rgba(5, 46, 22, 0.14);
  }

  .cta-strip--dark:hover > div {
    box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.35);
  }
}

/* --- Hover-анімації по сторінці (миша) --- */
@media (prefers-reduced-motion: no-preference) {
  .hover-surface-trust {
    transition:
      transform 0.3s var(--reveal-ease),
      border-color 0.25s ease,
      box-shadow 0.3s ease;
  }

  .hover-surface-trust:hover {
    transform: translateY(-3px);
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 10px 28px -14px rgba(5, 46, 22, 0.12);
  }

  .posluga-card {
    transition:
      transform 0.32s var(--reveal-ease),
      border-color 0.25s ease,
      box-shadow 0.32s ease;
  }

  .posluga-card:hover {
    transform: translateY(-4px);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 14px 36px -12px rgba(5, 46, 22, 0.14);
  }

  .media-hover img {
    transition: transform 0.55s var(--reveal-ease);
  }

  .media-hover:hover img {
    transform: scale(1.05);
  }

  .stat-item {
    transition:
      border-color 0.25s ease,
      background-color 0.25s ease,
      box-shadow 0.28s ease;
    border-radius: 0 8px 8px 0;
  }

  .stat-item:hover {
    background-color: rgba(236, 253, 245, 0.65);
    border-left-color: #059669;
    box-shadow: 4px 0 0 0 rgba(5, 150, 105, 0.15);
  }

  .table-shell {
    transition:
      box-shadow 0.35s ease,
      border-color 0.25s ease;
  }

  .table-shell:hover {
    box-shadow: 0 16px 40px -14px rgba(5, 46, 22, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
  }

  .table-shell tbody tr {
    transition: background-color 0.2s ease;
  }

  .table-shell tbody tr:hover {
    background-color: rgba(236, 253, 245, 0.55);
  }

  .compare-card {
    transition:
      transform 0.32s var(--reveal-ease),
      box-shadow 0.32s ease,
      border-color 0.25s ease;
  }

  .compare-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px -12px rgba(15, 23, 42, 0.1);
  }

  .proces-krok {
    transition:
      transform 0.3s var(--reveal-ease),
      border-color 0.25s ease,
      box-shadow 0.3s ease;
  }

  .proces-krok:hover {
    transform: translateY(-5px);
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 12px 32px -10px rgba(5, 46, 22, 0.12);
  }

  .bullet-card {
    transition:
      transform 0.28s var(--reveal-ease),
      border-color 0.22s ease,
      box-shadow 0.28s ease;
  }

  .bullet-card:hover {
    transform: translateX(4px);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 6px 20px -10px rgba(5, 46, 22, 0.1);
  }

  .faq-details {
    transition:
      border-color 0.25s ease,
      box-shadow 0.28s ease;
  }

  .faq-details:hover {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 8px 26px -12px rgba(5, 46, 22, 0.1);
  }

  .logo-mark {
    transition:
      transform 0.28s var(--reveal-ease),
      border-color 0.25s ease,
      box-shadow 0.28s ease;
  }

  #site-header a:hover .logo-mark,
  #site-header a:focus-visible .logo-mark {
    transform: scale(1.06) rotate(-2deg);
    border-color: rgba(5, 150, 105, 0.55);
    box-shadow: 0 6px 18px -8px rgba(5, 46, 22, 0.2);
  }

}

/* --- Доступність: контрастні фокуси (лише клавіатура) --- */
.skip-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #047857;
}

#site-header nav a:focus-visible {
  outline: 3px solid #065f46;
  outline-offset: 4px;
  border-radius: 6px;
}

#site-header a[href^="tel"]:focus-visible {
  outline: 3px solid #065f46;
  outline-offset: 3px;
  border-radius: 6px;
}

main a:focus-visible:not(.btn-motion),
footer a:focus-visible {
  outline: 3px solid #065f46;
  outline-offset: 3px;
  border-radius: 4px;
}

#site-header > div > a[href="#"]:focus-visible {
  outline-offset: 4px;
  border-radius: 10px;
}

.btn-motion.bg-emerald-600:focus-visible {
  outline: 3px solid #fefce8;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #064e3b;
}

.btn-motion.border-zinc-300:focus-visible,
.btn-motion.bg-white:focus-visible {
  outline: 3px solid #065f46;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #fff;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #065f46;
  outline-offset: 2px;
}

.faq-details summary:focus-visible {
  outline: 3px solid #065f46;
  outline-offset: 3px;
  border-radius: 14px;
}

#thank-popup .thanks-dialog button:focus-visible {
  outline: 3px solid #fefce8;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #064e3b;
}

/* --- Мобільна навігація --- */
body.mobile-nav-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .mobile-nav:not(.hidden) .mobile-nav-panel {
    animation: mobileNavPanelIn 0.32s var(--reveal-ease) both;
  }

  .mobile-nav:not(.hidden) > div:first-child {
    animation: mobileNavBackdropIn 0.28s ease both;
  }

  @keyframes mobileNavPanelIn {
    from {
      opacity: 0.98;
      transform: translateX(12px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @keyframes mobileNavBackdropIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}

.mobile-nav-burger-line {
  transform-origin: center;
  transition:
    transform 0.25s var(--reveal-ease),
    opacity 0.2s ease;
}

#mobile-nav-toggle.is-open .mobile-nav-burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#mobile-nav-toggle.is-open .mobile-nav-burger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

#mobile-nav-toggle.is-open .mobile-nav-burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-link {
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.mobile-nav-link:active {
  background-color: rgba(236, 253, 245, 0.95);
}

@media (hover: hover) {
  .mobile-nav-link:hover {
    background-color: rgba(236, 253, 245, 0.75);
    color: #065f46;
  }
}

#mobile-nav-toggle:focus-visible,
.tap-target-icon:focus-visible {
  outline: 3px solid #065f46;
  outline-offset: 3px;
}

.mobile-nav-link:focus-visible {
  outline: 3px solid #065f46;
  outline-offset: 2px;
}

.faq-details summary {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 767px) and (hover: none) {
  .cta-strip:hover > div {
    transform: none;
  }

  .cta-strip:not(.cta-strip--dark):hover > div,
  .cta-strip--dark:hover > div {
    box-shadow: none;
  }
}

/* --- Липка кнопка (лише мобільні) --- */
.mobile-scroll-cta {
  visibility: hidden;
  pointer-events: none;
  transform: translateY(110%);
  opacity: 0;
  transition:
    transform 0.32s var(--reveal-ease),
    opacity 0.28s ease,
    visibility 0s linear 0.35s;
}

.mobile-scroll-cta.mobile-scroll-cta--visible {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  opacity: 1;
  transition:
    transform 0.32s var(--reveal-ease),
    opacity 0.28s ease,
    visibility 0s linear 0s;
}

@media (max-width: 767px) {
  body.has-mobile-scroll-cta {
    padding-bottom: 5.25rem;
  }
}

.mobile-scroll-cta a:focus-visible {
  outline: 3px solid #fefce8;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #064e3b;
}

/* --- Каруселі (стрілки + крапки) --- */
[data-carousel-wrap] {
  position: relative;
}

.carousel-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(255, 255, 255, 0.95);
  font-size: 1.35rem;
  line-height: 1;
  color: #065f46;
  box-shadow: 0 4px 14px -4px rgba(15, 23, 42, 0.15);
  transform: translateY(-50%);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.carousel-nav:active {
  background: #ecfdf5;
}

.carousel-nav--prev {
  left: 0.15rem;
}

.carousel-nav--next {
  right: 0.15rem;
}

.carousel-nav:focus-visible {
  outline: 3px solid #065f46;
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .carousel-viewport {
    padding-inline: 2.6rem;
    scroll-padding-inline: 2.6rem;
  }
}

.carousel-dot {
  height: 0.45rem;
  width: 0.45rem;
  border-radius: 9999px;
  border: none;
  padding: 0;
  background: rgba(5, 150, 105, 0.28);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.carousel-dot--active {
  transform: scale(1.25);
  background: #059669;
}

.carousel-dot:focus-visible {
  outline: 3px solid #065f46;
  outline-offset: 2px;
}
