/* CD-84 motion preview A (home page only). Adds motion to the current page and applies fixes F1, F2, F6, F7.
   Colours, fonts, copy, cards and artwork are untouched. html[data-mp] is set by motion-plus.mjs:
   "on" | "paused" (Pause motion) | "reduced" (prefers-reduced-motion). Everything below that animates is
   "on" only; paused/reduced/no-JS show the complete still page. */

/* ---- F1: tighter gaps, larger screener picture (desktop) ---- */
@media (min-width: 641px) {
  /* The 70px floor keeps the gap under each section tall enough for a spine run (16px port + 20px corner + 33px to the hairline); it only changes widths under ~1250px (F1 had no floor above 44px). */
  .mr-page { --mr-sp-section: clamp(70px, 5.6vw, 78px); }
}
/* ---- F5: heading alignment is one rule at every width ----
   Centred: hero, how it works, journal, final CTA. Left: screener, calculators, telegram, roadmap, pricing, FAQ.
   Kicker + H2 + lead share the section's alignment; measured identical at 320/390/760/1024/1440/2560. */
.hp-copy, .mr-how__intro, .mr-journal__intro, .mr-final__inner { text-align: center; }
.mr-product__copy, .mr-roadmap__intro, .mr-pricing__intro, .mr-faq__intro { text-align: left; }
.mr-journal__intro .mr-body, .mr-how__intro .mr-body { margin-inline: auto; }
.mr-pricing__intro .mr-body, .mr-faq__intro .mr-body, .mr-product__copy .mr-body, .mr-roadmap__intro .mr-body { margin-inline: 0; }

/* ---- F7: FAQ +/- icons on phone: 44px target, glyph sits 15px in from the edge ---- */
@media (max-width: 767px) {
  .mr-page .mr-faq__item .mr-faq__icon { flex: 0 0 44px; width: 44px; height: 44px; margin-right: -8px; }
  .mr-page .mr-faq__item .mr-faq__icon::before,
  .mr-page .mr-faq__item .mr-faq__icon::after { top: 21px; left: 15px; }
}

/* ---- F6: final CTA at display size + glow ---- */
.mr-page .mr-final .mr-heading { font-size: clamp(44px, 6.4vw, 88px); line-height: 1.04; letter-spacing: -.03em; margin-bottom: 22px; }
.mr-page .mr-final .mr-body { font-size: clamp(17px, 1.5vw, 20px); margin-bottom: 36px; }
.mr-page .mr-final .mr-final__actions .mr-button { min-height: 56px; min-width: 240px; padding-inline: 32px; font-size: 17px; }
.mr-page .mr-final .mr-final__login { min-height: 56px; font-size: 17px; }
.mr-page .mr-final { padding-bottom: clamp(64px, 7vw, 96px); }
.mr-final::before {
  content: ""; position: absolute; z-index: 0; left: 50%; top: 52%; width: min(1100px, 130%); aspect-ratio: 2 / 1;
  translate: -50% -50%; pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--mr-gold) 22%, transparent), transparent);
  opacity: .8;
}
html[data-theme="light"] .mr-final::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--mr-gold) 12%, transparent), transparent); }
html[data-mp="on"] .mr-final::before { animation: mp-glow 7s ease-in-out infinite alternate; }
@keyframes mp-glow { from { opacity: .55; transform: scale(.94); } to { opacity: .95; transform: scale(1.06); } }

/* ---- M1: heading words burn in (opacity + blur + rise, once) ---- */
.mp-w { display: inline-block; }
html[data-mp="on"] .mp-h-pending .mp-w { opacity: 0; filter: blur(6px); transform: translateY(12px); }
html[data-mp="on"] .mp-h-in .mp-w {
  opacity: 1; filter: none; transform: none;
  transition: opacity .7s var(--ease-out, ease-out) calc(var(--i, 0) * 55ms),
    filter .7s var(--ease-out, ease-out) calc(var(--i, 0) * 55ms),
    transform .7s var(--ease-emph, ease-out) calc(var(--i, 0) * 55ms);
}

/* ---- M2: the gold wire spine (public/scripts/wire-spine.mjs) ----
   One orthogonal system: 1.5px G1 gold, round caps, one 4px glow on every segment, a bright head while drawing,
   6px ports that pop in (scale .6 -> 1) when the line reaches them. Nothing is visible until scroll draws it.
   Light theme keeps the approved G1 gold (#D9A93F): the brand kit records its contrast limit, so it is not darkened. */
.wire-spine { position: absolute; z-index: 2; top: 0; left: 0; width: 100%; pointer-events: none; }
.wire-spine .ws-seg {
  position: absolute; overflow: visible; pointer-events: none;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--mr-gold) 70%, transparent));
}
.wire-spine .ws-seg path { fill: none; stroke: var(--mr-gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wire-spine .ws-head { fill: color-mix(in srgb, var(--mr-gold) 40%, #fff); transform-box: fill-box; transform-origin: center; }
html[data-mp="on"] .wire-spine .ws-head { animation: ws-pulse .8s ease-in-out infinite alternate; }
@keyframes ws-pulse { from { scale: .8; opacity: .85; } to { scale: 1.25; opacity: 1; } }
.wire-port {
  position: absolute; left: 0; top: 0; width: 6px; height: 6px; border-radius: 50%; pointer-events: none;
  background: var(--mr-gold); box-shadow: 0 0 4px 1px color-mix(in srgb, var(--mr-gold) 70%, transparent);
  translate: -50% -50%; scale: .6; opacity: 0;
  transition: scale .38s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease-out;
}
.wire-port.is-lit { scale: 1; opacity: 1; }
html[data-mp="paused"] .wire-port, html[data-mp="reduced"] .wire-port { transition: none; }
/* The FAQ -> closing-art brace keeps its static SVG arms; give them the spine's glow so the system matches. */
.mr-page .mr-page-connector { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--mr-gold) 70%, transparent)); }

/* ---- M3: pictures. Transforms are set per frame by motion-plus.mjs; hover lift is the separate `translate`. ---- */
@media (hover: hover) and (pointer: fine) {
  html[data-mp="on"] .mr-page .mr-illustration { transition: translate .35s var(--ease-out, ease-out); }
  html[data-mp="on"] .mr-page .mr-illustration:hover { translate: 0 -5px; }
}

/* ---- M4: workflow circles fill gold in sequence ---- */
.mr-page .mr-how__number { transition: background-color .45s var(--ease-out, ease-out), color .3s var(--ease-out, ease-out); }
html[data-mp="on"] .mr-page .mr-how__number.mp-lit { background-color: var(--mr-gold); color: var(--mr-button-ink); }

/* ---- M5: the alert-settings window springs in once, when the Telegram picture first scrolls into view ---- */
html[data-mp="on"] .mr-telegram.mp-pending .app-win { opacity: 0; transform: translateY(40px) scale(.95); }
html[data-mp="on"] .mr-telegram.mp-in .app-win { opacity: 1; transform: none; transition: transform .9s cubic-bezier(.34, 1.56, .64, 1), opacity .45s ease-out; }

/* ---- M6: prices ---- */
.mr-plan__price .mp-price { color: inherit; font: inherit; letter-spacing: inherit; }
.mp-num { display: inline-block; font-variant-numeric: tabular-nums; }
html[data-mp="on"] .mp-roll-pending { opacity: 0; transform: translateY(.45em); }
html[data-mp="on"] .mp-roll-in { opacity: 1; transform: none; transition: opacity .6s var(--ease-out, ease-out), transform .8s var(--ease-emph, ease-out); }
.mr-plan--free { position: relative; }
.mr-plan--free::before {
  content: ""; position: absolute; inset: -1px; z-index: 1; padding: 1px; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), var(--mr-gold), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity .3s var(--ease-out, ease-out);
}
@media (hover: hover) and (pointer: fine) {
  html[data-mp="on"] .mr-plan--free:hover::before { opacity: .9; }
}

/* ---- Hero B: three.js scene over the poster ---- */
.hp-hero { position: relative; isolation: isolate; }
.hp-hero > .hp-copy, .hp-hero > .hp-figure { position: relative; z-index: 1; }
.hp-three { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; opacity: 0; transition: opacity .9s ease; }
.hp-three[data-ready] { opacity: 1; }
/* Soft left/right edges: the scene bleeds into the page instead of ending on the stage's hard edge. */
.hp-three { -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 96%, transparent); mask-image: linear-gradient(to right, transparent, #000 7%, #000 96%, transparent); }
/* The scene tilts itself; the A stage tilt would double it. The old DOM hero is hidden once the canvas is fully faded in. */
.hp-hero[data-h3d] .hp-stage { transform: none !important; }
.hp-hero[data-h3d="on"] .hp-world { visibility: hidden; }
.hp-hero[data-h3d] .hp-replay { display: none; }
/* Pause stays bottom-left over the picture on desktop, but smaller (the controls row lives in .hp-frame, F3). */
.hp-hero[data-h3d] .hp-controls > .hp-toggle { min-width: 96px; min-height: 40px; padding: 0 14px; bottom: 3.5%; left: 2.2%; }
/* Phone (< 760px): hero-prototype.css F3 puts Pause (and Replay) as 44px icon buttons in a row under the picture;
   the 3D scene does not change that, it only hides Replay (rule above). */
@media (max-width: 759px) {
  .hp-hero[data-h3d] .hp-controls > .hp-toggle { min-width: 44px; min-height: 44px; padding: 0; bottom: auto; left: auto; }
}

/* ---- Reduced motion / paused: everything visible, nothing travels ---- */
@media (prefers-reduced-motion: reduce) {
  .mr-final::before { animation: none; }
  .mp-w, .mp-num { transition: none !important; }
}
