/* src/styles/global-motion.css */
/* Global motion: smooth scrolling, reveals, hover transitions, page transitions. */

html {
  scroll-behavior: smooth;
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Link & button transitions everywhere ---------- */
a {
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.btn {
  transition: background-color 0.2s ease, color 0.2s ease,
              border-color 0.2s ease, transform 0.2s ease,
              box-shadow 0.2s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(28, 43, 58, 0.18);
}
.btn:active {
  transform: translateY(0);
}

/* Card hover lift */
.svc-card, .p-card, .proj-card, .how-step, .value-card, .town-card,
.faq-item, .helpbox, .trust-item, .footer-col, .cline {
  transition: transform 0.25s ease, box-shadow 0.25s ease,
              border-color 0.25s ease, background-color 0.25s ease;
}
.svc-card:hover, .p-card:hover, .proj-card:hover, .how-step:hover,
.value-card:hover, .town-card:hover, .faq-item:hover, .cline:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(28, 43, 58, 0.12);
  border-color: var(--copper);
}

/* Nav underline slide */
.main-nav a {
  transition: color 0.2s ease, border-color 0.25s ease;
}
.nav-phone {
  transition: color 0.2s ease;
}

/* Image placeholders: subtle media zoom on hover where real images will live. */
.proj-media img, .p-media img, .imgph {
  transition: transform 0.4s ease;
}
.p-card:hover .imgph, .proj-card:hover .imgph {
  transform: scale(1.02);
}

/* Filter buttons */
.filter-btn {
  transition: background-color 0.2s ease, color 0.2s ease,
              border-color 0.2s ease;
}

/* ---------- Page-to-page view transition (View Transitions API) ---------- */
::view-transition-old(root) {
  animation: none;
  z-index: 1;
}
::view-transition-new(root) {
  animation: page-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  z-index: 9999;
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Reduced motion: respect user preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn:hover,
  .svc-card:hover, .p-card:hover, .proj-card:hover, .how-step:hover,
  .value-card:hover, .town-card:hover, .faq-item:hover, .cline:hover,
  .p-card:hover .imgph, .proj-card:hover .imgph {
    transform: none;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* ============================================================
   SECTION RHYTHM
   The home/service sections below have inner containers that only
   carry horizontal padding (padding: 0 24px), so they sit flush at
   the top and bottom of their coloured band. Give those specific
   section wrappers vertical breathing room. (Other sections already
   have vertical padding via their inner containers, so they are left
   alone to avoid doubling the space.)
   ============================================================ */
section.services-section,
section.how-section,
section.projects-section,
section.values-section {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

/* ============================================================
   NAV — keep every label on a single line ("Areas Covered" must not
   wrap to two lines on desktop). Hide the phone slightly earlier on
   narrow desktops so the six nav labels always fit on one row.
   ============================================================ */
.main-nav a {
  white-space: nowrap;
}
@media (max-width: 1180px) and (min-width: 901px) {
  .nav-phone {
    display: none;
  }
  .main-nav ul {
    column-gap: 16px;
  }
  .main-nav a {
    font-size: var(--text-xs);
  }
}
