/* Pricing — one price per vehicle, everything included.
   Built on the tokens of /assets/site.css, in the language of the discover
   page: large type, hairlines, one colour. pricing.js adds `.is-visible` to
   [data-reveal] once it enters the viewport. Without JavaScript, or with
   reduced motion, everything is simply shown. */

.pricing {
  overflow-x: clip;
}

.pricing .eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pricing h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-headline);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.p-title {
  max-width: 20ch;
  margin-inline: auto !important;
  text-align: center;
}


/* Hero: the site's pastel wash, a little shorter than other pages so the
   prices are in the first screen. */
.pricing .page-hero {
  padding-bottom: 40px;
}

.pricing .page-hero h1 {
  max-width: none;
  font-size: var(--text-display);
  letter-spacing: -0.035em;
}

.pricing .page-hero .lead {
  max-width: 40ch;
  text-wrap: balance;
}

@media (min-width: 640px) {
  .pricing .page-hero {
    padding-bottom: 56px;
  }
}

/* Reveal ------------------------------------------------------------------ */

.js [data-reveal] {
  opacity: 0;
  translate: 0 28px;
  transition:
    opacity 0.9s var(--ease-apple),
    translate 0.9s var(--ease-apple);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
}

/* Plans ------------------------------------------------------------------- */

.p-plans {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px;
}

.plans {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .plans {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--bg-card);
}

/* The yearly plan is the one we recommend: a blue hairline, nothing louder. */
.plan-best {
  border-color: transparent;
  box-shadow: 0 0 0 1.5px var(--brand);
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 26px;
}

.plan h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.plan-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.plan-price {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 28px 0 0;
}

.plan-amount {
  font-family: var(--font-display);
  font-size: clamp(3rem, 2.4rem + 2.4vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.plan-unit {
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.3;
}

.plan-note {
  margin: 4px 0 28px;
  color: var(--ink-secondary);
  font-size: 15px;
}

.plan .button {
  width: 100%;
  margin-top: auto;
}

.button-quiet {
  background: var(--fill);
  color: var(--ink);
  box-shadow: none;
}

.button-quiet:hover {
  background: var(--fill-strong);
  color: var(--ink);
}

.plans-more {
  margin: 28px 0 0;
  color: var(--ink-secondary);
  font-size: 15px;
  text-align: center;
  text-wrap: balance;
}

.plans-fine {
  max-width: 60ch;
  margin: 8px auto 0;
  color: var(--ink-tertiary);
  font-size: var(--text-caption);
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}

/* Promises ---------------------------------------------------------------- */

/* Three facts about the subscription, separated by hairlines. */
.promises {
  display: grid;
  max-width: var(--container);
  margin: clamp(72px, 10vw, 112px) auto 0;
  padding: 0 20px;
  list-style: none;
}

.promises li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 24px;
  text-align: center;
}

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

.promises h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.022em;
}

.promises p {
  max-width: 28ch;
  margin: -6px 0 0;
  color: var(--ink-secondary);
  font-size: 16px;
  line-height: 1.45;
  text-wrap: pretty;
}

@media (min-width: 760px) {
  .promises {
    grid-template-columns: repeat(3, 1fr);
  }

  .promises li + li {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

.p-icon {
  display: block;
  color: var(--brand);
}

.p-icon svg {
  display: block;
  width: 34px;
  height: 34px;
  stroke-width: 1.4;
}

/* Each line icon traces itself once, when it comes into view. */
.js .p-icon svg .trace {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.js .is-visible .p-icon svg .trace {
  animation: trace 1.4s var(--ease-apple) forwards;
  animation-delay: calc(var(--i, 0) * 0.12s + 0.2s);
}

@keyframes trace {
  to {
    stroke-dashoffset: 0;
  }
}

/* Everything included ----------------------------------------------------- */

.p-features {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(96px, 14vw, 160px) 20px 0;
}

.features {
  display: grid;
  gap: 48px 40px;
  margin: clamp(48px, 7vw, 80px) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
    gap: 56px 48px;
  }
}

.features h3 {
  margin: 14px 0 10px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.features .p-icon svg {
  width: 30px;
  height: 30px;
}

.features ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.features ul li {
  padding: 11px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.4;
  text-wrap: pretty;
}

/* Questions --------------------------------------------------------------- */

.p-faq {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: clamp(96px, 14vw, 160px) 20px 0;
}

.faq {
  margin: clamp(40px, 6vw, 56px) 0 0;
  border-bottom: 1px solid var(--line);
}

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

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  list-style: none;
  cursor: pointer;
}

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

.faq summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: 4px;
}

.faq summary svg {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--ink-tertiary);
  transition: rotate 0.3s var(--ease-apple);
}

.faq details[open] summary svg {
  rotate: 45deg;
}

.faq details p {
  max-width: 62ch;
  margin: -8px 0 24px;
  color: var(--ink-secondary);
  text-wrap: pretty;
}

/* Closing ----------------------------------------------------------------- */

.p-closing {
  position: relative;
  isolation: isolate;
  margin-top: clamp(96px, 14vw, 160px);
  padding: clamp(96px, 12vw, 144px) 20px;
  text-align: center;
}

.p-closing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--wash);
  mask-image: linear-gradient(180deg, transparent, #000 40%);
}

.closing-mark {
  display: block;
  width: 72px;
  height: auto;
  margin: 0 auto 28px;
}

.p-closing h2 {
  max-width: 18ch;
  margin-inline: auto;
}

.p-closing p {
  max-width: 40ch;
  margin: 16px auto 0;
  color: var(--ink-secondary);
  font-size: var(--text-lead);
  line-height: 1.4;
  text-wrap: pretty;
}

.p-closing p:last-child {
  margin-top: 32px;
}

/* Motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    translate: none;
    transition: none;
  }

  .js .p-icon svg .trace {
    stroke-dashoffset: 0;
    animation: none !important;
  }


  .faq summary svg {
    transition: none;
  }
}

/* The country whose App Store prices the plans show. */
.plans-country {
  margin: 16px auto 0;
  color: var(--ink-secondary);
  font-size: 15px;
  text-align: center;
}
