/* Entry, navigation, and interaction share a short ease-out. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  :root {
    --ease-out: cubic-bezier(0.18, 0.78, 0.16, 1);
  }
  ::view-transition-group(root) {
    animation-duration: 0.25s;
  }
  .site-header {
    view-transition-name: site-header;
  }
  .site-header nav a[aria-current] {
    view-transition-name: active-destination;
  }
  ::view-transition-group(active-destination) {
    animation-duration: 0.32s;
    animation-timing-function: var(--ease-out);
  }
  .app-switcher summary {
    view-transition-name: app-picker;
  }
  .app-icon {
    view-transition-name: app-icon;
  }
  ::view-transition-group(site-header),
  ::view-transition-group(active-destination) {
    z-index: 2;
  }
  :root:has(.app-heading)::view-transition-group(*) {
    animation-duration: 180ms;
    animation-timing-function: var(--ease-out);
  }
  ::view-transition-old(app-picker),
  ::view-transition-old(app-icon) {
    animation: none;
    opacity: 0;
  }
  ::view-transition-new(app-picker),
  ::view-transition-new(app-icon) {
    animation: none;
  }

  .hero-intro,
  .hero-copy .actions,
  .store-intro > * {
    animation: lift-in 0.65s var(--ease-out) backwards;
  }
  .headline-line {
    animation: headline-in 0.9s var(--ease-out) backwards;
  }
  .headline-line + .headline-line {
    animation-delay: 0.09s;
  }
  .hero-intro,
  .store-intro > h1 {
    animation-delay: 0.12s;
  }
  .hero-copy .actions,
  .store-intro > p:last-child {
    animation-delay: 0.2s;
  }
  .founder-intro h1 {
    animation: headline-in 680ms var(--ease-out) backwards;
  }
  .founder-role {
    animation: stage-arrive 550ms var(--ease-out) 140ms backwards;
  }

  .hero-image img {
    transform: scale(1.035);
    translate: var(--mountain-x, 0px) var(--mountain-y, 0px);
    transition: translate 0.45s ease-out;
    animation: mountain-in 1.5s var(--ease-out) backwards;
  }
  .portrait.entered,
  .footer-inner.entered {
    animation: none;
  }
  .portrait.entered > img {
    animation: open-portrait 950ms var(--ease-out) 180ms backwards;
  }
  .portrait.entered figcaption {
    animation: lift-in 480ms var(--ease-out) 480ms backwards;
  }
  .founder-role .rule,
  .entered .rule {
    transform-origin: left;
    animation: draw-rule 0.68s var(--ease-out) backwards;
  }
  .entered {
    animation: lift-in 0.65s var(--ease-out) backwards;
  }
  .founder-bio > .entered + .entered {
    animation-delay: 120ms;
  }
  .footer-inner.entered > * {
    animation: lift-in 420ms var(--ease-out) backwards;
  }
  .footer-inner.entered > :nth-child(2) {
    animation-delay: 65ms;
  }
  .footer-inner.entered > :focus-within {
    animation: none;
  }
  .editorial-rows > .entered:nth-child(2) {
    animation-delay: 55ms;
  }
  .editorial-rows > .entered:nth-child(3) {
    animation-delay: 110ms;
  }
  .entered:focus-within {
    animation-duration: 1ms;
    animation-delay: 0s;
  }
  .prose details[open] > p {
    animation: lift-in 0.24s var(--ease-out);
  }
  .personal-links a,
  .site-header nav a {
    transition:
      transform 0.24s var(--ease-out),
      box-shadow 0.24s ease,
      background-color 0.18s ease;
  }
  .site-header nav a:active,
  .button:active {
    transform: scale(0.97);
  }
  .story-sequence.entered {
    animation: none;
  }
  .story-sequence.entered li {
    animation: stage-arrive 0.55s var(--ease-out) backwards;
  }
  .story-sequence.entered li:nth-child(2) {
    animation-delay: 0.14s;
  }
  .story-sequence.entered li:nth-child(3) {
    animation-delay: 0.28s;
  }
  .story-sequence.entered li:nth-child(4) {
    animation-delay: 0.42s;
  }
  .story-sequence.entered .story-art::after {
    animation: draw-rule 0.45s var(--ease-out) backwards;
    animation-delay: inherit;
  }
  .story-art.entered {
    animation: none;
  }
  @media (max-width: 640px) {
    .story-sequence.entered li {
      animation: none;
    }
    .story-art.entered img {
      animation: lift-in 0.5s var(--ease-out) backwards;
    }
  }
  @keyframes stage-arrive {
    from {
      opacity: 0.25;
      transform: translateX(-9px);
    }
  }
  @media (hover: hover) and (pointer: fine) {
    .personal-links a:hover {
      transform: translateY(-2px);
    }
    .button {
      isolation: isolate;
      overflow: hidden;
      position: relative;
    }
    .button::after {
      position: absolute;
      content: "";
      pointer-events: none;
      inset: -80% auto -80% -42%;
      width: 32%;
      background: linear-gradient(90deg, transparent, #89d8fb44, transparent);
      transform: skewX(-24deg);
    }
    .button:hover::after {
      animation: glass-light 0.64s ease-out;
    }
  }
  @keyframes draw-rule {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }
  @keyframes lift-in {
    from {
      opacity: 0.48;
      transform: translateY(14px);
    }
  }
  @keyframes headline-in {
    from {
      opacity: 0.4;
      transform: translateY(0.24em);
    }
  }
  @keyframes mountain-in {
    from {
      transform: scale(1.095);
      filter: grayscale(0.8) saturate(0.5) contrast(0.98) brightness(0.74);
    }
  }
  @keyframes open-portrait {
    from {
      opacity: 0.35;
      clip-path: inset(0 3% 22% round 0.55rem);
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      clip-path: inset(0 round 0.55rem);
      transform: none;
    }
  }
  @keyframes glass-light {
    to {
      left: 115%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .button:hover {
    transform: none;
  }
}
