/* ==========================================================================
   Unified Case Study Scroll Choreography (case-flow.css)
   1. Smooth Reading-Order Staggered Scroll Reveal (Zero Jitter, Sticky-Safe)
   2. MacBook Viewport Fit (100% Complete Exposure on 13"/14" MacBook)
   3. MacBook Live Iframe Anti-Hijack Click-to-Scroll Shield
   Note: Forward-only zero-overshoot smooth scroll & soft framing detents
   are handled in case-flow.js (zero CSS scroll-snap reverse bounce-back).
   ========================================================================== */

/* ---------- 1. Reading-Order Staggered Scroll Reveal ---------- */
html.cf-ready [data-cf-reveal] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 0.54s cubic-bezier(0.22, 1, 0.36, 1) var(--cf-delay, 0ms),
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1) var(--cf-delay, 0ms);
}

/* Sticky-ancestor safe variant (fade-only so position: sticky never breaks) */
html.cf-ready [data-cf-reveal="fade"] {
  transform: none;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1) var(--cf-delay, 0ms);
}

html.cf-ready [data-cf-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

html.cf-ready [data-cf-reveal].is-settled {
  transform: none;
}

/* ---------- 2. MacBook Viewport Height Fit (Complete Exposure on 13"/14" MacBook) ---------- */
.v3-macbook {
  width: min(100%, calc((100vh - 315px) * 1.6306)) !important;
  max-width: 1060px !important;
  min-width: min(100%, 640px);
  margin: 18px auto 8px !important;
}

@media (min-width: 1220px) and (min-height: 940px) {
  .v3-macbook {
    width: min(104%, calc((100vh - 305px) * 1.6306)) !important;
    max-width: 1080px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media (max-width: 780px) {
  .v3-macbook {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* ---------- 3. MacBook Live Iframe Anti-Hijack Scroll Shield ---------- */
.v3-mac-viewport {
  position: absolute;
}

.v3-macbook.is-live-active .id-live-landing,
.ob-view-home,
.ob-messages,
.ob-save-left,
.rn-hero-view,
.rn-es-body,
.demo-modal {
  overscroll-behavior-y: contain;
}

.pe-bench-scroll,
.ob-rail {
  overscroll-behavior-x: contain;
}

.v3-mac-viewport iframe {
  pointer-events: none;
}

.v3-macbook.is-live-active .v3-mac-viewport iframe {
  pointer-events: auto;
}

.v3-mac-bar {
  position: relative !important;
  z-index: 6 !important;
  flex: 0 0 auto !important;
  min-height: 28px !important;
  padding: 3px 13px !important;
  pointer-events: auto !important;
}

.v3-mac-shield {
  position: absolute;
  inset: 28px 0 0 0;
  z-index: 4;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 14px 16px;
  transition: background 0.24s ease, opacity 0.22s ease;
}

.v3-mac-shield:hover {
  background: rgba(20, 20, 24, 0.025);
}

.v3-mac-shield-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 20, 24, 0.84);
  color: #ffffff;
  font-size: 11.5px !important;
  font-weight: 500;
  letter-spacing: 0.01em;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(15, 20, 32, 0.18) !important;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.2s ease;
}

.v3-mac-shield:hover .v3-mac-shield-pill,
.v3-mac-shield:focus-visible .v3-mac-shield-pill {
  opacity: 0.96;
  background: rgba(20, 20, 24, 0.92);
  transform: translateY(0);
}

.v3-macbook.is-live-active .v3-mac-shield {
  opacity: 0;
  pointer-events: none;
}

.v3-mac-hint {
  position: relative;
  z-index: 7;
  cursor: pointer;
  padding: 3px 10px;
  line-height: 1.3;
  border-radius: 999px;
  pointer-events: auto;
  transition: background 0.18s ease, color 0.18s ease;
}

.v3-mac-hint:hover {
  background: rgba(20, 20, 22, 0.08);
  color: #202022;
}

.v3-macbook.is-live-active .v3-mac-hint {
  background: rgba(232, 131, 74, 0.16);
  color: #B8521E;
}

.v3-macbook.is-live-active .v3-mac-hint:hover {
  background: rgba(232, 131, 74, 0.26);
  color: #9A4112;
}

.v3-macbook.is-live-active .v3-mac-bar {
  cursor: pointer;
  background: linear-gradient(180deg, #FFFBF8 0%, #F7EFE8 100%);
  border-bottom-color: rgba(232, 131, 74, 0.24);
}

@media (prefers-reduced-motion: reduce) {
  html.cf-ready [data-cf-reveal],
  html.cf-ready [data-cf-reveal="fade"] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
