/* CBR V12 Motion Premium — animations sobres, performantes et accessibles. */
:root{
  --motion-ease:cubic-bezier(.22,.7,.18,1);
  --motion-ease-soft:cubic-bezier(.2,.65,.25,1);
  --motion-gold:#b88940;
  --motion-navy:#0b1a2a;
}

/* Page entry + transition */
body.cbr-page{opacity:1;transition:opacity .20s ease,transform .20s var(--motion-ease)}
body.cbr-page.motion-boot{opacity:0;transform:translateY(5px)}
body.cbr-page.motion-ready{opacity:1;transform:none}
body.cbr-page.is-leaving{opacity:.08;transform:translateY(4px);pointer-events:none}

/* Fine scroll progress — discreet but gives the whole site a living rhythm. */
.cbr-scroll-progress{position:fixed;z-index:140;left:0;top:0;width:100%;height:2px;pointer-events:none;background:transparent}
.cbr-scroll-progress>span{display:block;width:100%;height:100%;background:linear-gradient(90deg,#8e682f,#e4c67f);transform:scaleX(0);transform-origin:left center;will-change:transform;box-shadow:0 0 10px rgba(184,137,64,.28)}

/* Header contracts smoothly after the first scroll. */
.cbr-unified .site-header{transition:background .28s ease,box-shadow .28s ease,border-color .28s ease}
.cbr-unified .site-header .header-inner{transition:min-height .30s var(--motion-ease),gap .30s var(--motion-ease)}
.cbr-unified .site-header .brand img{transition:width .30s var(--motion-ease),height .30s var(--motion-ease),flex-basis .30s var(--motion-ease),transform .30s var(--motion-ease)}
.cbr-unified .site-header .brand-name{transition:font-size .30s var(--motion-ease),opacity .25s ease}
.cbr-unified .site-header.is-scrolled{background:rgba(255,255,255,.94);box-shadow:0 12px 36px rgba(11,26,42,.08);border-bottom-color:rgba(16,23,34,.05)}
.cbr-unified .site-header.is-scrolled .header-inner{min-height:70px}
.cbr-unified .site-header.is-scrolled .brand img{width:50px;height:50px;flex-basis:50px;transform:rotate(-1deg)}
.cbr-unified .site-header.is-scrolled .brand-name{font-size:16px}
.cbr-unified .site-header .nav a{transition:color .22s ease,transform .22s var(--motion-ease)}
.cbr-unified .site-header .nav a:hover{transform:translateY(-1px);color:#8e682f}
.cbr-unified .site-header .nav a:after{transition:transform .34s var(--motion-ease)}
.cbr-unified .site-header .contact-cta{transition:background .25s ease,color .25s ease,transform .25s var(--motion-ease),box-shadow .25s ease}
.cbr-unified .site-header .contact-cta:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(11,26,42,.14)}

/* Shared hero: text comes in by layers; image remains sharp (object-position parallax, no scaling). */
.cbr-unified .cbr-hero__media img{transition:object-position .08s linear,opacity .6s ease;will-change:object-position}
.cbr-unified .cbr-hero__grid{opacity:.78;transition:opacity .8s ease}
.cbr-unified .cbr-hero:after{content:"";position:absolute;z-index:1;left:-32%;top:0;width:26%;height:100%;pointer-events:none;background:linear-gradient(100deg,transparent,rgba(210,173,105,.08),transparent);transform:skewX(-12deg);animation:cbrHeroSweep 9s ease-in-out infinite 1.2s}
@keyframes cbrHeroSweep{0%,72%{transform:translateX(0) skewX(-12deg);opacity:0}78%{opacity:1}100%{transform:translateX(560%) skewX(-12deg);opacity:0}}
.cbr-unified .cbr-hero__copy>*{opacity:1;transform:none;transition:opacity .68s ease,transform .72s var(--motion-ease)}
.cbr-unified.motion-boot .cbr-hero__copy>*{opacity:0;transform:translateY(18px)}
.cbr-unified.motion-ready .cbr-hero__copy>*{opacity:1;transform:none}
.cbr-unified.motion-ready .cbr-hero__copy>*:nth-child(1){transition-delay:.08s}
.cbr-unified.motion-ready .cbr-hero__copy>*:nth-child(2){transition-delay:.15s}
.cbr-unified.motion-ready .cbr-hero__copy>*:nth-child(3){transition-delay:.23s}
.cbr-unified.motion-ready .cbr-hero__copy>*:nth-child(4){transition-delay:.31s}
.cbr-unified.motion-ready .cbr-hero__copy>*:nth-child(5){transition-delay:.39s}
.cbr-unified .cbr-hero__eyebrow:before{transform-origin:left;transform:scaleX(.12);transition:transform .8s var(--motion-ease) .18s}
.cbr-unified.motion-ready .cbr-hero__eyebrow:before{transform:scaleX(1)}
.cbr-unified .cbr-hero-topics__inner>span{transition:color .25s ease,transform .25s var(--motion-ease)}
.cbr-unified .cbr-hero-topics__inner>span:hover{color:#8e682f;transform:translateY(-1px)}
.cbr-unified .cbr-hero-topics__inner>span:before{transition:transform .28s var(--motion-ease),background .28s ease}
.cbr-unified .cbr-hero-topics__inner>span:hover:before{transform:scale(1.8);background:#d2ad69}

/* Generic on-scroll reveal, added dynamically by JS. */
.motion-reveal{opacity:0;transform:translateY(22px);transition:opacity .72s ease,transform .78s var(--motion-ease);transition-delay:var(--motion-delay,0ms);will-change:opacity,transform}
.motion-reveal.from-left{transform:translateX(-24px)}
.motion-reveal.from-right{transform:translateX(24px)}
.motion-reveal.motion-visible{opacity:1;transform:none;will-change:auto}
.motion-line{position:relative}
.motion-line:after{content:"";position:absolute;left:0;bottom:-8px;width:min(86px,22%);height:2px;background:linear-gradient(90deg,#b88940,rgba(184,137,64,0));transform:scaleX(.12);transform-origin:left;transition:transform .9s var(--motion-ease) .15s}
.motion-line.motion-visible:after{transform:scaleX(1)}

/* Card language: depth without aggressive scaling. */
.feature,.metric,.commit,.expert-card,.case,.rse-card,.timeline-card,.project-link-card,.step,.proof,.contact-box,.copy-box,.visual,.project-showcase,.realisations-cta{
  transition:transform .32s var(--motion-ease),box-shadow .32s ease,border-color .32s ease,background-color .32s ease;
  transform-style:preserve-3d;
}
@media (hover:hover) and (pointer:fine){
  .feature:hover,.metric:hover,.commit:hover,.case:hover,.rse-card:hover,.timeline-card:hover,.project-link-card:hover,.step:hover,.proof:hover,.contact-box:hover{
    transform:translateY(-5px);
    box-shadow:0 20px 46px rgba(11,26,42,.10);
    border-color:rgba(184,137,64,.32);
  }
  .expert-card:hover{transform:translateY(-5px);box-shadow:0 22px 48px rgba(11,26,42,.18)}
  .project-link-card .discover{transition:transform .25s var(--motion-ease),color .25s ease}
  .project-link-card:hover .discover{transform:translateX(5px);color:#b88940}
}

/* Images stay crisp: no permanent zoom. The overlay provides movement/design instead. */
.editorial .visual,.realisations-cta>img,.project-link-card .preview,.project-showcase .project-cover,.timeline-card,.case{position:relative;overflow:hidden}
.editorial .visual:after,.project-link-card .preview:before,.project-showcase .project-cover:before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(115deg,transparent 35%,rgba(255,255,255,.16) 48%,transparent 62%);transform:translateX(-130%);transition:transform .9s var(--motion-ease)}
@media (hover:hover) and (pointer:fine){.editorial .visual:hover:after,.project-link-card:hover .preview:before,.project-showcase:hover .project-cover:before{transform:translateX(130%)}}

/* Buttons feel more tactile. */
.btn,.cbr-hero__button,.band a,.discover,.gallery-nav button,.enlarge-btn{transition:transform .25s var(--motion-ease),box-shadow .25s ease,background-color .25s ease,border-color .25s ease,color .25s ease}
@media (hover:hover) and (pointer:fine){
  .btn:hover,.cbr-hero__button:hover,.band a:hover,.enlarge-btn:hover{transform:translateY(-3px);box-shadow:0 12px 24px rgba(11,26,42,.14)}
  .gallery-nav button:hover{transform:scale(1.08);box-shadow:0 8px 26px rgba(0,0,0,.25)}
}

/* Gallery: polished stage transition and active thumb. */
.gallery-stage img{transition:opacity .22s ease,filter .32s ease}
.gallery-stage.is-switching img{opacity:.18;filter:saturate(.75)}
.gallery-thumb{transition:opacity .25s ease,transform .25s var(--motion-ease),border-color .25s ease}
.gallery-thumb.active{transform:translateY(-2px)}

/* Footer appears as a final scene rather than a static block. */
.site-footer .footer-grid>div{transition-delay:var(--motion-delay,0ms)}
.site-footer a{transition:color .22s ease,transform .22s var(--motion-ease)}
.site-footer a:hover{transform:translateX(3px)}

/* Premium visual pages (Froid / Clim): preserve exact bitmap sharpness. Animate the shell, not the image content. */
.premium-visual-page{position:relative}
.premium-visual-wrap{isolation:isolate}
.premium-visual-wrap>img{opacity:1;transition:opacity .65s ease;transform:none!important;filter:none!important}
.motion-boot .premium-visual-wrap>img{opacity:0}
.motion-ready .premium-visual-wrap>img{opacity:1}
.premium-visual-wrap:after{content:"";position:absolute;z-index:1;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent 0%,rgba(210,173,105,.045) 48%,transparent 54%);background-size:240% 100%;animation:premiumSheen 14s ease-in-out infinite 2s;mix-blend-mode:screen}
@keyframes premiumSheen{0%,75%{background-position:130% 0;opacity:0}82%{opacity:.7}100%{background-position:-130% 0;opacity:0}}
.premium-hotspot{transition:box-shadow .25s ease,background-color .25s ease,transform .25s var(--motion-ease)}
.premium-hotspot:hover{background:rgba(210,173,105,.055);box-shadow:0 0 0 2px rgba(210,173,105,.32);transform:translateY(-1px)}

/* Mobile: keep animation short and cheap. */
@media(max-width:760px){
  .cbr-unified .site-header.is-scrolled .header-inner{min-height:64px}
  .cbr-unified .site-header.is-scrolled .brand img{width:46px;height:46px;flex-basis:46px}
  .cbr-unified .site-header.is-scrolled .brand-name{font-size:14px}
  .motion-reveal,.motion-reveal.from-left,.motion-reveal.from-right{transform:translateY(14px);transition-duration:.52s}
  .cbr-unified .cbr-hero:after,.premium-visual-wrap:after{display:none}
}

/* Accessibility: no motion when the OS requests it. */
@media(prefers-reduced-motion:reduce){
  .cbr-scroll-progress{display:none}
  body.cbr-page,body.cbr-page.motion-boot,body.cbr-page.motion-ready,body.cbr-page.is-leaving{opacity:1!important;transform:none!important;transition:none!important}
  .motion-reveal,.motion-reveal.from-left,.motion-reveal.from-right{opacity:1!important;transform:none!important;transition:none!important}
  .cbr-unified .cbr-hero__copy>*{opacity:1!important;transform:none!important;transition:none!important}
  .cbr-unified .cbr-hero__eyebrow:before{transform:none!important;transition:none!important}
  .premium-visual-wrap>img{opacity:1!important;transition:none!important}
  .cbr-unified .cbr-hero:after,.premium-visual-wrap:after{display:none!important}
}
