/* One scroll-controlled surface: a liquid drop opens into the solution card. */
.page--home .section--problems {
  --problem-card-surface:
    radial-gradient(ellipse at 100% 100%, #e8e8f680, transparent 58%),
    radial-gradient(ellipse at 0% 0%, #ffffff, transparent 65%),
    linear-gradient(135deg, #fffefa, #f8faff 58%, #f2f1f9);
  --problem-card-shadow:
    0 2px 4px #202a4505,
    0 16px 36px -20px #34467038,
    0 38px 76px -36px #5c68963b;
}

.page--home .section--problems .problem-row__problem p {
  color: #535c70;
}

.page--home .section--problems .problem-row__solution p {
  background: linear-gradient(112deg, #245ba2, #454f9b 52%, #715395);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.page--home .section--problems .text-marker--violet { --marker-fill: #e4dff4; }
.page--home .section--problems .text-marker--mint { --marker-fill: #dcece6; }
.page--home .section--problems .text-marker--peach { --marker-fill: #f1e4d4; }

/* The same finish also covers reduced motion and short landscape screens. */
.page--home .section--problems:not(.is-cinematic-problems) .problem-row {
  padding-inline: clamp(1.25rem, 3.2vw, 3.25rem);
  border-color: #8b98b52e;
  border-radius: 1.1rem;
  background: var(--problem-card-surface);
  box-shadow: var(--problem-card-shadow), inset 0 1px 0 #ffffff;
}

.problem-liquid {
  display: none;
  pointer-events: none;
}

.problem-row__caption {
  display: block;
  margin-bottom: .65rem;
  color: #171c30;
  font-family: var(--font-sans);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .015em;
}

@media (prefers-reduced-motion: no-preference) {
  .page--home .section--problems.is-cinematic-problems.is-liquid-problems {
    height: 360svh;
    min-height: 360svh;
    padding: 0;
    overflow: visible;
  }

  .page--home .is-cinematic-problems.is-liquid-problems .home-problems__layout {
    position: sticky;
    top: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100svh;
    padding: 0;
    overflow: clip;
    isolation: isolate;
    background:
      radial-gradient(ellipse at 25% 38%, #dce6ff45, transparent 58%),
      radial-gradient(ellipse at 78% 70%, #e5def73b, transparent 60%),
      #f5f6fb;
  }

  .page--home .section--problems.is-cinematic-problems.is-liquid-problems .section-heading--problems {
    position: absolute;
    z-index: 4;
    top: 50%;
    right: auto;
    left: 50%;
    width: min(88%, 74rem);
    margin: 0;
    text-align: center;
    opacity: var(--problems-title-opacity, 1);
    transform: translate3d(-50%, calc(-50% + var(--problems-title-y, 0px)), 0) scale(var(--problems-title-scale, 1));
    transform-origin: center;
    pointer-events: none;
  }

  .page--home .section--problems.is-cinematic-problems.is-liquid-problems .section-heading--problems h2 {
    width: 100%;
    max-width: none;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 6.8vw, 7.35rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -.058em;
  }

  html.js .page--home .is-cinematic-problems.is-liquid-problems .problem-heading-reveal[data-reveal] > *,
  html.js .page--home .is-cinematic-problems.is-liquid-problems .problem-heading-reveal[data-reveal].is-visible > * {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
  }

  .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-title__line {
    width: auto;
    max-width: 100%;
    margin-inline: auto;
  }

  .page--home .is-liquid-problems .problem-title__line--positive {
    background: none;
  }

  .is-liquid-title .problem-title__word,
  .is-liquid-title .problem-title__letter {
    display: inline-block;
  }

  .is-liquid-title .problem-title__word {
    white-space: nowrap;
  }

  .is-liquid-title .problem-title__letter {
    --letter-progress: clamp(0, calc((var(--problems-text-merge, 0) - var(--letter-delay, 0)) * 1.16), 1);
    color: color-mix(in srgb, var(--letter-ink, #171c30) calc((1 - var(--letter-progress)) * 100%), #6e76eb);
    transform:
      translate3d(calc(var(--letter-x, 0px) * var(--letter-progress)), calc(var(--letter-y, 0px) * var(--letter-progress) + var(--letter-arc, 0px) * var(--problems-text-arc, 0)), 0)
      scale(calc(1 - var(--letter-progress) * .9));
    filter: blur(clamp(0px, calc((var(--letter-progress) - .35) * 28px), 18px));
    transform-origin: center;
  }

  .is-liquid-title.is-measuring-title .problem-title__letter {
    transform: none;
    filter: none;
  }

  .page--home .is-cinematic-problems.is-liquid-problems .problem-liquid {
    position: absolute;
    z-index: 2;
    top: 54%;
    left: 50%;
    display: block;
    width: var(--liquid-width, 0px);
    height: var(--liquid-height, 0px);
    border-radius: var(--liquid-radius, 50%);
    opacity: var(--liquid-opacity, 0);
    transform: translate3d(-50%, calc(-50% + var(--liquid-y, 0px)), 0) rotate(var(--liquid-rotation, 0deg));
    box-shadow: var(--problem-card-shadow);
  }

  .problem-liquid__halo,
  .problem-liquid__surface,
  .problem-liquid__edge {
    position: absolute;
    inset: 0;
    border-radius: inherit;
  }

  .problem-liquid__halo {
    inset: -7px;
    background: conic-gradient(from var(--liquid-angle, 130deg), #5c41eb, #4998ff, #83e3f7, #8980fa, #a13bd8, #5c41eb);
    opacity: var(--liquid-glow, 0);
    filter: blur(16px);
  }

  .problem-liquid__surface {
    overflow: hidden;
    border: 1px solid #8b98b52e;
    background: var(--problem-card-surface);
    box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #7788ae0a;
  }

  .problem-liquid__surface::before,
  .problem-liquid__surface::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    content: "";
  }

  .problem-liquid__surface::before {
    background:
      radial-gradient(ellipse at 22% 12%, #dcfbff 0%, #7bdafa80 20%, transparent 52%),
      radial-gradient(ellipse at 83% 83%, #cd84f4, transparent 57%),
      linear-gradient(var(--liquid-angle, 130deg), #2188e7, #6253e9 55%, #8e44cd);
    opacity: var(--liquid-energy, 1);
  }

  .problem-liquid__surface::after {
    background: radial-gradient(ellipse at 30% 0%, #ffffffeb, transparent 55%);
    opacity: calc(var(--liquid-energy, 1) * .75);
  }

  .problem-liquid__edge {
    padding: 2px;
    background: conic-gradient(from var(--liquid-angle, 130deg), #c4c0ee, #6e9bdb, #d1edf5, #f6f3ff, #aaa1d7, #c4c0ee);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: calc(.12 + var(--liquid-energy, 1) * .88);
  }

  .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-list {
    position: absolute;
    z-index: 3;
    inset: 0;
    opacity: var(--problems-cards-opacity, 0);
    transform: translate3d(0, var(--problem-content-y, 0px), 0);
    transition: none;
  }

  .page--home .is-cinematic-problems.is-liquid-problems .problem-list::before {
    display: none;
  }

  html.js .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-list[data-reveal] .problem-row {
    position: absolute;
    top: 54%;
    left: 50%;
    display: grid;
    width: min(80vw, 68rem);
    min-height: min(50svh, 28rem);
    grid-template-columns: .58fr 1fr 1fr;
    align-content: center;
    gap: clamp(1.5rem, 3.2vw, 3.5rem);
    padding: clamp(2rem, 3.2vw, 3.25rem);
    overflow: visible;
    border: 0;
    background: none;
    box-shadow: none;
    clip-path: none;
    opacity: 0;
    transform: translate3d(-50%, calc(-50% + 12px), 0);
    transition: opacity 240ms ease, transform 360ms var(--ease-out);
    transition-delay: 0ms;
    pointer-events: none;
  }

  html.js .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-list[data-reveal] .problem-row.is-active {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0);
    pointer-events: auto;
  }

  html.js .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-list[data-reveal] .problem-row.is-before,
  html.js .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-list[data-reveal] .problem-row.is-after {
    opacity: 0;
    transform: translate3d(-50%, calc(-50% + 12px), 0);
  }

  .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-row > * {
    grid-column: auto;
    align-self: center;
    padding-right: 0;
    opacity: 1;
  }

  .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-row :is(.problem-row__problem, .problem-row__solution) {
    align-self: start;
  }

  .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-row h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.35rem, 3.6vw, 4rem);
    font-weight: 400;
  }

  .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-row p {
    font-size: clamp(.95rem, 1.18vw, 1.12rem);
    line-height: 1.55;
  }

  @media (max-width: 1099px) {
    .page--home .section--problems.is-cinematic-problems.is-liquid-problems .section-heading--problems {
      width: calc(100% - 2rem);
    }

    .page--home .section--problems.is-cinematic-problems.is-liquid-problems .section-heading--problems h2 {
      font-size: clamp(2.4rem, 7.8vw, 5.3rem);
    }

    html.js .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-list[data-reveal] .problem-row {
      width: min(calc(100% - 3rem), 44rem);
      grid-template-columns: 1fr;
      gap: 1.25rem;
      padding: clamp(1.5rem, 5vw, 3rem);
    }

    .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-row h3 {
      margin-bottom: 0;
      font-size: clamp(2.25rem, 6vw, 3rem);
    }

    .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-row p {
      max-width: 36ch;
      font-size: 1rem;
      line-height: 1.6;
    }
  }

  @media (max-width: 380px) {
    html.js .page--home .section--problems.is-cinematic-problems.is-liquid-problems .problem-list[data-reveal] .problem-row {
      width: calc(100% - 2rem);
      gap: 1rem;
      padding: 1.35rem;
    }
  }
}

@media (forced-colors: active) {
  .page--home .section--problems .problem-row :is(.problem-row__problem, .problem-row__solution) p {
    background: none;
    color: CanvasText;
  }
}
