.v-margins .mast {
  background-color: var(--bg-paper);
}

.faq-section.v-margins {
  --bg-page: #f7f6f3;
  --bg-paper: #f4f3f0;
  --bg-paper-deep: #ecebe8;
  --navy: #192236;
  --ivory: #f5f3ea;
  --steel: #355075;
  --ink-body: #2a2d33;
  --line: #cecdc9;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(1.25rem, 5vw, 5.5rem);
  --faq-maxw: 52.5rem;
  background: var(--bg-paper) radial-gradient(ellipse 52% 46% at 50% 4%, var(--bg-page), transparent 70%);
}

#faq {
  min-block-size: 0;
}

/* Landing-page reveal and hover share the same card position. */
#faq [data-reveal] {
  transform: none;
  translate: none;
  scale: none;
}

#faq:not(.faq-js) [data-reveal] {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  #faq.faq-js [data-reveal] {
    transition: opacity .26s ease-out var(--d, 0s);
  }

  #faq .faq-item::details-content {
    transition-duration: .22s, .16s, .22s;
  }
}

/* Both strips end before the reading column, including the blurred pixels. */
.margin-art {
  position: absolute;
  inset-block: 0;
  inline-size: calc(max(var(--pad), (100% - var(--faq-maxw)) / 2) - clamp(0.5rem, 2vw, 2.25rem));
  overflow: clip;
  pointer-events: none;
  --shape-size: clamp(22.5rem, 37vw, 45rem);
}

.margin-art--left {
  inset-inline-start: 0;
  mask-image: linear-gradient(to right, black 70%, transparent);
}

.margin-art--right {
  inset-inline-end: 0;
  mask-image: linear-gradient(to left, black 70%, transparent);
}

.margin-form {
  position: absolute;
  inline-size: var(--shape-size);
  aspect-ratio: 1;
}

/* Each texture includes a transparent margin around the original shape. */
.margin-form::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: var(--art) center / 100% 100% no-repeat;
}

.margin-art--left .margin-form {
  --art: url("faq-art-left.webp");
  --drift: 1.375rem;
  top: clamp(3.75rem, 7vw, 7.75rem);
  right: max(0px, calc(100% - var(--shape-size) * .52));
}

.margin-art--right .margin-form {
  --art: url("faq-art-right.webp");
  --drift: -1.75rem;
  top: 37%;
  left: max(0px, calc(100% - var(--shape-size) * .48));
}

.v-margins .faq-item {
  border: 1px solid rgb(25 34 54 / .15);
  background: var(--bg-page);
  box-shadow: inset 0 1px 0 rgb(247 246 243 / .96), 0 0.75rem 1.625rem -1.25rem rgb(20 24 33 / .2);
}

.v-margins .edition-switch {
  background: var(--bg-page);
  backdrop-filter: none;
}

.v-margins .faq-body p {
  max-inline-size: 67ch;
}

.v-margins .faq-summary::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 0.9375rem;
  inline-size: 2px;
  border-radius: 2px;
  background: linear-gradient(transparent, var(--steel) 18% 82%, transparent);
  opacity: 0;
  transform: scaleY(.08);
  transform-origin: top;
  transition: transform .68s var(--ease), opacity .5s ease;
}

.v-margins .faq-num {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 1;
  border: 1px solid rgb(25 34 54 / .22);
  border-radius: 50%;
  color: var(--navy);
  background: transparent;
  letter-spacing: 0;
  transition: background-color .5s ease, color .5s ease, border-color .5s ease;
}

.v-margins .faq-q,
.v-margins .faq-toggle {
  color: var(--navy);
}

.v-margins .faq-toggle {
  background: var(--bg-paper-deep);
}

.v-margins .faq-item[open] .faq-num,
.v-margins .faq-item[open] .faq-toggle {
  background: var(--navy);
  color: var(--ivory);
  border-color: var(--navy);
}

.v-margins .faq-item[open] > .faq-summary::before {
  opacity: .8;
  transform: scaleY(1);
}

@media (min-width: 861px) and (hover: hover) and (pointer: fine) {
  .v-margins .faq-item:not([open]):hover > .faq-summary::before {
    opacity: .52;
    transform: scaleY(.55);
  }

  .v-margins .faq-item:not([open]):hover .faq-num {
    background: var(--bg-paper-deep);
    border-color: rgb(25 34 54 / .4);
  }

  .v-margins .faq-item:not([open]):hover .faq-toggle {
    transform: scale(1.035);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .v-margins .faq-item,
  .v-margins.faq-js .faq-item {
    transition:
      opacity .65s var(--ease) var(--d, 0s),
      translate .78s var(--ease) var(--d, 0s),
      transform .48s var(--ease);
  }

  .v-margins.faq-js .faq-item:not(.is-in) {
    translate: 0 1.25rem;
    scale: 1;
  }

  .v-margins .faq-toggle {
    transition: background-color .48s ease, color .48s ease, transform .56s var(--ease);
  }

  .v-margins .faq-item::details-content {
    transition-duration: .32s, .24s, .32s;
  }

  @media (min-width: 861px) and (hover: hover) and (pointer: fine) {
    .v-margins .faq-item:hover {
      transform: translateY(-2px);
    }
  }
}

@supports (animation-timeline: scroll(root)) {
  .v-margins .reading-line {
    animation: faq-reading-progress linear both;
    animation-timeline: scroll(root);
  }

  @media (prefers-reduced-motion: no-preference) {
    html:not(.faq-static) body.v-margins .margin-form,
    #faq.faq-js .margin-form {
      animation: faq-margin-drift linear both;
      animation-timeline: scroll(root);
    }

    #faq.faq-js .margin-form {
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
  }
}

@keyframes faq-reading-progress {
  to { transform: scaleX(1); }
}

@keyframes faq-margin-drift {
  from { transform: translateY(0); }
  to { transform: translateY(var(--drift)); }
}

@media (prefers-reduced-motion: reduce) {
  .v-margins .faq-summary::before,
  .v-margins .faq-num {
    transition: none;
  }
}
