/* hellotelliapp.com: motion layer (Nov 11). Everything here is scoped to html.motion, which motion.js sets only
   when JavaScript runs and the visitor hasn't asked for reduced motion. Without it the page is complete and still. */

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- always-on polish (calm, no motion needed) ---------- */
.bar { transition: box-shadow .4s var(--ease-out), background-color .4s; }
.bar.scrolled { box-shadow: 0 1px 0 rgba(30, 26, 22, .08), 0 10px 30px -12px rgba(30, 26, 22, .28); }
.bar .nav a { position: relative; }
.bar .nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out); }
.bar .nav a:hover::after { transform: scaleX(1); }
.bar .nav a:hover { text-decoration: none; }
.ghost { transition: background-color .25s, color .25s, transform .2s var(--ease-out); }
.ghost:active, .abil button:active, .grp summary:active { transform: scale(.97); }
.abil button { transition: color .3s, background-color .3s, border-color .3s, transform .2s var(--ease-out); }

/* ---------- entrance: hero ---------- */
.motion .hero-copy > * { animation: up 1s var(--ease-out) both; }
.motion .hero-copy > .eyebrow { animation-delay: .05s; }
.motion .hero-copy > h1 { animation: none; }
.motion .hero-copy > .lede { animation-delay: .75s; }
.motion .hero-copy > .ctas { animation-delay: .9s; }
.motion .hero-copy > .fine { animation-delay: 1.05s; }
.motion h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .04em .12em; margin: 0 -.04em -.12em; }
.motion h1 .w > span { display: inline-block; animation: word 1.1s var(--ease-out) both; animation-delay: calc(.15s + var(--i) * 55ms); }
@keyframes word { from { transform: translateY(105%) rotate(4deg); } to { transform: none; } }
@keyframes up { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* phones: rise, then a slow float; scroll parallax comes from motion.js via `translate` */
.motion .hero-phones { animation: rise 1.2s .35s var(--ease-out) both, float 7s 1.6s ease-in-out infinite; will-change: transform; }
@keyframes rise { from { opacity: 0; transform: translateY(60px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* paper cut-outs drift and turn slowly, like mobiles */
.motion .cut { animation: drift 12s ease-in-out infinite; will-change: rotate, scale; }
.motion .cut.c1, .motion .last .c5 { animation: turn 60s linear infinite; }
.motion .cut.c2 { animation-duration: 15s; animation-delay: -4s; }
.motion .cut.c3 { animation-duration: 10s; animation-delay: -2s; }
.motion .learn .c5 { animation: turn 80s linear infinite reverse; }
.motion .cut.c6 { animation-duration: 13s; animation-delay: -7s; }
.motion .hero .c4 { animation: blob 16s ease-in-out infinite; }
@keyframes drift { 0%, 100% { rotate: 0deg; scale: 1; } 50% { rotate: 7deg; scale: 1.05; } }
@keyframes turn { to { rotate: 360deg; } }
@keyframes blob { 0%, 100% { rotate: 0deg; scale: 1 1; } 33% { rotate: 10deg; scale: 1.06 .97; } 66% { rotate: -6deg; scale: .97 1.05; } }

/* ---------- reveal on scroll ---------- */
.motion .rv { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
.motion .rv.is-in { opacity: 1; transform: none; }
.motion .rv.soft { transform: translateY(14px) scale(.98); }
.motion .rv.soft.is-in { transform: none; }

/* ---------- how it works ---------- */
.abil { position: relative; isolation: isolate; }
.motion .abil button[aria-selected="true"] { background: transparent; border-color: transparent; }
.abil-pill { position: absolute; left: 0; top: 0; z-index: -1; border-radius: 999px; background: var(--ink); transition: transform .5s var(--ease-out), width .5s var(--ease-out), height .5s var(--ease-out); pointer-events: none; }
.motion .flow.enter .steps li { animation: up .8s var(--ease-out) both; animation-delay: calc(var(--i) * 90ms); }
.motion .flow.enter .shown { animation: up .6s var(--ease-out) both; }
.motion .steps .ph { transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); }
@media (hover: hover) { .motion .steps li:hover .ph { transform: translateY(-6px); box-shadow: 0 24px 40px rgba(30, 26, 22, .2); } }

/* the little screens come alive when they come into view (class .play on the flow) */
.motion .cstar { animation: breathe 5s ease-in-out infinite; transform-origin: 50% 55%; }
@keyframes breathe { 0%, 100% { transform: scale(.94); } 45% { transform: scale(1.06); } }
.motion .flow.play .bar2 i { animation: fill 24s linear both; }
@keyframes fill { from { width: 0; } to { width: 34%; } }

.motion .skl > * { stroke-dasharray: 1; stroke-dashoffset: 0; }
.motion .flow:not(.play) .skl > * { stroke-dashoffset: 1; }
.motion .flow.play .skl > * { animation: undraw 1.1s var(--ease-out) both; animation-delay: calc(.5s + var(--d, 0) * 160ms); }
@keyframes undraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.motion .flow.play .chips2 span { animation: pop .5s var(--ease-spring) both; animation-delay: calc(.2s + var(--i) * 130ms); }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

.motion .flow.play .g4 b { animation: pop .45s var(--ease-spring) both; animation-delay: calc(.5s + var(--n) * 260ms); }
.motion .flow.play .g4 span.on { animation: ring 1.4s 1.6s var(--ease-out) both; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(226, 70, 42, .55); } 100% { box-shadow: 0 0 0 10px rgba(226, 70, 42, 0); } }

.motion .flow.play .sync { animation: syncpop .9s .3s var(--ease-spring) both; }
@keyframes syncpop { 0% { opacity: 0; transform: scale(.4) rotate(-8deg); } 100% { opacity: 1; transform: none; } }
.motion .lit2 span.on { transition: background-color .35s, border-color .35s, color .35s, transform .35s var(--ease-spring); }
.motion .flow:not(.lit) .lit2 span.on { background: var(--cream); border-color: var(--line); color: var(--ink); }
.motion .flow.lit .lit2 span.on { transition-delay: calc(var(--i) * 220ms); }

.motion .hid2 span { animation: hover 3.6s ease-in-out infinite; }
@keyframes hover { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
.motion .flow.play .drawn2 { animation: flip 1s .4s var(--ease-out) both; transform-origin: 50% 50%; }
@keyframes flip { from { transform: perspective(500px) rotateY(90deg); opacity: .2; } to { transform: none; opacity: 1; } }
.motion .flow.play .k2.ring { animation: ring 1.4s 1.2s var(--ease-out) both; }
.motion .flow.play .ten2 { animation: pop .7s .3s var(--ease-spring) both; }

.motion .bob { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.motion .flow.play .pbar i { animation: grow 2.4s var(--ease-out) both; }
@keyframes grow { from { width: 0; } }
.motion .flow:not(.play) .trace { stroke-dashoffset: 1; }
.motion .trace { stroke-dasharray: 1; }
.motion .flow.play .trace { animation: undraw 2.4s .3s cubic-bezier(.45, 0, .2, 1) both; }
.motion .flow.play .rise-star { animation: risestar 2.4s .3s cubic-bezier(.45, 0, .2, 1) both; }
@keyframes risestar { from { transform: translate(-34px, 56px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---------- practices: open and close smoothly ---------- */
.grp { transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); }
@media (hover: hover) { .grp:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -18px rgba(30, 26, 22, .28); } }
.grp summary::after { transition: transform .35s var(--ease-out); }
.grp details { overflow: hidden; }
.grp details p { transition: opacity .35s; }

/* ---------- a look inside ---------- */
.shots img { transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out); }
@media (hover: hover) { .shots img:hover { transform: translateY(-8px) rotate(-1deg); box-shadow: 0 26px 50px -16px rgba(30, 26, 22, .35); } }

/* ---------- features: icons draw themselves in ---------- */
.motion .feat .ic { transform: scale(.5) rotate(-12deg); opacity: 0; transition: transform .8s var(--ease-spring), opacity .4s; transition-delay: calc(var(--i, 0) * 120ms + .15s); }
.motion .feat.is-in .ic { transform: none; opacity: 1; }
.motion .feat .ic svg > * { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 120ms + .45s); }
.motion .feat.is-in .ic svg > * { stroke-dashoffset: 0; }
.tic { transition: transform .5s var(--ease-spring); }
@media (hover: hover) { .lrow:hover .tic { transform: rotate(-6deg) scale(1.06); } }

/* ---------- plans ---------- */
.plan { transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); }
@media (hover: hover) { .plan:hover { transform: translateY(-5px); box-shadow: 0 26px 50px -22px rgba(30, 26, 22, .35); } }
.plan.plus { overflow: hidden; }
.plan.plus .badge { z-index: 2; }
.plans { padding-top: 14px; }
.plan.plus::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 249, 240, .22) 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }
.motion .plan.plus.is-in::after { animation: sheen 1.6s .7s var(--ease-out) both; }
@keyframes sheen { to { transform: translateX(120%); } }
.motion .plan.plus .badge { transform: scale(0) rotate(-20deg); transition: transform .7s var(--ease-spring) .5s; }
.motion .plan.plus.is-in .badge { transform: rotate(-4deg); }
.plan.plus .badge { top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* ---------- hero art: bigger phones on desktop, signal rings behind them ---------- */
.hero-art { position: relative; align-self: end; }
.hero-art .hero-phones { position: relative; z-index: 1; width: 100%; height: auto; display: block; }
.ripple { position: absolute; z-index: 0; left: 50%; top: 42%; width: 110%; aspect-ratio: 1; margin-left: -55%; border-radius: 50%; border: 2px solid rgba(255, 249, 240, .9); transform: translateY(-50%) scale(.15); opacity: 0; pointer-events: none; }
.ripple:nth-child(2) { border-color: rgba(245, 169, 186, .9); }
.motion .ripple { animation: ripple 7.5s var(--ease-out) infinite; animation-delay: calc(1.1s + var(--r, 0) * .55s); }
.ripple:nth-child(2) { --r: 1; } .ripple:nth-child(3) { --r: 2; }
@keyframes ripple { 0% { opacity: 0; transform: translateY(-50%) scale(.15); } 6% { opacity: .9; } 45%, 100% { opacity: 0; transform: translateY(-50%) scale(1.15); } }
.motion .hero-art .hero-phones { animation: phonesin 1.5s .3s var(--ease-out) both, float 7s 1.9s ease-in-out infinite; }
@keyframes phonesin { from { opacity: 0; transform: translateY(90px) rotate(5deg) scale(.92); } to { opacity: 1; transform: none; } }

@media (min-width: 861px) {
  .hero-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.2fr); gap: 0; }
  .hero-copy { padding: 56px 0 56px; align-self: start; }
  .hero h1 { font-size: clamp(42px, 5.6vw, 76px); }
  /* whole phones, their tops level with the headline */
  .hero-art { align-self: start; margin: 0 -24px 0 32px; padding: 84px 0 56px; }
  .hero-art .hero-phones { width: 100%; max-width: 640px; margin-left: auto; }
  .ripple { top: 50%; }
  .hero .c4 { right: -140px; top: 50px; width: 340px; }
}
@media (max-width: 860px) {
  .hero-art { max-width: 520px; width: 100%; margin: 8px auto 0; }
}

/* the sync card arrives like a card dealt onto the table, and its pictures fan out */
.motion .flow.play .sc { animation: deal 1s .25s var(--ease-spring) both; }
@keyframes deal { from { opacity: 0; transform: translateY(26px) rotate(-5deg) scale(.9); } to { opacity: 1; transform: none; } }
.motion .flow:not(.play) .pile img { transform: none; }
.motion .pile img { transition: transform .9s var(--ease-spring) 1s; }
.motion .flow.play .shr span { animation: up .6s var(--ease-out) both; animation-delay: calc(1s + var(--i, 0) * 90ms); }
