/* ====================================================================
   ExpertPlace mobile hero — 5-MENU CAROUSEL (defile)
   Pure-CSS iPhone widget, ported from the desktop 25-step bundle so the
   mobile aesthetic matches desktop. Compositor-only animation
   (opacity + transform), scoped to mobile via gsap.matchMedia.

   Layers:
     .ep-site-smoke-root   — cyan WebGL smoke shader (existing, behind)
     .ephp-mobile-hero     — 460vh scroll runway
       .ephp-stage         — sticky 100dvh, subtle white wash
         .iphone-bezel     — the phone widget (CSS-built)
           .hardware-btn × 5
           .iphone-screen
             .dynamic-island
             .screen-glare
             .menu-showcase
               .menu-slide × 5
                 .menu-slide-restaurant (pill in corner)
                 .menu-slide-img
         .ephp-card        — brand teal card with cycling headlines + CTA
   ==================================================================== */

.ephp-mobile-hero { display: none; }

@media (max-width: 767px) {
  html, body { overflow-x: clip !important; overflow-y: visible !important; }

  /* Smoke always active on mobile, behind everything. */
  .ep-site-smoke-root { opacity: 0.85 !important; }

  /* Hide both the legacy V6 canvas hero and the desktop React hero. */
  .eph-mobile-hero { display: none !important; }
  #expertplace-hero-root { display: none !important; }

  .ephp-mobile-hero {
    display: block;
    position: relative;
    z-index: 50;
    padding: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    height: 460vh;
    background: transparent;
  }

  .ephp-stage {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 600px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    /* Center the composition vertically with tight uniform gaps so the title
       and CTA hug the phone instead of being shoved to the viewport edges. */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 100px 16px 24px;
  }

  /* Atmospheric orbs — soft drifting cyan blobs fill the empty space around
     the phone with brand-colored depth. Sit above the smoke shader but below
     the title/phone content. */
  .ephp-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    filter: blur(46px);
    opacity: 0.55;
    will-change: transform;
  }
  .ephp-orb--1 {
    width: 260px;
    height: 260px;
    top: 18%;
    left: -90px;
    background: radial-gradient(circle, rgba(93, 212, 230, 0.42) 0%, rgba(27, 154, 174, 0.16) 50%, transparent 75%);
    animation: ephpOrbDrift1 14s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  }
  .ephp-orb--2 {
    width: 320px;
    height: 320px;
    bottom: 8%;
    right: -120px;
    background: radial-gradient(circle, rgba(27, 154, 174, 0.38) 0%, rgba(25, 77, 102, 0.14) 55%, transparent 80%);
    animation: ephpOrbDrift2 18s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  }
  @keyframes ephpOrbDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -22px) scale(1.08); }
    66%      { transform: translate(-18px, 26px) scale(0.95); }
  }
  @keyframes ephpOrbDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40%      { transform: translate(-38px, 18px) scale(1.06); }
    75%      { transform: translate(22px, -28px) scale(0.96); }
  }

  /* =============================================================
     iPHONE WIDGET — pure CSS, scaled from desktop's 280x607 widget.
     ============================================================= */

  .iphone-stage {
    position: relative;
    z-index: 3;
    width: 195px;
    height: 423px;
    flex: 0 0 auto;
    will-change: transform;
  }

  /* =============================================================
     HERO COPY — title floats above the phone, subtitle below.
     Brief Section 6.1 copy. Phone position is untouched.
     ============================================================= */
  /* Title — desktop .ep-tagline typography (Syne 800, -0.04em) scaled big enough
     to read as the visual anchor on mobile. Brand-tinted navy ink instead of
     pure black so it sits inside the cyan-smoke palette instead of fighting it. */
  .ephp-mobile-title {
    position: relative;
    z-index: 4;
    width: 100%;
    max-width: 400px;
    text-align: center;
    font-family: 'Syne', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-size: 31px;
    line-height: 1.0;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0;
    color: #0c1f2e;
    text-shadow:
      0 10px 26px rgba(12, 31, 46, 0.20),
      0 2px 6px rgba(12, 31, 46, 0.12);
    flex: 0 0 auto;
  }
  /* Accent line — brand gradient text with a slow cyan shimmer sweep. */
  .ephp-mobile-title__accent {
    background: linear-gradient(
      100deg,
      #194d66 0%,
      #1b9aae 35%,
      #5dd4e6 50%,
      #1b9aae 65%,
      #194d66 100%
    );
    background-size: 220% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #1b9aae;
    animation: ephpAccentSweep 5.5s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  }
  @keyframes ephpAccentSweep {
    0%,100% { background-position: 0% 50%; }
    50%     { background-position: 100% 50%; }
  }
  /* Footer — eyebrow brand mark + primary CTA. Tight stack hugging the phone. */
  .ephp-mobile-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex: 0 0 auto;
  }
  /* Eyebrow brand mark — small caps, letterspaced, sits just under the phone
     like a discreet signature instead of a heavy second title. */
  .ephp-mobile-sub {
    position: relative;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-align: center;
    font-family: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #194d66;
    margin: 0;
  }
  .ephp-mobile-sub::before,
  .ephp-mobile-sub::after {
    content: '';
    width: 34px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(27, 154, 174, 0.75), transparent);
    transform-origin: center;
  }
  /* Live indicator dot — pulsing cyan signature next to the brand mark. */
  .ephp-mobile-sub__dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1b9aae;
    box-shadow: 0 0 0 3px rgba(27, 154, 174, 0.18), 0 0 10px rgba(93, 212, 230, 0.7);
    animation: ephpLiveDot 1.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    margin-right: -4px;
  }
  @keyframes ephpLiveDot {
    0%,100% {
      box-shadow: 0 0 0 3px rgba(27, 154, 174, 0.18), 0 0 10px rgba(93, 212, 230, 0.7);
      transform: scale(1);
    }
    50% {
      box-shadow: 0 0 0 6px rgba(27, 154, 174, 0.06), 0 0 16px rgba(93, 212, 230, 0.95);
      transform: scale(1.15);
    }
  }
  /* CTA — port of desktop .cta-btn--primary (navy → teal pill). */
  .ephp-mobile-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 15px 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, #194d66 0%, #1b9aae 100%);
    color: #ffffff !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.005em;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow:
      0 8px 24px -4px rgba(27, 154, 174, 0.5),
      0 2px 5px rgba(10, 10, 10, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: ephpCtaHalo 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  }
  @keyframes ephpCtaHalo {
    0%,100% {
      box-shadow:
        0 0 0 0 rgba(93, 212, 230, 0.45),
        0 8px 24px -4px rgba(27, 154, 174, 0.5),
        0 2px 5px rgba(10, 10, 10, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    }
    50% {
      box-shadow:
        0 0 0 9px rgba(93, 212, 230, 0.0),
        0 12px 30px -4px rgba(27, 154, 174, 0.6),
        0 2px 5px rgba(10, 10, 10, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    }
  }
  .ephp-mobile-cta:active {
    transform: translateY(1px);
    box-shadow:
      0 2px 8px rgba(27, 154, 174, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
  .ephp-mobile-cta__arrow {
    display: inline-block;
    font-size: 15px;
    line-height: 1;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .ephp-mobile-cta:hover .ephp-mobile-cta__arrow,
  .ephp-mobile-cta:active .ephp-mobile-cta__arrow {
    transform: translateX(3px);
  }

  @media (max-height: 760px) {
    .ephp-stage { padding: 96px 14px 22px; gap: 18px; }
    .ephp-mobile-title { font-size: 27px; max-width: 380px; }
    .ephp-mobile-sub { font-size: 13px; letter-spacing: 0.22em; gap: 12px; }
    .ephp-mobile-sub::before, .ephp-mobile-sub::after { width: 28px; }
    .ephp-mobile-footer { gap: 12px; }
    .ephp-mobile-cta { padding: 14px 28px; font-size: 15px; }
    .iphone-stage { width: 190px; height: 412px; }
  }
  @media (max-height: 670px) {
    .ephp-stage { padding: 86px 12px 18px; gap: 14px; }
    .ephp-mobile-title { font-size: 23px; max-width: 320px; letter-spacing: -0.038em; }
    .ephp-mobile-sub { font-size: 11.5px; letter-spacing: 0.2em; gap: 10px; }
    .ephp-mobile-sub::before, .ephp-mobile-sub::after { width: 22px; }
    .ephp-mobile-footer { gap: 10px; }
    .ephp-mobile-cta { padding: 12px 24px; font-size: 14.5px; }
    .iphone-stage { width: 175px; height: 380px; }
  }

  .iphone-bezel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 44px;
    background-color: #0a0a0a;
    box-shadow:
      inset 0 0 0 2px #2a2a2e,
      inset 0 0 0 6px #000,
      0 30px 60px -10px rgba(0, 0, 0, 0.55),
      0 12px 22px -4px rgba(0, 0, 0, 0.45),
      0 0 0 1px rgba(93, 212, 230, 0.08);
    transform-style: preserve-3d;
  }

  /* Hardware buttons (volume on left, power on right). Cyan-rim subtle glow. */
  .hardware-btn {
    position: absolute;
    background: linear-gradient(90deg, #404040 0%, #171717 100%);
    box-shadow:
      -2px 0 5px rgba(0, 0, 0, 0.7),
      inset -1px 0 1px rgba(255, 255, 255, 0.12),
      inset 1px 0 2px rgba(0, 0, 0, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    width: 3px;
    z-index: 0;
  }
  .hardware-btn--silent  { top: 96px;  left: -3px; height: 22px; border-radius: 2px 0 0 2px; }
  .hardware-btn--vol-up  { top: 138px; left: -3px; height: 44px; border-radius: 2px 0 0 2px; }
  .hardware-btn--vol-dn  { top: 192px; left: -3px; height: 44px; border-radius: 2px 0 0 2px; }
  .hardware-btn--power-1 { top: 146px; right: -3px; height: 68px; border-radius: 0 2px 2px 0;
    background: linear-gradient(270deg, #404040 0%, #171717 100%); }
  .hardware-btn--power-2 { top: 232px; right: -3px; height: 28px; border-radius: 0 2px 2px 0;
    background: linear-gradient(270deg, #404040 0%, #171717 100%); display: none; }

  /* Inner screen container, sits 6px inside the bezel. */
  .iphone-screen {
    position: absolute;
    inset: 6px;
    border-radius: 38px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.4);
    z-index: 10;
  }

  /* Dynamic Island — hidden because the menu PNGs already have the
     iPhone status bar + Dynamic Island baked into the image. The CSS
     one was overlapping the baked-in one. */
  .dynamic-island { display: none !important; }

  /* Subtle diagonal screen glare. */
  .screen-glare {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 45%);
    pointer-events: none;
    z-index: 40;
  }

  /* Menu showcase — the viewport into the menu track. Fixed inside the
     iPhone screen, overflow hidden. The track translates SIDEWAYS
     (translateX) as the page scrolls, parading all 5 menus through one
     after another like swiping between restaurants. */
  .menu-showcase {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #ffffff;
    z-index: 20;
  }

  /* Track holds all 5 menus stacked at the same position. The active one
     fades in, others fade out. No translate, no slide — each menu POPS
     in cleanly when scroll crosses its threshold. */
  .menu-track {
    position: absolute;
    inset: 0;
  }

  .menu-tile {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
    background: #ffffff;
    opacity: 0;
    transition: opacity 0.22s ease-out;
    will-change: opacity;
  }
  .menu-tile.is-active { opacity: 1; }

  /* =============================================================
     TRUST BADGES — direct port of desktop .floating-ui-badge glass
     pattern, dimensioned for mobile but with the same premium
     vocabulary: real backdrop-filter glass, multi-layer shadow stack
     (rim + drop + close + top highlight + bottom inner), Syne display
     font matching desktop, soft-rounded rectangle (NOT pill).
     ============================================================= */
  .ephp-trust {
    position: absolute;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 10px;
    border-radius: 14px;
    /* Glass-morphism — dark inverted so it reads premium on the white
       stage wash above the cyan smoke shader. Two-stop gradient gives
       the surface real material depth. */
    background:
      linear-gradient(135deg,
        rgba(18, 32, 52, 0.72) 0%,
        rgba(12, 22, 40, 0.82) 100%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    box-shadow:
      /* Bright rim — picks up edge light, separates from background */
      0 0 0 1px rgba(255, 255, 255, 0.08),
      /* Long depth shadow — anchors the badge in space */
      0 20px 40px -12px rgba(8, 18, 35, 0.55),
      /* Close shadow — micro depth, prevents flatness */
      0 4px 10px -2px rgba(8, 18, 35, 0.35),
      /* Top inner highlight — Apple-style top light */
      inset 0 1px 1px rgba(255, 255, 255, 0.14),
      /* Bottom inner shadow — material thickness */
      inset 0 -1px 1px rgba(0, 0, 0, 0.35);
    color: #ffffff;
    opacity: 0;
    will-change: opacity, transform;
    pointer-events: none;
  }
  .ephp-trust--tl {
    top: -22px;
    left: -18px;
    animation: ephpTrustInLeft 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.45s forwards;
    transform: translate(-8px, 8px);
  }
  .ephp-trust--br {
    bottom: -22px;
    right: -18px;
    animation: ephpTrustInRight 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.60s forwards;
    transform: translate(8px, -8px);
  }
  @keyframes ephpTrustInLeft {
    to { opacity: 1; transform: translate(0, 0); }
  }
  @keyframes ephpTrustInRight {
    to { opacity: 1; transform: translate(0, 0); }
  }
  .ephp-trust--tl, .ephp-trust--br {
    will-change: transform;
  }

  .ephp-trust__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background:
      linear-gradient(135deg,
        rgba(27, 154, 174, 0.22) 0%,
        rgba(27, 154, 174, 0.10) 100%);
    box-shadow:
      inset 0 0 0 1px rgba(93, 212, 230, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #5dd4e6;
    flex: 0 0 30px;
  }
  .ephp-trust__icon--accent {
    background:
      linear-gradient(135deg,
        rgba(255, 220, 80, 0.22) 0%,
        rgba(255, 220, 80, 0.10) 100%);
    box-shadow:
      inset 0 0 0 1px rgba(255, 220, 80, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #ffdc50;
  }
  .ephp-trust__text {
    display: flex;
    flex-direction: column;
    line-height: 1.18;
    gap: 1px;
  }
  .ephp-trust__title {
    margin: 0;
    /* Match desktop's Syne font; falls back to system sans so it never
       looks like a generic serif. */
    font-family: 'Syne', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }
  .ephp-trust__sub {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 10px;
    font-weight: 500;
    /* Matches desktop's rgba(168,210,230,0.65) */
    color: rgba(168, 210, 230, 0.78);
    letter-spacing: 0.005em;
    white-space: nowrap;
  }

  /* Old card is hidden. */
  .ephp-card { display: none !important; }
  .ephp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #141414;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 8px;
  }
  .ephp-eyebrow::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #1b9aae;
    box-shadow: 0 0 0 2px rgba(27, 154, 174, 0.18);
  }
  .ephp-states { position: relative; min-height: 72px; margin-bottom: 16px; }
  .ephp-state {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
  }
  .ephp-state.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .ephp-headline {
    font-family: "Times New Roman", Georgia, "Source Serif Pro", serif;
    font-size: 23px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin: 0;
    color: #ffffff;
  }
  .ephp-headline em {
    font-style: italic;
    font-weight: 600;
    color: #ffffff;
  }
  .ephp-mobile-hero .ep03__btn--primary {
    width: 100% !important;
    justify-content: center;
    font-size: 14px !important;
    padding: 14px 22px !important;
  }
  .ephp-dots {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    justify-content: center;
  }
  .ephp-dot {
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    transition: background 0.3s ease;
  }
  .ephp-dot.is-active { background: rgba(255, 255, 255, 0.85); }

  /* No standalone restaurant pill above phone — each slide has its own
     menu-slide-restaurant chip inside the screen. Hide the legacy one. */
  .ephp-resto-pill,
  .ephp-brand,
  .ephp-spec-sweep {
    display: none !important;
  }

  @media (prefers-reduced-motion: reduce) {
    .dynamic-island::after { animation: none; }
    .ephp-mobile-title, .ephp-mobile-sub, .ephp-mobile-footer { animation: none !important; opacity: 1 !important; }
  }
}
