/* vision.html: the "Read our vision" page. Structure follows
   superlogical.com/vision: one column of text on the left, a tall colour
   field pinned to the right that shifts as you scroll, and the page's own
   scroll thumb inside the field. Loaded after styles.css. */

.vision {
  --field: 10px;
  --field-inset: 12px;
  --pad: 1.5rem;
}

/* On body, not html: a font size on html would change what a rem is. */
.vision body {
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* The field carries the scroll thumb, so the browser's own bar is hidden
   wherever the thumb is shown. */
@media (width >= 40rem) {
  html.vision {
    scrollbar-width: none;
  }

  html.vision::-webkit-scrollbar {
    display: none;
  }
}

/* ---------- the field ---------- */

.field {
  position: fixed;
  top: var(--field-inset);
  right: var(--field-inset);
  z-index: 20;
  width: var(--field);
  height: calc(100dvh - 2 * var(--field-inset));
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  /* --at runs 0 to 1 with the page's scroll; vision.js sets it. */
  background: linear-gradient(
      to bottom,
      #c9f7ea 0%,
      #8cebd3 10%,
      #5ee1c2 22%,
      #2fae92 36%,
      #1a8870 50%,
      #11604f 64%,
      #0c3a32 78%,
      #0a211e 90%,
      #0b0d10 100%
    )
    0 calc(var(--at, 0) * 100%) / 100% 260% no-repeat;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06) inset;
}

.field .grain {
  z-index: 0;
  opacity: 0.55;
  mix-blend-mode: overlay;
}

.thumb {
  position: fixed;
  top: var(--field-inset);
  right: calc(var(--field-inset) + 7px);
  z-index: 21;
  display: none;
  width: 9px;
  height: 120px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.55);
  cursor: grab;
  touch-action: none;
}

.thumb:hover,
.thumb.dragging {
  background: rgb(255 255 255 / 0.8);
}

.thumb.dragging {
  cursor: grabbing;
}

/* ---------- the column ---------- */

.article {
  display: flex;
  flex-direction: column;
  margin: 2rem 0;
  padding: 0 calc(var(--field) + var(--field-inset) + var(--pad)) 0 var(--pad);
}

.vision .top {
  display: block;
  height: 1.5rem;
}

.vision-hero {
  margin: 11rem 0 10rem;
}

.vision-hero .headline {
  min-height: 0;
}

/* The wheel looks as it does on the front page: the next phrases hang below
   the one in the slot and fade out. It is not grabbable here, so that
   scrolling over it scrolls the page. */
.vision-hero .wheel-hit {
  display: none;
}

.prose {
  max-width: 72ch;
  margin: 2.5rem 0;
}

.prose p {
  margin: 0;
}

.prose > p + p,
.prose > ol + p {
  margin-top: 1.25rem;
}

.prose .label,
.wide-section .label {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.prose ol {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 2.25rem 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.prose ol li {
  display: flex;
  gap: 1rem;
  counter-increment: step;
}

.prose ol li::before {
  content: counter(step);
  flex: none;
  width: 1rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.wide-section {
  margin: 2.5rem 0;
}

.wide-section > p:not(.label) {
  max-width: 72ch;
  margin: 0;
}

.people {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.people li {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.people .photo {
  flex: none;
  width: 6rem;
  height: 6rem;
  background: var(--rule);
}

.people div:last-child {
  max-width: 62ch;
}

.people h3 {
  margin: 0;
  font: inherit;
  font-weight: 500;
}

.people p {
  margin: 0.5rem 0 0;
}

.backers {
  display: grid;
  gap: 0.25rem 3rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.vision .bar {
  margin-top: 5rem;
}

/* ---------- wider screens ---------- */

@media (width < 48rem) {
  .vision-hero .line {
    display: block;
  }
}

@media (width >= 40rem) {
  .vision {
    --field: 80px;
    --pad: 2.5rem;
  }

  .article {
    margin: 2.5rem 0;
  }

  .thumb {
    display: block;
  }

  .people li {
    flex-direction: row;
    gap: 1.5rem;
  }

  .people .photo {
    width: 8rem;
    height: 8rem;
  }

  .backers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (width >= 48rem) {
  /* Put the headline at the middle of the first screen, with the first
     paragraph showing below it. */
  .vision-hero {
    --half: max(21.25rem, 50svh);
    --lift: max(0px, calc(25.5rem - var(--half)));
    margin-top: max(0px, calc(var(--half) - 6.5rem - var(--lift)));
    margin-bottom: max(calc(1rem + var(--lift)), calc(var(--half) - 13.75rem + var(--lift)));
  }

  .vision-hero .line {
    display: inline;
  }

  .vision-hero .slot {
    display: inline-block;
  }

  .vision-hero .wheel {
    right: auto;
    width: 16em;
  }

  .prose,
  .wide-section {
    margin: 3.5rem 0;
  }

  .people {
    margin-top: 3.5rem;
  }

  .vision .bar {
    margin-top: 7rem;
  }
}

@media (width >= 64rem) {
  .vision {
    --field: calc(clamp(30vw, calc(100vw - 4rem - 47.6rem - 4rem), 40vw) - 2 * var(--field-inset));
    --pad: 4rem;
  }

  .article {
    margin: 3rem 0;
    padding-right: calc(var(--field) + 2 * var(--field-inset) + var(--pad));
  }

  .vision-hero {
    --lift: max(0px, calc(26rem - var(--half)));
    margin-top: max(0px, calc(var(--half) - 7.5rem - var(--lift)));
    margin-bottom: max(calc(1rem + var(--lift)), calc(var(--half) - 13.5rem + var(--lift)));
  }

  .backers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* The wordmark stays at the top on this page; the bar keeps the links. */
  .vision .bar-mark {
    display: block;
  }

  .vision .bar {
    padding-bottom: 0;
  }
}

.square .field,
.square .thumb {
  border-radius: 0;
}
