/* ============================================================
   Landing v40 — How-it-works polish (mobile-first)
   Loaded after landing.css + v36–v39

   Fixes:
   - .how-step { text-align:center } made body copy centered (rookie)
   - Too much side padding (section 20 + container 28 + max-width 420)
   - Screenshots scaled 112–120% → "Edit" clipped, awkward crop
   - Nested white frame + soft card = muddy hierarchy
   - Weak type scale / spacing rhythm
   ============================================================ */

/* ---------- Section / grid: use the phone width ---------- */
.how-section--tiles .how-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 28px;
}

.how-steps--tiles {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

/* Kill legacy centered-step layout from landing.css .how-step */
.how-step.how-step--tile {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  text-align: left !important;
  gap: 0 !important;
  padding: 0 !important;
  min-height: 100%;
  background: var(--surface-card);
  border: 1px solid var(--line-cool);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

/* ---------- Copy block ---------- */
.how-step--tile .how-step-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 18px 14px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

/* Badge: small, quiet — does not compete with title */
.how-step--tile .how-num,
.how-step--tile.is-active .how-num {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 26px;
  height: 20px !important;
  padding: 0 6px;
  margin: 0 0 4px;
  border-radius: 5px;
  background: var(--ink) !important;
  color: #fff !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  box-shadow: none !important;
  place-items: unset;
  flex: none;
}

/* Title = primary */
.how-step--tile .how-title {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: left;
}

/* Body = secondary, left-aligned, full width (beats .how-step text-align:center) */
.how-step--tile .how-body {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
  text-align: left !important;
  max-width: none;
}

/* ---------- UI fragment: full-bleed, no nested frame ---------- */
/* Sits flush to card edges so product UI is the content, not a card-in-card */
.how-ui-tile {
  position: relative;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  overflow: hidden;
  height: 260px;
  box-shadow: none;
  width: 100%;
}

/* Fill the tile. No 112–120% zoom that clips chrome (Edit, filters). */
.how-ui-tile img,
.how-ui-tile--quote img,
.how-ui-tile--jobs img,
.how-ui-tile--paid img {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  width: 100% !important;
  max-width: none;
  height: 100%;
  display: block;
  transform: none !important;
  object-fit: cover;
  object-position: top center;
  border: 0;
  border-radius: 0;
  pointer-events: none;
  user-select: none;
}

/* Soft bottom fade — intentional crop, not a hard cut */
.how-ui-tile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  background: linear-gradient(to top, #fff 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Per-step vertical bias only — never horizontal scale */
.how-ui-tile--quote img {
  object-position: top center;
}
.how-ui-tile--jobs img {
  object-position: top center;
}
.how-ui-tile--paid img {
  object-position: top center;
}

/* ---------- Features / hook / pricing (light hierarchy) ---------- */
.feature-stage {
  border: 1px solid var(--line-cool);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}

.feature-panel-copy p {
  color: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

.hook-transforms li {
  border-color: var(--line-cool);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  font-size: 13.5px;
  padding: 9px 14px;
}

.beta-strip {
  border-color: var(--line-cool);
  background: var(--surface-card);
}

.pricing-grid {
  border-color: var(--line-cool) !important;
}

/* ---------- Tablet / stacked ---------- */
@media (max-width: 980px) {
  /* Drop the 420px cap — cards should use full container width */
  .how-steps--tiles {
    grid-template-columns: 1fr !important;
    max-width: none !important;
    gap: 12px;
  }

  .how-ui-tile {
    height: 240px;
  }

  /* Beat v37 mobile type shrink (15px / 13.5px) */
  .how-step--tile .how-title {
    font-size: 17px !important;
  }
  .how-step--tile .how-body {
    font-size: 14px !important;
    margin-bottom: 0 !important;
  }
}

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  /* Section + container both pad — pull how-it-works in tighter */
  .how-section--tiles.section {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .how-section--tiles .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .how-section--tiles .how-head {
    margin-bottom: 22px;
    padding: 0 4px;
  }

  .how-step--tile .how-step-copy {
    padding: 16px 16px 12px;
    gap: 5px;
  }

  .how-step--tile .how-title {
    font-size: 16px !important;
  }

  .how-step--tile .how-body {
    font-size: 13.5px !important;
    line-height: 1.5;
  }

  .how-ui-tile {
    height: 220px;
  }

  .feature-stage {
    padding: 20px 16px 24px;
  }

  .feature-panel-copy p {
    font-size: 15px;
  }
}

@media (max-width: 400px) {
  .how-section--tiles.section {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .how-ui-tile {
    height: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .how-ui-tile img {
    position: absolute;
    left: 0;
    top: 0;
    transform: none !important;
    width: 100% !important;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }
}
