/* Motion layer, loaded after style.css. Movement is slow and short-distance; everything that moves on its own
   sits inside prefers-reduced-motion:no-preference. Classes prefixed dy- here are added by motion.js. */

/* ---- sticky header ---- */
body>header.dy-sticky{position:sticky;top:calc(var(--wp-admin--admin-bar--height,0px) - var(--dy-head-cut,0px));z-index:60}
@media (max-width:600px){body.admin-bar>header.dy-sticky{top:calc(0px - var(--dy-head-cut,0px))}}
html{scroll-padding-top:var(--dy-head-h,0px)}
.dy-sticky .pro-inner{transform:translateY(calc(var(--dy-head-p,0) * var(--dy-head-cut,0px) / 2))}
.dy-sticky .pro-brand{transform:scale(calc(1 - var(--dy-head-p,0) * .12));transform-origin:left center}
.dy-sticky .pro-header{transition:box-shadow .5s}
.dy-sticky.is-condensed .pro-header{box-shadow:0 10px 28px rgb(0 0 0 / .2)}
/* Home: the header overlaps the title area and stays transparent until the page scrolls (or the menu opens). */
body.home>header.dy-sticky{margin-bottom:calc(0px - var(--dy-head-full,0px))}
body.home>header.dy-sticky+#main-content .brand-intro{padding-top:calc(72px + var(--dy-head-full,0px))}
@media (max-width:767px){body.home>header.dy-sticky+#main-content .brand-intro{padding-top:calc(48px + var(--dy-head-full,0px))}}
body.home .dy-sticky .pro-header{transition:background-color .5s,border-color .5s,box-shadow .5s}
body.home .dy-sticky:not(.is-condensed) .pro-header{background:transparent;border-bottom-color:transparent}
body.home .dy-sticky:not(.is-condensed):has(#mobile-nav:not([hidden])) .pro-header{background:var(--n-bg)}
/* The title area is light (2026-11-12). Where the header cannot be the glass that turns ink over light sections (no
   backdrop-filter, or reduced transparency), it stays solid navy there instead of clear. */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){body.home .dy-sticky:not(.is-condensed) .pro-header{background:var(--n-bg)}}
@media (prefers-reduced-transparency:reduce){body.home .dy-sticky:not(.is-condensed) .pro-header{background:var(--n-bg)}}
/* Frosted glass (2026-10-17): wherever something passes under the header, it is clear glass that blurs it and takes
   its colour. Over light sections motion.js adds is-light and the text turns ink; with the phone menu open the header
   is solid. Without backdrop-filter, or with reduced transparency, it stays solid navy. */
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
 body .dy-sticky .pro-header{transition:background-color .45s,border-color .45s,box-shadow .45s,color .45s}
 body .dy-sticky .pro-header :is(a,small,strong){transition:color .45s,border-color .45s,background-color .3s}
 body .dy-sticky .pro-brand img{transition:filter .45s}
 body:not(.home) .dy-sticky .pro-header,body .dy-sticky.is-condensed .pro-header{background:transparent;-webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5);border-bottom-color:rgb(255 255 255 / .1)}
 body .dy-sticky.is-condensed .pro-header{box-shadow:0 8px 24px rgb(0 0 0 / .1),inset 0 1px 0 rgb(255 255 255 / .08)}
 body .dy-sticky:has(#mobile-nav:not([hidden])) .pro-header{background:rgb(17 29 37 / .96)}
 body .dy-sticky.is-light:not(:has(#mobile-nav:not([hidden]))) .pro-header{--dy-nav-line:var(--n-gold-d);color:var(--n-ink);border-bottom-color:rgb(29 44 53 / .08);box-shadow:0 8px 24px rgb(60 50 30 / .08),inset 0 1px 0 rgb(255 255 255 / .45)}
 body .dy-sticky.is-light:not(:has(#mobile-nav:not([hidden]))) .pro-header .pro-inner>nav a{color:var(--n-ink)}
 body .dy-sticky.is-light:not(:has(#mobile-nav:not([hidden]))) .pro-header .pro-inner>nav a:hover{color:var(--n-gold-d)}
 body .dy-sticky.is-light:not(:has(#mobile-nav:not([hidden]))) .pro-header .pro-brand img{filter:brightness(0) invert(.13)}
 body .dy-sticky.is-light:not(:has(#mobile-nav:not([hidden]))) .pro-header .pro-brand small{color:var(--n-gold-d)}
 body .dy-sticky.is-light:not(:has(#mobile-nav:not([hidden]))) .pro-header .pro-brand strong{background-image:linear-gradient(90deg,var(--n-gold-d),rgb(110 90 48 / .25))}
 body .dy-sticky.is-light:not(:has(#mobile-nav:not([hidden]))) .pro-header .pro-contact{color:var(--n-ink);border-color:var(--n-gold-d)}
 body .dy-sticky.is-light:not(:has(#mobile-nav:not([hidden]))) .pro-header .pro-toggle{color:var(--n-ink);border-color:rgb(29 44 53 / .35)}
 body .dy-sticky.is-light:not(:has(#mobile-nav:not([hidden]))) .pro-header :focus-visible{outline-color:var(--n-gold-d)}
}
@media (prefers-reduced-transparency:reduce){
 body:not(.home) .dy-sticky .pro-header,body .dy-sticky.is-condensed .pro-header{background:var(--n-bg);-webkit-backdrop-filter:none;backdrop-filter:none}
}

/* ---- hover details ---- */
body .pro-inner>nav a{background:linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;background-origin:border-box;transition:background-size .45s cubic-bezier(.2,.65,.25,1),color .3s}
body .pro-inner>nav a:hover,body .pro-inner>nav a:focus-visible{background-size:100% 1px}
body .pro-header .pro-contact{transition:background-color .3s,color .3s}
.dy-arrow{display:inline-block;transition:transform .35s cubic-bezier(.2,.65,.25,1)}
a:hover .dy-arrow[data-dir=up]{transform:translate(3px,-3px)}
a:hover .dy-arrow[data-dir=right]{transform:translateX(4px)}
body .dy-journal-cover img{transition:transform 1.4s cubic-bezier(.2,.65,.25,1)}
body .dy-journal-card a:hover img{transform:scale(1.05)}
body .dy-journal-card h2{transition:color .35s}

/* ---- mobile hotline ---- */
.dy-callbar{display:none}
@media (max-width:850px){
.dy-callbar{position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));z-index:55;display:flex;align-items:center;gap:12px;padding:12px 18px;min-height:56px;box-sizing:border-box;background:var(--n-bg2);color:var(--n-ivory);border:1px solid var(--n-gold);border-radius:2px;box-shadow:0 12px 32px rgb(0 0 0 / .45);transform:translateY(calc(100% + 32px));transition:transform .6s cubic-bezier(.2,.65,.25,1)}
.dy-callbar.is-shown{transform:none}
.dy-callbar:focus-visible{outline:2px solid var(--n-gold);outline-offset:3px}
.dy-callbar-icon{width:22px;height:22px;flex-shrink:0;fill:none;stroke:var(--n-gold);stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round}
.dy-callbar-label{font-size:13px;letter-spacing:.16em;color:var(--n-gold)}
.dy-callbar-number{margin-left:auto;font:500 20px/1.2 var(--n-serif);letter-spacing:.04em;white-space:nowrap}}

/* ---- service-step timeline (static layout also used when motion is reduced) ---- */
.dy-process ol.dy-timeline{--dy-tl-pad:44px;--dy-tl-x:8px;position:relative;padding-left:var(--dy-tl-pad)}
.dy-timeline::before,.dy-timeline::after{content:"";position:absolute;left:var(--dy-tl-x);top:var(--dy-tl-start,0);width:1px;height:var(--dy-tl-len,0);background:var(--n-line);pointer-events:none}
.dy-timeline::after{background:var(--n-gold);transform:scaleY(var(--dy-tl-p,0));transform-origin:top}
.dy-timeline>li{position:relative}
.dy-timeline>li::before{content:"";position:absolute;left:calc(var(--dy-tl-x) - var(--dy-tl-pad) - 4px);top:calc(var(--dy-dot-y,2em) - 4.5px);width:9px;height:9px;box-sizing:border-box;border-radius:50%;border:1px solid var(--n-line);background:var(--n-bg);transition:background-color .5s,border-color .5s,box-shadow .5s}
.dy-timeline>li.is-active::before{background:var(--n-gold);border-color:var(--n-gold);box-shadow:0 0 0 5px rgb(217 187 126 / .14)}
.dy-timeline .dy-step-number{align-self:start;transition:color .5s}
.dy-timeline>li:not(.is-active) .dy-step-number{color:var(--n-line)}
@media (max-width:600px){.dy-process ol.dy-timeline{--dy-tl-pad:26px;--dy-tl-x:4px}}

@media (prefers-reduced-motion:no-preference){
/* Home opening (2026-11-12): the passage and the 「為什麼要選擇鼎佑人本？」 link are there from the first paint; only
   「以禮為本　因地制宜」 moves, both lines together out of a soft blur over 1.5 s, evenly (slow at both ends). Once per
   session (a new tab plays it again). */
html:not(.dy-intro-seen) .brand-intro h1{animation:dy-emerge 1.5s cubic-bezier(.45,.05,.4,1) .3s both}

/* Inner-page titles rise on arrival; they are on screen from the first paint, so this needs no script. */
body:not(.home) .breadcrumb-section .elementor-widget{animation:dy-fade .8s ease both}
body:not(.home) .inner-hero .elementor-widget{animation:dy-rise 1s cubic-bezier(.2,.65,.25,1) .1s both}
body:not(.home) .inner-hero .elementor-widget:nth-child(2){animation-delay:.22s}
body:not(.home) .inner-hero .elementor-widget:nth-child(3){animation-delay:.34s}
body:not(.home) .inner-hero .elementor-widget:nth-child(n+4){animation-delay:.46s}

/* Scroll reveal: content below the first screen fades up as it arrives; motion.js removes the classes afterwards. */
body .dy-reveal{opacity:0;transform:translate3d(0,22px,0)}
body .dy-reveal.is-in{opacity:1;transform:none;transition:opacity .9s cubic-bezier(.2,.65,.25,1) var(--dy-delay,0ms),transform 1.1s cubic-bezier(.2,.65,.25,1) var(--dy-delay,0ms)}
body img.dy-reveal{transform:scale(1.025)}
body img.dy-reveal.is-in{transform:none;transition:opacity 1.2s ease var(--dy-delay,0ms),transform 1.8s cubic-bezier(.2,.65,.25,1) var(--dy-delay,0ms)}
body .elementor-widget-image.dy-reveal{overflow:hidden}
body .elementor-widget-image.dy-reveal img,body .dy-journal-card.dy-reveal img{transform:scale(1.06)}
body .elementor-widget-image.dy-reveal.is-in img,body .dy-journal-card.dy-reveal.is-in img{transform:none;transition:transform 1.8s cubic-bezier(.2,.65,.25,1) var(--dy-delay,0ms)}
/* A top rule is drawn left to right in place of the element's own border. */
.dy-rel{position:relative}
body .dy-line.dy-reveal{border-top-color:transparent!important}
body .dy-line.dy-reveal::after{content:"";position:absolute;left:0;right:0;top:calc(0px - var(--dy-line-w,1px));height:var(--dy-line-w,1px);background:var(--dy-line-color,currentColor);transform:scaleX(0);transform-origin:left;pointer-events:none}
body .dy-line.dy-reveal.is-in::after{transform:none;transition:transform 1.3s cubic-bezier(.65,0,.35,1) var(--dy-delay,0ms)}
/* Line icons draw their own strokes (pathLength=1). The gap is longer than the dash and the start offset overshoots
   slightly, so the rounded line caps do not show as dots before drawing begins. */
body .dy-reveal .dy-line-icon svg *{stroke-dasharray:1 2;stroke-dashoffset:1.05}
body .dy-reveal.is-in .dy-line-icon svg *{stroke-dashoffset:0;transition:stroke-dashoffset 1.8s cubic-bezier(.4,0,.2,1) calc(var(--dy-delay,0ms) + .25s)}

body .dy-reviews:not(.dy-reviews--list) .dy-review-slide{animation:dy-slide-in .9s cubic-bezier(.2,.65,.25,1)}
.pro-header #mobile-nav:not([hidden]){animation:dy-menu-in .4s cubic-bezier(.2,.65,.25,1)}
@supports (interpolate-size:allow-keywords){
.dy-shared-faq details{interpolate-size:allow-keywords}
.dy-shared-faq details::details-content{block-size:0;overflow:hidden;transition:block-size .5s cubic-bezier(.2,.65,.25,1),content-visibility .5s allow-discrete}
.dy-shared-faq details[open]::details-content{block-size:auto}}
}

@keyframes dy-emerge{from{opacity:0;filter:blur(12px);transform:translateY(.1em)}to{opacity:1;filter:blur(0);transform:none}}
@keyframes dy-rise{from{opacity:0;transform:translateY(18px)}}
@keyframes dy-fade{from{opacity:0}}
@keyframes dy-draw-x{from{transform:scaleX(0)}}
@keyframes dy-slide-in{from{opacity:0;transform:translateY(10px)}}
@keyframes dy-menu-in{from{opacity:0;transform:translateY(-8px)}}
@media print{body .dy-reveal{opacity:1!important;transform:none!important}
.dy-callbar{display:none!important}}
