/* The landing page's motion (motion.js sets .motion on the page unless reduced motion is asked for) and its
   screenshot viewer. Without .motion everything shows in its final state. */

/* sections fade up as they come into view, siblings 90 ms apart */
.motion [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.motion [data-reveal].in {
  opacity: 1;
  transform: none;
}

/* the strike draws across the plan we skipped */
.motion .card.skipped h3 {
  width: fit-content;
  text-decoration: none;
  background: linear-gradient(#b9452f, #b9452f) no-repeat 0 55% / 0 2px;
  transition: background-size 0.9s cubic-bezier(0.6, 0, 0.2, 1) 0.7s;
}
.motion .card.skipped.in h3 {
  background-size: 100% 2px;
}

/* the Zurich photo settles, its tag slides in */
.motion .photo img {
  transform: scale(1.12);
  transition: transform 3.2s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.motion .photo figcaption {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.6s ease 1s, transform 0.6s ease 1s;
}
.motion .photo.in img,
.motion .photo.in figcaption {
  transform: none;
  opacity: 1;
}

/* the twelve outcomes tick off in turn */
.outcomes li {
  grid-template-columns: 64px minmax(0, 1fr) 18px;
}
.outcomes li::after {
  content: "";
  align-self: center;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--brass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2 4.2 7.2 8 3' fill='none' stroke='%230f3b36' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.motion .outcomes li::after {
  background-color: transparent;
  background-size: 0;
  border: 1.5px solid var(--spruce-line);
  transform: scale(0.8);
  transition: background-color 0.3s, background-size 0.3s, border-color 0.3s, transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.motion .outcomes.in li::after {
  background-color: var(--brass);
  background-size: 10px;
  border-color: var(--brass);
  transform: none;
}
.motion .outcomes.in li:nth-child(1)::after { transition-delay: 0.2s; }
.motion .outcomes.in li:nth-child(2)::after { transition-delay: 0.4s; }
.motion .outcomes.in li:nth-child(3)::after { transition-delay: 0.6s; }
.motion .outcomes.in li:nth-child(4)::after { transition-delay: 0.8s; }
.motion .outcomes.in li:nth-child(5)::after { transition-delay: 1s; }
.motion .outcomes.in li:nth-child(6)::after { transition-delay: 1.2s; }
.motion .outcomes.in li:nth-child(7)::after { transition-delay: 1.4s; }
.motion .outcomes.in li:nth-child(8)::after { transition-delay: 1.6s; }
.motion .outcomes.in li:nth-child(9)::after { transition-delay: 1.8s; }
.motion .outcomes.in li:nth-child(10)::after { transition-delay: 2s; }
.motion .outcomes.in li:nth-child(11)::after { transition-delay: 2.2s; }
.motion .outcomes.in li:nth-child(12)::after { transition-delay: 2.4s; }

/* the closing band's mark breathes */
.motion .closing .halo path {
  animation: breathe 4.8s ease-in-out infinite;
}
.motion .closing .halo path:last-child {
  animation-name: breathe-down;
}
@keyframes breathe {
  50% { transform: translateY(-0.8px); }
}
@keyframes breathe-down {
  50% { transform: translateY(0.8px); }
}

/* a screenshot opens the viewer */
.opens {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.opens:hover {
  transform: translateY(-3px);
}
.opens:focus-visible {
  outline: 2px solid var(--spruce);
  outline-offset: 4px;
}

.viewer {
  width: min(1240px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: var(--bone);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(8, 34, 31, 0.35);
}
.viewer::backdrop {
  background: rgba(8, 34, 31, 0.72);
}
.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.viewer-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.viewer button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.viewer-tabs button {
  padding: 0 14px;
  white-space: nowrap;
}
.viewer-tabs button[aria-selected="true"] {
  background: var(--spruce);
  border-color: var(--spruce);
  color: var(--bone);
}
.viewer-close {
  width: 44px;
  flex: none;
  font-size: 22px !important;
}
.viewer-stage {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}
.viewer-stage img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #e3ddcf;
  background: #fff;
}
.viewer-stage button {
  width: 44px;
}
.viewer-caption {
  margin: 12px 56px 0;
  font-size: 14px;
  color: var(--ink3);
}
@media (max-width: 819px) {
  .viewer {
    padding: 12px;
  }
  .viewer-stage {
    grid-template-columns: minmax(0, 1fr);
  }
  .viewer-stage button {
    display: none;
  }
  .viewer-caption {
    margin: 10px 0 0;
  }
}

/* Why now: an agent on top of a platform pays at a gate for every call; inside Stabiso the rules pass free */
.toll {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px 32px;
  margin: 56px 0 0;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid #e3ddcf;
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: var(--lift);
}
.toll .lane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lane-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
}
.lane-head strong {
  font: 500 clamp(20px, 2vw, 24px) / 1.2 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.lane .meter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font: 500 13px/1.4 var(--mono);
  color: var(--ink3);
}
.lane .cost {
  font: 600 12px/1.3 var(--mono);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lane.out .cost {
  color: var(--negative);
}
.lane.in .cost {
  color: var(--spruce);
}
.lane .meter b {
  font: 500 clamp(26px, 3vw, 34px) / 1 var(--display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}
.lane.out .meter b {
  color: var(--negative);
}
.lane.in .meter b {
  color: var(--spruce);
}
.lane .track {
  position: relative;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: #fbf3ef;
}
.lane.in .track {
  background: #eef4f1;
}
.lane .track::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 23px;
  height: 2px;
  background: #e7c8bd;
}
.lane.in .track::before {
  background: #c4d6d0;
}
.lane .track i {
  position: absolute;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--negative);
}
.lane.in .track i {
  background: var(--spruce);
}
.lane .track i:nth-of-type(1) { left: 18%; }
.lane .track i:nth-of-type(2) { left: 44%; }
.lane .track i:nth-of-type(3) { left: 78%; }
.lane .gate {
  position: absolute;
  left: 52%;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: #b9452f;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--negative);
  white-space: nowrap;
  text-indent: 10px;
}
.lane-note {
  font-size: 14px;
  color: var(--ink3);
}
.toll figcaption {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--ink4);
}
/* the calls run left to right: slowed at the gate outside, straight through inside */
.motion .lane .track i {
  left: -3%;
  animation: run-out 4.2s linear infinite;
}
.motion .lane.in .track i {
  animation: run-in 3s linear infinite;
}
.motion .lane.out .track i:nth-of-type(2) { animation-delay: -1.4s; }
.motion .lane.out .track i:nth-of-type(3) { animation-delay: -2.8s; }
.motion .lane.in .track i:nth-of-type(2) { animation-delay: -1s; }
.motion .lane.in .track i:nth-of-type(3) { animation-delay: -2s; }
@keyframes run-in {
  from { left: -3%; }
  to { left: 101%; }
}
@keyframes run-out {
  0% { left: -3%; }
  40% { left: 49%; }
  55% { left: 49%; }
  100% { left: 101%; }
}
