/* Mutual Works — motion layer. Transforms and opacity only; everything degrades to a static page. */

/* ---------- page transitions (cross-document View Transitions) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: mw-fade-out .18s ease both; }
::view-transition-new(root) { animation: mw-fade-in .28s ease both; }
.site-header { view-transition-name: mw-header; }
@keyframes mw-fade-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes mw-fade-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- reveals (JS adds .in when visible; --i = stagger index) ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 90ms); }
[data-reveal="scale"] { transform: translateY(10px) scale(.96); }
[data-reveal="left"] { transform: translateX(-24px); }
[data-reveal="right"] { transform: translateX(24px); }
[data-reveal].in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ---------- hover and press ---------- */
.card, .audience-card, .stat { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease, border-color .35s ease; }
@media (hover: hover) {
  .card:hover, .audience-card:hover, .stat:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgba(42,34,40,.35); border-color: var(--line); }
}
.btn { transition: transform .25s cubic-bezier(.2,.7,.2,1), background .15s ease, color .15s ease, border-color .15s ease, box-shadow .25s ease; will-change: transform; }
.btn:active { transform: scale(.97); }
.btn-primary:hover { box-shadow: 0 10px 24px -12px rgba(184,90,52,.7); }
.nav a { position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 2px; height: 2px; background: var(--cta); transition: right .3s cubic-bezier(.2,.7,.2,1); }
.nav a:hover::after, .nav a[aria-current="page"]::after { right: 0; }
.text-link { background-image: linear-gradient(currentColor, currentColor); background-size: 0 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .3s ease; text-decoration: none; }
.text-link:hover { background-size: 100% 2px; text-decoration: none; }

/* ---------- hero ---------- */
.hero.dark { position: relative; isolation: isolate; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.hero-bg .b1 { width: 520px; height: 520px; left: -140px; top: -180px; background: #5C6B42; animation: mw-drift1 26s ease-in-out infinite alternate; }
.hero-bg .b2 { width: 560px; height: 560px; right: -200px; top: -120px; background: #2A5560; animation: mw-drift2 32s ease-in-out infinite alternate; }
.hero-bg .b3 { width: 360px; height: 360px; left: 45%; bottom: -220px; background: #C4623A; opacity: .35; animation: mw-drift3 22s ease-in-out infinite alternate; }
@keyframes mw-drift1 { to { transform: translate(90px, 60px) scale(1.15); } }
@keyframes mw-drift2 { to { transform: translate(-70px, 90px) scale(1.1); } }
@keyframes mw-drift3 { to { transform: translate(-120px, -50px) scale(1.2); } }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, rgba(245,241,238,.06), transparent 60%); }

.hero.dark h1 { max-width: 16ch; }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.hero h1 .w > span { display: inline-block; transform: translateY(110%); animation: mw-rise .9s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(.15s + var(--i, 0) * 90ms); }
@keyframes mw-rise { to { transform: none; } }
.rotator { display: inline-grid; vertical-align: bottom; text-align: left; color: var(--peach); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.rotator > em { grid-area: 1 / 1; justify-self: start; white-space: nowrap; opacity: 0; transform: translateY(60%) rotateX(-40deg); transform-origin: 50% 100%; transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.rotator > em.on { opacity: 1; transform: none; }
.rotator > em.out { opacity: 0; transform: translateY(-50%) rotateX(40deg); }
.hero .lead, .hero .actions { opacity: 0; animation: mw-up .8s cubic-bezier(.2,.8,.2,1) forwards; }
.hero .lead { animation-delay: .7s; } .hero .actions { animation-delay: .9s; }
@keyframes mw-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.arrow-bob { display: inline-block; animation: mw-bob 1.8s ease-in-out infinite; }
@keyframes mw-bob { 50% { transform: translateY(3px); } }

/* hero illustration (inline SVG) */
.hero-scene { border-radius: 24px; overflow: hidden; background: #352B31; opacity: 0; animation: mw-up .9s ease .3s forwards; }
.hero-scene svg { display: block; width: 100%; height: auto; }
.hero-scene .chair-l { transform: translateX(-140px); animation: mw-slide 1.1s cubic-bezier(.2,.8,.2,1) .55s forwards; }
.hero-scene .chair-r { transform: translateX(140px); animation: mw-slide 1.1s cubic-bezier(.2,.8,.2,1) .65s forwards; }
.hero-scene .table { transform: translateY(80px); opacity: 0; animation: mw-table .9s cubic-bezier(.2,.8,.2,1) 1.05s forwards; }
.hero-scene .cups { opacity: 0; animation: mw-fadein .6s ease 1.5s forwards; }
.hero-scene .dot { transform-origin: 600px 150px; animation: mw-pulse 2.6s ease-in-out 1.8s infinite; }
.hero-scene .dash { stroke-dasharray: 2 18; animation: mw-dash 6s linear 1.8s infinite; }
.hero-scene .steam { opacity: 0; animation: mw-steam 3s ease-in-out 2s infinite; }
@keyframes mw-slide { to { transform: none; } }
@keyframes mw-table { to { transform: none; opacity: 1; } }
@keyframes mw-fadein { to { opacity: 1; } }
@keyframes mw-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .75; } }
@keyframes mw-dash { to { stroke-dashoffset: -120; } }
@keyframes mw-steam { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-22px); } }

/* ---------- match story (pinned, scroll-driven) ---------- */
.story { position: relative; height: 420vh; }
.story-pin { position: sticky; top: 0; min-height: 100vh; display: grid; align-items: center; padding: 96px 0 48px; }
.story-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: center; }
.story-copy { position: relative; min-height: 220px; }
.story-copy .chapter { position: absolute; inset: 0; opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.story-copy .chapter.on { opacity: 1; transform: none; pointer-events: auto; }
.story-copy h2 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 12px; }
.story-copy .lead { font-size: 17px; }
.story-progress { display: flex; gap: 8px; margin-top: 28px; }
.story-progress span { flex: 1; height: 4px; border-radius: 3px; background: var(--line-warm); overflow: hidden; position: relative; }
.story-progress span::after { content: ""; position: absolute; inset: 0; background: var(--cta); transform: scaleX(var(--f, 0)); transform-origin: left; }
.stage { background: var(--ink); color: #fff; border-radius: 28px; padding: 28px; min-height: 460px; position: relative; overflow: hidden; }
.stage::before { content: ""; position: absolute; inset: -40%; background: radial-gradient(circle at 70% 20%, rgba(92,107,66,.35), transparent 45%), radial-gradient(circle at 20% 90%, rgba(42,85,96,.35), transparent 45%); transform: rotate(calc(var(--p, 0) * 40deg)); }
.stage > * { position: relative; }
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.7); }
.timer { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px; border-radius: 999px; background: var(--turn-bg); color: var(--turn-ink); font-variant-numeric: tabular-nums; transition: background .4s ease, color .4s ease; }
.timer.done { background: var(--ok-bg); color: var(--ok-ink); }
.mcard { margin-top: 18px; background: #fff; color: var(--ink); border-radius: 18px; padding: 20px; display: grid; gap: 14px; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.mcard .who { display: flex; align-items: center; gap: 14px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--olive-300); color: var(--olive-900); transition: background .5s ease, color .5s ease; }
.mcard .name { font-family: var(--font-display); font-size: 22px; line-height: 1.1; }
.mcard .sub { font-size: 13px; color: var(--muted); font-weight: 600; }
.name-anon, .name-real { display: block; transition: opacity .4s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.name-real { position: absolute; opacity: 0; transform: translateY(10px); }
.mcard.revealed .name-anon { opacity: 0; transform: translateY(-10px); position: absolute; }
.mcard.revealed .name-real { position: static; opacity: 1; transform: none; }
.mcard.revealed .avatar { background: var(--cta); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .pill { opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .4s ease, transform .5s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i, 0) * 120ms); }
.chips .pill.on { opacity: 1; transform: none; }
.lockline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; max-height: 60px; overflow: hidden; transition: opacity .4s ease, max-height .4s ease, margin .4s ease; }
.mcard.revealed .lockline { max-height: 0; margin-top: -14px; }
.lockline .lock { width: 18px; height: 18px; border-radius: 5px; background: var(--line-soft); display: grid; place-items: center; font-size: 11px; }
.msg { max-width: 92%; background: var(--teal-100); color: var(--teal-900); border-radius: 16px 16px 16px 4px; padding: 0 14px; font-size: 14px; line-height: 1.5; opacity: 0; max-height: 0; margin-top: -14px; overflow: hidden; transform: translateY(10px); transition: opacity .4s ease, transform .5s cubic-bezier(.2,.8,.2,1), max-height .5s ease, padding .4s ease, margin .4s ease; }
.msg.on { opacity: 1; transform: none; max-height: 220px; padding: 12px 14px; margin-top: 0; }
.msg .who-said { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-700); margin-bottom: 4px; }
.msg .typed::after { content: "▍"; color: var(--teal); animation: mw-caret 1s steps(1) infinite; }
.msg.complete .typed::after { content: ""; }
@keyframes mw-caret { 50% { opacity: 0; } }
.sysline { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); opacity: 0; max-height: 0; margin-top: -14px; overflow: hidden; transition: opacity .4s ease, max-height .4s ease, margin .4s ease; }
.sysline.on { opacity: 1; max-height: 40px; margin-top: 0; }
.sysline b { color: var(--ok-ink); background: var(--ok-bg); padding: 3px 10px; border-radius: 999px; }
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.stages div { font-size: 11px; font-weight: 700; text-align: center; padding: 10px 4px 8px; border-radius: 10px; background: var(--bg); color: var(--faint); position: relative; transition: background .4s ease, color .4s ease, transform .4s ease; }
.stages div::before { content: ""; display: block; height: 4px; border-radius: 3px; background: var(--line-soft); margin: 0 auto 8px; width: 80%; transition: background .4s ease; }
.stages div.on { background: var(--olive-100); color: var(--olive-900); }
.stages div.on::before { background: var(--olive); }
.stages div.now { transform: translateY(-3px); background: var(--olive); color: #fff; }
.stages div.now::before { background: #fff; }
.story-hint { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 18px; opacity: .8; }
@media (max-width: 960px) {
  .story { height: 380vh; }
  .story-grid { grid-template-columns: 1fr; gap: 20px; }
  .story-copy { min-height: 136px; }
  .story-copy h2 { font-size: 24px; margin-bottom: 8px; }
  .story-copy .lead { font-size: 15px; }
  .story-progress { margin-top: 16px; }
  .story-hint { margin-top: 10px; }
  .mcard { padding: 16px; gap: 12px; }
  .mcard .name { font-size: 20px; }
  .stage { min-height: 0; padding: 20px; }
  .story-pin { padding-top: 84px; }
}

/* ---------- from → to dots ---------- */
.dots-wrap { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 24px; padding: 24px; }
.dots { display: grid; grid-template-columns: repeat(20, 1fr); gap: 6px; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: var(--line); display: block; transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1), background .5s ease; }
.dots i.off { opacity: .12; transform: scale(.55); }
.dots i.keep { background: var(--cta); transform: scale(1.5); z-index: 1; }
.dots i.keep.k1 { background: var(--olive); } .dots i.keep.k2 { background: var(--teal); } .dots i.keep.k4 { background: var(--olive-300); } .dots i.keep.k5 { background: var(--teal-300); }
.dots-legend { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.dots-legend b { color: var(--ink); }
.compare li { opacity: 0; transform: translateX(-10px); transition: opacity .5s ease, transform .5s ease; transition-delay: calc(var(--i, 0) * 110ms); }
.compare.in li { opacity: 1; transform: none; }

/* ---------- how it works autoplay ---------- */
.steps-auto .card { position: relative; overflow: hidden; }
.steps-auto .card .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--line-soft); }
.steps-auto .card .bar::after { content: ""; position: absolute; inset: 0; background: var(--cta); transform-origin: left; transform: scaleX(0); }
.steps-auto .card.active { border-color: var(--cta); transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgba(42,34,40,.35); }
.steps-auto .card.active .bar::after { animation: mw-bar var(--dur, 3.2s) linear forwards; }
.steps-auto.paused .card.active .bar::after { animation-play-state: paused; }
@keyframes mw-bar { to { transform: scaleX(1); } }

/* ---------- count-up ---------- */
[data-count] { font-variant-numeric: tabular-nums; }

/* ---------- 72h ring (professionals page) ---------- */
.ring-anim circle.fill { stroke-dasharray: 880; stroke-dashoffset: 880; transition: stroke-dashoffset 1.6s cubic-bezier(.2,.7,.2,1); }
.ring-anim.in circle.fill { stroke-dashoffset: 220; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  [data-reveal], .hero .lead, .hero .actions, .hero-scene, .hero h1 .w > span, .chips .pill, .msg, .sysline, .story-copy .chapter, .compare li { opacity: 1 !important; transform: none !important; }
  .hero-bg { display: none; }
  .story { height: auto; }
  .story-pin { position: static; min-height: 0; }
  .story-copy .chapter { position: static; }
  .story-copy .chapter:not(:first-child) { display: none; }
}
