/* CHTAE capability page, phones only (2026-10-23): moving module strips, card stories, beacons on the car
   (see capability-mobile-motion-20261023.js). Replaces capability-mobile-motion-20261022.css. */
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  /* arrival: cards rise in one after another */
  .cap-atlas-mobile-modules.cm-wait > article,
  .cap-atlas-mobile-modules.cm-wait > section { opacity: 0; translate: 26px 14px; }
  .cap-atlas-mobile-modules.cm-wait.cm-seen > article,
  .cap-atlas-mobile-modules.cm-wait.cm-seen > section {
    opacity: 1; translate: 0 0;
    transition: opacity 700ms ease calc(var(--cm-i, 0) * 110ms), translate 900ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--cm-i, 0) * 110ms);
  }

  /* interior: the card in front is full strength, the others step back a little; its picture slowly pushes in */
  [data-layout="interior"] .cap-atlas-mobile-modules.cm-step > article { transition: opacity 520ms ease, scale 620ms cubic-bezier(0.22, 1, 0.36, 1); }
  [data-layout="interior"] .cap-atlas-mobile-modules.cm-step > article:not(.cm-current) { opacity: 0.6; scale: 0.965; }
  [data-layout="interior"] .cap-atlas-mobile-modules.cm-step > article img { transition: transform 3600ms ease-out; transform-origin: 50% 60%; }
  [data-layout="interior"] .cap-atlas-mobile-modules.cm-step > article.cm-current img { transform: scale(1.045); }
  [data-layout="interior"] .cap-atlas-mobile-modules.cm-step > article.cm-current strong { color: #2f35a8; transition: color 400ms ease; }

  /* closures: a red line draws over the card in front, its number lights up */
  [data-layout="closures"] .cap-atlas-mobile-modules.cm-step > article { position: relative; transition: opacity 420ms ease, translate 520ms cubic-bezier(0.22, 1, 0.36, 1), border-color 420ms ease; }
  [data-layout="closures"] .cap-atlas-mobile-modules.cm-step > article::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #b02a35, rgba(176, 42, 53, 0.2));
    transition: width 900ms cubic-bezier(0.65, 0, 0.35, 1);
  }
  [data-layout="closures"] .cap-atlas-mobile-modules.cm-step > article.cm-current { opacity: 1; translate: 0 -3px; border-top-color: rgba(152, 38, 48, 0.35); }
  [data-layout="closures"] .cap-atlas-mobile-modules.cm-step > article.cm-current::before { width: 100%; }
  [data-layout="closures"] .cap-atlas-mobile-modules.cm-step > article > span { transition: color 400ms ease, letter-spacing 500ms ease; }
  [data-layout="closures"] .cap-atlas-mobile-modules.cm-step > article.cm-current > span { color: #b02a35; letter-spacing: 0.08em; }
  [data-layout="closures"] .cap-atlas-mobile-modules.cm-step > article p { transition: opacity 500ms ease 120ms, translate 600ms cubic-bezier(0.22, 1, 0.36, 1) 120ms; }
  [data-layout="closures"] .cap-atlas-mobile-modules.cm-step > article:not(.cm-current) p { opacity: 0.55; translate: 0 4px; }

  /* body: a soft light passes over each picture as it glides by */
  [data-layout="body"] .cap-atlas-mobile-modules.cm-glide .cap-atlas-mobile-body-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.42) 50%, transparent 62%) -160% 0 / 60% 100% no-repeat;
    animation: cm-sheen 5.2s ease-in-out infinite;
    animation-delay: calc(var(--cm-i, 0) * 1.3s);
    pointer-events: none;
  }
  @keyframes cm-sheen { 0%, 55% { background-position: -160% 0; } 85%, 100% { background-position: 260% 0; } }

  /* progress line under the step strips: fills while the next card is coming */
  .cm-progress {
    position: relative;
    z-index: 2;
    height: 2px;
    margin: -24px 18px 22px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(20, 24, 28, 0.1);
  }
  .cm-progress i {
    position: absolute;
    inset: 0;
    background: rgba(152, 38, 48, 0.85);
    transform: scaleX(0);
    transform-origin: left center;
  }
  [data-layout="interior"] .cm-progress i { background: rgba(76, 82, 218, 0.85); }
  .cm-progress.is-running i { animation: cm-fill 3600ms linear forwards; }
  .cm-rail.cm-held + .cm-progress i { animation-play-state: paused; }
  @keyframes cm-fill { to { transform: scaleX(1); } }
}
/* ---------- body cards: one clean rounded corner and shadow ----------
   The four pictures carry their own translucent rounded backing, whose corners did not match the 14 px frame
   (a notch at the corners). The picture is enlarged 6 % inside its frame so its own edges fall outside; the
   frame alone draws the corners and the shadow. The pictures themselves are unchanged. */
@media (max-width: 767px) {
  [data-layout="body"] .cap-atlas-mobile-modules .cap-atlas-mobile-body-media {
    border-radius: 16px;
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 10px 24px rgba(20, 24, 28, 0.08);
  }
  [data-layout="body"] .cap-atlas-mobile-modules .cap-atlas-mobile-body-media img {
    transform: scale(1.06);
    transform-origin: 50% 50%;
  }
}

/* ---------- iPhone: native sideways swipe on the body strip ---------- */
@media (max-width: 767px) {
  [data-mobile-carousel="body"].cm-free-swipe {
    touch-action: pan-x pan-y !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    cursor: auto;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  /* ---------- the card in front tells its story ---------- */
  /* title wipes in from the left, a thin line grows under it, the text rises */
  .cm-rail > .cm-current strong,
  .cm-cycle .cm-current strong { animation: cm-wipe 760ms cubic-bezier(0.65, 0, 0.35, 1) both; }
  .cm-rail > .cm-current p,
  .cm-cycle .cm-current p,
  .cm-cycle .cm-current .cap-exterior-keywords { animation: cm-rise 820ms cubic-bezier(0.16, 1, 0.3, 1) 180ms both; }
  @keyframes cm-wipe { from { clip-path: inset(0 100% 0 0); opacity: 0.4; } to { clip-path: inset(0 -4px 0 0); opacity: 1; } }
  @keyframes cm-rise { from { opacity: 0; translate: 0 10px; filter: blur(3px); } to { opacity: 1; translate: 0 0; filter: none; } }
  .cm-rail > article > span, .cm-rail .cap-atlas-mobile-body-heading > span,
  .cm-cycle article > span, .cm-cycle .cap-atlas-exterior-focus-index { display: inline-block; transition: color 360ms ease, transform 480ms cubic-bezier(0.34, 1.56, 0.64, 1); }
  .cm-rail > .cm-current > span, .cm-rail .cm-current .cap-atlas-mobile-body-heading > span,
  .cm-cycle .cm-current > span, .cm-cycle .cm-current .cap-atlas-exterior-focus-index { transform: scale(1.18); color: #b02a35 !important; }

  /* body glide: the picture in the middle is lit, the others rest */
  [data-layout="body"] .cm-glide > section .cap-atlas-mobile-body-media { transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 600ms ease; }
  [data-layout="body"] .cm-glide > section.cm-current .cap-atlas-mobile-body-media { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 16px 30px rgba(120, 30, 38, 0.14); }
  [data-layout="body"] .cm-glide > section:not(.cm-current) { opacity: 0.72; transition: opacity 500ms ease; }
  [data-layout="body"] .cm-glide > section.cm-current { opacity: 1; transition: opacity 500ms ease; }

  /* exterior bumpers and integration cards take turns */
  .cm-cycle .cap-atlas-exterior-focus,
  .cm-cycle > article { position: relative; transition: opacity 420ms ease, background-color 520ms ease; }
  .cm-cycle .cap-atlas-exterior-focus:not(.cm-current),
  .cm-cycle > article:not(.cm-current) { opacity: 0.62; }
  .cm-cycle .cap-atlas-exterior-focus::after,
  .cm-cycle > article::after {
    content: "";
    position: absolute;
    left: 0;
    top: -1px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #b02a35, rgba(176, 42, 53, 0.15));
    transition: width 900ms cubic-bezier(0.65, 0, 0.35, 1);
    pointer-events: none;
  }
  .cm-cycle .cap-atlas-exterior-focus.cm-current::after,
  .cm-cycle > article.cm-current::after { width: 100%; }
  .cm-cycle > article.cm-current { background-color: rgba(255, 255, 255, 0.55); }
  .cm-cycle.cm-wait > article, .cm-cycle.cm-wait .cap-atlas-exterior-focus { opacity: 0; translate: 0 16px; }
  .cm-cycle.cm-wait.cm-seen > article, .cm-cycle.cm-wait.cm-seen .cap-atlas-exterior-focus {
    translate: 0 0;
    transition: opacity 640ms ease calc(var(--cm-i, 0) * 90ms), translate 820ms cubic-bezier(0.16, 1, 0.3, 1) calc(var(--cm-i, 0) * 90ms);
  }
  .cm-cycle.cm-wait.cm-seen > article.cm-current, .cm-cycle.cm-wait.cm-seen .cap-atlas-exterior-focus.cm-current { opacity: 1; }
  .cm-cycle.cm-wait.cm-seen > article:not(.cm-current), .cm-cycle.cm-wait.cm-seen .cap-atlas-exterior-focus:not(.cm-current) { opacity: 0.62; }

  /* ---------- points on the car: the others breathe, the active one gets a beacon ---------- */
  .cap-refined .cm-beacons .cap-guide-source:not(.is-active) .cap-guide-core::before { animation: cm-breathe 2.6s ease-in-out infinite; }
  .cap-refined .cm-beacons .cap-guide-source:nth-of-type(2n) .cap-guide-core::before { animation-delay: -1.3s; }
  @keyframes cm-breathe { 0%, 100% { scale: 1; opacity: 0.75; } 50% { scale: 1.35; opacity: 1; } }
  .cm-beacon {
    position: absolute;
    z-index: 7;
    width: 0;
    height: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 260ms ease, left 520ms cubic-bezier(0.22, 1, 0.36, 1), top 520ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .cm-beacon.is-on { opacity: 1; }
  .cm-beacon-core {
    position: absolute;
    left: -6px;
    top: -6px;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #d23a44;
    box-shadow: 0 0 0 3px rgba(210, 58, 68, 0.28), 0 0 16px 4px rgba(210, 58, 68, 0.55);
  }
  .cm-beacon.is-on .cm-beacon-core { animation: cm-pop 620ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
  .cm-beacon-ring {
    position: absolute;
    left: -22px;
    top: -22px;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(210, 58, 68, 0.75);
    border-radius: 50%;
    opacity: 0;
  }
  .cm-beacon.is-on .cm-beacon-ring { animation: cm-ripple 1900ms cubic-bezier(0.2, 0.6, 0.35, 1) infinite; }
  .cm-beacon.is-on .cm-beacon-ring--late { animation-delay: 950ms; }
  @keyframes cm-ripple { 0% { opacity: 0.9; transform: scale(0.25); } 70% { opacity: 0.15; } 100% { opacity: 0; transform: scale(1.6); } }
  @keyframes cm-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
  .cm-beacon-tag {
    position: absolute;
    left: 14px;
    bottom: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(16, 20, 23, 0.86);
    color: #fff;
    font: 600 11px/1.3 system-ui, -apple-system, "PingFang SC", sans-serif;
    font-style: normal;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    opacity: 0;
    translate: -6px 4px;
  }
  .cm-beacon-tag:empty { display: none; }
  .cm-beacon.is-on .cm-beacon-tag { animation: cm-tag 520ms cubic-bezier(0.16, 1, 0.3, 1) 220ms both; }
  .cm-beacon.tag-left .cm-beacon-tag { left: auto; right: 14px; }
  .cm-beacon.tag-below .cm-beacon-tag { bottom: auto; top: 12px; }
  @keyframes cm-tag { to { opacity: 1; translate: 0 0; } }
}

@media (min-width: 768px), (prefers-reduced-motion: reduce) {
  .cm-progress, .cm-beacon { display: none; }
}
