/* Motion belongs to the landing; all content and native controls work without it. */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 1;
    translate: 0 0;
    transition: opacity 700ms var(--ease-out) var(--reveal-delay, 0ms),
      translate 850ms var(--ease-out) var(--reveal-delay, 0ms);
  }
  [data-reveal='pending'] { opacity: 0; translate: 0 28px; }
  [data-reveal]:focus-within { opacity: 1; transition-delay: 0ms; }
  .hero-form[data-reveal], .visit-card[data-reveal] { transition-duration: 600ms, 800ms; }
  .image-strip > img[data-reveal], .planning-sketch[data-reveal] { transition-duration: 850ms, 1000ms; }
  .footer-large[data-reveal='pending'] { translate: 0 18px; }

  .hero-picture { overflow: clip; }
  .contact-section { overflow: clip; }
  [data-parallax] { transform: translate3d(0, var(--photo-offset, 0px), 0) scale(1.12); }

  .primary-nav a { position: relative; transition: color 220ms ease; }
  .primary-nav a::after {
    content: '';
    position: absolute;
    inset: auto 0 7px;
    height: 1px;
    background: var(--brand-accent-ink);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 350ms var(--ease-out);
  }
  .text-link, .footer-bottom a, .footer-contact a, .footer-location a {
    transition: color 220ms ease, opacity 220ms ease;
  }
  .text-link > span, .text-link > svg, .visit-button > span, .contact-button > svg {
    transition: transform 350ms var(--ease-out);
  }
  .contact-button, .visit-button, .contact-card button[type='submit'],
  .testimonial-controls button, .dialog-close {
    transition: transform 300ms var(--ease-out), background 250ms ease,
      color 250ms ease, border-color 250ms ease, box-shadow 300ms ease;
  }
  .contact-card input, .contact-card textarea {
    transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
  }
  .contact-card input:focus-visible, .contact-card textarea:focus-visible {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 4px rgb(242 100 25 / 18%);
  }
  .project-card {
    transition: opacity 700ms var(--ease-out) var(--reveal-delay, 0ms),
      translate 850ms var(--ease-out) var(--reveal-delay, 0ms),
      border-color 300ms ease, box-shadow 400ms ease;
  }
  .image-button img { transition: transform 900ms var(--ease-out); }
  .toggle-icon::after { transition: transform 350ms var(--ease-out); }
  .discipline summary, .faq-item summary { transition: color 220ms ease; }

  .project-dialog[open] { animation: dialog-enter 350ms var(--ease-out) both; }
  .project-dialog[open]::backdrop { animation: backdrop-enter 300ms ease both; }

  @supports (interpolate-size: allow-keywords) {
    .discipline, .faq-item { interpolate-size: allow-keywords; }
    .discipline::details-content, .faq-item::details-content {
      block-size: 0;
      overflow: clip;
      transition: block-size 420ms var(--ease-out), content-visibility 420ms allow-discrete;
    }
    .discipline[open]::details-content, .faq-item[open]::details-content { block-size: auto; }
  }

  @media (hover: hover) and (pointer: fine) {
    .primary-nav a:hover { color: var(--brand-accent-ink); opacity: 1; }
    .primary-nav a:hover::after, .primary-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
    .text-link:hover { opacity: .8; }
    .text-link:hover > span, .text-link:hover > svg, .visit-button:hover > span { transform: translate(3px, -3px); }
    .contact-button:hover, .visit-button:hover, .contact-card button[type='submit']:not(:disabled):hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 22px rgb(242 100 25 / 18%);
    }
    .testimonial-controls button:hover, .dialog-close:hover { transform: scale(1.08); }
    .project-card:hover { border-color: #cfc0b5; box-shadow: 0 14px 36px rgb(0 0 0 / 6%); }
    .image-button:hover img { transform: scale(1.045); }
    .discipline summary:hover, .faq-item summary:hover { color: var(--brand-accent-ink); }
    .footer-contact a:hover, .footer-location a:hover { color: var(--brand-accent-ink); }
  }

  @media (max-width: 767px) {
    [data-reveal='pending'] { translate: 0 18px; }
    [data-reveal] { transition-duration: 550ms, 650ms; }
    .site-header[data-menu-open] .primary-nav { animation: menu-enter 280ms var(--ease-out) both; }
  }

  .contact-button:active, .visit-button:active, .contact-card button[type='submit']:not(:disabled):active,
  .testimonial-controls button:active, .dialog-close:active { transform: scale(.97); }
}

@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes menu-enter {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; translate: none; }
  [data-parallax] { transform: none; }
  *, *::before, *::after { animation: none !important; }
}
