/*
 * Love Asking Why interaction layer.
 * Progressive enhancement only: content and navigation remain usable without it.
 */

.nav {
  overflow: visible;
}

.law-scroll-progress {
  --law-progress: 0;
  position: absolute;
  inset: auto 0 -1px;
  z-index: 2;
  height: 2px;
  pointer-events: none;
  transform: scaleX(var(--law-progress));
  transform-origin: left center;
  background: linear-gradient(90deg, var(--teal), var(--gold) 52%, var(--wmlav));
  box-shadow: 0 0 14px rgba(187, 166, 239, .55);
  transition: transform .08s linear;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--wmlav);
  outline-offset: 4px;
  border-radius: 3px;
}

.nav-toggle {
  min-width: 44px;
  min-height: 44px;
}

.links > a.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-ask {
  display: none !important;
}

.article > h2 {
  position: relative;
  padding-left: 25px;
  scroll-margin-top: 96px;
}

.article > h2::before {
  content: "\2726";
  position: absolute;
  left: 0;
  top: .12em;
  color: var(--gold);
  font-size: .68em;
  text-shadow: 0 0 14px rgba(231, 181, 74, .38);
}

figure.feat img,
.feat-row img {
  transform: translateZ(0);
  transition: transform .55s cubic-bezier(.2, .7, .2, 1), filter .55s ease,
    border-color .35s ease, box-shadow .35s ease;
}

figure.feat:hover img,
.feat-row:hover img {
  transform: scale(1.012);
  filter: saturate(1.06) brightness(1.025);
  border-color: rgba(187, 166, 239, .34);
  box-shadow: 0 20px 50px rgba(6, 9, 27, .32), 0 0 26px rgba(74, 44, 140, .12);
}

.step {
  position: relative;
  overflow: hidden;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease,
    background .3s ease;
}

.step::after {
  content: "\2726";
  position: absolute;
  right: 20px;
  top: 16px;
  color: var(--wmlav);
  opacity: 0;
  transform: scale(.75) rotate(-16deg);
  transition: opacity .3s ease, transform .3s ease;
}

.step:hover {
  transform: translateY(-4px);
  border-color: rgba(187, 166, 239, .28);
  background: linear-gradient(145deg, rgba(90, 58, 165, .13), transparent 55%), var(--ink2);
  box-shadow: 0 18px 44px rgba(6, 9, 27, .24);
}

.step:hover::after {
  opacity: .72;
  transform: scale(1) rotate(0);
}

#how .steps {
  position: relative;
  isolation: isolate;
}

#how .steps::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 167, 195, .42),
    rgba(231, 181, 74, .38), rgba(187, 166, 239, .42), transparent);
}

/* Answers archive */
.answers-index {
  max-width: 980px !important;
}

.answer-list {
  counter-reset: law-answer;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 36px 0 10px;
}

.answer-item {
  counter-increment: law-answer;
  position: relative;
  min-height: 168px;
  margin: 0 !important;
  padding: 54px 54px 24px 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 16px;
  background:
    radial-gradient(circle at 88% 12%, rgba(138, 107, 216, .14), transparent 34%),
    var(--ink2);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.answer-item::before {
  content: counter(law-answer, decimal-leading-zero);
  position: absolute;
  left: 24px;
  top: 20px;
  color: var(--gold);
  font-family: 'Lora', serif;
  font-size: 13px;
  letter-spacing: .13em;
}

.answer-item::after {
  content: "\2197";
  position: absolute;
  right: 23px;
  top: 18px;
  color: var(--wmlav);
  font-size: 21px;
  transition: transform .3s ease, color .3s ease;
}

.answer-item:hover {
  transform: translateY(-4px);
  border-color: rgba(187, 166, 239, .35);
  box-shadow: 0 18px 46px rgba(6, 9, 27, .28);
}

.answer-item:hover::after {
  transform: translate(3px, -3px);
  color: var(--gold);
}

.answer-item > a {
  display: inline-block;
  padding-right: 6px;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.answer-item > br {
  display: none;
}

.answer-item > span {
  display: block;
  margin-top: 12px;
  line-height: 1.62;
}

/* About FAQ */
.faq {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.faq details {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(90, 58, 165, .08), transparent 50%), var(--ink2);
  transition: border-color .3s ease, box-shadow .3s ease;
}

.faq details[open] {
  border-color: rgba(187, 166, 239, .3);
  box-shadow: 0 15px 38px rgba(6, 9, 27, .22);
}

.faq summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 16px 58px 16px 20px;
  cursor: pointer;
  color: var(--cloud);
  font-family: 'Lora', serif;
  font-size: 20px;
  line-height: 1.35;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  color: var(--wmlav);
  font-family: 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 300;
  transition: transform .3s ease, color .3s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
  color: var(--gold);
}

.faq details[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.faq details > p {
  margin: 0;
  padding: 18px 20px 22px;
}

/* Form focus should feel like entering the doorway, while staying restrained. */
.form-card {
  transition: border-color .35s ease, box-shadow .35s ease;
}

.form-card:focus-within {
  border-color: rgba(187, 166, 239, .3);
  box-shadow: 0 24px 66px rgba(6, 9, 27, .3), 0 0 34px rgba(74, 44, 140, .12);
}

.form-card input:focus,
.form-card textarea:focus {
  outline: 2px solid rgba(187, 166, 239, .78);
  outline-offset: 2px;
  border-color: rgba(187, 166, 239, .62);
}

@media (prefers-reduced-motion: no-preference) {
  html.law-enhanced .law-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .65s ease, transform .65s cubic-bezier(.2, .7, .2, 1);
    transition-delay: var(--law-delay, 0ms);
  }

  html.law-enhanced .law-reveal.law-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .nav-menu .menu-ask {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin: 8px 18px 10px;
    border-color: rgba(231, 181, 74, .5);
    color: var(--gold);
  }

  .article > h2 {
    padding-left: 22px;
  }

  .answer-list {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .answer-item {
    min-height: 0;
    padding: 52px 48px 22px 20px;
  }

  .answer-item::before {
    left: 20px;
  }

  #how .steps::before {
    left: 50%;
    right: auto;
    top: 4%;
    bottom: 4%;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, transparent, rgba(47, 167, 195, .38),
      rgba(231, 181, 74, .34), rgba(187, 166, 239, .38), transparent);
  }
}

@media (max-width: 360px) {
  .links > a.btn:not(.menu-ask) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .law-scroll-progress,
  figure.feat img,
  .feat-row img,
  .step,
  .step::after,
  .answer-item,
  .answer-item::after,
  .faq summary::after,
  .form-card {
    transition: none !important;
  }

  figure.feat:hover img,
  .feat-row:hover img,
  .step:hover,
  .answer-item:hover {
    transform: none;
  }
}
