/* Adapted from UI Vault sections/howitworkd/model-001: same scroll
   storytelling (a 400vh section with a sticky stage that walks three steps,
   text rising on the left and a visual sliding in on the right) and the same
   compositions and photos, translated to MIRA's tokens. Gone from the model:
   Manrope and Georgia, the beige greys, the 8–15px text, the square corners,
   its eyebrow and its "MIRA WORKFLOW 01 / 03" footer (removed on request),
   and its 1100 / 820px breakpoints. Photos are local WebP in assets/how/. */

.mira-how {
  --how-ease: cubic-bezier(.22, 1, .36, 1);

  position: relative;
  height: 400vh;
  /* Safety net for the sliding visuals. clip (not hidden) keeps the sticky
     stage working, since it does not create a scroll container. */
  overflow-x: clip;
  background: linear-gradient(180deg, var(--ui-gray-100) 0%, var(--ui-gray-50) 100%);
  color: var(--ui-text);
}

.mira-how__sticky {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* The floating menu covers the top ~100px while this section is on screen,
   so the stage starts below it with some air. */
.mira-how__container {
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(1440px, calc(100% - 80px));
  height: min(900px, 100vh);
  margin-inline: auto;
  padding: 136px 0 32px;
}

/* =========================================================
   HEADER
========================================================= */

.mira-how__header {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: 56px;
  align-items: end;
  padding-bottom: 28px; /* no divider under it (2026-09-24, on request) */
}

.mira-how__header h2 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(40px, 4.4vw, 76px);
  line-height: .96;
  letter-spacing: -.07em;
}

.mira-how__header h2 span {
  display: block;
  color: var(--ui-muted);
}

.mira-how__header > p {
  max-width: 360px;
  margin: 0;
  color: var(--ui-muted);
  font-size: var(--fs-body);
  line-height: 1.6;
}

/* =========================================================
   EXPERIENCE: steps (left) + stage (right)
========================================================= */

.mira-how__experience {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(300px, .72fr) minmax(0, 1.4fr);
  gap: clamp(56px, 7vw, 120px);
  align-items: center;
  padding-top: 32px;
}

.mira-how__steps {
  position: relative;
  height: 340px;
}

.mira-how__step {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(-50% + 55px));
  transition:
    opacity 520ms ease,
    transform 700ms var(--how-ease),
    visibility 520ms ease;
}

.mira-how__step.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%);
}

.mira-how__step.is-past { transform: translateY(calc(-50% - 55px)); }

.mira-how__step-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.mira-how__step-number {
  font-family: var(--font-display);
  font-size: var(--fs-ui);
  font-weight: 800;
}

.mira-how__step-label,
.mira-how__caption span,
.mira-how__preview-head,
.mira-how__panel-head span,
.mira-how__overline,
.mira-how__success span {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.mira-how__step-label { color: var(--ui-muted); }

.mira-how__step h3 {
  max-width: 460px;
  margin: 0;
  font-size: clamp(36px, 3.4vw, 58px);
  line-height: 1;
  letter-spacing: -.06em;
}

.mira-how__step p {
  max-width: 430px;
  margin: 22px 0 0;
  color: var(--ui-muted);
  font-size: var(--fs-body);
  line-height: 1.65;
}

.mira-how__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  display: grid;
  width: min(360px, 100%);
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mira-how__progress span {
  height: 4px;
  border-radius: 999px;
  background: var(--ui-progress-track);
  transition: background-color .35s ease;
}

/* Lit segments follow the progress gradient: indigo → teal → green. */
.mira-how__progress span:nth-child(1).is-active { background: var(--ui-account-1); }
.mira-how__progress span:nth-child(2).is-active { background: var(--ui-account-3); }
.mira-how__progress span:nth-child(3).is-active { background: var(--ui-success); }

/* =========================================================
   STAGE
========================================================= */

.mira-how__stage {
  position: relative;
  width: 100%;
  height: min(520px, 54vh);
  min-height: 420px;
  perspective: 1200px;
}

.mira-how__visual {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(70px) rotateY(-3deg) scale(.97);
  transition:
    opacity 600ms ease,
    transform 800ms var(--how-ease),
    visibility 600ms ease;
}

.mira-how__visual.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.mira-how__visual.is-past { transform: translateX(-80px) rotateY(3deg) scale(.97); }

.mira-how__photo {
  position: absolute;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ui-gray-100);
}

.mira-how__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mira-how__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(var(--ui-shadow-rgb), .02), rgba(var(--ui-shadow-rgb), .5));
}

/* Shared surface for the mock UI cards that float over the photos. */
.mira-how__float,
.mira-how__panel,
.mira-how__success {
  border: 1px solid var(--ui-soft);
  border-radius: 16px;
  background: rgba(var(--ui-surface-rgb), .96);
  box-shadow: 0 24px 70px rgba(var(--ui-shadow-rgb), .12);
  backdrop-filter: blur(12px);
}

/* ---------- 01 · content ---------- */

.mira-how__photo--main {
  top: 0;
  right: 0;
  width: 76%;
  height: 86%;
}

/* Bottom-right of the photo: the content card covers its bottom-left. */
.mira-how__caption {
  position: absolute;
  right: 32px;
  bottom: 30px;
  width: min(300px, 50%);
  color: var(--ui-on-photo);
}

.mira-how__caption span {
  display: block;
  margin-bottom: 10px;
  opacity: .75;
}

.mira-how__caption strong {
  display: block;
  max-width: 360px;
  font-family: var(--font-display);
  font-size: clamp(22px, 1.8vw, 28px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.04em;
}

.mira-how__preview {
  position: absolute;
  z-index: 5;
  bottom: 0;
  left: 0;
  width: min(340px, 52%);
  padding: 22px;
}

.mira-how__preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ui-gray-100);
  color: var(--ui-muted);
}

.mira-how__preview-plus {
  color: var(--ui-text);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.mira-how__source {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 18px;
}

.mira-how__source-icon {
  display: grid;
  width: 40px;
  height: 48px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: var(--ui-deep);
  color: var(--ui-bg);
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 800;
}

.mira-how__source strong,
.mira-how__source span { display: block; }
.mira-how__source strong { font-size: var(--fs-small); font-weight: 700; }
.mira-how__source span { margin-top: 2px; color: var(--ui-muted); font-size: var(--fs-label); }

.mira-how__preview blockquote {
  margin: 18px 0 0;
  color: var(--ui-muted);
  font-size: var(--fs-small);
  font-style: italic;
  line-height: 1.55;
}

.mira-how__preview-action {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--ui-gray-100);
  font-size: var(--fs-small);
  font-weight: 700;
}

.mira-how__photo--small {
  top: 32px;
  left: 4px;
  width: 150px;
  height: 108px;
  border: 5px solid var(--ui-surface);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(var(--ui-shadow-rgb), .1);
}

/* ---------- 02 · campaign ---------- */

.mira-how__photo--campaign {
  top: 0;
  left: 0;
  width: 46%;
  height: 100%;
}

.mira-how__panel {
  position: absolute;
  top: 50%;
  right: 0;
  width: 66%;
  padding: 28px;
  transform: translateY(-50%);
  background: var(--ui-surface);
}

.mira-how__panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ui-gray-100);
}

.mira-how__panel-head span {
  display: block;
  margin-bottom: 6px;
  color: var(--ui-muted);
}

.mira-how__panel-head h4 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.04em;
}

.mira-how__panel-head .mira-how__status {
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ui-gray-100);
  color: var(--ui-primary);
  letter-spacing: .08em;
}

.mira-how__row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 80px;
  border-bottom: 1px solid var(--ui-gray-100);
}

.mira-how__row:last-child { border-bottom: 0; }

.mira-how__row-label {
  color: var(--ui-muted);
  font-size: var(--fs-small);
  font-weight: 500;
}

.mira-how__posts { display: flex; gap: 6px; }

.mira-how__posts div {
  display: grid;
  width: 44px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: var(--ui-gray-50);
  color: var(--ui-muted);
  font-size: var(--fs-label);
}

.mira-how__posts div:nth-child(2) { background: var(--ui-gray-100); }
.mira-how__posts div:nth-child(3) { background: var(--ui-soft); color: var(--ui-primary); }
.mira-how__posts .is-more { background: var(--ui-deep); color: var(--ui-bg); font-weight: 700; }

.mira-how__accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: var(--fs-small);
  font-weight: 700;
}

.mira-how__week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.mira-how__week div {
  display: flex;
  height: 46px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--ui-gray-100);
  border-radius: 10px;
}

.mira-how__week span { color: var(--ui-muted); font-size: var(--fs-label); line-height: 1; }

.mira-how__week strong {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ui-deep);
}

/* A day with a post (it carries the dot) is painted: semantic "scheduled". */
.mira-how__week div:has(strong) {
  border-color: var(--ui-success);
  background: var(--ui-success);
}
.mira-how__week div:has(strong) span { color: var(--ui-on-accent); font-weight: 700; }
.mira-how__week div:has(strong) strong { background: var(--ui-on-accent); }

/* ---------- 03 · publish ---------- */

.mira-how__photo--publish { inset: 0; }

.mira-how__publish-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(var(--ui-shadow-rgb), .74), rgba(var(--ui-shadow-rgb), .12));
}

.mira-how__publish {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 7%;
  width: min(400px, 56%);
  color: var(--ui-on-photo);
  transform: translateY(-50%);
}

.mira-how__overline {
  display: block;
  margin-bottom: 16px;
  opacity: .75;
}

.mira-how__publish h4 {
  max-width: 340px;
  margin: 0;
  color: var(--ui-on-photo);
  font-size: clamp(34px, 3.4vw, 54px);
  line-height: 1;
  letter-spacing: -.06em;
}

.mira-how__publish p {
  margin: 16px 0 0;
  font-size: var(--fs-small);
  opacity: .8;
}

/* Same family as the final CTA: 60px, radius 10px, solid over the photo. */
.mira-how__play {
  display: inline-flex;
  min-height: 60px;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 0 22px 0 12px;
  border-radius: 10px;
  background: var(--ui-on-photo);
  color: var(--ui-on-photo-glyph);
  font-size: var(--fs-ui);
  font-weight: 700;
  text-decoration: none;
  transition: transform .35s var(--how-ease), box-shadow .35s var(--how-ease);
}

.mira-how__play:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(var(--ui-shadow-rgb), .22);
}

.mira-how__play:focus-visible {
  outline: 2px solid var(--ui-on-photo);
  outline-offset: 4px;
}

.mira-how__play-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: var(--ui-on-photo-glyph);
  color: var(--ui-on-photo);
}

.mira-how__play-icon svg { width: 18px; height: 18px; fill: currentColor; }

.mira-how__success {
  position: absolute;
  z-index: 5;
  right: 24px;
  bottom: 24px;
  display: flex;
  min-width: 250px;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
}

.mira-how__success-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: 999px;
  background: var(--ui-success);   /* semantic: the campaign is scheduled */
  color: var(--ui-on-accent);
}

.mira-how__success-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mira-how__success span { display: block; color: var(--ui-muted); }

.mira-how__success strong {
  display: block;
  margin-top: 3px;
  font-size: var(--fs-small);
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1279.98px) {
  .mira-how__container { width: min(100% - 48px, 1200px); }
  .mira-how__header { grid-template-columns: 1fr; }
  .mira-how__header > p { display: none; }
  .mira-how__experience {
    grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr);
    gap: 48px;
  }
  .mira-how__panel { width: 72%; padding: 22px; }
  .mira-how__row { grid-template-columns: 82px 1fr; }
}

/* Below 1024px a 400vh sticky story is uncomfortable: the section becomes a
   plain list, each step followed by its own visual. */
@media (max-width: 1023.98px) {
  .mira-how { height: auto; padding: 110px 0 90px; }

  .mira-how__sticky {
    position: relative;
    display: block;
    height: auto;
    overflow: visible;
  }

  .mira-how__container {
    display: block;
    width: min(100% - 48px, 720px);
    height: auto;
    padding: 0;
  }

  .mira-how__header { padding-bottom: 36px; }
  .mira-how__header > p { display: block; }
  .mira-how__header h2 { font-size: clamp(42px, 9vw, 64px); }

  /* stretch, not the desktop centring: the visuals are all absolute layers
     and would collapse to zero width. */
  .mira-how__experience { display: flex; flex-direction: column; align-items: stretch; padding: 0; }
  .mira-how__steps,
  .mira-how__stage { display: contents; }

  .mira-how__step,
  .mira-how__visual {
    position: relative;
    inset: auto;
    top: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .mira-how__step { margin: 64px 0 28px; }
  .mira-how__step.is-past,
  .mira-how__step.is-active { transform: none; }
  .mira-how__visual { height: 460px; }
  .mira-how__visual.is-past { transform: none; }

  .mira-how__step:nth-of-type(1) { order: 1; }
  .mira-how__visual:nth-of-type(1) { order: 2; }
  .mira-how__step:nth-of-type(2) { order: 3; }
  .mira-how__visual:nth-of-type(2) { order: 4; }
  .mira-how__step:nth-of-type(3) { order: 5; }
  .mira-how__visual:nth-of-type(3) { order: 6; }

  .mira-how__progress { display: none; }
}

@media (max-width: 767.98px) {
  .mira-how__container { width: calc(100% - 48px); }
  .mira-how__step h3 { font-size: clamp(34px, 10vw, 44px); }

  /* 01: photo on top, the content card overlapping its lower edge. */
  .mira-how__visual--content { height: 540px; }
  .mira-how__photo--main { width: 100%; height: 320px; }
  /* Raised so the content card, which overlaps the photo's bottom edge,
     never covers it. */
  .mira-how__caption { right: 20px; bottom: 56px; width: auto; left: 20px; }
  .mira-how__preview { right: 0; width: auto; left: 12%; padding: 18px; }
  .mira-how__photo--small { display: none; }

  /* 02: photo strip on top, the panel below it. */
  .mira-how__visual--campaign { height: auto; }
  .mira-how__photo--campaign { position: relative; width: 100%; height: 170px; }
  .mira-how__panel {
    position: relative;
    top: auto;
    width: 100%;
    margin-top: -40px;
    transform: none;
    padding: 18px;
  }
  .mira-how__row { grid-template-columns: 1fr; gap: 10px; min-height: 0; padding: 14px 0; }
  .mira-how__week { gap: 4px; }
  .mira-how__week div { height: 42px; border-radius: 8px; }

  /* 03: the text sits on the photo; the scheduled chip below it. */
  .mira-how__visual--publish { height: 480px; }

  /* Phone: the three steps are a carousel (scripts/mobile-rail.js), each
     column a step over its illustration; swipe for the next one. Replaces
     the 3,000px list (2026-09-23, on request). */
  .mira-how__experience {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none; /* the desktop grid's columns */
    grid-template-rows: auto auto;
    grid-auto-columns: calc(100vw - 72px);
    gap: 20px 14px;
    align-items: start;
    margin-inline: -24px;
    padding: 0 24px; /* the tablet block zeroes it: keep the rail's bleed */
  }
  .mira-how__step { grid-row: 1; margin: 0; scroll-snap-align: start; }
  .mira-how__visual { grid-row: 2; }
  .mira-how__step:nth-of-type(1), .mira-how__visual:nth-of-type(1) { grid-column: 1; }
  .mira-how__step:nth-of-type(2), .mira-how__visual:nth-of-type(2) { grid-column: 2; }
  .mira-how__step:nth-of-type(3), .mira-how__visual:nth-of-type(3) { grid-column: 3; }
  .mira-how__publish-shade {
    background: linear-gradient(180deg, rgba(var(--ui-shadow-rgb), .7), rgba(var(--ui-shadow-rgb), .3));
  }
  .mira-how__publish { top: 36px; left: 22px; width: calc(100% - 44px); transform: none; }
  .mira-how__success { right: 16px; bottom: 16px; left: 16px; min-width: 0; }
}


/* Reduced motion: site.css already cuts every transition to 0.01ms, so the
   steps and visuals swap in place without sliding. */
