/* The about page (about.html): the yellow card with a landscape seen from above, a business mapped out
   as a live graph (graph.js), the automation ladder as a staircase and how we count. The base, the
   texture and the yellow card's layout are in page.css; motion.js brings the parts in, this file is
   the resting state. */

.ab-sec {
  position: relative;
  padding: 16px 16px 0;
}

.ab-no {
  flex: none;
  width: 34px;
  font-size: 16.5px;
  font-weight: 500;
  letter-spacing: -0.04em;
  color: #6f6d60;
}

/* ------------------------------------------------------------ the yellow card: the landscape, the founder */

/* contour lines, as on a map; they fade out before they reach the text at the bottom */
.ab-topo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 82%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 82%);
}

.ab-topo__lines path {
  fill: none;
  stroke: rgba(37, 35, 36, 0.2);
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ab-topo__lines path.is-index {
  stroke: rgba(37, 35, 36, 0.32);
  stroke-width: 1.8;
}

/* the pin on the highest hill */
.ab-topo__dot {
  fill: #252324;
}

.ab-topo__ring {
  fill: none;
  stroke: #252324;
  stroke-width: 1.5;
}

.ab-topo__pulse {
  fill: none;
  stroke: #252324;
  stroke-width: 1.2;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .ab-topo__pulse {
    transform-box: fill-box;
    transform-origin: center;
    animation: ab-pulse 2.8s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
  }
}

@keyframes ab-pulse {
  from {
    transform: scale(1);
    opacity: 0.7;
  }

  to {
    transform: scale(7);
    opacity: 0;
  }
}

/* ------------------------------------------------------------ the founder: the photo, and the name beside it */

.ab-person {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: end;
  gap: 16px;
  border-radius: 40px;
  background: #000000;
  color: #fffce1;
  padding: 16px;
}

.ab-person > .pg-fx--grain {
  opacity: 0.085;
}

.ab-person__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 28px;
  background: #feeb8d;
  color: #252324;
}

.ab-person__photo > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* until the photo is in: the eagle */
.ab-person__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.ab-person__ph svg {
  width: 30%;
  height: auto;
  aspect-ratio: 833 / 873;
}

.ab-person__name {
  position: relative;
  margin: 0;
  padding: 0 24px 24px;
  font-size: clamp(48px, 6.4vw, 120px);
  font-weight: 550;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.ab-person__name > span {
  display: block;
}

.ab-person__name > span + span {
  color: rgba(255, 252, 225, 0.5);
}

/* ------------------------------------------------------------ the map: the text, and the graph beside it */

.ab-map {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-radius: 40px;
  background: #fffce1;
  color: #000000;
  padding: 16px;
}

.ab-map > .pg-fx {
  border-radius: inherit;
}

.ab-map__body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 40px 56px 32px 24px;
}

.ab-map__title {
  margin: 0;
  font-size: clamp(36px, 3.86vw, 74px);
  font-weight: 550;
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.ab-map__title > span {
  color: rgba(0, 0, 0, 0.45);
}

.ab-map__text {
  margin: 28px 0 0;
  max-width: 28em;
  font-size: 20px;
  font-weight: 450;
  line-height: 1.35;
  letter-spacing: -0.012em;
  color: #6f6d60;
  text-wrap: pretty;
}

.ab-map__text + .ab-map__text {
  margin-top: 16px;
}

/* a signal in the text: underlined in yellow, as on the map; pointing at it lights up its point */
.ab-map__text mark {
  background: linear-gradient(transparent 62%, #feeb8d 62%);
  color: #000000;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.ab-map__text mark:hover {
  background-color: #feeb8d;
}

/* the panel the graph lives in: black, like the third solution */
.ab-map__panel {
  position: relative;
  overflow: hidden;
  min-height: 680px;
  border-radius: 28px;
  background: #000000;
  color: #fffce1;
}

.ab-map__panel > .pg-fx--grain {
  opacity: 0.085;
}

/* ------------------------------------------------------------ the graph (graph.js) */

.gr {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
}

.gr-link {
  stroke: rgba(255, 252, 225, 0.2);
  stroke-width: 1;
  transition: opacity 0.3s ease, stroke 0.3s ease;
}

.gr-link--signal {
  stroke: rgba(254, 235, 141, 0.3);
}

.gr-node {
  cursor: grab;
  touch-action: none;
  transition: opacity 0.3s ease;
}

.gr.is-dragging,
.gr.is-dragging .gr-node {
  cursor: grabbing;
}

.gr-hit {
  fill: transparent;
}

.gr-dot {
  fill: #fffce1;
  transition: fill 0.2s ease;
}

.gr-node--step .gr-dot {
  fill: rgba(255, 252, 225, 0.55);
}

.gr-node--system .gr-dot {
  fill: #000000;
  stroke: #fffce1;
  stroke-width: 1.6;
}

.gr-node--signal .gr-dot {
  fill: #feeb8d;
}

.gr-ring {
  fill: none;
  stroke: rgba(255, 252, 225, 0.35);
  stroke-width: 1;
}

.gr-pulse {
  fill: none;
  stroke: #feeb8d;
  stroke-width: 1.2;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .gr-pulse {
    transform-box: fill-box;
    transform-origin: center;
    animation: gr-pulse 2.6s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
  }

  .gr-node:nth-child(3n) .gr-pulse {
    animation-delay: -0.9s;
  }

  .gr-node:nth-child(3n + 1) .gr-pulse {
    animation-delay: -1.7s;
  }
}

@keyframes gr-pulse {
  from {
    transform: scale(1);
    opacity: 0.8;
  }

  to {
    transform: scale(3.4);
    opacity: 0;
  }
}

/* the names, with a dark edge so the lines behind them don't cut through */
.gr-label {
  fill: rgba(255, 252, 225, 0.62);
  stroke: #000000;
  stroke-width: 4px;
  stroke-linejoin: round;
  paint-order: stroke;
  font-size: 11.5px;
  font-weight: 450;
  letter-spacing: -0.01em;
  text-anchor: middle;
  pointer-events: none;
  transition: fill 0.2s ease;
}

.gr-node--process .gr-label {
  fill: rgba(255, 252, 225, 0.92);
  font-size: 13.5px;
  font-weight: 500;
}

.gr-node--center .gr-label {
  fill: #fffce1;
  font-size: 15px;
  font-weight: 600;
}

.gr-node--signal .gr-label {
  fill: #feeb8d;
}

/* a small panel: the names of steps and systems only show when they light up */
.gr.is-small .gr-node--step .gr-label,
.gr.is-small .gr-node--system .gr-label {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gr.is-small .gr-node.is-near .gr-label {
  opacity: 1;
}

/* pointing at a point: it and what it is connected to stay, the rest fades */
.gr.is-focus .gr-node,
.gr.is-focus .gr-link {
  opacity: 0.12;
}

.gr.is-focus .gr-node.is-near,
.gr.is-focus .gr-link.is-near {
  opacity: 1;
}

.gr.is-focus .gr-link.is-near {
  stroke: rgba(254, 235, 141, 0.85);
}

.gr.is-focus .gr-node.is-near .gr-label {
  fill: #fffce1;
}

.gr.is-focus .gr-node--signal.is-near .gr-label {
  fill: #feeb8d;
}

/* coming in (graph.js): points appear from the middle outwards, lines follow */
.gr.is-pre .gr-node,
.gr.is-pre .gr-link {
  opacity: 0;
}

.gr.is-pre .gr-node.is-in,
.gr.is-pre .gr-link.is-in {
  opacity: 1;
  transition: opacity 0.7s ease;
}

.gr.is-pre .gr-dot {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gr.is-pre .gr-node.is-in .gr-dot {
  transform: none;
}

/* ------------------------------------------------------------ the automation ladder */

.ab-ladder {
  position: relative;
  overflow: hidden;
  border-radius: 40px;
  background: #000000;
  color: #fffce1;
  padding: 48px 32px 32px 40px;
}

.ab-ladder__head {
  position: relative;
  display: grid;
  grid-template-columns: calc(50.27% - 4px) minmax(0, 1fr);
  align-items: end;
  row-gap: 20px;
}

.ab-ladder__title {
  margin: 0;
  padding-right: 40px;
  font-size: clamp(40px, 4.4vw, 84px);
  font-weight: 550;
  line-height: 0.95;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.ab-ladder__title > span {
  color: #feeb8d;
}

.ab-ladder__text {
  margin: 0;
  max-width: 24em;
  font-size: 20px;
  font-weight: 450;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: rgba(255, 252, 225, 0.62);
}

/* the six steps as a staircase, each one higher than the last; the lowest, the one that wins when it
   works, is yellow */
.ab-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  margin: 72px 0 0;
  padding: 0;
  list-style: none;
}

.ab-step {
  display: flex;
  min-height: calc(220px + var(--i, 0) * 52px);
}

.ab-step__in {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  padding: 22px 20px 24px;
  background: rgba(255, 252, 225, calc(0.05 + var(--i, 0) * 0.018));
}

.ab-ladder .ab-no {
  color: rgba(255, 252, 225, 0.5);
}

.ab-step__name {
  margin: 14px 0 0;
  font-size: clamp(22px, 1.9vw, 32px);
  font-weight: 550;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.ab-step:first-child .ab-step__in {
  background: #feeb8d;
  color: #252324;
}

.ab-step:first-child .ab-no {
  color: rgba(37, 35, 36, 0.62);
}

/* ------------------------------------------------------------ how we count */

.ab-say {
  position: relative;
  display: grid;
  grid-template-columns: calc(50.27% - 4px) minmax(0, 1fr);
  padding: 160px 48px 128px 56px;
}

.ab-say__title {
  grid-column: 1 / -1;
}

.ab-say__title {
  margin: 0;
  max-width: 13em;
  font-size: clamp(44px, 6.4vw, 120px);
  font-weight: 550;
  line-height: 0.95;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.ab-say__title > span {
  color: rgba(255, 252, 225, 0.5);
}

/* the percentage without its base, struck through in yellow (motion.js draws the line) */
.ab-strike {
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}

.ab-strike::after {
  content: '';
  position: absolute;
  left: -0.03em;
  right: -0.03em;
  top: 0.52em;
  height: 0.075em;
  border-radius: 0.04em;
  background: #feeb8d;
  transform: scaleX(var(--strike, 1));
  transform-origin: left center;
}

.ab-say__text {
  grid-column: 2;
  margin: 40px 0 0;
  max-width: 28em;
  font-size: 20px;
  font-weight: 450;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: rgba(255, 252, 225, 0.62);
}

/* ------------------------------------------------------------ smaller screens */

@media (max-width: 1100px) {
  .ab-steps {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 6px;
    margin-top: 48px;
  }

  /* still a staircase: each step a little further in */
  .ab-step {
    min-height: 0;
    padding-left: calc(var(--i, 0) * 14px);
  }

  .ab-step__in {
    display: grid;
    grid-template-columns: 34px minmax(0, 14em) minmax(0, 1fr);
    align-items: baseline;
    column-gap: 16px;
    border-radius: 20px;
    padding: 20px 22px;
  }

  .ab-step__name {
    margin: 0;
  }
}

@media (max-width: 1000px) {
  .ab-map,
  .ab-say,
  .ab-ladder__head {
    grid-template-columns: minmax(0, 1fr);
  }

  .ab-map__body {
    padding: 36px 24px 32px;
  }

  .ab-map__panel {
    min-height: 560px;
  }

  .ab-say__text {
    grid-column: 1;
  }
}

@media (max-width: 720px) {
  .ab-person {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    border-radius: 32px;
    padding: 12px;
  }

  .ab-person__photo {
    border-radius: 22px;
  }

  .ab-person__name {
    padding: 16px 12px 20px;
  }

  .ab-map {
    border-radius: 32px;
    padding: 12px;
  }

  .ab-map__body {
    padding: 28px 12px 28px;
  }

  .ab-map__title {
    font-size: 38px;
  }

  .ab-map__text {
    font-size: 18px;
  }

  .ab-map__panel {
    min-height: 460px;
    border-radius: 22px;
  }

  /* on a phone the card is tall and narrow: the lines stay above the title, the pin would land beside it */
  .ab-topo {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 12%, transparent 34%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 12%, transparent 34%);
  }

  .ab-topo__pin {
    display: none;
  }

  .ab-say {
    padding: 112px 24px 96px;
  }

  .ab-say__text {
    margin-top: 28px;
    font-size: 18px;
  }

  .ab-ladder {
    border-radius: 32px;
    padding: 32px 16px 16px;
  }

  .ab-ladder__head {
    padding: 0 8px;
  }

  .ab-ladder__title {
    padding-right: 0;
  }

  .ab-ladder__text {
    font-size: 18px;
  }

  .ab-no {
    width: 26px;
    font-size: 15px;
  }

  .ab-step {
    padding-left: calc(var(--i, 0) * 8px);
  }

  .ab-step__in {
    grid-template-columns: 26px minmax(0, 1fr);
    row-gap: 6px;
    padding: 18px 18px 20px;
  }
}
