/* Hidden only after JS adds .motion. Without that class, every section stays visible.
   Keyframes, not a transition to `none`: Safari drops that transition and never paints the start. */

@keyframes rise-in {
  from { opacity: 0; transform: translate3d(0, 36px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes rise-in-short {
  from { opacity: 0; transform: translate3d(0, 25px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes rise-in-left {
  from { opacity: 0; transform: translate3d(-40px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

html.motion .rise {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
}

html.motion .rise.rise-short:not(.is-in) {
  transform: translate3d(0, 25px, 0);
}

html.motion .hero .kicker.rise:not(.is-in) {
  transform: translate3d(-40px, 0, 0);
}

html.motion .rise.is-in,
html.motion .rise.rise-short.is-in,
html.motion .band.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  animation: rise-in 0.4s ease-out both;
  animation-delay: var(--d, 0ms);
}

html.motion .band.is-in {
  animation-delay: var(--d, 300ms);
}

html.motion .rise.rise-short.is-in {
  animation-name: rise-in-short;
}

html.motion .hero .kicker.rise.is-in {
  animation-name: rise-in-left;
}

html.motion .rise.is-settled,
html.motion .rise.rise-short.is-settled,
html.motion .band.is-settled,
html.motion .hero .kicker.rise.is-settled {
  animation: none;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Hero titles type on, one letter at a time. The full line keeps its space. */
html.motion h1.type:not(.set),
html.motion h1.type:not(.set) * {
  color: transparent;
}
html.motion h1.type .type-word { white-space: nowrap; }
html.motion h1.type.set .ch { color: inherit; }
html.motion h1.type .ch { position: relative; opacity: 0; }
html.motion h1.type .ch.on { opacity: 1; }
html.motion h1.type .ch.tip::after {
  content: "";
  position: absolute;
  top: 0.08em;
  left: 100%;
  width: 0.045em;
  min-width: 2px;
  height: 0.78em;
  background: currentColor;
  animation: type-caret 0.72s steps(1) infinite;
}
@keyframes type-caret {
  50% { opacity: 0; }
}

/* Blue closing band is the site's light-to-contrast break. It arrives as one piece. */
html.motion .band:not(.is-in) {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
}

html.motion .acc > .item.rise:not(.is-in),
html.motion .list > .card.rise:not(.is-in) {
  transform: translate3d(0, 36px, 0);
}

html.motion .acc > .item.rise.is-in,
html.motion .list > .card.rise.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

html.motion .acc .item {
  display: grid;
  grid-template-rows: auto 0fr;
  transition: none;
}

html.motion .acc .item.open {
  grid-template-rows: auto 1fr;
}

html.motion .acc .item > p {
  display: block;
  min-height: 0;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: none;
}

html.motion .acc .item.open > p {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (max-width: 1100px) {
  html.motion .acc .item { display: block; transition: none; }
  html.motion .acc .item > p {
    display: none;
    overflow: visible;
    transform: none;
    transition: none;
  }
  html.motion .acc .item.open > p {
    display: block;
    opacity: 1;
    visibility: visible;
  }
}

html.motion .list .card {
  display: grid;
  grid-template-rows: auto 0fr;
  transition: grid-template-rows 0.4s ease-out;
}

html.motion .list .card.open {
  grid-template-rows: auto 1fr;
}

html.motion .list .panel {
  display: grid;
  min-height: 0;
  margin-top: 0;
  overflow: hidden;
  visibility: hidden;
  transition:
    margin-top 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0.75s;
}

html.motion .list .card.open .panel {
  margin-top: 20px;
  visibility: visible;
  transition:
    margin-top 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0s;
}

html.motion .list .panel > * {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

html.motion .list .card.open .panel > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

html.motion .list .card.open .panel > :nth-child(2) {
  transition-delay: 0.12s;
}

@media (max-width: 768px) {
  @keyframes rise-in {
    from { opacity: 0; transform: translate3d(0, 24px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  @keyframes rise-in-short {
    from { opacity: 0; transform: translate3d(0, 16px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  @keyframes rise-in-band {
    from { opacity: 0; transform: translate3d(0, 16px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }

  html.motion .rise:not(.is-in),
  html.motion .acc > .item.rise:not(.is-in),
  html.motion .list > .card.rise:not(.is-in) {
    transform: translate3d(0, 24px, 0);
  }

  html.motion .rise.rise-short:not(.is-in) {
    transform: translate3d(0, 16px, 0);
  }

  html.motion .band:not(.is-in) {
    transform: translate3d(0, 16px, 0);
  }

  html.motion .band.is-in:not(.is-settled) {
    animation-name: rise-in-band;
    animation-duration: 0.8s;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.motion .rise,
  html.motion .rise.rise-short,
  html.motion .band,
  html.motion .rise.is-in,
  html.motion .rise.rise-short.is-in,
  html.motion .band.is-in,
  html.motion .acc .item,
  html.motion .acc > .item.rise,
  html.motion .acc > .item.rise.is-in,
  html.motion .acc .item > p,
  html.motion .acc .item.open > p,
  html.motion .list .card,
  html.motion .list > .card.rise,
  html.motion .list > .card.rise.is-in,
  html.motion .list .panel,
  html.motion .list .panel > *,
  html.motion .list .card.open .panel {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
    visibility: visible;
  }

  html.motion .acc .item,
  html.motion .list .card {
    display: block;
    grid-template-rows: none;
  }

  html.motion .acc .item > p,
  html.motion .list .panel {
    display: none;
    opacity: 0;
    visibility: hidden;
  }

  html.motion .acc .item.open > p {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  html.motion .list .card.open .panel {
    display: grid;
    margin-top: 20px;
    opacity: 1;
    visibility: visible;
  }

  html.motion .list .card.open .panel > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

html.motion nav a { position: relative; }
html.motion nav a:not(.active)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--nav-line, #0069b9);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}
html.motion nav a:not(.active):hover::after,
html.motion nav a:not(.active):focus-visible::after {
  transform: scaleX(1);
}

html.motion footer .cols a { position: relative; }
html.motion footer .cols a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}
html.motion footer .cols a:hover::after,
html.motion footer .cols a:focus-visible::after { width: 100%; }

html.motion footer .cols > div.rise h3 {
  position: relative;
  border-bottom-color: transparent;
}
html.motion footer .cols > div.rise h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: #000;
  transition: width 1s ease-out;
}
html.motion footer .cols > div.rise.is-in h3::after {
  width: 100%;
  transition-delay: 0.3s;
}

html.motion .card .photo { overflow: hidden; }
html.motion .others a img { transition: transform 0.3s ease; }
html.motion .others a:hover img { transform: translateX(8px); }

@media (max-width: 1100px) {
  html.motion header nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    visibility: hidden;
    background: var(--bg, #f4f3ee);
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding-top 0.4s ease;
  }
  html.motion header nav.open {
    max-height: 240px;
    opacity: 1;
    padding-top: 12px;
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.motion nav a::after,
  html.motion footer .cols a::after,
  html.motion footer .cols > div.rise h3::after,
  html.motion .others a img,
  html.motion header nav,
  html.motion header nav.open {
    transition: none;
  }
  html.motion footer .cols > div.rise h3::after { width: 100%; }
  html.motion h1.type,
  html.motion h1.type * { color: inherit; }
  html.motion h1.type .blue { color: var(--blue); }
  html.motion h1.type .ch { opacity: 1; }
  html.motion h1.type .ch.tip::after { content: none; animation: none; }
}
