/* Animation layer shared by the portfolio and its supporting pages. */
html {
  scroll-behavior: smooth;
}

.motion-ready .reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.motion-ready .reveal.reveal-left {
  transform: translate3d(-24px, 0, 0);
}

.motion-ready .reveal.reveal-scale {
  transform: scale(0.97);
}

.motion-ready .reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.brand span {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand:hover span {
  transform: rotate(-7deg) scale(1.06);
}

.header nav a,
.subnav a {
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

.header nav a:hover,
.subnav a:hover {
  transform: translateY(-1px);
}

.button,
.map-link,
.page-nav a {
  transition:
    transform 0.25s ease,
    color 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.button:hover,
.map-link:hover,
.page-nav a:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(24, 25, 20, 0.1);
}

.portrait,
.lead-grid figure,
.logo-box {
  overflow: hidden;
}

.portrait img,
.lead-grid img,
.logo-box img {
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.portrait:hover img,
.lead-grid figure:hover img,
.logo-box:hover img {
  transform: scale(1.025);
}

.skills article,
.card,
.document,
.project-list > a {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.35s ease,
    box-shadow 0.35s ease;
}

.skills article:hover,
.card:hover,
.document:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 45px rgba(24, 25, 20, 0.09);
}

.project-list > a:hover {
  transform: translateX(8px);
}

.timeline article {
  transition: background-color 0.3s ease;
}

.timeline article > time,
.timeline article > div {
  transform: translate3d(0, 0, 0);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
  .timeline article:hover {
    background: rgba(255, 255, 255, 0.38);
  }

  .timeline article:hover > time,
  .timeline article:hover > div {
    transform: translate3d(10px, 0, 0);
  }
}

.motion-ready .timeline article.reveal {
  transform: translate3d(0, 16px, 0);
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.3s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.motion-ready .timeline article.reveal.is-visible {
  transform: translate3d(0, 0, 0);
}

.education article {
  position: relative;
  isolation: isolate;
}

.education article::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 3px;
  background: var(--blue);
  content: "";
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.education article::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, rgba(41, 72, 255, 0.08), transparent 68%);
  content: "";
  opacity: 0;
  transition: opacity 0.4s ease;
}

.education article > * {
  translate: 0 0;
  transition:
    translate 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.3s ease;
}

.education article > time {
  display: inline-block;
}

@media (hover: hover) {
  .education article:hover::before {
    transform: scaleY(1);
  }

  .education article:hover::after {
    opacity: 1;
  }

  .education article:hover > * {
    translate: 8px 0;
  }

  .education article:hover h3 {
    color: var(--blue);
  }
}

.education article:focus-within::before {
  transform: scaleY(1);
}

.education article:focus-within::after {
  opacity: 1;
}

.education article:focus-within > * {
  translate: 8px 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .motion-ready .reveal {
    opacity: 1;
    transform: none;
  }
}
