/* ==========================================================================
   Pricing teaser (home page)
   The line, and a strip: three starting prices, each a
   link to its service on the pricing page, and an ink "View all pricing"
   cell. Hover draws an ink line along a cell's foot from the side the
   pointer came in and turns its arrow. First time in view (pricing.js,
   teaser): the line's words rise, the cells unroll one after another and
   the prices count up. Built by tools/pricing/build.py.
   ========================================================================== */

.pstrip {
  position: relative;
  z-index: 1;
  padding: clamp(88px, 13vh, 150px) var(--gutter) clamp(96px, 15vh, 170px);
  background: var(--bone);
}

/* Paper grain, as on the rest of the page. */
.pstrip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/textures/grain.webp") repeat;
  background-size: 160px 160px;
  opacity: 0.55;
  pointer-events: none;
}

.pstrip > * {
  position: relative;
}

.pstrip__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.pstrip__label {
  font-size: var(--fs-micro);
  font-weight: 400;
}

.pstrip__index {
  color: var(--text-mute);
}

.pstrip__intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
  margin-top: clamp(28px, 4.5vh, 48px);
}

.pstrip__lede {
  max-width: 17ch;
  font-size: clamp(2rem, 3.7vw, 4.5rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.038em;
}

.pstrip__w {
  display: inline-block;
  overflow: clip;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  vertical-align: top;
}

.pstrip__w > span {
  display: inline-block;
}

/* ------------------------------------------------------------------ the strip */

.pstrip__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.2fr);
  margin: clamp(40px, 7vh, 80px) 0 0;
  padding: 0;
  list-style: none;
  border-block: 1px solid var(--line);
}

.pstrip__list > li {
  display: flex;
  min-width: 0;
}

.pstrip__list > li + li {
  border-left: 1px solid var(--line);
}

.pstrip__item,
.pstrip__all {
  position: relative;
  display: grid;
  width: 100%;
  min-height: clamp(160px, 21vh, 220px);
  -webkit-tap-highlight-color: transparent;
}

.pstrip__item {
  grid-template-rows: auto 1fr auto;
  row-gap: 14px;
  padding: 20px clamp(18px, 1.6vw, 28px) 22px;
  transition: background-color 300ms ease;
}

.pstrip__i {
  color: var(--text-mute);
}

.pstrip__name {
  font-size: clamp(1.0625rem, 0.95rem + 0.35vw, 1.375rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.pstrip__from {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.pstrip__pre {
  flex-basis: 100%;
  margin-bottom: 6px;
  color: var(--text-mute);
}

.pstrip__num {
  font-size: clamp(2.5rem, 1.5rem + 2.3vw, 4.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.pstrip__unit {
  margin-left: 3px;
  font-size: 1.0625rem;
  color: var(--text-mute);
}

/* An arrow up and away (it points on, into the pricing page, on hover). */
.pstrip__arrow {
  position: absolute;
  top: 20px;
  right: clamp(18px, 1.6vw, 28px);
  width: 18px;
  height: 18px;
  rotate: -45deg;
  transition:
    rotate 450ms var(--ease-out),
    translate 450ms var(--ease-out);
}

.pstrip__item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: var(--line-from, 0%) 50%;
  transition: transform 600ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .pstrip__item:hover {
    background: rgb(255 255 255 / 0.5);
  }

  .pstrip__item:hover::after {
    transform: scaleX(1);
  }

  .pstrip__item:hover .pstrip__arrow {
    rotate: 0deg;
    translate: 3px 0;
  }
}

.pstrip__item:focus-visible,
.pstrip__all:focus-visible {
  outline-offset: -6px;
}

/* View all pricing: the ink cell. */
.pstrip__all {
  grid-template-rows: 1fr auto;
  align-content: space-between;
  gap: 14px;
  padding: 22px clamp(20px, 1.8vw, 32px) 24px;
  color: var(--white);
  background: var(--ink);
  transition: background-color 300ms ease;
}

.pstrip__all-title {
  align-self: start;
  max-width: 9ch;
  font-size: clamp(1.625rem, 1.1rem + 1.2vw, 2.75rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.pstrip__all-sub {
  max-width: 30ch;
  padding-right: 48px;
  color: var(--on-ink-mute);
  line-height: 1.5;
}

.pstrip__all-arrow {
  position: absolute;
  right: clamp(20px, 1.8vw, 32px);
  bottom: 22px;
  width: 30px;
  height: 30px;
  transition: translate 450ms var(--ease-out);
}

.pstrip__all:focus-visible {
  outline-color: var(--bone);
}

@media (hover: hover) and (pointer: fine) {
  .pstrip__all:hover {
    background: #1f1f1f;
  }

  .pstrip__all:hover .pstrip__all-arrow {
    translate: 6px 0;
  }
}

/* Tablets: two by two. Phones: one price a row, name on the left and the
   price on the right, then the ink cell. */
@media (max-width: 1099px) {
  .pstrip__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pstrip__list > li:nth-child(3) {
    border-left: 0;
  }

  .pstrip__list > li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 599px) {
  .pstrip__list {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .pstrip__item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    column-gap: 14px;
    min-height: 96px;
    padding: 18px 4px;
  }

  .pstrip__from {
    justify-content: flex-end;
    text-align: right;
  }

  .pstrip__pre {
    margin-bottom: 4px;
  }

  .pstrip__num {
    font-size: 2.125rem;
  }

  .pstrip__arrow {
    display: none;
  }

  .pstrip__all {
    min-height: 150px;
    margin-top: 12px;
    border-radius: 16px;
  }
}

/* ------------------------------------------------------------------ reveal */

.pstrip.is-armed .pstrip__w > span {
  transform: translateY(108%);
  transition: transform 1150ms var(--ease-out) calc(var(--w, 0) * 45ms);
}

.pstrip.is-armed .pstrip__list > li {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1150ms var(--ease-out) calc(200ms + var(--i, 0) * 90ms);
}

.pstrip.is-in .pstrip__w > span {
  transform: none;
}

.pstrip.is-in .pstrip__list > li {
  clip-path: inset(0 -2px -2px 0);
}

@media (prefers-reduced-motion: reduce) {
  .pstrip *,
  .pstrip *::before,
  .pstrip *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

/* Phones: the site's section rhythm (--sec-top / --sec-bot / --sec-end, tokens.css),
   so every gap between two sections reads the same. */
@media (max-width: 719px) {
  .pstrip {
    padding-top: var(--sec-top);
    padding-bottom: var(--sec-bot);
  }
}
