/* Adapted from UI Vault sections/Content Workspace/model-005 (Done For You):
   the same scroll story. The writer's photo fills the stage, then slides
   left and stays there while, on the right, "Meanwhile"
   and five operations play one after another (prepare → create → schedule →
   publish → review). At the end the photo returns behind the closing line.

   Changes from the model: fonts, sizes, colours and breakpoints on the
   design system tokens (nothing under --fs-label); no eyebrow above the
   headline and no full stops on titles; the schedule shows real post cards
   instead of "Aa" / "▶" placeholders; published posts turn green with a
   check as they cross into LIVE; colour marks story data (scene, emotion)
   with the same colours as #booketeer; no progress line under the stage
   (removed on request); the photo and the bars move with clip-path (the model
   animated right/left/width), and every bar uses the --ui-progress gradient.

   Progressive enhancement, as in components/flow and components/booketeer:
   the base styles are a static list; dfy.js adds .is-animated at ≥1024px
   without reduced motion, and only then the sticky stage exists. */

.mira-dfy {
  --dfy-ease: cubic-bezier(.22, 1, .36, 1);
  --dfy-scene: var(--ui-rating);
  --dfy-emotion: var(--ui-account-2);

  position: relative;
  padding: 110px 0 96px;
  overflow-x: clip;
  background: var(--ui-gray-50);
  color: var(--ui-text);
}

.mira-dfy__container {
  width: min(720px, calc(100% - 48px));
  margin: 0 auto;
}

/* =========================================================
   HEADER: the answer on the left, the promise on the right
========================================================= */

.mira-dfy__header h2 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(42px, 9vw, 64px);
  line-height: .96;
  letter-spacing: -.07em;
}

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

.mira-dfy__header p {
  max-width: 340px;
  margin: 20px 0 0;
  color: var(--ui-muted);
  font-size: var(--fs-lead);
  line-height: 1.55;
}

/* =========================================================
   STATIC LIST (base)
========================================================= */

.mira-dfy__stage {
  display: flex;
  flex-direction: column;
  margin-top: 44px;
}

.mira-dfy__photo {
  position: relative;
  height: 360px;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--ui-gray-100);
}

.mira-dfy__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}

.mira-dfy__meanwhile {
  margin: 56px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(48px, 11vw, 80px);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.07em;
}

.mira-dfy__ops { display: grid; gap: 56px; margin-top: 32px; }

.mira-dfy__op-head { margin-bottom: 22px; }

.mira-dfy__op-step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--ui-muted);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.mira-dfy__op-step iconify-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--ui-soft);
  border-radius: 999px;
  background: var(--ui-surface);
  color: var(--ui-text);
  font-size: 18px;
}

.mira-dfy__op--review .mira-dfy__op-step iconify-icon {
  border-color: var(--ui-success);
  background: var(--ui-success);
  color: var(--ui-on-accent);
}

.mira-dfy__op h3 {
  max-width: 480px;
  margin: 0;
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1;
  letter-spacing: -.06em;
}

/* Shared card look for every operation visual. */
.mira-dfy__card {
  border: 1px solid var(--ui-soft);
  border-radius: 20px;
  background: var(--ui-surface);
  box-shadow: 0 30px 80px rgba(var(--ui-shadow-rgb), .08);
}

.mira-dfy__small {
  display: block;
  margin-bottom: 8px;
  color: var(--ui-muted);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---------- 1 · prepare: the page and its index ---------- */

.mira-dfy__prepare {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
  overflow: hidden;
}

.mira-dfy__page { padding: 26px; border-right: 1px solid var(--ui-gray-100); }

.mira-dfy__page p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.04em;
}

.mira-dfy__page i {
  display: block;
  height: 6px;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--ui-gray-100);
}

.mira-dfy__page i:nth-of-type(1) { width: 92%; margin-top: 22px; }
.mira-dfy__page i:nth-of-type(2) { width: 74%; }
.mira-dfy__page i:nth-of-type(3) { width: 84%; }

.mira-dfy__index {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 22px;
}

.mira-dfy__attr {
  --c: var(--ui-soft);
  padding: 12px 14px;
  border-left: 3px solid var(--c);
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 10%, var(--ui-surface));
}

.mira-dfy__attr--scene { --c: var(--dfy-scene); }
.mira-dfy__attr--emotion { --c: var(--dfy-emotion); }

.mira-dfy__attr .mira-dfy__small { margin-bottom: 2px; letter-spacing: .12em; }
.mira-dfy__attr strong { display: block; font-size: var(--fs-body); }

/* ---------- 2 · create: image, hook and caption ---------- */

.mira-dfy__create {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  height: 320px;
}

.mira-dfy__piece { overflow: hidden; }

.mira-dfy__piece--image { grid-row: 1 / 3; margin: 0; }

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

.mira-dfy__piece--quote,
.mira-dfy__piece--caption {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 22px;
}

.mira-dfy__piece blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.04em;
}

.mira-dfy__piece p {
  margin: 0;
  color: var(--ui-muted);
  font-size: var(--fs-small);
  line-height: 1.5;
}

/* ---------- 3 · schedule: the week ---------- */

.mira-dfy__schedule {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mira-dfy__day {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mira-dfy__day-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ui-text);
  font-size: var(--fs-label);
  font-weight: 700;
}

.mira-dfy__day-name span { color: var(--ui-muted); font-weight: 500; }

.mira-dfy__post {
  position: relative;
  display: grid;
  height: 220px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ui-gray-100);
}

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

.mira-dfy__post-type {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ui-surface);
  color: var(--ui-text);
  font-size: var(--fs-label);
  font-weight: 600;
}

.mira-dfy__post--quote {
  align-content: end;
  padding: 18px;
  background: var(--ui-inverse);
  color: var(--ui-inverse-text);
}

.mira-dfy__post--quote blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.04em;
}

.mira-dfy__post--video .mira-dfy__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 999px;
  background: rgba(var(--ui-on-photo-rgb), .92);
  color: var(--ui-on-photo-glyph);
  font-size: 22px;
  transform: translate(-50%, -50%);
}

/* ---------- 4 · publish: prepared → live ---------- */

.mira-dfy__publish { position: relative; padding: 22px; }

.mira-dfy__lanes-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 8px;
  color: var(--ui-muted);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.mira-dfy__lanes-head span:last-child {
  padding-left: 18px;
  color: var(--ui-success);
}

.mira-dfy__lanes { position: relative; }

/* The boundary between prepared and live. */
.mira-dfy__lanes::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--ui-soft);
}

.mira-dfy__lane {
  position: relative;
  height: 62px;
  border-bottom: 1px solid var(--ui-gray-100);
}

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

/* A post chip; its green "live" face sits on top and fades in. The static
   list shows it already live, on the right of the boundary. */
.mira-dfy__chip {
  position: absolute;
  top: 50%;
  left: calc(50% + 18px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  overflow: hidden;
  border: 1px solid var(--ui-soft);
  border-radius: 999px;
  background: var(--ui-surface);
  font-size: var(--fs-small);
  font-weight: 600;
  white-space: nowrap;
  transform: translateY(-50%);
}

.mira-dfy__chip-live {
  position: absolute;
  inset: -1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: inherit;
  background: var(--ui-success);
  color: var(--ui-on-accent);
}

/* ---------- 5 · review: what worked ---------- */

.mira-dfy__review { padding: 24px; }

.mira-dfy__metric {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 56px;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  font-size: var(--fs-small);
}

.mira-dfy__metric > span:first-child { color: var(--ui-muted); }
.mira-dfy__metric > strong { text-align: right; color: var(--ui-success); }

.mira-dfy__bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ui-progress-track);
}

.mira-dfy__bar i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--ui-progress);
}

.mira-dfy__review-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--ui-gray-100);
  color: var(--ui-text);
  font-size: var(--fs-body);
}

.mira-dfy__review-note iconify-icon { color: var(--ui-success); font-size: 20px; }

/* ---------- closing line ---------- */

.mira-dfy__final { margin-top: 80px; }

.mira-dfy__final .mira-dfy__small { margin-bottom: 16px; }

.mira-dfy__final h3 {
  margin: 0;
  font-size: clamp(42px, 9vw, 64px);
  line-height: .95;
  letter-spacing: -.07em;
}

.mira-dfy__final h3 em {
  display: block;
  color: var(--ui-muted);
  font-style: normal;
}

/* =========================================================
   ANIMATED STAGE (≥1024px, set by dfy.js)
========================================================= */

.mira-dfy.is-animated {
  height: 560vh;
  padding: 0;
}

.mira-dfy.is-animated .mira-dfy__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.mira-dfy.is-animated .mira-dfy__container {
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(1440px, calc(100% - 80px));
  height: 100vh;
  padding: 136px 0 28px;
}

.mira-dfy.is-animated .mira-dfy__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
}

.mira-dfy.is-animated .mira-dfy__header h2 { max-width: none; font-size: clamp(38px, 3.6vw, 62px); }
.mira-dfy.is-animated .mira-dfy__header p { flex: none; margin: 0; padding-bottom: 6px; }

.mira-dfy.is-animated .mira-dfy__stage {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.mira-dfy__canvas { position: relative; min-height: 0; }

.mira-dfy.is-animated .mira-dfy__canvas { grid-row: 1; }

/* The photo fills the canvas; dfy.js narrows it to the left 46% with
   clip-path, then opens it again for the closing line. */
.mira-dfy.is-animated .mira-dfy__photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  height: auto;
  clip-path: inset(0 0% 0 0 round 20px);
}

/* The right half: "Meanwhile" on top, the operation below. */
.mira-dfy.is-animated .mira-dfy__world {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 52%;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(14px, 2.4vh, 28px);
}

.mira-dfy.is-animated .mira-dfy__meanwhile {
  margin: 0;
  font-size: clamp(44px, min(5.4vw, 8.5vh), 92px);
}

.mira-dfy.is-animated .mira-dfy__ops {
  position: relative;
  display: block;
  min-height: 0;
  margin: 0;
}

.mira-dfy.is-animated .mira-dfy__op {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
}

.mira-dfy.is-animated .mira-dfy__op-head { margin-bottom: clamp(12px, 2.2vh, 24px); }
.mira-dfy.is-animated .mira-dfy__op-step { margin-bottom: clamp(6px, 1.2vh, 12px); }
.mira-dfy.is-animated .mira-dfy__op h3 { font-size: clamp(26px, min(2.5vw, 4.4vh), 42px); }
.mira-dfy.is-animated .mira-dfy__page { padding: clamp(18px, 2.8vh, 26px); }
.mira-dfy.is-animated .mira-dfy__page p { font-size: clamp(18px, min(2vw, 3.2vh), 26px); }

/* Visuals take what height is left, up to their natural size. */
.mira-dfy.is-animated .mira-dfy__op-visual { flex: 0 1 auto; min-height: 0; max-height: 100%; }
.mira-dfy.is-animated .mira-dfy__create {
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  grid-template-rows: auto auto;
  height: auto;
  min-height: clamp(160px, 26vh, 320px);
}
.mira-dfy.is-animated .mira-dfy__piece--quote,
.mira-dfy.is-animated .mira-dfy__piece--caption { padding: clamp(12px, 2vh, 20px) 20px; }
.mira-dfy.is-animated .mira-dfy__piece .mira-dfy__small { margin-bottom: clamp(4px, .8vh, 8px); }
.mira-dfy.is-animated .mira-dfy__piece blockquote { font-size: clamp(17px, min(1.6vw, 2.8vh), 22px); }
.mira-dfy.is-animated .mira-dfy__post { height: clamp(120px, 23vh, 240px); }
.mira-dfy.is-animated .mira-dfy__prepare { min-height: clamp(160px, 26vh, 300px); }
.mira-dfy.is-animated .mira-dfy__lane { height: clamp(44px, 6.4vh, 62px); }

/* Chips start on the prepared side; dfy.js carries them across. */
.mira-dfy.is-animated .mira-dfy__chip { left: 18px; }

.mira-dfy.is-animated .mira-dfy__final {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: min(1180px, 92%);
  margin: 0;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  /* dfy.js centres it with xPercent/yPercent -50 */
}

.mira-dfy.is-animated .mira-dfy__final h3 { font-size: clamp(44px, 5vw, 88px); }

/* =========================================================
   ICON MOTION (UI Vault assets/icons, semantic motion)
========================================================= */

.mira-dfy [data-motion].is-active .mira-dfy__op-step iconify-icon { animation: .55s var(--dfy-ease) .15s; }
.mira-dfy [data-motion="lift"].is-active .mira-dfy__op-step iconify-icon { animation-name: mira-dfy-lift; }
.mira-dfy [data-motion="pop"].is-active .mira-dfy__op-step iconify-icon { animation-name: mira-dfy-pop; }
.mira-dfy [data-motion="fly"].is-active .mira-dfy__op-step iconify-icon { animation-name: mira-dfy-fly; }

@keyframes mira-dfy-lift { 50% { transform: translateY(-6px); } }
@keyframes mira-dfy-pop { 45% { transform: scale(1.2); } 70% { transform: scale(.96); } }
@keyframes mira-dfy-fly { 40% { transform: translate(5px, -5px); opacity: 0; } 41% { transform: translate(-5px, 5px); } }

/* =========================================================
   RESPONSIVE (system breakpoints only)
========================================================= */

@media (max-width: 1279.98px) {
  .mira-dfy.is-animated .mira-dfy__container { width: min(1200px, calc(100% - 48px)); }
  .mira-dfy.is-animated .mira-dfy__header p { display: none; }
  .mira-dfy.is-animated .mira-dfy__world { left: 50%; }
  .mira-dfy__metric { grid-template-columns: 96px minmax(0, 1fr) 48px; }
}

@media (max-width: 767.98px) {
  .mira-dfy__photo { height: 300px; }
  .mira-dfy__prepare { grid-template-columns: 1fr; }
  .mira-dfy__page { border-right: 0; border-bottom: 1px solid var(--ui-gray-100); }
  .mira-dfy__create { display: flex; flex-direction: column; height: auto; }
  .mira-dfy__piece--image { height: 220px; }
  .mira-dfy__schedule { gap: 8px; }
  .mira-dfy__post { height: 170px; }
  .mira-dfy__post--quote { padding: 12px; }
  .mira-dfy__post--quote blockquote { font-size: 15px; }
  .mira-dfy__day-name span { display: none; }
  .mira-dfy__metric { grid-template-columns: 84px minmax(0, 1fr) 44px; gap: 10px; }

  /* Phone: "Meanwhile", then the five operations as a carousel
     (scripts/mobile-rail.js), one per card; replaces the 3,500px list
     (2026-09-23, on request). */
  .mira-dfy__meanwhile { margin-top: 44px; }
  .mira-dfy__ops {
    grid-auto-flow: column;
    grid-auto-columns: calc(100vw - 72px);
    gap: 14px;
    align-items: start;
    margin-top: 20px;
  }
  .mira-dfy__op { scroll-snap-align: start; }
}
