/* Dentaloft motion system. Content remains visible without JavaScript. */
:root {
  --motion-ease: cubic-bezier(.2,.75,.25,1);
  --motion-accent: #178c83;
}

@media (prefers-reduced-motion: no-preference) {
  [data-motion].motion-entered {
    animation: dentaloft-lift .65s var(--motion-ease) both;
    animation-delay: var(--motion-delay, 0ms);
  }
  [data-motion="heading"].motion-entered {
    animation-name: dentaloft-text;
    animation-duration: .62s;
  }
  [data-motion="photo"].motion-entered {
    animation-name: dentaloft-photo;
    animation-duration: .78s;
  }
  [data-motion="hero"].motion-entered {
    animation-name: dentaloft-hero;
    animation-duration: .85s;
  }
  /* Focused controls must never be obscured during a reveal. */
  [data-motion].motion-entered:focus-within { animation: none; }

  @keyframes dentaloft-lift {
    from { opacity: .12; translate: 0 24px; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes dentaloft-text {
    from { opacity: .18; translate: 0 17px; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes dentaloft-photo {
    from { opacity: .18; translate: 0 20px; scale: .985; }
    to { opacity: 1; translate: 0 0; scale: 1; }
  }
  @keyframes dentaloft-hero {
    from { opacity: .25; translate: 0 24px; }
    to { opacity: 1; translate: 0 0; }
  }

  .btn, .sticky-mobile-bar-btn, .case-tab, .services-directory-categories a {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  }
  .card-link, .canva-dentist-list a, .canva-treatment-links a, .canva-branch,
  .case-comparison, .smile-story, .panel-entry, .home-panel-logos a, .branch-panel-logos a {
    transition: border-color .25s ease, box-shadow .3s var(--motion-ease), background-color .25s ease;
  }
  main img:not(.case-photo), .canva-hero-visual {
    transition: scale .45s var(--motion-ease), box-shadow .3s var(--motion-ease), outline-color .25s ease;
  }

  /* Narrow screens retain the reveal but use a smaller travel distance. */
  @media(max-width: 719px) {
    [data-motion].motion-entered { animation-duration: .52s; }
    [data-motion="photo"].motion-entered, [data-motion="hero"].motion-entered { animation-duration: .64s; }
    @keyframes dentaloft-lift { from { opacity: .18; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
    @keyframes dentaloft-text { from { opacity: .25; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
    @keyframes dentaloft-photo { from { opacity: .25; translate: 0 14px; scale: .99; } to { opacity: 1; translate: 0 0; scale: 1; } }
    @keyframes dentaloft-hero { from { opacity: .3; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
  }
}

/* Image highlights use borders and a soft teal halo, never captions/popups. */
@media (hover: hover) and (pointer: fine) {
  main :is(.card-link,.canva-dentist-list a,.canva-treatment-links a,.canva-branch,.smile-story,.panel-entry,.home-panel-logos a,.branch-panel-logos a):hover {
    border-color: var(--motion-accent);
    box-shadow: 0 0 0 2px rgba(23,140,131,.16), 0 10px 26px rgba(18,52,48,.10);
  }
  main img:not(.case-photo):hover {
    outline: 2px solid var(--motion-accent);
    outline-offset: -2px;
    box-shadow: 0 0 0 3px rgba(23,140,131,.15);
  }
  main .case-comparison:hover { border-color: var(--motion-accent); box-shadow: 0 0 0 2px rgba(23,140,131,.16); }
  .canva-hero-visual:hover { filter: drop-shadow(0 0 20px rgba(80,202,185,.18)); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  main :is(.canva-treatment-links a,.canva-branch-photo,.services-directory-card,.branch-card):hover img:not(.case-photo) { scale: 1.025; }
  main :is(.dentist-card,.canva-dentist-list a,.dentist-profile-directory-portrait):hover .dentist-card-photo { scale: 1.018; }
}
main :is(.card-link,.canva-dentist-list a,.canva-treatment-links a,.home-panel-logos a,.branch-panel-logos a):focus-visible {
  outline: 2px solid var(--motion-accent); outline-offset: 3px;
}

/* A slim page-reading indicator; no impact on the header layout. */
.motion-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg,#178c83,#6ccfc0);
  transform: scaleX(var(--motion-progress,0));
  transform-origin: left center;
  z-index: 600;
  pointer-events: none;
}
@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .motion-progress { display: none; }
}
