/* CampusFit website.
   The look is the app's own: its blue, its ink, its four label colours, capsule buttons and
   Avenir Next, which is the face the app is set in on every iPhone and Mac. */

:root {
  color-scheme: light;
  --blue: #2456e6;
  --blue-deep: #1b3fb0;
  --blue-tint: #e8eeff;
  --ink: #0f172a;
  --muted: #5b6478;
  --paper: #f5f7fb;
  --white: #fff;
  --soft: #e9edf5;
  --line: #dce2ed;
  --amber: #ffb829;
  --amber-tint: #fff4d6;
  --amber-ink: #5c4a1b;

  /* The four labels, as the app draws them on white. */
  --likely: #2456e6;
  --target: #7c9bf5;
  --reach: #c4d1fb;
  --high: #ffb829;

  --font: "Avenir Next", Avenir, "Segoe UI Variable Display", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --gutter: clamp(22px, 5vw, 48px);
  --max: 1160px;
  --band: clamp(64px, 9vw, 124px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 1.0625rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 20;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.hide {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Type */

h1 {
  font-size: clamp(2.7rem, 5.2vw + 0.9rem, 4.7rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.022em;
}

h2 {
  font-size: clamp(1.95rem, 2.6vw + 1.1rem, 3.1rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h3 {
  font-size: 1.3125rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.lead {
  font-size: clamp(1.125rem, 0.6vw + 1rem, 1.3125rem);
  line-height: 1.45;
  max-width: 34em;
}

.intro {
  max-width: 40em;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.5;
}

.small {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
}

a.button:hover {
  background: #1c2742;
}

.button.is-light {
  background: var(--white);
  color: var(--ink);
}

a.button.is-light:hover {
  background: var(--blue-tint);
}

/* Not a link yet: the app is not on the App Store. */
.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.5);
  font-weight: 700;
}

.soon::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
}

.on-paper .soon {
  box-shadow: inset 0 0 0 1.5px var(--line);
}

/* Header and hero */

/* The bar sits on top of the blue hero, so the hero is one unbroken field of colour. */
.top-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  color: var(--white);
}

.top-bar.is-solid {
  position: static;
  background: var(--blue);
}

.hero {
  position: relative;
  overflow: hidden;
  padding-top: 88px;
  background: var(--blue);
  color: var(--white);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand svg {
  width: 36px;
  height: 36px;
  flex: none;
}

.top nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.6vw, 34px);
  font-size: 0.9375rem;
  font-weight: 700;
}

.top nav a {
  padding-block: 10px;
  text-decoration: none;
}

.top nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

.top nav a.button {
  min-height: 44px;
  padding: 0 20px;
  font-size: 0.9375rem;
}

.top nav a.button:hover {
  text-decoration: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 396px);
  align-items: center;
  gap: clamp(40px, 5vw, 76px);
  padding-top: clamp(28px, 5vw, 72px);
  padding-bottom: clamp(56px, 7vw, 104px);
}

.hero-copy .lead {
  margin-top: 24px;
}

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

.hero-copy .small {
  margin-top: 16px;
  opacity: 0.86;
}

/* The sun from the app's welcome screen, behind the deck. */
.deck-wrap {
  position: relative;
}

.deck-wrap::before {
  content: "";
  position: absolute;
  top: -58px;
  right: -92px;
  width: 232px;
  height: 232px;
  border-radius: 50%;
  background: var(--amber);
}

/* The deck */

.deck {
  position: relative;
  width: 100%;
  max-width: 404px;
  aspect-ratio: 404 / 528;
  margin-inline: auto;
  border-radius: 34px;
}

.card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 34px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 22px 44px -22px rgb(6 18 64 / 0.6);
  transform-origin: 50% 100%;
  transition:
    transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.24s ease;
}

/* Without the script there is one card to read and nothing to swipe. */
.card + .card,
.deck-actions,
.tray {
  display: none;
}

.js .card + .card {
  display: flex;
}

.js .deck-actions {
  display: flex;
}

.js .tray {
  display: block;
}

.js .card {
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

/* The card being decided is on top; the next two show their lower edges beneath it. */
.js .card[data-pos="0"] {
  z-index: 3;
}

.js .card[data-pos="1"] {
  z-index: 2;
  transform: translateY(15px) scale(0.955);
}

.js .card[data-pos="2"] {
  z-index: 1;
  transform: translateY(30px) scale(0.91);
}

.js .card[data-pos="3"] {
  transform: translateY(30px) scale(0.91);
  opacity: 0;
}

.js .card[data-pos="gone"] {
  z-index: 4;
  opacity: 0;
  pointer-events: none;
}

.js .card.is-dragging {
  transition: none;
  cursor: grabbing;
}

.card-photo {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--blue-tint) url(img/campus.svg) center 58% / 52% no-repeat;
}

/* A photo that has not arrived yet, or never does, leaves the drawn campus showing. */
.card-photo img:not([src]) {
  visibility: hidden;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.pill {
  position: absolute;
  top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--white);
  font-size: 0.84375rem;
  font-weight: 700;
  line-height: 1;
}

.pill-fit {
  left: 14px;
  gap: 5px;
}

.pill-fit span {
  color: var(--muted);
  font-weight: 600;
}

.pill-label {
  right: 14px;
}

.swatch {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--likely);
}

.swatch.k1 {
  background: var(--target);
}

/* The palest label needs an edge to show on white, as in the app. */
.swatch.k2 {
  background: var(--reach);
  box-shadow: inset 0 0 0 1.5px var(--target);
}

.swatch.k3 {
  background: var(--high);
}

.stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 1.125rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
}

.stamp-save {
  background: var(--blue);
  opacity: max(0, var(--pull, 0));
}

.stamp-pass {
  opacity: max(0, calc(-1 * var(--pull, 0)));
}

.card-body {
  padding: 18px 22px 16px;
}

.card-body h3 {
  font-size: 1.375rem;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.028em;
}

.card-where {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.875rem;
}

.card-chance {
  margin-top: 10px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--muted);
}

.card-chance b {
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.card-why {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.84375rem;
  line-height: 1.38;
}

.card-why svg {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  color: var(--blue);
}

.card-credit {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.3;
}

.deck-done {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  padding: 34px;
  border-radius: 34px;
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.45);
}

.deck-done[hidden] {
  display: none;
}

.deck-done p:first-child {
  font-size: 1.75rem;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.deck-done .button {
  margin-top: 6px;
}

.deck-actions {
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 46px;
}

.round {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.round svg {
  width: 24px;
  height: 24px;
}

.round:active {
  transform: scale(0.94);
}

.round.is-undo {
  width: 46px;
  height: 46px;
  background: rgb(255 255 255 / 0.2);
  color: var(--white);
}

.round.is-undo svg {
  width: 19px;
  height: 19px;
}

.round.is-save {
  background: var(--ink);
  color: var(--white);
}

.round:disabled {
  opacity: 0.38;
  cursor: default;
}

.tray {
  max-width: 404px;
  margin: 22px auto 0;
  padding: 14px 18px 15px;
  border-radius: 22px;
  background: var(--white);
  color: var(--ink);
}

.tray-count {
  font-weight: 800;
  letter-spacing: -0.015em;
}

.tray-bar {
  display: flex;
  gap: 3px;
  height: 6px;
  margin-top: 9px;
}

.tray-bar[hidden] {
  display: none;
}

.tray-bar i {
  flex: 1;
  border-radius: 999px;
  background: var(--likely);
}

.tray-bar i.k1 {
  background: var(--target);
}

.tray-bar i.k2 {
  background: var(--reach);
  box-shadow: inset 0 0 0 1.5px var(--target);
}

.tray-bar i.k3 {
  background: var(--high);
}

.tray-line {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}

.deck-note {
  max-width: 404px;
  margin: 16px auto 0;
  font-size: 0.875rem;
  line-height: 1.45;
  opacity: 0.88;
}

@keyframes nudge {
  0%,
  100% {
    transform: none;
  }
  40% {
    transform: translateX(26px) rotate(3.2deg);
  }
}

.js .card.is-nudging {
  animation: nudge 0.9s cubic-bezier(0.3, 0.7, 0.3, 1);
}

/* The deck lives in a phone, laid out as the app's own Matches screen. Everything on the screen
   is sized from the screen's width (cqw), so the phone can shrink without its contents reflowing,
   and a card that is swiped away leaves at the edge of the glass. */

.stage {
  position: relative;
  width: min(100%, 344px);
  margin-inline: auto;
}

.hero-phone {
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-shadow: 0 44px 70px -36px rgb(6 18 64 / 0.8);
}

.screen {
  container-type: inline-size;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  color: var(--ink);
}

.screen-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 13.4cqw;
  padding: 0.8cqw 7.6cqw 0 9cqw;
  font-size: 4.5cqw;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.screen-status svg {
  width: 13.4cqw;
  height: auto;
}

.screen-head {
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  padding: 2.4cqw 5.5cqw 0;
}

.screen-head > div {
  flex: 1;
  min-width: 0;
}

.screen-title {
  font-size: 7.6cqw;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.screen-sub {
  margin-top: 0.6cqw;
  color: var(--muted);
  font-size: 3.7cqw;
  line-height: 1.3;
}

.screen-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 10.4cqw;
  height: 10.4cqw;
  border-radius: 50%;
  background: var(--paper);
}

.screen-icon svg {
  width: 5.2cqw;
  height: 5.2cqw;
}

.hero-phone .deck {
  flex: 1;
  width: auto;
  max-width: none;
  min-height: 0;
  aspect-ratio: auto;
  margin: 3.4cqw 4.3cqw 0;
  border-radius: 8.6cqw;
}

.hero-phone .card {
  border-radius: 8.6cqw;
  box-shadow:
    0 0 0 1px var(--line),
    0 5.5cqw 9cqw -5.5cqw rgb(15 23 42 / 0.5);
}

.js .hero-phone .card[data-pos="1"] {
  transform: translateY(4.3cqw) scale(0.955);
}

.js .hero-phone .card[data-pos="2"],
.js .hero-phone .card[data-pos="3"] {
  transform: translateY(8.6cqw) scale(0.91);
}

.hero-phone .pill {
  top: 3.7cqw;
  gap: 1.9cqw;
  height: 8.6cqw;
  padding: 0 3.5cqw;
  font-size: 3.7cqw;
}

.hero-phone .pill-fit {
  left: 3.7cqw;
  gap: 1.3cqw;
}

.hero-phone .pill-label {
  right: 3.7cqw;
}

.hero-phone .swatch {
  width: 2.6cqw;
  height: 2.6cqw;
}

.hero-phone .stamp {
  padding: 3cqw 5.6cqw;
  font-size: 4.9cqw;
}

.hero-phone .card-body {
  padding: 4.3cqw 5cqw 3.7cqw;
}

.hero-phone .card-body h3 {
  font-size: 6cqw;
}

.hero-phone .card-where {
  margin-top: 0.9cqw;
  font-size: 3.7cqw;
  line-height: 1.4;
}

.hero-phone .card-chance {
  margin-top: 2.4cqw;
  font-size: 3.7cqw;
}

.hero-phone .card-chance b {
  font-size: 4.9cqw;
}

.hero-phone .card-why {
  gap: 2cqw;
  margin-top: 2cqw;
  font-size: 3.7cqw;
}

.hero-phone .card-why svg {
  width: 3.8cqw;
  height: 3.8cqw;
  margin-top: 0.8cqw;
}

.hero-phone .card-credit {
  margin-top: 2.4cqw;
  font-size: 2.9cqw;
}

.hero-phone .deck-done {
  gap: 3.4cqw;
  padding: 7cqw;
  border-radius: 8.6cqw;
  background: var(--paper);
  box-shadow: none;
  color: var(--muted);
  font-size: 4.3cqw;
  line-height: 1.42;
}

.hero-phone .deck-done p:first-child {
  color: var(--ink);
  font-size: 7.4cqw;
}

.hero-phone .deck-done .button {
  min-height: 13.6cqw;
  margin-top: 1.4cqw;
  padding: 0 6.2cqw;
  font-size: 4.3cqw;
}

/* The gap above the buttons is where the next two cards show their lower edges. */
.hero-phone .deck-actions {
  gap: 5cqw;
  margin-top: 12.6cqw;
}

.hero-phone .round {
  width: 16cqw;
  height: 16cqw;
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.hero-phone .round svg {
  width: 6.2cqw;
  height: 6.2cqw;
}

.hero-phone .round.is-undo {
  width: 11.8cqw;
  height: 11.8cqw;
  background: var(--paper);
  box-shadow: none;
  color: var(--muted);
}

.hero-phone .round.is-undo svg {
  width: 4.9cqw;
  height: 4.9cqw;
}

.hero-phone .round.is-save {
  box-shadow: none;
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4.6cqw 4.3cqw 4.6cqw;
  padding: 1.5cqw;
  border-radius: 999px;
  background: var(--white);
  box-shadow:
    0 0 0 1px var(--line),
    0 3cqw 7cqw -3cqw rgb(15 23 42 / 0.3);
}

.tabs span {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.8cqw;
  min-width: 12.6cqw;
  height: 12.6cqw;
  border-radius: 999px;
  font-size: 3.7cqw;
  font-weight: 700;
  line-height: 1;
}

.tabs svg {
  width: 5.8cqw;
  height: 5.8cqw;
}

.tabs .is-on {
  padding: 0 4.8cqw;
  background: var(--ink);
  color: var(--white);
}

/* How many colleges have been saved, on the heart, as in the app. */
.tabs b {
  position: absolute;
  top: 0.9cqw;
  right: 0.3cqw;
  min-width: 5cqw;
  height: 5cqw;
  padding: 0 1.3cqw;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  font-size: 3.1cqw;
  font-weight: 800;
  line-height: 5cqw;
  text-align: center;
}

.tabs b[hidden] {
  display: none;
}

.deck-note {
  max-width: 344px;
}

/* Beside the copy, the phone stands to the right. On a short laptop screen it is drawn smaller,
   so the buttons under the cards are still in view without scrolling. */
@media (min-width: 941px) {
  .stage {
    width: clamp(264px, calc((100vh - 190px) * 0.46), 344px);
    width: clamp(264px, calc((100svh - 190px) * 0.46), 344px);
    max-width: 100%;
    margin-inline: auto 0;
  }

  .deck-note {
    margin-right: 0;
  }
}

/* With room to spare, what has been saved floats off the phone's lower left corner. It reaches
   a fifth of the way across the glass, which stops short of the pass button. */
@media (min-width: 1141px) {
  /* The line under the buttons stops short of where the tray floats. */
  .hero-copy .small {
    max-width: 31em;
  }

  .js .tray {
    position: absolute;
    right: 80%;
    bottom: 26px;
    z-index: 2;
    width: 200px;
    margin: 0;
    background: rgb(255 255 255 / 0.86);
    box-shadow:
      inset 0 0 0 1px rgb(255 255 255 / 0.7),
      0 22px 44px -20px rgb(6 18 64 / 0.7);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
  }
}

/* Bands */

.band {
  padding-block: var(--band);
}

.band.is-white {
  background: var(--white);
}

.band.is-ink {
  background: var(--ink);
  color: var(--white);
}

.band.is-blue {
  background: var(--blue);
  color: var(--white);
}

.band.is-ink .intro {
  color: #b4bfd6;
}

/* A phone, drawn flat like the app's illustrations, around a real screenshot. */
.phone {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1206 / 2622;
  border: 9px solid var(--ink);
  border-radius: 13.5% / 6.2%;
  background: var(--white);
}

.phone img {
  width: 100%;
}

.phone::after {
  content: "";
  position: absolute;
  top: 1.25%;
  left: 50%;
  width: 29%;
  height: 3.5%;
  translate: -50% 0;
  border-radius: 999px;
  background: var(--ink);
}

/* How it works */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin-top: clamp(36px, 5vw, 64px);
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

/* The top of the phone only: what the step looks like, without three whole screens in a row. */
.shot {
  overflow: hidden;
  aspect-ratio: 1 / 1.04;
  padding: 9% 13% 0;
  border-radius: 30px;
  background: var(--soft);
}

.shot .phone {
  aspect-ratio: auto;
  border-bottom: 0;
  border-radius: 40px 40px 0 0;
  height: 100%;
}

.shot .phone::after {
  top: 11px;
  height: 20px;
}

.steps h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

/* The numbered squares of the app's own survey. */
.steps h3::before {
  content: counter(step);
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0;
}

.steps p {
  margin-top: 10px;
  color: var(--muted);
}

.note {
  margin-top: clamp(32px, 4vw, 52px);
  padding: 20px 24px;
  border-radius: 22px;
  background: var(--white);
  max-width: 46em;
}

.note a {
  font-weight: 700;
  text-underline-offset: 3px;
}

/* A college page */

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  grid-template-areas:
    "phone head"
    "phone facts";
  align-items: start;
  gap: clamp(28px, 3.4vw, 44px) clamp(36px, 7vw, 112px);
}

.page-grid .phone {
  grid-area: phone;
  align-self: center;
}

.page-head {
  grid-area: head;
  align-self: end;
}

.facts {
  grid-area: facts;
}

.facts div {
  padding-block: 18px;
  border-top: 1px solid var(--line);
}

.facts div:last-child {
  border-bottom: 1px solid var(--line);
}

.facts dt {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.facts dd {
  margin-top: 4px;
  max-width: 36em;
  color: var(--muted);
}

/* The labels */

.scale {
  margin-top: clamp(32px, 4vw, 56px);
}

.scale-bar {
  display: flex;
  gap: 2px;
  height: 20px;
}

.scale-bar i {
  border-radius: 4px;
}

/* On ink the strongest blue is lifted a step and the palest paled a step, so all four clear the surface. */
.is-ink {
  --likely: #3d6bee;
  --target: #8faaf8;
  --reach: #d5defc;
}

.scale-bar .k3 {
  flex: 15;
  background: var(--high);
}

.scale-bar .k2 {
  flex: 25;
  background: var(--reach);
}

.scale-bar .k1 {
  flex: 30;
  background: var(--target);
}

.scale-bar .k0 {
  flex: 25;
  background: var(--likely);
}

.scale-bar .never {
  flex: 5;
  background: repeating-linear-gradient(135deg, rgb(255 255 255 / 0.22) 0 2px, transparent 2px 6px);
}

.scale-ticks {
  position: relative;
  height: 26px;
  margin-top: 8px;
  color: #b4bfd6;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.scale-ticks span {
  position: absolute;
  top: 0;
  translate: -50% 0;
}

.scale-ticks .t0 {
  left: 0;
  translate: 0;
}

.scale-ticks .t15 {
  left: 15%;
}

.scale-ticks .t40 {
  left: 40%;
}

.scale-ticks .t70 {
  left: 70%;
}

.scale-ticks .t95 {
  left: 95%;
}

.scale-key {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 28px;
  margin-top: 18px;
}

.scale-key dt {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.scale-key dt i {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.scale-key .k0 i {
  background: var(--likely);
}

.scale-key .k1 i {
  background: var(--target);
}

.scale-key .k2 i {
  background: var(--reach);
}

.scale-key .k3 i {
  background: var(--high);
}

.scale-key dd {
  margin-top: 3px;
  color: #b4bfd6;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 40px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: clamp(28px, 3.4vw, 40px);
  border-top: 1px solid rgb(255 255 255 / 0.16);
}

.rules p {
  margin-top: 8px;
  color: #b4bfd6;
}

/* The what-if demo */

.sorter {
  position: relative;
  margin-top: clamp(56px, 7vw, 96px);
  padding: clamp(22px, 3.4vw, 44px);
  border-radius: 34px;
  background: #18233d;
}

.sorter-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 20px clamp(28px, 5vw, 72px);
}

.sorter-top p {
  margin-top: 10px;
  color: #b4bfd6;
}

.dial label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.dial output {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.dial input {
  --fill: 53.3%;
  display: block;
  width: 100%;
  height: 44px;
  margin: 6px 0 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.dial input::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--white) var(--fill), rgb(255 255 255 / 0.22) var(--fill));
}

.dial input::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.22);
}

.dial input::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--white);
}

.dial input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -11px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 6px rgb(255 255 255 / 0.18);
}

.dial input::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 6px rgb(255 255 255 / 0.18);
}

.dial-ends {
  position: relative;
  display: flex;
  justify-content: space-between;
  color: #b4bfd6;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.dial-ends .today {
  position: absolute;
  left: 53.3%;
  translate: -50% 0;
  white-space: nowrap;
}

.sorter-say {
  min-height: 3.1em;
  margin-top: 26px;
  font-size: clamp(1.1875rem, 1vw + 1rem, 1.5rem);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.bins {
  margin-top: 14px;
}

.bin {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding-block: 12px;
  border-top: 1px solid rgb(255 255 255 / 0.13);
}

.bin-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.bin-name b {
  font-size: 1.1875rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 18px;
}

.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--likely);
}

.dot.k1 {
  background: var(--target);
}

.dot.k2 {
  background: var(--reach);
}

.dot.k3 {
  background: var(--high);
}

.dot:hover,
.dot.is-on {
  box-shadow:
    0 0 0 2px #18233d,
    0 0 0 4px var(--white);
}

.tip {
  position: absolute;
  z-index: 5;
  max-width: 260px;
  padding: 9px 13px;
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 10px 28px -10px rgb(0 0 0 / 0.5);
}

.tip[hidden] {
  display: none;
}

.tip b {
  display: block;
  font-weight: 700;
}

.sorter-key {
  margin-top: 18px;
  color: #b4bfd6;
  font-size: 0.875rem;
}

.moves {
  margin-top: 16px;
}

.moves summary {
  display: inline-block;
  padding-block: 8px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.moves summary::-webkit-details-marker {
  display: none;
}

.moves ul {
  columns: 2 280px;
  column-gap: 40px;
  margin-top: 10px;
  color: #dbe2f1;
  font-size: 0.9375rem;
}

.moves li {
  padding-block: 5px;
  break-inside: avoid;
}

.moves li span {
  color: #b4bfd6;
}

/* More in the app */

.rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 72px);
  margin-top: clamp(36px, 5vw, 64px);
}

.rail .phone {
  max-width: 290px;
}

.rail h3 {
  margin-top: 24px;
}

.rail p {
  margin-top: 8px;
  max-width: 22em;
  color: var(--muted);
}

/* What it is not */

.plain {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(32px, 6vw, 96px);
  margin-top: clamp(32px, 4vw, 56px);
}

.plain li {
  padding-block: 24px;
  border-top: 2px solid var(--ink);
}

.plain p {
  margin-top: 8px;
  color: var(--muted);
}

/* Price */

.price-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  align-items: start;
  gap: clamp(32px, 6vw, 96px);
}

.plans {
  border-radius: 30px;
  background: var(--white);
  padding: 8px 26px;
}

.plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 16px;
  padding-block: 22px;
}

.plan + .plan {
  border-top: 1px solid var(--line);
}

.plan h3 {
  font-size: 1.1875rem;
}

.plan .amount {
  grid-row: span 2;
  text-align: right;
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.plan .amount span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
}

.plan .tag {
  justify-self: start;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--amber-tint);
  box-shadow: inset 0 0 0 1.5px var(--amber);
  color: var(--amber-ink);
  font-size: 0.84375rem;
  font-weight: 700;
}

.plan .plain-tag {
  color: var(--muted);
  font-size: 0.875rem;
}

.terms {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.terms + .terms {
  margin-top: 10px;
}

/* Questions */

.faq {
  max-width: 820px;
  margin-top: clamp(28px, 3.4vw, 44px);
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 20px;
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 100% no-repeat;
  transition: rotate 0.2s ease;
}

.faq details[open] summary::after {
  background: linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat;
  rotate: 180deg;
}

.faq details p {
  max-width: 40em;
  padding-bottom: 22px;
  color: var(--muted);
}

/* Closing band and footer */

.close {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px 48px;
}

.close h2 {
  max-width: 14em;
}

.foot {
  padding-block: 44px 56px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.foot-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  color: var(--ink);
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-size: 0.9375rem;
  font-weight: 700;
}

.foot nav a {
  padding-block: 8px;
  text-decoration: none;
}

.foot nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.foot p {
  max-width: 62em;
  margin-top: 14px;
}

.foot-top + p {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* Privacy, Terms, Support and Credits: one reading column. */

.doc {
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) 72px;
}

.doc h1 {
  font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
  line-height: 1.02;
}

.doc h2 {
  margin-top: 40px;
  font-size: 1.375rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.doc p,
.doc li {
  margin-top: 10px;
}

.doc ul {
  padding-left: 22px;
  list-style: disc;
}

.doc a {
  color: var(--blue-deep);
  font-weight: 600;
  text-underline-offset: 3px;
}

.doc .date {
  margin-top: 12px;
  color: var(--muted);
}

.doc .panel {
  margin-top: 28px;
  padding: 22px 24px;
  border-radius: 24px;
  background: var(--white);
}

.doc .panel p {
  margin-top: 4px;
}

.credits li {
  margin-top: 0;
  padding-block: 14px;
  border-top: 1px solid var(--line);
}

.doc ul.credits {
  padding-left: 0;
  margin-top: 24px;
  list-style: none;
}

.credits b {
  display: block;
  font-weight: 700;
}

/* Smaller screens */

/* Two columns but not much room: the headline steps down so it still breaks into three lines. */
@media (min-width: 941px) and (max-width: 1140px) {
  h1 {
    font-size: clamp(3rem, 5.6vw, 3.9rem);
  }
}

@media (max-width: 940px) {
  .top nav a:not(.button) {
    display: none;
  }

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

  .deck-wrap::before {
    top: -46px;
    right: -70px;
    width: 190px;
    height: 190px;
  }

  .price-grid,
  .sorter-top {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "phone"
      "facts";
  }

  .page-grid .phone {
    width: min(100%, 300px);
    justify-self: center;
  }

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

@media (max-width: 760px) {
  /* On a phone the deck is the next thing down, so the button that scrolls past it steps aside. */
  .get .is-extra {
    display: none;
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .shot {
    aspect-ratio: 1 / 0.86;
    padding-inline: 17%;
  }

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

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

  /* The label and its count on one line, its dots beneath: a full row of dots fits a phone. */
  .bin {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .bin-name {
    justify-content: flex-start;
  }

  .dot {
    width: 14px;
    height: 14px;
  }

  .dots {
    gap: 5px;
    min-height: 14px;
  }

  /* Three whole screens side by side would be too small to read: they scroll sideways instead. */
  .rail {
    grid-auto-flow: column;
    grid-auto-columns: 66%;
    grid-template-columns: none;
    gap: 22px;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }

  .rail::-webkit-scrollbar {
    display: none;
  }

  .rail li {
    scroll-snap-align: start;
  }

  .plan .amount {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card,
  .round,
  .faq summary::after {
    transition: none;
  }

  .js .card.is-nudging {
    animation: none;
  }
}

@media (forced-colors: active) {
  .swatch,
  .dot,
  .scale-bar i,
  .tray-bar i,
  .scale-key dt i {
    forced-color-adjust: none;
  }
}

/* A button on a plain page keeps a button's colours, not a link's. */
.doc a.button {
  color: var(--white);
  text-decoration: none;
}
