/* Salty Babe motion layer. Quiet, photographic movement only: soft fades, short rises, slow settles.
   Nothing here changes colour, type, spacing or layout. Only opacity, translate and scale move, using the
   individual `translate` / `scale` properties so existing transforms are never overwritten.
   Everything sits behind `html.motion`, which assets/motion.js adds only when the visitor has not asked for
   reduced motion; without it (or without JavaScript) the site is exactly the static one. */

@media screen and (prefers-reduced-motion:no-preference){
 html.motion{--sb-ease:cubic-bezier(.16,1,.3,1);--sb-soft:cubic-bezier(.33,.1,.2,1)}

 @keyframes sb-rise{from{opacity:0;translate:0 14px}}
 @keyframes sb-rise-lg{from{opacity:0;translate:0 24px}}
 @keyframes sb-fade{from{opacity:0}}
 @keyframes sb-develop{from{scale:1.06}}
 @keyframes sb-settle-desktop{from{transform:translate(calc(0% - var(--hero-subject-x)),-50%) scale(1.07)}}
 @keyframes sb-settle-mobile{from{transform:scale(1.07)}}
 @keyframes sb-bob{50%{translate:0 5px}}
 @keyframes sb-drop{from{opacity:0;translate:0 -8px}}
 @keyframes sb-tick{from{opacity:0;translate:0 5px}}

 /* ---------- First visit: the header arrives, then the hero ---------- */
 html.motion.intro .header-brand{animation:sb-rise 1.2s var(--sb-ease) .1s backwards}
 html.motion.intro :is(.tagline,.social-links){animation:sb-fade 1.4s ease .5s backwards}
 html.motion.intro :is(.site-nav>div,.mobile-nav){animation:sb-fade 1.2s ease .6s backwards}

 /* ---------- Hero: the photograph settles, then the words surface ---------- */
 html.motion .hero-photo{animation:sb-fade 1.5s ease-out backwards}
 html.motion .hero h1{animation:sb-rise-lg 1.3s var(--sb-ease) .6s backwards}
 html.motion .hero-copy>p{animation:sb-rise-lg 1.3s var(--sb-ease) .85s backwards}
 html.motion .dive-arrow{animation:sb-rise 1.2s var(--sb-ease) 1.15s backwards}
 html.motion .dive-arrow img{animation:sb-bob 3.4s ease-in-out 2.6s infinite}
 @media(min-width:768px){
  html.motion .hero-photo{animation:sb-fade 1.5s ease-out backwards,sb-settle-desktop 3.2s var(--sb-ease) backwards}
 }
 @media(max-width:767px){
  html.motion .hero-photo{animation:sb-fade 1.5s ease-out backwards,sb-settle-mobile 3.2s var(--sb-ease) backwards}
 }
 /* As the visitor scrolls away, the words drift up and fade; on wide screens the photograph trails slightly. */
 html.motion .hero :is(h1,.hero-copy>p,.dive-arrow){translate:0 calc(var(--hp,0) * -26px);opacity:calc(1 - var(--hp,0))}
 @media(min-width:768px){
  html.motion .hero-photo{translate:0 calc(var(--hp,0) * 12px)}
 }

 /* ---------- Scroll reveals ----------
    Keep this list in step with REVEAL in assets/motion.js. */
 html.motion:not(.reveal-all) :is(
  #preset-packages .element,
  #print-shop-gallery-to-darkroom .element,
  #saltybabe-contact .element,
  .instagram-strip .gallery-photo,
  #saltybabe-footer-1 .canvas,
  .product-photo,
  .product-summary h1,
  .product-description,
  .product-buy,
  .print-toolbar,
  .print-artwork h1,
  .print-preview,
  .print-field,
  .print-add,
  .print-details details,
  .contact-intro h1,
  .contact-intro p,
  .contact-field,
  .contact-send,
  .contact-details
 ):not(.in){opacity:0;translate:0 14px}
 html.motion .in{animation:sb-rise 1.05s var(--sb-ease) var(--d,0ms) backwards}
 html.motion .in.now{animation:none}
 /* Photographs develop: the frame fades up while the picture settles from a touch larger. */
 html.motion :is(.element.image,.gallery-photo,.product-photo,.print-preview){overflow:clip}
 html.motion .in:is(.element.image,.gallery-photo,.product-photo,.print-preview) img{animation:sb-develop 1.9s var(--sb-ease) var(--d,0ms) backwards}
 html.motion .in.now img{animation:none}
 /* The two curved section labels are artwork, not photographs: they only fade and rise. */
 html.motion :is(#preset-packages-8,#print-shop-gallery-to-darkroom-3) img{animation:none!important}
 /* A translated last element must not lengthen the page while it waits to arrive. */
 html.motion footer{overflow:clip}

 /* ---------- Page to page ---------- */
 html.motion :is(main,footer){transition:opacity .26s ease}
 html.motion.leaving :is(main,footer){opacity:0}

 /* ---------- Phone menu ---------- */
 html.motion .mobile-menu[open] .mobile-menu-links{animation:sb-drop .42s var(--sb-ease)}
 html.motion .mobile-menu[open] .mobile-menu-links a{animation:sb-rise .5s var(--sb-ease) backwards}
 html.motion .mobile-menu[open] .mobile-menu-links a:nth-child(2){animation-delay:.05s}
 html.motion .mobile-menu[open] .mobile-menu-links a:nth-child(3){animation-delay:.1s}
 html.motion .mobile-menu[open] .mobile-menu-links a:nth-child(4){animation-delay:.15s}

 /* ---------- Messages that appear on the print and contact pages ---------- */
 html.motion :is(.print-status,.contact-status):not([hidden]){animation:sb-rise .55s var(--sb-ease)}
 html.motion .print-price.tick{animation:sb-tick .5s var(--sb-ease)}
 html.motion .print-details details.touched[open]>:not(summary){animation:sb-rise .55s var(--sb-ease)}

 /* ---------- Hover and focus (mouse and trackpad only) ---------- */
 @media(hover:hover) and (pointer:fine){
  /* Navigation: a thin line draws under the link. */
  html.motion .site-nav a{position:relative}
  html.motion .site-nav a::after{content:'';position:absolute;left:0;right:3.3px;top:calc(50% + 11px);height:1px;background:currentColor;transform:scaleX(0);transform-origin:right;transition:transform .55s var(--sb-ease)}
  html.motion .site-nav a:is(:hover,:focus-visible)::after{transform:scaleX(1);transform-origin:left}

  /* Social icons lift slightly. */
  html.motion .social-links a{transition:translate .45s var(--sb-ease),opacity .3s ease}
  html.motion .social-links a:hover{translate:0 -2px}

  /* Gallery photographs: a slow push-in inside the frame. */
  html.motion .element.image[href] img,html.motion .gallery-photo img{transition:scale 1.4s var(--sb-ease)}
  html.motion .element.image[href]:hover img{scale:1.045}
  html.motion .gallery-photo:hover img{scale:1.04}

  /* Buttons: a small lift, settling on press. The existing hover colour is untouched. */
  html.motion .element.button{transition:translate .4s var(--sb-ease),box-shadow .4s ease,opacity .3s ease,background-color .3s ease,border-color .3s ease}
  html.motion .element.button:not(:disabled):hover{translate:0 -2px;box-shadow:0 10px 20px -12px #1c1e2366}
  html.motion .element.button:not(:disabled):active{translate:0 0;box-shadow:none;transition-duration:.12s}

  /* Print page */
  html.motion .print-back span{display:inline-block;transition:translate .45s var(--sb-ease)}
  html.motion .print-back:hover span{translate:-4px 0}
  html.motion .print-field select{transition:border-color .3s ease}
  html.motion .print-field select:hover{border-color:#909683}
  html.motion .print-units label{transition:background-color .3s ease,border-color .3s ease,color .3s ease}
 }

 /* ---------- Contact form: the field line fills in on focus ---------- */
 html.motion .contact-field :is(input,select,textarea){transition:border-color .35s ease,box-shadow .35s ease}
 html.motion .contact-field :is(input,select):focus{border-bottom-color:#52645c;box-shadow:0 1px 0 #52645c}
 html.motion .contact-field textarea:focus{border-color:#52645c}
}
