/* The same interactions are used in the theme and its six static previews. */
:root {
  --agy-ease: cubic-bezier(.22, 1, .36, 1);
  --agy-marker: #f2d58e;
  --agy-focus: #9a480a;
}

/* Keep the underline within the label, independent of the menu hit area. */
.nav a:not(.booking) {
  position: relative;
  text-decoration: none;
}
.nav a:not(.booking)::after {
  content: "";
  position: absolute;
  inset: auto 0 2px;
  border-bottom: 2px solid currentColor;
  transform: scaleX(0);
  transition: transform .28s var(--agy-ease);
}
.nav a:not(.booking):is([aria-current="page"], :focus-visible, :active)::after {
  transform: scaleX(1);
}

/* A highlighter stroke distinguishes the few links that advance the reading path. */
main a.editorial-link,
.card-jump a.textlink,
.article-listen a {
  background-image: linear-gradient(var(--agy-marker), var(--agy-marker));
  background-position: left calc(50% + .55em);
  background-size: 100% .2em;
  background-repeat: no-repeat;
  color: var(--blue);
  text-decoration: none;
  transition: background-size .32s var(--agy-ease);
}
main a.editorial-link:is(:focus-visible, :active),
.card-jump a.textlink:is(:focus-visible, :active),
.article-listen a:is(:focus-visible, :active) {
  background-size: 100% .6em;
}

/* Story titles still read like text. A finer rule makes their target visible on touch. */
.story-title .story-link,
.cover-grid .entry h2 {
  text-decoration: underline;
  text-decoration-color: #97a1b4;
  text-decoration-thickness: 1px;
  text-underline-offset: .19em;
}
.story-title .story-link:is(:focus-visible, :active),
.cover-grid .entry:is(:focus-visible, :active) h2 {
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}
.bar-action .play,
.footer-social svg {
  transition: transform .26s var(--agy-ease);
}
.bar-action:is(:focus-visible, :active) .play {
  transform: scale(1.07);
}
.footer-social a:is(:focus-visible, :active) svg {
  transform: translateY(-2px);
}
body :is(a, button, summary, input, select):focus-visible {
  outline: 2px solid var(--agy-focus);
  outline-offset: 3px;
}
.soundbar a:focus-visible {
  outline-color: #ffcf6d;
}

@media (hover: hover) and (pointer: fine) {
  .nav a:not(.booking):hover::after { transform: scaleX(1); }
  main a.editorial-link:hover,
  .card-jump a.textlink:hover,
  .article-listen a:hover { background-size: 100% .6em; }
  .story-title .story-link:hover,
  .cover-grid .entry:hover h2 {
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
  }
  .bar-action:hover .play { transform: scale(1.07); }
  .footer-social a:hover svg { transform: translateY(-2px); }
}

/* Independent translate preserves the original plate angles and final composition. */
@keyframes agy-register {
  from { translate: var(--agy-dx, 0px) var(--agy-dy, 0px); }
  to { translate: 0 0; }
}
@keyframes agy-settle {
  from { translate: 0 7px; opacity: .85; }
  to { translate: 0 0; opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .cover-print .plane { --agy-dx: 4%; --agy-dy: 3%; }
  .cover-print .ink { --agy-dx: -7%; --agy-dy: 3%; }
  .cover-print .orbit { --agy-dx: -3%; --agy-dy: -2%; }
  .cover-print .sun { --agy-dx: 6%; --agy-dy: -5%; }
  .cover-print .echo { --agy-dx: 7%; --agy-dy: 3%; }
  .cover-print i { animation: agy-register 1.15s var(--agy-ease) backwards; }
  .cover-print :is(.sun, .echo) { animation-delay: 95ms; }
  .hero h1, .bio-copy h1, .article-masthead h1, .article-head h1,
  .show-mast h1, .speaking-hero h1 {
    animation: agy-settle .58s var(--agy-ease) backwards;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav a, .nav a::after, main a, main a .play, .footer-social svg {
    transition: none;
  }
  .bar-action:is(:hover, :focus-visible, :active) .play,
  .footer-social a:is(:hover, :focus-visible, :active) svg { transform: none; }
}
@media (forced-colors: active) {
  main a.editorial-link, .card-jump a.textlink, .article-listen a {
    text-decoration: underline;
  }
  body :is(a, button, summary, input, select):focus-visible { outline-color: Highlight; }
}
