/* Motion follows the photography: quiet reveals, framing and a reading indicator. */
.site-header-wrap { transition: box-shadow .3s, border-color .3s; }
.site-header-wrap.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 28px rgba(0, 0, 0, .1); }
.site-scroll-progress { position: absolute; bottom: -1px; left: 0; display: block; width: 100%; height: 2px; pointer-events: none; transform: scaleX(0); transform-origin: left; background: var(--text); }

@media (max-width: 820px) {
  .has-nav-toggle .site-header-wrap.is-scrolled { box-shadow: none; }
  .has-nav-toggle .site-header-wrap.is-scrolled .site-header { border-color: var(--line); box-shadow: 0 10px 32px rgba(0, 0, 0, .16); }
  .has-nav-toggle .site-scroll-progress { bottom: var(--site-header-bottom); left: max(32px, calc((100% - 520px) / 2)); width: min(520px, calc(100% - 64px)); height: 1px; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .service-pricing-link { transition: background .25s, color .25s, border-color .25s, transform .25s, box-shadow .25s; }
  .button:active, .service-pricing-link:active { transform: scale(.98); }
  .service-group, .pricing-card, .post-card { transition: border-color .3s, box-shadow .3s; }
  .floating-contact { transition: bottom .2s, background .25s, box-shadow .25s, transform .25s; }
  .contact-dialog[open] { animation: dialog-entrance .28s cubic-bezier(.2, .7, .2, 1); }
  .contact-dialog[open]::backdrop { animation: backdrop-entrance .28s ease-out; }
  .veba-faq-row[open] .veba-faq-answer { animation: answer-entrance .28s ease-out; }
  .hero-underline path { stroke-dasharray: 1; animation: memory-underline 1.25s .4s ease-out both; }
  .hero-photo-note { animation: photo-note-entrance .9s .6s cubic-bezier(.2, .7, .2, 1) both; }
  .portfolio-tab-mark { transition: transform .5s, background .3s, border-color .3s; }
  .portfolio-tab-indicator::after { animation: tab-light 1.1s .15s ease-out both; }

  @keyframes memory-underline {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
  }
  @keyframes photo-note-entrance {
    from { opacity: 0; transform: translateY(18px) rotate(-7deg); }
    to { opacity: 1; transform: translateY(0) rotate(-4deg); }
  }
  @keyframes tab-light {
    from { transform: translateX(-110%); }
    to { transform: translateX(110%); }
  }

  @keyframes dialog-entrance {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes backdrop-entrance {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @keyframes answer-entrance {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 820px) and (prefers-reduced-motion: no-preference) {
  .has-nav-toggle .site-header[data-menu-open] .site-nav { animation: answer-entrance .22s ease-out; }
  .nav-backdrop:not([hidden]) { animation: backdrop-entrance .22s ease-out; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .button:hover, .service-pricing-link:hover, .floating-contact:hover { transform: translateY(-3px); }
  .button:active, .service-pricing-link:active, .floating-contact:active { transform: translateY(0) scale(.98); }
  .service-group:hover, .pricing-card:hover, .post-card:hover { border-color: var(--text); box-shadow: 0 16px 36px rgba(0, 0, 0, .1); }
  .service-card-image img { transition: scale .65s cubic-bezier(.2, .7, .2, 1); }
  .service-group:is(:hover, :focus-within) .service-card-image img { scale: 1.035; }

  .veba-portfolio-photo::after { content: ''; position: absolute; inset: 16px; border: 1px solid rgba(243, 235, 221, .5); opacity: 0; transform: scale(1.035); transition: opacity .35s, transform .55s; pointer-events: none; }
  .veba-portfolio-item:is(:hover, :focus-visible) .veba-portfolio-photo::after { opacity: 1; transform: scale(1); }

  .veba-hero-photo.has-photo-motion img { transform: translate3d(var(--photo-x, 0px), var(--photo-y, 0px), 0) scale(1.035); transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
  .veba-hero-photo.has-photo-motion::after {
    content: ''; position: absolute; top: 0; left: 0; width: 76px; height: 76px;
    pointer-events: none; opacity: 0; color: var(--cream);
    transform: translate3d(calc(var(--focus-x, 48px) - 38px), calc(var(--focus-y, 48px) - 38px), 0);
    transition: opacity .3s, transform .18s ease-out;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .45));
    background:
      linear-gradient(currentColor, currentColor) left top / 18px 1px no-repeat,
      linear-gradient(currentColor, currentColor) left top / 1px 18px no-repeat,
      linear-gradient(currentColor, currentColor) right top / 18px 1px no-repeat,
      linear-gradient(currentColor, currentColor) right top / 1px 18px no-repeat,
      linear-gradient(currentColor, currentColor) left bottom / 18px 1px no-repeat,
      linear-gradient(currentColor, currentColor) left bottom / 1px 18px no-repeat,
      linear-gradient(currentColor, currentColor) right bottom / 18px 1px no-repeat,
      linear-gradient(currentColor, currentColor) right bottom / 1px 18px no-repeat;
  }
  .veba-hero-photo.has-photo-motion.is-framing::after { opacity: .85; }
}

@media (min-width: 821px) and (hover: hover) and (prefers-reduced-motion: no-preference) {
  .site-header .site-nav a:not(.nav-offer) { position: relative; }
  .site-header .site-nav a:not(.nav-offer)::after { content: ''; position: absolute; right: 14px; bottom: 7px; left: 14px; height: 1px; background: var(--text); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
  .site-header .site-nav a:not(.nav-offer):is(:hover, :focus-visible)::after { transform: scaleX(1); }
}
