/* Extra effects, in the style of the reference site. Each one is separate, so
   any of them can be removed without touching the others:

   1. Headline words rise          .fx-words      (fx.js splits the words)
   2. Scrolling section labels     .fx-marquee    (markup in index.html)
   3. The offer grows to full width  data-fx="grow"
   4. Question list lights up      data-fx="focus"
   5. Footer wordmark              .fx-wordmark   (markup in index.html)

   fx.js adds .fx-on to <html> when it runs. With reduced motion it doesn't,
   and everything here falls back to the plain page. */

:root { --fx-ease: cubic-bezier(.19, 1, .22, 1); }

/* The site's own scroll-in animations (cards, boxes and text fading up, set
   up in styles.css and motion.js) keep their original gentle timing. The only
   change is a slightly longer rise, so they hold their own next to the bigger
   effects. Don't put these on --fx-ease: that curve does most of its movement
   in the first tenth of a second, which makes a small fade look like a pop. */
.js.fx-on .reveal {
  transform: translateY(26px);
  transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0ms);
}
.js.fx-on .reveal.in { transform: none; }

/* 1. Headline words rise --------------------------------------------------- */
.fx-w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .16em;
  margin-bottom: -.16em;
}
.fx-w-in { display: inline-block; will-change: transform; }

/* Hero headline: plays once when the page loads */
.fx-on .hero .fx-w-in {
  animation: fx-rise .95s var(--fx-ease) both;
  animation-delay: calc(.08s + var(--i) * 45ms);
}
@keyframes fx-rise { from { transform: translateY(110%); } }

/* Section headlines: play when they scroll in (motion.js adds .in) */
.js.fx-on .reveal.fx-words { opacity: 1; transform: none; transition: none; }
.js.fx-on .reveal.fx-words .fx-w-in {
  transform: translateY(110%);
  transition: transform .9s var(--fx-ease);
  transition-delay: calc(var(--i) * 40ms);
}
.js.fx-on .reveal.fx-words.in .fx-w-in { transform: none; }

/* 2. Scrolling section labels ------------------------------------------------
   Each section's label, oversized and moving, in place of the small green
   label. The small label stays in the page for screen readers (.sr-only). */
.has-marquee { padding-top: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* The 92% stat sits right above its section's label */
.stat-wrap .big-stat { margin-bottom: 0; border-bottom: 0; }
.fx-marquee {
  overflow: hidden;
  white-space: nowrap;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  -webkit-user-select: none; user-select: none;
}
.dark .fx-marquee { border-top-color: var(--navy-line); }
.fx-marquee.no-line { border-top: 0; }
.fx-marquee-track { display: inline-flex; }
.fx-marquee span {
  padding-right: .42em;
  font: 800 clamp(54px, 12.5vw, 168px)/.92 var(--head);
  /* --fx-scale on the .fx-marquee shrinks a long label so it reads sooner */
  font-size: calc(clamp(54px, 12.5vw, 168px) * var(--fx-scale, 1));
  letter-spacing: -.045em;
  text-transform: uppercase;
  /* On light sections: solid mint, mint outline, navy outline. The outlined
     ones are filled white. */
  color: var(--white);
  -webkit-text-stroke: 1.5px var(--navy);
}
.fx-marquee span:nth-child(3n + 1) { color: var(--mint); -webkit-text-stroke: 0; }
.fx-marquee span:nth-child(3n + 2) { -webkit-text-stroke: 2px var(--mint); }
/* On navy: solid mint, mint outline, white outline, with nothing inside the outlines */
.dark .fx-marquee span { color: transparent; -webkit-text-stroke-color: var(--white); }
.dark .fx-marquee span:nth-child(3n + 1) { color: var(--mint); -webkit-text-stroke: 0; }
.dark .fx-marquee span:nth-child(3n + 2) { color: transparent; -webkit-text-stroke: 1.5px var(--mint); }
/* fx.js sets the real duration from the text's width, so every label moves at
   the same speed however long it is. */
.fx-on .fx-marquee-track { animation: fx-marquee 30s linear infinite; will-change: transform; }
@keyframes fx-marquee { to { transform: translateX(-50%); } }

/* 3. The offer grows -------------------------------------------------------- */
.fx-grow-wrap { background: var(--white); }
.fx-grow-wrap.fx-from-paper { background: var(--paper); }
.fx-grow-wrap.fx-from-navy { background: var(--navy); }
.fx-grow-wrap > section { will-change: clip-path; }

/* 4. Question list ---------------------------------------------------------- */
.fx-on .qa[data-fx="focus"] {
  grid-template-columns: 1fr;
  gap: 0;
  counter-reset: fxq;
  margin-top: 36px;
  border-bottom: 1px solid var(--navy-line);
}
.fx-on .qa[data-fx="focus"] article {
  counter-increment: fxq;
  background: none;
  border: 0;
  border-top: 1px solid var(--navy-line);
  border-radius: 0;
  padding: 26px 0 26px 46px;
  position: relative;
}
.fx-on .qa[data-fx="focus"] article::before {
  content: "0" counter(fxq);
  position: absolute; left: 0; top: 32px;
  font: 700 13px/1 var(--body);
  letter-spacing: .08em;
  color: var(--mint);
  font-variant-numeric: tabular-nums;
}
.fx-on .qa[data-fx="focus"] h3 {
  font-size: clamp(23px, 3.5vw, 42px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.025em;
  margin-bottom: 12px;
  text-wrap: balance;
}
.fx-on .qa[data-fx="focus"] p { max-width: 62ch; }
/* Everything but the one being read is dimmed */
.fx-on .qa.fx-focus article > *,
.fx-on .qa.fx-focus article::before { opacity: .3; transition: opacity .5s var(--fx-ease); }
.fx-on .qa.fx-focus article.is-on > *,
.fx-on .qa.fx-focus article.is-on::before { opacity: 1; }
@media (hover: hover) {
  .fx-on .qa.fx-focus article:hover > *,
  .fx-on .qa.fx-focus article:hover::before { opacity: 1; }
}
@media (min-width: 760px) {
  .fx-on .qa[data-fx="focus"] article { padding: 34px 0 34px 72px; }
  .fx-on .qa[data-fx="focus"] article::before { top: 44px; }
}

/* 5. Footer wordmark -------------------------------------------------------- */
.fx-wordmark {
  background: var(--navy);
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  height: 11.4vw;            /* crops the bottom of the letters */
  border-top: 1px solid var(--navy-line);
  padding-top: 2.2vw;
}
.fx-wordmark span {
  display: inline-block;
  font: 800 15.4vw/.8 var(--head);
  letter-spacing: -.05em;
  text-transform: uppercase;
  color: var(--mint);
  background: linear-gradient(100deg, var(--mint-light), var(--mint) 45%, var(--teal));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.fx-wordmark + .site-footer { padding-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  .fx-marquee-track, .fx-on .hero .fx-w-in { animation: none; }
}
