/* V59 WOW EXPERIMENT — intentionally sparse, progressive enhancement over V58.1. */

/* Mobile continuation: V58 intentionally hid it; V59 makes it a compact touch target. */
@media (max-width:900px){
  body.project-page .v58-next-project{
    display:grid !important;
    grid-template-columns:58px minmax(0,1fr) 18px;
    gap:10px;
    width:min(100%,340px);
    min-height:62px;
    margin:18px 0 0;
    padding:7px 9px 7px 7px;
    border-color:rgba(201,152,77,.34);
    background:rgba(201,152,77,.025);
    -webkit-tap-highlight-color:transparent;
    touch-action:manipulation;
  }
  body.project-page .v58-next-project img{
    width:58px !important;
    height:44px !important;
  }
  body.project-page .v58-next-project small{font-size:7px !important;margin-bottom:4px}
  body.project-page .v58-next-project b{font-size:12px !important;line-height:1.16 !important}
  body.project-page .v58-next-project:active{transform:scale(.985);border-color:rgba(201,152,77,.7)}
}

/* WOW effects are desktop-first and never participate in layout. */
@media (min-width:901px) and (prefers-reduced-motion:no-preference){
  /* 1. Material light: a very soft grazing-light simulation, clipped to the photo. */
  .page-dentistry .material-photo{
    position:relative;
    isolation:isolate;
  }
  .page-dentistry .material-photo::after{
    content:"";
    position:absolute;
    inset:-8%;
    z-index:3;
    pointer-events:none;
    opacity:0;
    background:
      radial-gradient(ellipse 24% 78% at var(--v59-light-x,34%) 50%,rgba(255,243,213,.17),rgba(226,194,135,.06) 36%,transparent 72%);
    mix-blend-mode:screen;
    transition:opacity .55s ease,background-position .25s ease;
  }
  .page-dentistry .material-photo.v59-light-active::after{opacity:.82}

  /* 2. One golden reflection across the large home bear. JS positions the mask exactly over the image. */
  .page-home .hero-bear{position:relative}
  .v59-bear-glint{
    position:absolute;
    z-index:4;
    pointer-events:none;
    opacity:0;
    overflow:hidden;
    -webkit-mask:url("bear.png") center/contain no-repeat;
    mask:url("bear.png") center/contain no-repeat;
    background:linear-gradient(112deg,transparent 32%,rgba(255,244,203,0) 39%,rgba(255,244,203,.76) 49%,rgba(255,214,126,.24) 55%,transparent 65%);
    background-size:260% 100%;
    background-position:160% 0;
    filter:blur(.15px);
  }
  .v59-bear-glint.v59-glint-run{
    animation:v59BearGlint 1.45s cubic-bezier(.2,.64,.28,1) .18s 1 both;
  }
  @keyframes v59BearGlint{
    0%{opacity:0;background-position:160% 0}
    15%{opacity:.7}
    72%{opacity:.55}
    100%{opacity:0;background-position:-70% 0}
  }

  /* 3. Rostselmash process montage: the existing composition enters in sequence, then stays still. */
  body.v59-ready.page-rostselmash .process-gallery > figure,
  body.v59-ready.page-rostselmash .process-gallery > aside{
    opacity:0;
    transform:translate3d(0,18px,0) scale(.992);
  }
  body.v59-ready.page-rostselmash .process.v59-process-enter .process-gallery > figure,
  body.v59-ready.page-rostselmash .process.v59-process-enter .process-gallery > aside{
    animation:v59ProcessPanel .68s cubic-bezier(.16,.76,.24,1) forwards;
  }
  body.v59-ready.page-rostselmash .process.v59-process-enter .process-gallery > .p1{animation-delay:.03s}
  body.v59-ready.page-rostselmash .process.v59-process-enter .process-gallery > .p2{animation-delay:.11s}
  body.v59-ready.page-rostselmash .process.v59-process-enter .process-gallery > .p3{animation-delay:.19s}
  body.v59-ready.page-rostselmash .process.v59-process-enter .process-gallery > aside{animation-delay:.27s}
  @keyframes v59ProcessPanel{to{opacity:1;transform:translate3d(0,0,0) scale(1)}}

  /* 4. One architectural reveal: the heritage photograph opens on a clean vertical boundary. */
  body.v59-ready.page-eparchy .heritage .heritage-bg{
    clip-path:inset(0 100% 0 0);
    transform:scale(1.018);
    transform-origin:left center;
  }
  body.v59-ready.page-eparchy .heritage.v59-arch-enter .heritage-bg{
    animation:v59ArchitecturalReveal .92s cubic-bezier(.18,.72,.22,1) forwards;
  }
  @keyframes v59ArchitecturalReveal{
    to{clip-path:inset(0 0 0 0);transform:scale(1)}
  }
}

@media (prefers-reduced-motion:reduce){
  .v59-bear-glint{display:none !important}
  .page-dentistry .material-photo::after{display:none !important}
  .page-rostselmash .process-gallery > figure,
  .page-rostselmash .process-gallery > aside{opacity:1 !important;transform:none !important;animation:none !important}
  .page-eparchy .heritage .heritage-bg{clip-path:none !important;transform:none !important;animation:none !important}
}
