/* Site Studio Mobile Experience — mobile only (<= 760px). Desktop untouched. */
@media (max-width: 760px) {
  body.ssm-on {
    -webkit-tap-highlight-color: transparent;
    --ssm-accent: var(--red, #c63729);
    --ssm-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ssm-lift: 0px;
    --ssm-safe: env(safe-area-inset-bottom, 0px);
  }

  /* ---------- Sticky, frosted header ---------- */
  body.ssm-on.ssm-profile-atelier.ssm-sticky .atelier-header {
    position: sticky;
    top: var(--il-header-offset, 0px);
    z-index: 45;
    max-height: calc(100dvh - var(--il-header-offset, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: color-mix(in srgb, var(--atelier-page, #fff) 84%, transparent);
    -webkit-backdrop-filter: saturate(170%) blur(14px);
    backdrop-filter: saturate(170%) blur(14px);
    transition: box-shadow 0.3s var(--ssm-ease);
  }
  body.ssm-on.ssm-profile-editorial.ssm-sticky .site-header {
    background: color-mix(in srgb, var(--paper, #fff) 86%, transparent);
    -webkit-backdrop-filter: saturate(170%) blur(14px);
    backdrop-filter: saturate(170%) blur(14px);
  }
  body.ssm-on.ssm-scrolled .atelier-header,
  body.ssm-on.ssm-scrolled .site-header {
    box-shadow: 0 8px 24px -14px rgba(0, 0, 0, 0.35);
  }

  /* ---------- Reading progress ---------- */
  .ssm-progress {
    position: fixed;
    top: var(--il-header-offset, 0px);
    left: 0;
    right: 0;
    height: 3px;
    z-index: 70;
    pointer-events: none;
    background: transparent;
  }
  .ssm-progress > i {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--ssm-accent);
    transform: scaleX(var(--ssm-p, 0));
    transform-origin: left;
    transition: transform 0.1s linear;
  }

  /* ---------- Share button ---------- */
  .ssm-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 14px;
    padding: 10px 18px;
    border: 1.5px solid color-mix(in srgb, var(--ink, #222) 18%, transparent);
    border-radius: 999px;
    background: transparent;
    color: var(--ink, #222);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s var(--ssm-ease);
  }
  .ssm-share:active { transform: scale(0.97); background: color-mix(in srgb, var(--ink, #222) 7%, transparent); }

  /* ---------- Touch comfort ---------- */
  body.ssm-on .site-footer a,
  body.ssm-on .atelier-footer a {
    display: inline-block;
    padding-block: 8px;
  }
  body.ssm-on .story-card,
  body.ssm-on .review-card,
  body.ssm-on .atelier-service {
    transition: background-color 0.2s ease;
  }
  body.ssm-on .story-card:active,
  body.ssm-on .review-card:active {
    background: color-mix(in srgb, var(--ink, #222) 4%, transparent);
  }
  body.ssm-on img { -webkit-touch-callout: none; }

  /* ---------- Scroll reveal ---------- */
  html.ssm-reveal-ready .ssm-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--ssm-ease), transform 0.6s var(--ssm-ease);
  }
  html.ssm-reveal-ready .ssm-reveal.is-visible { opacity: 1; transform: none; }

  /* ---------- Beauty: testimonials become a swipeable carousel ---------- */
  body.ssm-profile-atelier .atelier-testimonials {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 86%;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: -20px;
    padding: 4px 20px 14px;
    scroll-padding-inline: 20px;
  }
  body.ssm-profile-atelier .atelier-testimonials::-webkit-scrollbar { display: none; }
  body.ssm-profile-atelier .atelier-testimonials > figure {
    scroll-snap-align: start;
    padding: 22px 20px;
    border: 1px solid var(--atelier-border);
    border-radius: 20px;
    background: var(--atelier-soft, transparent);
  }

  /* ---------- Beauty: Book / Call action bar ---------- */
  .ssm-bar {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(10px + var(--ssm-safe));
    z-index: 60;
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--atelier-page, var(--paper, #ffffff)) 92%, transparent);
    border: 1px solid var(--atelier-border, color-mix(in srgb, var(--ink, #222) 16%, transparent));
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    box-shadow: 0 14px 36px -10px rgba(0, 0, 0, 0.38);
    transition: transform 0.4s var(--ssm-ease);
  }
  body.ssm-bar-hidden .ssm-bar { transform: translateY(150%); }
  .ssm-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .ssm-bar .ssm-bar-primary {
    flex: 1 1 auto;
    padding: 0 22px;
    background: var(--red, #c63729);
    color: var(--paper, #ffffff);
  }
  .ssm-bar .ssm-bar-call {
    flex: 0 0 auto;
    padding: 0 20px;
    background: color-mix(in srgb, var(--ink, #222) 10%, transparent);
    border: 1px solid var(--atelier-border, color-mix(in srgb, var(--ink, #222) 16%, transparent));
    color: var(--ink, #222);
  }
  .ssm-bar:has(> a:only-child) .ssm-bar-primary,
  .ssm-bar:has(> a:only-child) .ssm-bar-call { flex: 1 1 auto; }

  /* Reserve room and lift existing floating privacy/achievement controls above the bar */
  body.ssm-has-bar { --ssm-lift: 76px; padding-bottom: calc(76px + var(--ssm-safe)); }
  body.ssm-has-bar.ssm-bar-hidden { --ssm-lift: 0px; }
  body.ssm-has-bar .pa-mobile-controls,
  body.ssm-has-bar .il-privacy-launch {
    bottom: calc(var(--ssm-lift) + max(14px, env(safe-area-inset-bottom))) !important;
    transition: bottom 0.4s var(--ssm-ease);
  }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .ssm-bar, .ssm-progress > i, html.ssm-reveal-ready .ssm-reveal { transition: none !important; }
}
