/* Motion layer for the landing page — how it moves, not how it looks. Same approach as
   demos/template/assets/motion.css, tuned calmer to suit the paper-and-serif look.
   Scoped to html.motion, which assets/motion.js adds only for a real visitor: no JS,
   "reduce motion", or a headless check tool, and the page is the still page as before. */

/* Slide-up reveal: blocks get .rv, then .in as they scroll into view.
   .rv-prep hides a block instantly, so it never fades out first. */
.motion .rv {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0s);
}
.motion .rv.in { opacity: 1; transform: none; }
.motion .rv-prep { transition: none !important; }

/* ---------- the opening ----------
   Hidden from the first paint (html.motion is set in <head>), then played once when
   motion.js adds .loaded: the wall fades up, the cursor glides in and taps, the hole
   bursts open with its cracks, and the headline arrives in three sizes. */
/* The stage starts under the header (73px: its 72px bar + hairline), so the pin is stuck
   from the very first pixel of the swipe. Before, the first 73px slid the whole wall up
   before the zoom began, a little nudge (operator, 2026-10-31: "not completely smooth").
   The padding moves by the same 73px, so the opening picture sits exactly where it did. */
.motion .stage { height: calc(100svh + 85svh); margin-top: -73px; }   /* the extra 85svh is the fly-through */
.motion .stage-pin { position: sticky; top: 0; height: 100svh; min-height: 0; padding-top: calc(64px + 73px); padding-bottom: calc(96px - 73px); }
.motion .wall, .motion .hole-zoom { will-change: transform; }
/* after the fly-through: an ordinary first screen, no extra height, no pinning */
.motion.flown .stage { height: auto; margin-top: 0; }
.motion.flown .stage-pin { position: relative; height: calc(100svh - 56px); padding-top: 24px; padding-bottom: 96px; }

.motion .wall, .motion .pointer svg, .motion .hole-pop, .motion .cracks,
.motion .hole-text h1 span, .motion .stage-foot > *, .motion .stage-top > * { opacity: 0; }
.motion.loaded .wall { animation: mo-fade 1s ease both; }
.motion.loaded .pointer svg { animation: mo-tap .85s cubic-bezier(.2, .7, .2, 1) .1s both; }
.motion.loaded .hole-pop { animation: mo-burst .6s cubic-bezier(.3, 1.45, .5, 1) .68s both; }
/* backwards, not both: once played, the fly-through's inline opacity must win */
.motion.loaded .cracks { opacity: 1; animation: mo-fade .35s ease .8s backwards; }
.motion.loaded .h-a { animation: mo-up .55s cubic-bezier(.2, .7, .2, 1) .95s both; }
.motion.loaded .h-b { animation: mo-big .7s cubic-bezier(.3, 1.4, .5, 1) 1.07s both; }
.motion.loaded .h-c { animation: mo-up .55s cubic-bezier(.2, .7, .2, 1) 1.22s both; }
.motion.loaded .stage-foot > :nth-child(1) { animation: mo-up .6s ease 1.35s both; }
.motion.loaded .stage-foot > :nth-child(2) { animation: mo-up .6s ease 1.45s both; }
.motion.loaded .stage-foot > :nth-child(3) { animation: mo-up .6s ease 1.6s both; }
.motion.loaded .stage-foot > :nth-child(4) { animation: mo-up .6s ease 1.75s both; }
.motion.loaded .stage-top > * { animation: mo-up .6s ease 1.6s both; }
.motion.loaded .stage-foot > .btn-shine { animation: mo-up .6s ease 1.45s both, mo-sheen 3.4s ease-in-out 2.4s infinite; }   /* rises in, then shines */
.motion.loaded .scroll-cue span { animation: mo-nudge 1.6s ease-in-out 2.2s infinite; }

@keyframes mo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mo-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes mo-big { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes mo-burst { 0% { opacity: 0; transform: scale(.04) rotate(-8deg); } 6% { opacity: 1; } 100% { opacity: 1; transform: none; } }
/* glides in from the bottom right, presses the wall, springs back */
@keyframes mo-tap {
  0%   { opacity: 0; transform: translate(42vw, 34vh) rotate(-10deg); }
  55%  { opacity: 1; transform: translate(-14%, -18%); }
  70%  { opacity: 1; transform: translate(-14%, -18%) scale(.78); }
  85%  { opacity: 1; transform: translate(-6%, -8%) scale(1.06); }
  100% { opacity: 1; transform: none; }
}
@keyframes mo-nudge { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(6px) rotate(45deg); } }

/* ---------- through the wall: each line lights up word by word as you swipe ---------- */
.motion .say .w { color: rgba(255, 255, 255, .16); transition: color .35s ease; }
.motion .say .w.lit { color: #fff; }
/* The orange phrase waits in faint orange (so the fade is orange to orange, not through
   a muddy grey) and lights as one overlapping wave, each word a beat after the last. */
.motion .say em .w { color: rgba(240, 89, 28, .2); transition: color .7s cubic-bezier(.3, .6, .3, 1); transition-delay: calc(var(--i, 0) * 110ms); }
.motion .say em .w.lit { color: #f0591c; }

/* clip, not hidden: stops a sideways wobble on phones without breaking sticky things */
.motion main { overflow-x: clip; }

/* ---------- scroll-linked entrances (motion.js sets --p from 0 to 1 by scroll position) ----------
   Each part moves WITH the scroll: no timers, so fast scrollers never outrun it and slow
   scrollers watch it glide in. .done hands the part back to its normal styles and hovers. */
.motion .sl:not(.done) { opacity: var(--p, 0); transform: translateY(calc((1 - var(--p, 0)) * 24px)); }
.motion .sl-rise:not(.done) { transform: translateY(calc((1 - var(--p, 0)) * 60px)); }
.motion .sl-pop:not(.done) { transform: scale(calc(.2 + .8 * var(--p, 0))); }
.motion .sl-drop:not(.done) { transform: translateY(calc((var(--p, 0) - 1) * 8px)); }
.motion .sl-count:not(.done) { opacity: 1; transform: none; }
/* before and after: the old site's phone comes in from the left, the rebuilt one from the right */
.motion .phone-before.sl:not(.done) { transform: translateX(calc((1 - var(--p, 0)) * -75%)) rotate(calc(-4deg - (1 - var(--p, 0)) * 12deg)); }
.motion .phone-after.sl:not(.done) { transform: translateX(calc((1 - var(--p, 0)) * 75%)) rotate(calc(3deg + (1 - var(--p, 0)) * 13deg)) translateY(-8px); }
.motion .phone-tag.sl:not(.done) { transform: translateX(-50%) scale(calc(.3 + .7 * var(--p, 0))); }
/* once in place: the rebuilt phone glows and the hint pulses */
.motion .phone-after.done { animation: mo-glow 2.8s ease-in-out .4s infinite; }
/* the tap badges: a ring ripples out every couple of seconds, like a finger pressing */
.motion .tap-me::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #fff;
  animation: mo-ripple 2.4s ease-out 1s infinite; opacity: 0;
}
@keyframes mo-ripple { 0% { opacity: .9; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.9); } }
.motion .tap-hint.done { animation: mo-hint 2.2s ease-in-out .6s infinite; }
@keyframes mo-hint { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes mo-glow {
  0%, 100% { box-shadow: 0 18px 40px rgba(201, 74, 18, .35), 0 0 0 2px var(--orange); }
  50% { box-shadow: 0 18px 48px rgba(201, 74, 18, .55), 0 0 0 2px var(--orange), 0 0 0 8px rgba(240, 89, 28, .18); }
}
@keyframes mo-pop-in { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
/* how it works: the line down the numbers draws as you scroll past */
.motion .sl-line:not(.done) { opacity: 1; transform: none; }
.motion .how-scene .steps.sl:not(.done)::before { transform: scaleY(var(--p, 0)); transform-origin: top; }

/* Header: a little taller at the top, then shrinks and swaps its hairline for a soft
   shadow once you scroll */
.motion .top { transition: box-shadow .3s ease, border-color .3s ease; }
.motion .top-inner { min-height: 72px; transition: min-height .3s ease; }
.motion .logo { transition: height .3s ease; }
.motion .top.scrolled { border-bottom-color: transparent; box-shadow: 0 4px 18px rgba(20, 30, 40, .08); }
.motion .top.scrolled .top-inner { min-height: 56px; }
.motion .top.scrolled .logo { height: 34px; }

/* Buttons give under your thumb */
.motion .btn { transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
.motion .btn:active { transform: scale(.97); }

/* Contact form: the "done" panel pops in instead of just appearing */
.motion .form-done:not([hidden]) { animation: mo-pop .45s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes mo-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* WhatsApp speech bubble pops up just after its button arrives (and when the form sheet opens) */
.motion .sheet.is-in .wa-bubble { animation: mo-bubble .5s cubic-bezier(.3, 1.5, .5, 1) .45s both; }
@keyframes mo-bubble { from { opacity: 0; transform: translateY(8px) scale(.85); transform-origin: 30px 100%; } to { opacity: 1; transform: none; } }
.motion .scroll-cue { cursor: pointer; }   /* tapping "Swipe up" plays the fly-through too */

/* The orange pills: a soft shine sweeps across every few seconds. */
.motion .btn-shine {
  background-image: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .38) 50%, transparent 62%),
                    linear-gradient(180deg, #d9501a, #b23b0b);
  background-size: 260% 100%, 100% 100%;
  background-repeat: no-repeat;
  animation: mo-sheen 3.4s ease-in-out 1s infinite;
}
.motion .btn-top { animation: none; background-image: linear-gradient(180deg, #d9501a, #b23b0b); }   /* header pill: no shine; two at once is too much (operator, 2026-10-25) */
@keyframes mo-sheen { 0% { background-position: 130% 0, 0 0; } 45%, 100% { background-position: -30% 0, 0 0; } }


