/* ==========================================================================
   SATYAM — motion.css (TASK-12). Loaded on every page AFTER base.css and the page css,
   together with assets/js/motion.js. Motion-library feel without a library:
     · pressables: whileHover scale ↑ / whileTap scale ↓ on a spring
     · entrances:  fade + rise when scrolled into view (motion.js, WAAPI), staggered per batch

   TOKENS
     --spring / --spring-dur              hover spring (k 420, c 17, m 1 → ζ .41, 24 % overshoot, 720 ms)
     --spring-snappy / --spring-snappy-dur press spring (k 600, c 30 → ζ .61, 9 % overshoot, 400 ms)
     --reveal-ease / --reveal-dur / --reveal-y   entrance (expo-out, 650 ms, 20 px)
     linear() curves are sampled from the analytic damped-spring step response; browsers
     without linear() get a cubic-bezier overshoot.
   PER-ELEMENT KNOBS
     --hover-scale (default 1.05)   --tap-scale (default .96)
   Scaling uses the individual `scale` property (and reveals use `translate`), so neither
   ever overrides an element's own `transform`. Hover only on (hover: hover) and
   (pointer: fine); press also on touch (motion.js enables :active on iOS).
   Everything lives under prefers-reduced-motion: no-preference.
   ========================================================================== */

:root {
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --spring-dur: .55s;
  --spring-snappy: cubic-bezier(.34, 1.36, .64, 1);
  --spring-snappy-dur: .35s;
  --reveal-ease: cubic-bezier(.16, 1, .3, 1);
  --reveal-dur: .65s;
  --reveal-y: 20px;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.029, 0.105, 0.217, 0.351, 0.497, 0.643, 0.781, 0.906, 1.013, 1.099, 1.164, 1.208, 1.232, 1.239, 1.231, 1.212, 1.185, 1.153, 1.118, 1.083, 1.05, 1.021, 0.996, 0.975, 0.96, 0.95, 0.944, 0.943, 0.945, 0.95, 0.956, 0.964, 0.972, 0.981, 0.988, 0.995, 1.001, 1.006, 1.01, 1.012, 1.013, 1.014, 1.013, 1.012, 1.01, 1.008, 1.007, 1.005, 1.003, 1.001, 1, 0.998, 0.998, 0.997, 0.997, 0.997, 0.997, 0.997, 0.998, 1);
    --spring-dur: .72s;
    --spring-snappy: linear(0, 0.037, 0.131, 0.257, 0.398, 0.539, 0.67, 0.786, 0.881, 0.957, 1.013, 1.051, 1.075, 1.086, 1.087, 1.083, 1.073, 1.062, 1.049, 1.037, 1.026, 1.016, 1.008, 1.002, 0.998, 0.995, 0.993, 0.992, 0.992, 0.993, 0.994, 0.995, 0.996, 0.997, 1);
    --spring-snappy-dur: .4s;
  }
}

@media (prefers-reduced-motion: no-preference) {

  /* ---------- Pressables: transitions (existing ones kept + scale) ---------- */
  .btn, .pill, .chip, .dish-tag, .menu-filter, .nav__link, .locale__btn, .search__clear,
  .mobile-menu__locales .locale__option, .site-footer .footer__link--social,
  .branch-row, .dish--link, .mobile-menu__link {
    --press-dur: var(--spring-dur);
    --press-ease: var(--spring);
    -webkit-tap-highlight-color: transparent;
  }
  .btn { transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), scale var(--press-dur) var(--press-ease); }
  .btn:active { transform: none; } /* base.css nudges 1px down; the press scale replaces it */
  .pill { transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), scale var(--press-dur) var(--press-ease); }
  .chip { transition: background-color .2s var(--ease), box-shadow .2s var(--ease), scale var(--press-dur) var(--press-ease); }
  .dish-tag { transition: background-color .2s var(--ease), color .2s var(--ease), scale var(--press-dur) var(--press-ease); }
  .menu-filter { transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), scale var(--press-dur) var(--press-ease); }
  .nav__link { transition: color .2s var(--ease), background-size .25s var(--ease), scale var(--press-dur) var(--press-ease); }
  .locale__btn { transition: box-shadow .2s var(--ease), background-color .2s var(--ease), scale var(--press-dur) var(--press-ease); }
  .search__clear { transition: background-color .2s var(--ease), color .2s var(--ease), scale var(--press-dur) var(--press-ease); }
  .mobile-menu__locales .locale__option { transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), scale var(--press-dur) var(--press-ease); }
  .site-footer .footer__link--social { transition: color .2s var(--ease), scale var(--press-dur) var(--press-ease); }
  .mobile-menu__link { transition: scale var(--press-dur) var(--press-ease); transform-origin: 0 50%; }
  .branch-row { transition: background-color .25s var(--ease), box-shadow .25s var(--ease), scale var(--press-dur) var(--press-ease); }
  .dish--link { transition: scale var(--press-dur) var(--press-ease); }

  /* sizes: small controls grow more, wide rows / cards barely */
  .btn { --hover-scale: 1.04; }
  .btn--sm, .pill, .chip, .menu-filter, .locale__btn { --hover-scale: 1.05; }
  .btn--icon, .search__clear { --hover-scale: 1.1; --tap-scale: .92; }
  .dish-tag, .nav__link, .site-footer .footer__link--social { --hover-scale: 1.06; }
  .dish--link { --hover-scale: 1.02; --tap-scale: .985; }
  .branch-row { --hover-scale: 1.015; --tap-scale: .985; }
  .mobile-menu__link { --tap-scale: .97; }

  /* ---------- Hover (mouse / trackpad only) ---------- */
  @media (hover: hover) and (pointer: fine) {
    .btn:hover:not(:disabled), .pill:hover:not(:disabled), .chip:hover, .dish-tag:hover,
    .menu-filter:hover:not(:disabled), .nav__link:hover, .locale__btn:hover, .search__clear:hover,
    .mobile-menu__locales .locale__option:hover, .site-footer .footer__link--social:hover,
    .branch-row:hover, .dish--link:hover {
      scale: var(--hover-scale, 1.05);
    }
    /* rows read as a card while lifted (same beige as the highlighted row) */
    .branch-row:hover:not(.is-highlight) { background: var(--surface); box-shadow: -12px 0 0 var(--surface), 12px 0 0 var(--surface); }
    .branch-row:hover { z-index: 2; }
    /* photos zoom inside their frame */
    .dish--link:hover .dish__photo, .menu-item:hover .menu-item__thumb, .dishes .dish:hover .dish__img { scale: 1.06; }
  }

  /* ---------- Press (all pointers) ---------- */
  .btn:active:not(:disabled), .pill:active:not(:disabled), .chip:active, .dish-tag:active,
  .menu-filter:active:not(:disabled), .nav__link:active, .locale__btn:active, .search__clear:active,
  .mobile-menu__locales .locale__option:active, .site-footer .footer__link--social:active,
  .branch-row:active, .dish--link:active, .mobile-menu__link:active {
    scale: var(--tap-scale, .96);
    --press-dur: var(--spring-snappy-dur);
    --press-ease: var(--spring-snappy);
  }
  /* pressing the round navigate button inside a row must not also squash the row */
  .branch-row:has(.branch-row__nav:active) { scale: var(--hover-scale); }

  /* photo zoom frames */
  .dish__photo, .menu-item__thumb, .dishes .dish__img { transition: scale var(--spring-dur) var(--spring); }

  /* map pins (map.js scales them on hover/open with transform) → spring */
  .satyam-map-pin { transition: transform var(--spring-dur) var(--spring); }
  .satyam-map-pin:active { transform: translateX(-50%) scale(.94); transition-duration: var(--spring-snappy-dur); transition-timing-function: var(--spring-snappy); }

  /* ---------- Locale dropdown + mobile menu: springy open ---------- */
  .locale__menu:not([hidden]) { transform-origin: 85% 0; animation: motion-pop var(--spring-snappy-dur) var(--spring-snappy) both; }
  @keyframes motion-pop { from { opacity: 0; scale: .92; translate: 0 -6px; } 40% { opacity: 1; } }

  .mobile-menu.is-open .mobile-menu__links li,
  .mobile-menu.is-open .mobile-menu__inner > div {
    animation: motion-menu-in .55s var(--reveal-ease) both;
  }
  .mobile-menu.is-open .mobile-menu__links li:nth-child(2) { animation-delay: .04s; }
  .mobile-menu.is-open .mobile-menu__links li:nth-child(3) { animation-delay: .08s; }
  .mobile-menu.is-open .mobile-menu__inner > div:nth-child(2) { animation-delay: .12s; }
  .mobile-menu.is-open .mobile-menu__inner > div:nth-child(3) { animation-delay: .16s; }
  @keyframes motion-menu-in { from { opacity: 0; translate: 0 14px; } }

  /* ---------- Hero photos settle (CSS only; content is never hidden) ---------- */
  .hero__bg, .page-hero__bg, .branch-hero__bg { animation: motion-settle 1.6s var(--reveal-ease) both; }
  @keyframes motion-settle { from { scale: 1.06; } }

  /* ---------- Entrances (motion.js) ----------
     Only elements that are entirely below the viewport when motion.js prepares them get
     .reveal-pending, and only while html.has-motion is set (JS on). motion.js removes the
     class and plays the fade-up with the Web Animations API when they scroll into view. */
  .has-motion .reveal-pending { opacity: 0; translate: 0 var(--reveal-y); }
}

@media print {
  .reveal-pending { opacity: 1 !important; translate: none !important; }
}
