/* Digi Coral — motion & visual storytelling layer (v4, Nov 2026)
   Purely presentational. Loaded after styles.css. Never targets form controls.
   Driven by assets/js/motion.js, which sets: --p (0–1 scroll progress), --rx/--ry (tilt), --pos (compare slider).
   Everything decorative is disabled under prefers-reduced-motion. */

/* ---------- Cinematic page transitions (Chromium cross-document View Transitions; ignored elsewhere) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .22s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vtIn .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(14px); } }
.site-header { view-transition-name: site-header; }

/* ---------- Depth: scroll parallax + pointer tilt ---------- */
.m-parallax { transform: translate3d(0, calc((var(--p, .5) - .5) * var(--depth, 0px)), 0); will-change: transform; }
.m-tilt { transform: perspective(1100px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); transform-style: preserve-3d; }
.m-tilt.is-tilting { transition: transform .12s linear; }

/* ---------- Wipe reveal for graphics ---------- */
.js .m-wipe { clip-path: inset(0 100% 0 0 round 24px); transition: clip-path 1.1s cubic-bezier(.65, 0, .35, 1); }
.js .m-wipe.is-visible { clip-path: inset(0 0 0 0 round 24px); }

/* ---------- Heading accent: underline sweeps in when a section head enters ---------- */
.js .section-head .eyebrow::before, .js .reveal .eyebrow::before { transform-origin: left; transform: scaleX(0); transition: transform .8s cubic-bezier(.2, .7, .2, 1) .15s; }
.js .is-visible .eyebrow::before, .js .section-head.is-visible .eyebrow::before { transform: scaleX(1); }

/* ---------- Scroll-scrubbed process & timeline lines ---------- */
.process.m-scrub::after { transition: none; transform: scaleX(clamp(0, calc((var(--p, 0) - .28) * 2.6), 1)); }
@media (max-width: 900px) { .process.m-scrub::after { transform: scaleY(clamp(0, calc((var(--p, 0) - .2) * 1.9), 1)); } }
.timeline.m-scrub::after { content: ""; position: absolute; left: 23px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: linear-gradient(var(--orange), var(--blue)); transform-origin: top; transform: scaleY(clamp(0, calc((var(--p, 0) - .2) * 1.8), 1)); }
.timeline.m-scrub li .tl-dot { transition: border-color .4s, background-color .4s, color .4s; }
.timeline.m-scrub li.is-lit .tl-dot { border-color: var(--blue); background: var(--blue); color: #fff; }

/* ---------- Bento service cards: mini motion illustrations ---------- */
.mini-anim { position: absolute; top: 20px; right: 20px; width: 112px; height: 76px; pointer-events: none; opacity: .95; }
.mini-anim svg { width: 100%; height: 100%; overflow: visible; }
.bento .feature .mini-anim, .bento .feature.wide .mini-anim { display: none; }
@media (max-width: 640px) { .mini-anim { width: 92px; height: 62px; top: 16px; right: 14px; } }
.mini-anim [class^="ma-"], .mini-anim [class*=" ma-"] { transform-box: fill-box; transform-origin: center; }
.card-link:hover .mini-anim *, .card-link.is-visible .mini-anim * { animation-play-state: running; }
.mini-anim * { animation-play-state: paused; }
/* PPC: cursor clicks the top ad, a lead ticks */
.ma-cursor { animation: maCursor 3.2s cubic-bezier(.2,.7,.2,1) infinite; }
@keyframes maCursor { 0% { transform: translate(40px, 34px); opacity: 0; } 15% { opacity: 1; } 45%, 70% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
.ma-ring { opacity: 0; animation: maRing 3.2s ease-out infinite; }
@keyframes maRing { 0%, 44% { opacity: 0; transform: scale(.3); } 52% { opacity: 1; } 75%, 100% { opacity: 0; transform: scale(1.8); } }
.ma-tick { animation: maTick 3.2s cubic-bezier(.34,1.56,.64,1) infinite; }
@keyframes maTick { 0%, 55% { transform: scale(0); } 70%, 92% { transform: scale(1); } 100% { transform: scale(0); } }
/* Social: hearts float up from a post */
.ma-heart { opacity: 0; animation: maHeart 2.8s ease-out infinite; }
.ma-heart.h2 { animation-delay: .9s; } .ma-heart.h3 { animation-delay: 1.8s; }
@keyframes maHeart { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-34px) scale(1.1); } }
/* Content: lines type themselves */
.ma-line { transform-origin: left !important; animation: maType 3.6s cubic-bezier(.65,0,.35,1) infinite; }
.ma-line.l2 { animation-delay: .35s; } .ma-line.l3 { animation-delay: .7s; } .ma-line.l4 { animation-delay: 1.05s; }
@keyframes maType { 0% { transform: scaleX(0); } 35%, 85% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
/* Email: letter flies into the inbox */
.ma-mail { animation: maMail 3s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes maMail { 0% { transform: translate(-46px, 18px) rotate(-12deg) scale(.7); opacity: 0; } 20% { opacity: 1; } 60% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; } 80%, 100% { transform: translate(0, 0) scale(.6); opacity: 0; } }
.ma-badge { animation: maTick 3s cubic-bezier(.34,1.56,.64,1) .2s infinite; }
/* Website: blocks assemble */
.ma-block { animation: maBlock 3.6s cubic-bezier(.2,.7,.2,1) infinite; }
.ma-block.b2 { animation-delay: .2s; } .ma-block.b3 { animation-delay: .4s; } .ma-block.b4 { animation-delay: .6s; }
@keyframes maBlock { 0% { opacity: 0; transform: translateY(8px); } 20%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
/* SEO: your result climbs */
.ma-climb { animation: maClimb 3.6s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes maClimb { 0%, 15% { transform: translateY(36px); } 55%, 90% { transform: translateY(0); } 100% { transform: translateY(36px); } }
.ma-sink { animation: maSink 3.6s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes maSink { 0%, 15% { transform: translateY(0); } 55%, 90% { transform: translateY(18px); } 100% { transform: translateY(0); } }

/* ---------- Benefits story stage (pinned visual that changes with the benefit in view) ---------- */
.story-stage { position: relative; margin-top: 36px; aspect-ratio: 4 / 3; max-width: 440px; border-radius: 26px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.story-stage::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 220px at 80% 0%, rgba(37,99,235,.10), transparent 70%), radial-gradient(300px 200px at 0% 100%, rgba(249,115,22,.08), transparent 70%); }
.story-frame { position: absolute; inset: 0; opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.story-frame svg { width: 100%; height: 100%; }
.story-stage[data-step="0"] .f0, .story-stage[data-step="1"] .f1, .story-stage[data-step="2"] .f2, .story-stage[data-step="3"] .f3 { opacity: 1; transform: none; }
.story-dots { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 8px; }
.story-dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--blue-100); transition: width .4s, background-color .4s; }
.story-stage[data-step="0"] .story-dots i:nth-child(1), .story-stage[data-step="1"] .story-dots i:nth-child(2), .story-stage[data-step="2"] .story-dots i:nth-child(3), .story-stage[data-step="3"] .story-dots i:nth-child(4) { width: 26px; background: var(--blue); }
.story-frame .sf-pop { transform-box: fill-box; transform-origin: center; }
.story-stage[data-step="0"] .f0 .sf-pop, .story-stage[data-step="1"] .f1 .sf-pop, .story-stage[data-step="2"] .f2 .sf-pop, .story-stage[data-step="3"] .f3 .sf-pop { animation: scPop .7s cubic-bezier(.34,1.56,.64,1) .25s both; }
.story-stage[data-step="1"] .f1 .sf-bar { animation: scGrowY .9s cubic-bezier(.2,.7,.2,1) both; transform-box: fill-box; transform-origin: bottom; }
.story-stage[data-step="1"] .f1 .sf-bar.b2 { animation-delay: .1s; } .story-stage[data-step="1"] .f1 .sf-bar.b3 { animation-delay: .2s; } .story-stage[data-step="1"] .f1 .sf-bar.b4 { animation-delay: .3s; }
.story-stage[data-step="2"] .f2 .sf-star { transform-box: fill-box; transform-origin: center; animation: scPop .5s cubic-bezier(.34,1.56,.64,1) both; }
.story-stage[data-step="2"] .f2 .sf-star.s2 { animation-delay: .1s; } .story-stage[data-step="2"] .f2 .sf-star.s3 { animation-delay: .2s; } .story-stage[data-step="2"] .f2 .sf-star.s4 { animation-delay: .3s; } .story-stage[data-step="2"] .f2 .sf-star.s5 { animation-delay: .4s; }
.story-stage[data-step="3"] .f3 .sf-note { transform-box: fill-box; transform-origin: right; animation: scRise .6s cubic-bezier(.2,.7,.2,1) both; }
.story-stage[data-step="3"] .f3 .sf-note.n2 { animation-delay: .35s; } .story-stage[data-step="3"] .f3 .sf-note.n3 { animation-delay: .7s; }
.benefit { transition: transform .35s var(--ease), box-shadow .35s, border-color .3s, opacity .4s; }
.benefits-live .benefit { opacity: .55; }
.benefits-live .benefit.is-active { opacity: 1; border-color: var(--blue-200); box-shadow: var(--shadow-sm); transform: translateX(6px); }
@media (max-width: 900px) { .story-stage { display: none; } .benefits-live .benefit { opacity: 1; } }

/* ---------- Before / after comparison slider (service pages) ---------- */
.compare-wrap { margin-top: clamp(32px, 4vw, 48px); }
.compare { --pos: 50%; position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.compare svg { display: block; width: 100%; height: auto; }
.compare .cmp-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.compare .cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(11,26,58,.12), 0 0 24px rgba(37,99,235,.35); pointer-events: none; }
.compare .cmp-knob { position: absolute; top: 50%; left: var(--pos); width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--blue); pointer-events: none; transition: transform .25s var(--ease-spring); }
.compare .cmp-knob svg { width: 26px; height: 26px; }
.compare:hover .cmp-knob { transform: scale(1.08); }
.compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.compare input[type="range"]:focus-visible + .cmp-line + .cmp-knob { outline: 3px solid var(--orange); outline-offset: 4px; }
.cmp-tag { position: absolute; top: 16px; padding: 7px 14px; border-radius: 999px; font: 800 .8rem/1 var(--font); letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.cmp-tag.before { left: 16px; background: #f1f3f8; color: #5b6478; }
.cmp-tag.after { right: 16px; background: var(--blue); color: #fff; }
.compare-hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; font-size: .9rem; font-weight: 650; color: var(--muted); }
.compare-hint svg { width: 18px; height: 18px; color: var(--blue); }

/* ---------- Map: connection lines draw in when the map enters ---------- */
.js .city-map .map-link { stroke-dashoffset: 400; transition: stroke-dashoffset 1.6s cubic-bezier(.65,0,.35,1); }
.js .city-map.is-drawn .map-link { stroke-dashoffset: 0; }

/* ---------- Section ambience: soft gradient orbs drift with scroll ---------- */
.m-orb { position: absolute; z-index: 0; width: 420px; height: 420px; border-radius: 50%; pointer-events: none; filter: blur(70px); opacity: .45; }
.m-orb.blue { background: radial-gradient(circle, #bcd0ff, transparent 65%); }
.m-orb.orange { background: radial-gradient(circle, #ffd9bd, transparent 65%); }
.has-orbs { position: relative; overflow: hidden; }
.has-orbs > .container { position: relative; z-index: 1; }

/* ---------- Cards: staggered entrance for icon badges ---------- */
.js .reveal .icon-badge { transform: scale(.6) rotate(-12deg); opacity: 0; transition: transform .7s cubic-bezier(.34,1.56,.64,1) .2s, opacity .4s .2s; }
.js .reveal.is-visible .icon-badge { transform: none; opacity: 1; }
.js .reveal.is-visible.card-link:hover .icon-badge { transform: rotate(-8deg) scale(1.08); }

/* ---------- Deliverables: checkmark badges count in ---------- */
.js .deliverables li.reveal::before { transform: scale(0); transition: transform .5s cubic-bezier(.34,1.56,.64,1) .25s, background-color .3s, color .3s; }
.js .deliverables li.reveal.is-visible::before { transform: none; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .m-parallax, .m-tilt { transform: none !important; }
  .js .m-wipe { clip-path: none; }
  .mini-anim * { animation: none !important; }
  .ma-cursor { transform: none; opacity: 1; } .ma-ring, .ma-heart { opacity: 0; } .ma-tick, .ma-badge { transform: none; }
  .ma-line { transform: none; } .ma-mail { transform: none; opacity: 1; } .ma-block { opacity: 1; transform: none; } .ma-climb, .ma-sink { transform: none; }
  .story-frame { transition: none; }
  .process.m-scrub::after, .timeline.m-scrub::after { transform: none !important; }
  .js .city-map .map-link { stroke-dashoffset: 0; transition: none; }
  .js .reveal .icon-badge { transform: none; opacity: 1; transition: none; }
  .js .deliverables li.reveal::before { transform: none; }
}
.compare .sf { font-family: var(--font); }

/* v5: cards lean toward the cursor (motion.js sets `rotate`) */
.card.m-lean { transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s, rotate .5s cubic-bezier(.2, .7, .2, 1); }
.grid:has(> .m-lean), .bento:has(.m-lean) { perspective: 1400px; }
@media (prefers-reduced-motion: reduce) { .card.m-lean { rotate: none !important; } }

/* ---------- v6 design polish ---------- */
/* Pure white across every page: soft sections become white, separated by a hairline that fades at the edges */
.section-soft { background-color: #fff; background-image: linear-gradient(90deg, transparent, #e3e9f5 18%, #e3e9f5 82%, transparent), linear-gradient(90deg, transparent, #e3e9f5 18%, #e3e9f5 82%, transparent);
  background-size: 100% 1px, 100% 1px; background-position: top center, bottom center; background-repeat: no-repeat; }
/* Feature graphics travel with long text columns instead of leaving empty space */
@media (min-width: 900px) {
  .split > .flywheel, .split > .funnel-art { position: sticky; top: 132px; align-self: start; }
}
/* Footer: all six social profiles on one row */
.social-row { gap: 8px; }
.social-row a { width: 42px; height: 42px; border-radius: 13px; }
