/* ============================================================
   UI / UX polish layer
   ============================================================ */

::selection {
  background: rgba(47, 93, 74, 0.28);
  color: var(--color-forest);
}

:focus-visible {
  outline: 2px solid var(--color-leaf);
  outline-offset: 3px;
}

/* Soft page enter */
body.page-ready {
  animation: page-in 0.55s var(--ease) both;
}

@keyframes page-in {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

/* Slightly glassier header bar for centered nav presence */
.site-header.is-scrolled {
  height: 64px;
  background: rgba(250, 251, 250, 0.92);
}

.site-header:not(.is-scrolled) {
  background: linear-gradient(180deg, rgba(12, 28, 22, 0.45), transparent);
}

.site-header.is-scrolled .logo img {
  width: 44px;
  height: 44px;
}

/* Primary nav — all links visible */
.site-nav {
  gap: 0.55rem 0.95rem;
}

.nav-more {
  position: relative;
}

.nav-more__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.15rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
  cursor: pointer;
}

.site-header:not(.is-scrolled) .nav-more__btn {
  color: rgba(255, 255, 255, 0.88);
}

.site-header.is-scrolled .nav-more__btn,
body.page-inner .nav-more__btn {
  color: var(--color-ink-soft);
}

.nav-more__btn:hover,
body.page-inner .nav-more__btn:hover {
  color: var(--color-forest);
}

.site-header:not(.is-scrolled) .nav-more__btn:hover {
  color: #fff;
}

.nav-more__chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition);
}

.nav-more.is-open .nav-more__chevron {
  transform: rotate(225deg) translateY(-1px);
}

.nav-more__menu {
  position: absolute;
  top: calc(100% + 0.85rem);
  right: 0;
  min-width: 220px;
  padding: 0.55rem;
  border-radius: 14px;
  background: rgba(250, 251, 250, 0.96);
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 40px rgba(22, 28, 25, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity var(--transition),
    transform var(--transition),
    visibility 0s linear 0.2s;
  z-index: 120;
}

.nav-more.is-open .nav-more__menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.nav-more__menu a {
  display: block;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: var(--color-forest) !important;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-more__menu a::after {
  display: none !important;
}

.nav-more__menu a:hover,
.nav-more__menu a.is-active {
  background: rgba(47, 93, 74, 0.08);
}

/* Mobile drawer — only on small screens */
@media (max-width: 860px) {
  .mobile-nav {
    inset: 0;
    top: 0;
    padding:
      calc(var(--header-h) + 1rem)
      1.25rem
      calc(1.5rem + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 36, 28, 0.97);
    backdrop-filter: blur(16px);
    gap: 0.15rem;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.45s var(--ease),
      opacity 0.35s ease;
    display: flex !important;
    border: 0;
    z-index: 95;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  .mobile-nav__cta {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .mobile-nav__contact {
    color: #fff !important;
    font-size: 1.45rem !important;
    font-family: var(--font-display);
    font-weight: 600;
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 0.65rem 0 !important;
    border-bottom: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .mobile-nav__cta .btn {
    margin-top: 0 !important;
  }

  .mobile-nav a {
    color: #eef5f0 !important;
    font-size: 1.1rem;
    font-family: var(--font-display);
    font-weight: 600;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: translateX(16px);
  }

  .mobile-nav.is-open > a {
    animation: mobile-link-in 0.45s var(--ease) forwards;
  }

  .mobile-nav.is-open > a:nth-of-type(1) { animation-delay: 0.05s; }
  .mobile-nav.is-open > a:nth-of-type(2) { animation-delay: 0.09s; }
  .mobile-nav.is-open > a:nth-of-type(3) { animation-delay: 0.13s; }
  .mobile-nav.is-open > a:nth-of-type(4) { animation-delay: 0.17s; }
  .mobile-nav.is-open > a:nth-of-type(5) { animation-delay: 0.21s; }
  .mobile-nav.is-open > a:nth-of-type(6) { animation-delay: 0.25s; }
  .mobile-nav.is-open > a:nth-of-type(7) { animation-delay: 0.29s; }

  .mobile-nav .btn {
    margin-top: 0;
    width: 100%;
    min-height: 52px;
    font-family: var(--font-body);
    font-size: 0.98rem;
    border-bottom: 0;
    justify-content: center;
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .site-header {
    z-index: 110;
  }

  body.nav-open .menu-toggle {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
  }

  body.nav-open .menu-toggle span {
    background: #fff;
  }
}

@keyframes mobile-link-in {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Buttons — livelier press */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.22), transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease);
}

.btn:hover::after {
  transform: translateX(120%);
}

/* Service cards — stronger hierarchy */
.service-detail {
  transition:
    transform 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    border-color 0.45s var(--ease);
}

.service-detail:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
}

.service-detail--accent:hover {
  box-shadow: 0 22px 48px rgba(12, 28, 22, 0.35);
}

.service-detail__list li {
  transition: color 0.25s ease, transform 0.25s ease;
}

.service-detail:hover .service-detail__list li {
  transform: translateX(2px);
}

.service-nav {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 20;
  padding: 0.55rem 0;
  background: linear-gradient(180deg, rgba(250, 251, 250, 0.94), rgba(250, 251, 250, 0.82));
  backdrop-filter: blur(10px);
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

/* Projects — ken burns on hover already; add lift */
.project-card {
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  box-shadow: 0 0 0 transparent;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

/* Forms */
.form-row input,
.form-row textarea,
.form-row select {
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    transform 0.2s ease;
}

.form-row input:hover,
.form-row textarea:hover,
.form-row select:hover {
  border-color: rgba(47, 93, 74, 0.28);
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  background: #fff;
  transform: translateY(-1px);
}

/* WhatsApp — quieter pulse, clearer hit area */
.whatsapp-float {
  width: 60px;
  height: 60px;
  animation: pulse-wa 3.6s ease-in-out infinite;
}

.whatsapp-float:focus-visible {
  outline-color: #25d366;
}

/* Section divider breath */
.section + .section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: min(120px, 30vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(47, 93, 74, 0.28), transparent);
  opacity: 0.7;
}

.about::before,
.process::before,
.clients::before {
  display: none;
}

/* Hero content float-in refinement */
.hero__content {
  animation: hero-content-settle 0.55s var(--ease) both;
}

@keyframes hero-content-settle {
  from {
    opacity: 0.85;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

body.has-intro .hero__content {
  animation: none;
}

body.is-revealing .hero__content {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero__media img,
  .hero__media video {
    transform: scale(1.05) !important;
    filter: brightness(1.05) saturate(1.15) !important;
    animation: none !important;
  }

  .hero:not(.is-alive) .hero__brand,
  .hero:not(.is-alive) .hero h1,
  .hero:not(.is-alive) .hero__headline,
  .hero:not(.is-alive) .hero__sub,
  .hero:not(.is-alive) .hero__actions,
  .hero:not(.is-alive) .hero__scroll,
  .hero.is-alive .hero__brand,
  .hero.is-alive .hero h1,
  .hero.is-alive .hero__headline,
  .hero.is-alive .hero__sub,
  .hero.is-alive .hero__actions,
  .hero.is-alive .hero__scroll {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* Image lazy fade */
img[loading='lazy'] {
  background: var(--color-mist);
}

/* Cursor-friendly gallery */
.gallery-item {
  border: 0;
  padding: 0;
  background: transparent;
  transition: transform 0.45s var(--ease);
}

.gallery-item:hover {
  transform: translateY(-3px);
}

.gallery-item:focus-visible {
  outline-offset: 4px;
}

/* Progress rail (desktop) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 200;
  background: linear-gradient(90deg, var(--color-leaf), var(--color-accent));
  pointer-events: none;
  transition: width 0.05s linear;
}

@media (max-width: 860px) {
  .site-nav {
    display: none;
  }

  .nav-more {
    display: none;
  }

  .service-nav {
    position: static;
    background: transparent;
    backdrop-filter: none;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  .service-nav button {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-ready,
  .hero__content,
  .mobile-nav.is-open a,
  .btn::after {
    animation: none !important;
  }

  .btn::after {
    display: none;
  }
}
