/* The audits page (/audit): the three options with their facts, the example
   audit and who does the work. It reuses the home page's drawings: the
   example audit's book and the options' squares. Every option is one block
   in the page's source, so its facts stay together for a reader who never
   sees the layout. The checker's own page uses audit.css; this sheet is for
   /audit only. */

/* Opening: the question on the left, the example audit's book on the right */
.offer-hero {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(40px, 4vw, 72px);
  padding: clamp(40px, 4vw, 72px) var(--bl-side) clamp(56px, 5vw, 88px);
}

.offer-hero__text {
  flex: 1 1 360px;
  align-self: center;
  min-width: 0;
}

.offer-hero h1 {
  max-width: 15em;
  margin-top: 22px;
  font-size: clamp(28px, 2.474vw, 52px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.offer-hero__line {
  max-width: 24em;
  margin-top: 1.1em;
  font-size: clamp(17px, 1.302vw, 27px);
  line-height: 1.4;
  text-wrap: pretty;
}

.offer-hero__actions {
  margin-top: clamp(28px, 2.6vw, 44px);
}

.offer-example {
  max-width: 28em;
  margin-top: clamp(40px, 3.5vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--bl-rule);
}

.offer-example p {
  margin-top: 10px;
  color: var(--bl-muted);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}

.offer-example .arrow-link {
  margin-top: 8px;
}

.offer-hero__cover {
  display: grid;
  flex: 1.4 1 420px;
  place-items: center;
  min-width: 0;
  min-height: clamp(400px, 38vw, 720px);
  padding: 64px 24px 48px;
  background: var(--bl-stone);
}

.offer-hero__cover:hover {
  text-decoration: none;
}

/* The example audit as a thick volume, as on the home page. */
.book {
  position: relative;
  display: flex;
  width: clamp(210px, 21vw, 380px);
  aspect-ratio: 1 / 1.414;
  background: #a74b38;
  filter: drop-shadow(0 20px 18px rgba(70, 35, 25, .28));
  color: #f6efe8;
  transform: translate(-8%, 5.66%);
  transition: transform .9s cubic-bezier(.2, .7, .2, 1), filter .9s ease;
}

/* The page block seen from the front right, between the boards. Depth is
   16% of the width on both faces (11.32% of the height is the same length). */
.book::before,
.book::after {
  content: '';
  position: absolute;
}

.book::before {
  bottom: 100%;
  left: 0;
  width: 100%;
  height: 11.32%;
  background:
    linear-gradient(90deg, #8e3b2c 0 7%, transparent 7%),
    linear-gradient(0deg, #a74b38 0 8%, transparent 8% 90%, #93402f 90%),
    repeating-linear-gradient(0deg, #f3ebdf 0 1.5px, #dccfbc 1.5px 2.5px);
  transform: skewX(-45deg);
  transform-origin: 0 100%;
}

.book::after {
  top: 0;
  left: 100%;
  width: 16%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(60, 30, 20, .04), rgba(60, 30, 20, .16)),
    linear-gradient(90deg, #8e3b2c 0 8%, transparent 8% 90%, #7d3326 90%),
    repeating-linear-gradient(90deg, #e9dfd0 0 1.5px, #cfbfaa 1.5px 2.5px);
  transform: skewY(-45deg);
  transform-origin: 0 0;
}

.book__spine {
  flex: 0 0 7%;
  background: #8e3b2c;
}

.book__page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-between;
  padding: 12% 11%;
}

.book__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(9px, .75vw, 13px);
  font-weight: 500;
  letter-spacing: .42em;
}

.book__brand svg {
  width: 10px;
  height: 12px;
  fill: currentColor;
}

.book__title {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.book__title strong {
  font-size: clamp(18px, 1.7vw, 31px);
  font-weight: 300;
  line-height: 1.15;
}

.book__title span {
  font-size: clamp(10px, .8vw, 14px);
  line-height: 1.4;
  text-wrap: balance;
}

.book__foot {
  font-size: clamp(9px, .72vw, 13px);
  line-height: 1.4;
}

/* The book comes into focus as the page opens, and lifts a little under the
   pointer. */
.offer-hero__cover .book {
  animation: offer-focus 1.8s cubic-bezier(.2, .7, .2, 1) .15s backwards;
}

.offer-hero__cover:hover .book {
  transform: translate(-8%, calc(5.66% - 8px));
  filter: drop-shadow(0 28px 22px rgba(70, 35, 25, .3));
}

@keyframes offer-focus {
  from {
    opacity: 0;
    filter: blur(14px) drop-shadow(0 20px 18px rgba(70, 35, 25, 0));
  }
  to {
    opacity: 1;
    filter: blur(0) drop-shadow(0 20px 18px rgba(70, 35, 25, .28));
  }
}

/* The options */
.offer-options {
  padding: clamp(56px, 5vw, 96px) var(--bl-side) 0;
}

.offer-options__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
}

.offer-options__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px clamp(32px, 3.7vw, 56px);
  margin-top: clamp(28px, 3vw, 48px);
}

.offer-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  scroll-margin-top: 24px;
}

.offer-option__art {
  position: relative;
  align-self: stretch;
  aspect-ratio: 1 / 1;
}

.offer-option__art img,
.offer-option__art svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.offer-option h3 {
  margin-top: 28px;
  font-size: clamp(20px, 1.5vw, 26px);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}

/* Each fact carries its label as text: "What you get", "When", "Price". */
.offer-facts {
  align-self: stretch;
  margin: 16px 0 0;
  padding-bottom: 24px;
}

.offer-facts > div {
  padding: 14px 0 15px;
  border-top: 1px solid var(--bl-rule);
}

.offer-facts dt {
  color: var(--bl-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.offer-facts dd {
  margin: 6px 0 0;
  font-size: 17px;
  line-height: 1.5;
  text-wrap: pretty;
}

.offer-facts dd p + p {
  margin-top: .6em;
  color: var(--bl-muted);
  font-size: 15px;
}

/* When the options come into view, each drawing comes into focus, one after
   the other (offer.js). Without the script, or for reduced motion, they stand
   finished. */
.offer-option__art > * {
  transition: filter 1.6s ease, opacity 1.2s ease, transform 1.8s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.offer-option:nth-child(2) .offer-option__art > * { --reveal-delay: .2s; }
.offer-option:nth-child(3) .offer-option__art > * { --reveal-delay: .4s; }

.offer-options__grid.is-preparing .offer-option__art > * {
  transition: none;
}

.offer-options__grid.is-waiting .offer-option__art > * {
  opacity: .2;
  filter: blur(18px);
  transform: scale(1.04);
}

/* Who does the work, and how to ask */
.offer-closing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px clamp(32px, 3.7vw, 56px);
  padding: clamp(72px, 6.5vw, 112px) var(--bl-side) 0;
  font-size: 17px;
  line-height: 1.55;
}

.offer-closing__part {
  min-width: 0;
  padding-top: 24px;
  border-top: 1px solid var(--bl-ink);
  scroll-margin-top: 24px;
}

.offer-closing__part > p {
  max-width: 32em;
  margin-top: 16px;
  text-wrap: pretty;
}

.offer-closing__part > .arrow-link {
  margin-top: 8px;
}

.offer-who__head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.offer-who__portrait {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.offer-closing p a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--bl-underline);
  text-underline-offset: .25em;
}

.offer-closing p a:hover {
  text-decoration-color: var(--bl-ink);
}

/* No big empty space above the footer. */
.page-offer .site-footer {
  margin-top: clamp(40px, 3.5vw, 52px);
}

/* Very wide screens: the page frame stops at 2200px, where the margin is
   121px. A percentage here would be taken from the screen, not the frame. */
@media (min-width: 2200px) {
  .offer-hero,
  .offer-options,
  .offer-closing {
    padding-right: 121px;
    padding-left: 121px;
  }
}

/* Tablets and small laptops: one option to a row, its drawing beside its
   facts. */
@media (max-width: 1099px) {
  .offer-options__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .offer-option {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(28px, 4vw, 48px);
    align-items: start;
  }

  /* Sized by its column, not stretched to the facts' height. */
  .offer-option__art {
    grid-row: 1 / span 4;
    align-self: start;
    width: 100%;
  }

  .offer-option > :not(.offer-option__art) {
    grid-column: 2;
  }

  .offer-option h3 {
    margin-top: 0;
  }

  .offer-option .button-outline {
    justify-self: start;
  }
}

@media (max-width: 759px) {
  .offer-hero {
    padding-top: 36px;
    padding-bottom: 56px;
  }

  .offer-hero__cover {
    min-height: 360px;
  }

  .offer-option {
    display: flex;
  }

  .offer-option h3 {
    margin-top: 24px;
  }

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

@media (prefers-reduced-motion: reduce) {
  .book,
  .offer-option__art > * {
    transition: none;
  }

  .offer-hero__cover .book {
    animation: none;
  }
}
