/* The page for creators: the head, the steps with their example phone screens, the money facts.
   Tokens come from tokens.css; the closing strip (.ask) is styled here too, as on the Work page. */

/* ---------- Page head ---------- */
.crhead { padding-block: calc(84px + var(--s-9)) var(--s-8); }
.crhead__inner { display: grid; gap: var(--s-5); }
.crhead__label {
  font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: var(--tracking-mono);
  text-transform: uppercase; color: var(--text-3);
}
.crhead__title { font-size: clamp(2.8rem, 1.6rem + 5vw, 6rem); line-height: 0.98; }
.crhead__lead { max-width: 56ch; color: var(--text-2); font-size: var(--fs-lead); text-wrap: pretty; }

/* ---------- Steps: text on one side, an iPhone on the other, swapping sides each step ---------- */
.steps { padding-bottom: var(--section-y); }
.steps__list { display: grid; list-style: none; }
.step { display: grid; gap: var(--s-7); align-items: center; padding-block: var(--s-8); }
.step__text { display: grid; gap: var(--s-4); align-content: center; max-width: 32rem; }
.step__num { font-family: var(--font-display); font-size: clamp(4rem, 3rem + 5vw, 8rem); line-height: 0.85; color: var(--line-strong); }
.step__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.8rem); line-height: 1; text-wrap: balance; }
.step__body { color: var(--text-2); font-size: var(--fs-lead); text-wrap: pretty; }
.step__phones { display: flex; justify-content: center; align-items: flex-start; gap: var(--s-5); }

/* a photographed iPhone frame with a live example screen behind its glass (see creators-screens.css) */
.iphone { flex: 0 1 320px; min-width: 0; display: grid; gap: var(--s-4); justify-items: center; }
.step__phones--pair .iphone { flex-basis: 270px; }
.iphone__stage { position: relative; width: 100%; translate: 0 calc(var(--drift, 0) * 1px); }
.iphone__frame { position: relative; display: block; width: 100%; height: auto; pointer-events: none; }

/* ---------- Motion: each step comes alive as it scrolls into view ----------
   app.js adds is-in to the step; here its parts arrive one after another. The row itself stays put. */
.steps { overflow-x: clip; }
.js .step.reveal { opacity: 1; transform: none; filter: none; }
.js .step .step__num, .js .step .step__title, .js .step .step__body, .js .step .iphone, .js .step .iphone__tag {
  opacity: 0; transition: opacity 0.7s ease, transform 1s var(--ease-out);
}
.js .step .step__num { transform: translateY(28px) scale(0.92); transform-origin: left bottom; }
.js .step .step__title { transform: translateY(26px); transition-delay: 0.1s; }
.js .step .step__body { transform: translateY(22px); transition-delay: 0.2s; }
.js .step .iphone { transform: translateY(70px) rotate(4deg) scale(0.9); transition-delay: 0.15s; transition-duration: 0.8s, 1.2s; }
.js .step--flip .iphone { transform: translateY(70px) rotate(-4deg) scale(0.9); }
.js .step .step__phones--pair .iphone + .iphone { transition-delay: 0.32s; }
.js .step .iphone__tag { transition-delay: 0.9s; }
.js .step.is-in .step__num, .js .step.is-in .step__title, .js .step.is-in .step__body,
.js .step.is-in .iphone, .js .step.is-in .iphone__tag { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .step .step__num, .js .step .step__title, .js .step .step__body, .js .step .iphone, .js .step .iphone__tag {
    opacity: 1; transform: none; transition: none;
  }
  .iphone__stage { translate: none; }
}
.iphone__tag {
  font-family: var(--font-mono); font-size: var(--fs-micro); letter-spacing: var(--tracking-mono);
  text-transform: uppercase; color: var(--text-3);
}

/* ---------- The money ---------- */
.money { padding-block: var(--section-y); border-top: 1px solid var(--line); background: var(--bg-raised); }
.money__title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h2); line-height: 1.02; margin-bottom: var(--s-7); }
.money__title em { font-style: italic; }
.money__grid { display: grid; gap: var(--s-6); }
.money__item { display: grid; gap: var(--s-2); align-content: start; padding-top: var(--s-5); border-top: 1px solid var(--line-strong); }
.money__item dt { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.1; }
.money__item dd { color: var(--text-2); }
.money__link { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; white-space: nowrap; }
.money__link:hover { text-decoration-color: var(--text); }

/* ---------- Closing strip ---------- */
.ask { padding-block: var(--s-8); border-top: 1px solid var(--line); background: var(--bg); }
.ask__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-5) var(--s-7); }
.ask__title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h3); line-height: 1.1; }
.ask__text { margin-top: var(--s-2); color: var(--text-2); }

@media (min-width: 640px) {
  .nav__links a[aria-current="page"] { color: var(--text); }
  .money__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .step { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(3rem, 7vw, 8rem); padding-block: var(--s-9); }
  .step__text { justify-self: end; }
  .step--flip .step__text { order: 2; justify-self: start; }
  .step--flip .step__phones { order: 1; }
  .money__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Phone ---------- */
@media (max-width: 639px) {
  .crhead { padding-block: calc(64px + var(--s-8)) var(--s-6); text-align: center; }
  .crhead__inner { justify-items: center; }
  .step { padding-block: var(--s-7); gap: var(--s-6); text-align: center; }
  .step__text { justify-items: center; margin-inline: auto; }
  .step__phones { gap: var(--s-3); }
  .iphone { flex-basis: 250px; }
  .step__phones--pair .iphone { flex-basis: 170px; }
  .money { text-align: center; }
  .ask__inner { flex-direction: column; text-align: center; }
}
