/* A single deck unfolds into three complete earning examples. */
.earnings-section {
  position: relative;
  background: #fdfdfd;
  color: #292929;
  font-family: var(--font-gilroy);
}
.earnings-stage {
  max-width: 1440px;
  margin: auto;
  padding: 120px 48px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}
.earnings-kicker {
  display: grid;
  position: relative;
  z-index: 4;
  width: 100%;
  flex: none;
  margin: 0;
  font-size: var(--section-heading-size);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.035em;
  text-align: center;
}
.earnings-kicker > span { grid-area: 1 / 1; align-self: center; }
.earnings-title-expanded { visibility: hidden; opacity: 0; }
.earnings-layout {
  --deck-gap: clamp(24px, 4vw, 56px);
  --deck-scale: 1;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--deck-gap);
  width: min(100%, 1080px);
  margin-block: auto;
}
.earnings-example {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid #e4e2dd;
  border-radius: 24px;
  background: #f5f3ef;
  transform-origin: 50% 60%;
}
.earnings-example:nth-child(2) { z-index: 2; }
.earnings-photo { width: 100%; aspect-ratio: 4 / 3; max-height: 32svh; overflow: hidden; border-radius: 15px; }
.earnings-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.earnings-details { flex: 1; padding: 24px 12px 18px; }
.earnings-details h3 { min-height: 2.4em; margin: 0 0 14px; font-size: clamp(22px, 2vw, 28px); font-weight: 500; line-height: 1.2; letter-spacing: -.025em; }
.earnings-tag { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0; line-height: 1.2; }
.earnings-tag strong { font-size: clamp(26px, 2.6vw, 36px); font-weight: 500; letter-spacing: -.035em; white-space: nowrap; }
.earnings-tag > span { color: #75736f; font-size: 16px; white-space: nowrap; }
.earnings-section.is-scrollable { height: 195svh; }
.is-scrollable .earnings-stage { position: sticky; top: 0; height: 100svh; min-height: 580px; overflow: clip; }
.is-scrollable .earnings-example { will-change: transform; }
@media (max-width: 767px) {
  .earnings-stage { padding: 104px 16px 52px; gap: 32px; }
  .earnings-kicker { font-size: clamp(30px, 7.5vw, 40px); max-width: 540px; min-height: 2.3em; text-wrap: balance; }
  .earnings-layout { --deck-gap: clamp(8px, 2.5vw, 12px); --deck-scale: 1.35; width: calc(100% - 12px); }
  .earnings-example { width: calc(100% + 24px); justify-self: center; padding: 6px; border-radius: 14px; }
  .earnings-photo { aspect-ratio: 2 / 1; border-radius: 9px; }
  .earnings-details { padding: 10px 2px 6px; }
  .earnings-details h3 { font-size: clamp(14px, 3.8vw, 22px); min-height: 2.4em; margin-bottom: 6px; }
  .earnings-tag { flex-direction: column; gap: 5px; }
  .earnings-tag strong { font-size: clamp(20px, 5.5vw, 30px); }
  .earnings-tag > span { font-size: 12px; }
  .is-scrollable .earnings-stage { min-height: 520px; }
}
/* Paint the opening stack before deferred scripts or webfonts arrive. Each
   card shares a layout anchor, so a refresh never exposes the unfolded grid. */
@media (prefers-reduced-motion: no-preference) and (min-height: 520px) {
  .has-js .earnings-section { height: 195svh; }
  .has-js .earnings-stage { position: sticky; top: 0; height: 100svh; min-height: 0; overflow: clip; }
  .has-js .earnings-layout { grid-template-columns: 1fr; }
  .has-js .earnings-example {
    grid-area: 1 / 1;
    justify-self: center;
    width: calc((100% - 2 * var(--deck-gap)) / 3);
    transform: translateY(-12px) scale(var(--deck-scale));
  }
}
@media (max-width: 767px) {
  html:not(.has-js) .earnings-layout { grid-template-columns: 1fr; gap: 24px; }
  html:not(.has-js) .earnings-example { width: 100%; }
  html:not(.has-js) .earnings-details h3 { min-height: 0; font-size: 22px; }
}
@media (max-height: 700px) and (min-width: 768px) {
  .earnings-stage { padding-top: 96px; padding-bottom: 36px; gap: 24px; }
  .earnings-kicker { font-size: 44px; }
  .earnings-photo { max-height: 27svh; }
  .earnings-details { padding-block: 18px 10px; }
}
/* Without motion (or JavaScript), every example remains visible in normal flow. */
@media (prefers-reduced-motion: reduce) {
  .earnings-stage { gap: 48px; }
}

@media (min-width: 1025px) {
  .earnings-details h3 { font-size: 30px; }
}

@supports (height: 100dvh) {
  .earnings-section.is-scrollable { height: calc(95svh + 100dvh); }
  .earnings-section.is-scrollable .earnings-stage { height: 100dvh; }
  @media (prefers-reduced-motion: no-preference) and (min-height: 520px) {
    .has-js .earnings-section { height: calc(95svh + 100dvh); }
    .has-js .earnings-stage { height: 100dvh; }
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce), (max-width: 767px) and (max-height: 519px) {
  .earnings-layout { grid-template-columns: 1fr; gap: 24px; }
  .earnings-example { width: 100%; }
  .earnings-details h3 { min-height: 0; font-size: 22px; }
}

/* Phone: a centered, alternating vertical sequence. Natural page flow keeps
   every card readable even with browser chrome or a short landscape viewport. */
@media (max-width: 767px) {
  .earnings-section, .has-js .earnings-section { height: auto; }
  .earnings-stage, .has-js .earnings-stage {
    position: relative; height: auto; min-height: 0; overflow: visible;
    padding: 100px 28px 72px; gap: 36px;
  }
  .earnings-title-intro { visibility: hidden; opacity: 0; }
  .earnings-title-expanded { visibility: visible; opacity: 1; }
  .earnings-layout, .has-js .earnings-layout {
    display: grid; grid-template-columns: 1fr; width: min(100%, 400px);
    gap: 24px; margin: 0 auto; --deck-scale: 1;
  }
  .earnings-example, .has-js .earnings-example {
    grid-area: auto; width: 80%; max-width: 290px; justify-self: start;
    padding: 10px; border-radius: 20px; transform: rotate(-3deg);
  }
  .earnings-example:nth-child(2) { justify-self: end; transform: rotate(3deg); }
  .earnings-photo { aspect-ratio: 2 / 1; max-height: none; border-radius: 12px; }
  .earnings-details { padding: 14px 4px 10px; }
  .earnings-details h3 { font-size: 21px; min-height: 0; margin-bottom: 12px; }
  .earnings-tag { flex-direction: row; gap: 5px 10px; }
  .earnings-tag strong { font-size: 29px; }
  .earnings-tag > span { font-size: 14px; }
}

@media (max-width: 767px) and (prefers-reduced-motion: no-preference) and (min-height: 520px) {
  .is-mobile-deck .earnings-title-intro { visibility: visible; opacity: 1; }
  .is-mobile-deck .earnings-title-expanded { visibility: hidden; opacity: 0; }
  .is-mobile-deck .earnings-layout { gap: 0; padding-bottom: 16px; }
  .is-mobile-deck .earnings-example { will-change: transform; }
  .is-mobile-deck .earnings-example + .earnings-example { margin-top: -28px; }
  .is-mobile-deck .earnings-example:nth-child(1) { z-index: 3; }
  .is-mobile-deck .earnings-example:nth-child(2) { z-index: 2; }
  .is-mobile-deck .earnings-example:nth-child(3) { z-index: 1; }
}
