/* ===== Problem/Solution (res-problem) =====
   Behaviour and sizes from the ads v3 page (Danny, 2026-10-20; its .ps section): a 2250px black section with a 20px
   spacer column and a sticky rounded card (looping video, dark shade, copy).
   State "problem" (default): heading (2 lines) visible, body copy at opacity 0, shade rgba(0,0,0,.85).
   State "solution" (section top 140px above the viewport top, js/15-problem.js): heading fades out and leaves the flow,
   body copy fades in and grows, the copy block glides up, the shade lightens to rgba(0,0,0,.5). All of it is CSS
   transitions with the ads timings. On phones the card fills the screen (100svh minus 20px above and below).
   The body copy is always set at its final (solution) size and grows by transform: scale from the problem-state size,
   so its lines never re-break mid-animation (2026-11-19, Nathan: on an iPhone 16 "your" jumped between lines while
   the copy grew from 20px to 28px).
   The card fades up 16px the first time it is ~20% in view. Breakpoints as the ads page: 1200 and 810. */

.nf-res-problem {
  --nf-res-problem-out-expo: cubic-bezier(.16, 1, .3, 1);
  --nf-res-problem-out-cubic: cubic-bezier(.33, 1, .68, 1);
  --nf-res-problem-io-cubic: cubic-bezier(.65, 0, .35, 1);
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  height: 2250px;
  padding: 80px 82px 80px 80px;
  background-color: var(--nf-black);
  overflow: visible;
}
.nf-res-problem__lab { flex: none; width: 20px; }

/* Sticky card */
.nf-res-problem__sticky { position: sticky; top: 80px; z-index: 1; flex: 1; min-width: 0; height: 700px; }
.nf-res-problem__card {
  position: relative; width: 100%; height: 100%;
  background-color: var(--nf-black); border-radius: 18px; overflow: hidden;
}
.nf-res-problem__media { position: absolute; left: -8px; top: 0; width: calc(100% + 16px); height: 112.4%; }
.nf-res-problem__video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.nf-res-problem__shade {
  position: absolute; inset: 0; z-index: 1;
  background-color: rgba(0, 0, 0, 0.85);
  transition: background-color 600ms var(--nf-res-problem-io-cubic);
}

/* Copy */
.nf-res-problem__content {
  position: absolute; z-index: 3; left: 106px; right: 146px; top: 229px;
  transition: top 600ms var(--nf-res-problem-out-expo);
}
.nf-res-problem__stack { position: relative; display: flex; flex-direction: column; gap: 25px; }
.nf-res-problem__heading {
  display: flex; flex-direction: column;
  transition: opacity 200ms var(--nf-res-problem-out-cubic);
}
.nf-res-problem__heading-line,
.nf-res-problem__body-text {
  font-family: "SF Pro Display Regular", "SF Pro Display Regular Placeholder", sans-serif;
  font-weight: 400; color: var(--nf-white); text-align: left;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word;
}
.nf-res-problem__heading-line { font-size: 56px; line-height: 67.2px; letter-spacing: 1.12px; }
.nf-res-problem__body { opacity: 0; transition: opacity 600ms var(--nf-res-problem-out-expo) 100ms; }
.nf-res-problem__body-text {
  font-size: 56px; line-height: 67.2px; letter-spacing: normal;
  transform-origin: 0 0; transform: scale(0.571429); /* 32px / 56px */
  transition: transform 600ms var(--nf-res-problem-out-expo);
}

/* Solution state */
.nf-res-problem[data-state="solution"] .nf-res-problem__shade { background-color: rgba(0, 0, 0, 0.5); }
.nf-res-problem[data-state="solution"] .nf-res-problem__content { top: 178px; }
.nf-res-problem[data-state="solution"] .nf-res-problem__heading { position: absolute; opacity: 0; pointer-events: none; }
.nf-res-problem[data-state="solution"] .nf-res-problem__body { opacity: 1; }
.nf-res-problem[data-state="solution"] .nf-res-problem__body-text { transform: none; }

/* Card reveal: fades up 16px once, when ~20% of it is in view (only hidden once the script runs) */
.nf-res-problem.is-js .nf-res-problem__card {
  opacity: 0; transform: translateY(16px);
  transition: opacity 600ms var(--nf-res-problem-out-expo), transform 600ms var(--nf-res-problem-out-expo);
}
.nf-res-problem.is-js .nf-res-problem__card.is-in { opacity: 1; transform: none; }

/* ---------- tablet (810px to 1199.98px) ---------- */
@media (max-width: 1199.98px) {
  .nf-res-problem { padding: 40px 40px 40px 28px; }
  .nf-res-problem__sticky { top: 40px; height: 800px; }
  .nf-res-problem__content { left: 106px; right: 38px; }
}

/* ---------- phone (<= 809.98px) ---------- */
@media (max-width: 809.98px) {
  .nf-res-problem { padding: 20px 20px 20px 10px; }
  .nf-res-problem__lab { width: 10px; }
  /* tall card that fits the screen with 20px above and below, so its bottom corners show */
  .nf-res-problem__sticky { top: 20px; height: calc(100vh - 40px); height: calc(100svh - 40px); min-height: 600px; }
  .nf-res-problem__media { height: max(112.4%, 823px); }
  .nf-res-problem__content { left: 25px; right: 45px; top: 193px; }
  .nf-res-problem__heading-line { font-size: 32px; line-height: 38.4px; letter-spacing: 0.64px; }
  .nf-res-problem__body-text { font-size: 28px; line-height: 33.6px; transform: scale(0.714286); } /* 20px / 28px */
  .nf-res-problem[data-state="solution"] .nf-res-problem__content { top: 110px; }
  /* Big phones (Pro Max / Plus, 430px) break the lines like a standard iPhone (390 to 402px): the text column stops
     at 282px, so "your" starts the next line after "It monitors" (Nathan, 2026-11-19). */
  .nf-res-problem__body-text { max-width: 282px; }
}

@media (prefers-reduced-motion: reduce) {
  .nf-res-problem__content, .nf-res-problem__body-text, .nf-res-problem__heading, .nf-res-problem__body,
  .nf-res-problem__shade { transition: none; }
  .nf-res-problem.is-js .nf-res-problem__card { transform: none; }
}

/* Launch QA (2026-10-30): on narrow tablets the card is 800px tall but the solution sentence is 56px, so it ran past the
   bottom of the card (English from ~810px, the longer Bahasa up to ~1100px). Smaller there; desktop and phone unchanged. */
@media (min-width: 810px) and (max-width: 949.98px) {
  .nf-res-problem__body-text { font-size: 44px; line-height: 52.8px; transform: scale(0.727273); } /* 32px / 44px */
}
@media (min-width: 810px) and (max-width: 1199.98px) {
  html[lang="id"] .nf-res-problem__body-text { font-size: 44px; line-height: 52.8px; transform: scale(0.727273); } /* 32px / 44px */
}
@media (min-width: 1200px) {
  html[lang="id"] .nf-res-problem__body-text { font-size: 50px; line-height: 60px; transform: scale(0.64); } /* 32px / 50px */
}
