@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

@keyframes content-arrive {
  from { opacity: .62; translate: 0 11px; }
  to { opacity: 1; translate: none; }
}

@keyframes scroll-arrive {
  from { opacity: var(--reveal-fade, .32); translate: 0 var(--reveal-rise, 26px); }
  to { opacity: 1; translate: none; }
}

@keyframes shoreline-depart {
  to { opacity: .12; translate: 0 -24px; }
}

@keyframes hero-depart {
  to { opacity: .25; translate: 0 -36px; }
}

@keyframes image-settle {
  from { transform: scale(1.035); }
  to { transform: scale(1); }
}

@keyframes surface-arrive {
  from { opacity: .55; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-group(root) {
    animation-duration: 290ms;
    animation-timing-function: cubic-bezier(.4,.08,.3,1);
  }

  :is([data-enter], .hero-copy > *, .profile-caption > *, .catalogue-intro > *) {
    animation: content-arrive 430ms var(--ease-out) both;
  }
  .hero-copy[data-enter] { animation: none; }
  .hero-copy h1 { animation-duration: 700ms; }
  :is(.hero-copy p, .catalogue-intro p, .profile-actions, [data-enter="follow"]) {
    animation-duration: 550ms;
    animation-delay: 85ms;
  }
  .hero-copy .hero-action { animation-delay: 150ms; }
  .catalogue-controls[data-enter] { animation-delay: 160ms; }

  [data-reveal="image"] { --reveal-fade: .24; --reveal-rise: 34px; --reveal-duration: 750ms; }
  [data-reveal="soft"] { --reveal-fade: .63; --reveal-rise: 13px; --reveal-duration: 570ms; }
  [data-reveal="late"] { --reveal-delay: 100ms; }
  .inquire-card[data-reveal] { --reveal-fade: .76; --reveal-rise: 16px; }
  .landscape-panel[data-reveal] { --reveal-fade: .68; --reveal-rise: 30px; --reveal-duration: 710ms; }
  .footer-ascii-mark[data-reveal] { --reveal-rise: 0px; }
  @media (max-width: 760px) {
    [data-reveal] { --reveal-rise: 17px; }
    [data-reveal="soft"] { --reveal-rise: 8px; }
    [data-reveal="image"] { --reveal-rise: 24px; }
    .landscape-panel[data-reveal] { --reveal-rise: 20px; }
  }

  @media (min-width: 621px) and (max-width: 1059px) {
    .site-card:nth-child(2n of .site-card:not([hidden])) { --reveal-delay: 95ms; }
  }
  @media (min-width: 1060px) {
    .site-card:nth-child(3n + 2 of .site-card:not([hidden])) { --reveal-delay: 90ms; }
    .site-card:nth-child(3n of .site-card:not([hidden])) { --reveal-delay: 180ms; }
  }

  @supports (animation-timeline: view()) {
    .hero { view-timeline-name: --hero-scroll; }
    .hero .image-ascii {
      animation: shoreline-depart linear both;
      animation-timeline: --hero-scroll;
      animation-range: exit 3% exit 82%;
    }
    .hero .hero-copy {
      animation: hero-depart linear both;
      animation-timeline: --hero-scroll;
      animation-range: exit 12% exit 68%;
    }
    .featured-grid .site-card { view-timeline-name: --featured-card; }
    .featured-grid .site-card-image {
      animation: image-settle var(--ease-out) backwards;
      animation-timeline: --featured-card;
      animation-range: entry 2% cover 47%;
    }
  }

  [data-reveal-pending] { opacity: var(--reveal-fade, .32); translate: 0 var(--reveal-rise, 26px); }
  [data-revealed] {
    animation: scroll-arrive var(--reveal-duration, 680ms) cubic-bezier(.22,.6,.34,1) var(--reveal-delay, 0ms) both;
  }
  .profile-cover img:first-child { animation: image-settle 630ms var(--ease-out); }

  /* Let the destination arrive as one scene instead of replaying its load animation. */
  :root[data-page-transition] :is([data-enter], .hero-copy > *, .profile-caption > *, .catalogue-intro > *, .profile-cover img:first-child) {
    animation: none;
  }

  .select-options:not([hidden]) { animation: surface-arrive 140ms var(--ease-out) both; }
  :is(.inquire-modal[open], .demo-restore-dialog[open], .photo-viewer:not([hidden]), .compare-site > a) {
    animation: surface-arrive 240ms var(--ease-out) both;
  }

  .mobile-menu::before, .mobile-menu::backdrop, .mobile-menu-links {
    opacity: 1;
    transition: opacity 250ms var(--ease-out);
  }
  .mobile-menu-links { transition: opacity 240ms var(--ease-out), translate 290ms var(--ease-out); }
  .mobile-menu[data-closing]::before, .mobile-menu[data-closing]::backdrop,
  .mobile-menu[data-closing] .mobile-menu-links {
    opacity: 0;
    transition-duration: 145ms;
  }
  .mobile-menu[data-closing] .mobile-menu-links { translate: 0 -7px; }
  @starting-style {
    .mobile-menu[open]::before, .mobile-menu[open]::backdrop, .mobile-menu[open] .mobile-menu-links {
      opacity: 0;
    }
    .mobile-menu[open] .mobile-menu-links { translate: 0 -9px; }
  }

  .question-indicator::after { transition: transform 220ms var(--ease-out), opacity 180ms var(--ease-out); }

  :is(.button, .menu-button):active:not(:disabled) { scale: .985; }
  :is([data-enter], [data-reveal], .profile-caption > *):is(:focus-within, :target) {
    animation: none;
    opacity: 1;
    translate: none;
  }
}
