/* Phone homepage hero (Sabrina, 2026-10-04): "the house rises through the clouds, held up by balloons."
   Phones only. home-hero-phone.js adds .is-phone to the hero; home-portal-hero.js does not run on phones.
   Client changes the same day: no sky or cloud-bank images on phones; the hero's flat colour shows, with many
   drifting pastel clouds (the "Pick your bounce" cloud sprites and drift) in front of and behind the house.
   No swipe gestures: the hero scrolls like the rest of the page. */
@media (max-width:767px){
  /* Client (2026-10-04): the same warm off-white as the "Pick your bounce" section directly below. */
  .portal-hero.is-phone{ height:100vh; height:100svh; touch-action:manipulation; background:#FDF5E8; }
  .portal-hero.is-phone .ph-stage{ position:relative; height:100vh; height:100svh; overflow:hidden; opacity:1 !important; animation:none !important; }
  .portal-hero.is-phone :is(.ph-world, .ph-clouds, .ph-clouds-front){ display:none !important; }

  /* Clouds: two layers, one behind the houses (z 2) and one in front (z 4). */
  .pp-clouds{ position:absolute; inset:0; pointer-events:none; overflow:hidden; }
    /* One layer per cloud: the drift moves transform, the rise and fall moves translate (independent properties). */
  .pp-cloud{ position:absolute; left:0; top:0; display:block; transform:translateX(-100%); will-change:transform, translate; }
  /* No drop-shadow here: with 26 to 32 moving clouds the filter cost about a third of the frame budget. */
  .pp-cloud img{ display:block; width:100%; height:auto; max-width:none; }

  /* Title (client, round c1): one hero title, no product names. The h1 that is screen-reader-only on PC shows here. */
  .portal-hero.is-phone .ph-title--2{ display:none !important; }
  .portal-hero.is-phone .ph-scene--1{ position:absolute !important; inset:0 !important; width:auto !important; height:auto !important; overflow:visible !important; clip-path:none !important; z-index:7; pointer-events:none; }
  .portal-hero.is-phone h1.ph-title--1{
    position:absolute; left:50%; top:calc(50% + .33em); translate:-50% -50%; /* client 2026-10-05: centred by eye, on the heavy "Your party" line, not the box (box centring read too high) */ width:max-content; max-width:88vw;
    opacity:1 !important; transform:none !important; font-size:clamp(42px,12.5vw,58px) !important; color:#173B68; text-shadow:0 2px 14px rgba(253,245,232,.95), 0 0 2px rgba(253,245,232,.9);
  }
  .portal-hero.is-phone h1.ph-title--1 .ph-script{ display:block; }
  .portal-hero.is-phone h1.ph-title--1 .pp-word{ display:inline-block; white-space:nowrap; }
}
/* Title entrance (client round c5): "Your party" arrives letter by letter exactly like the About page headings
   (each letter fades in and rises 30px, 50 ms apart); then "starts here." is written out left to right by a
   soft-edged mask, as if by a pen. It then stays. Reduced motion: shown as is. */
@media (max-width:767px) and (prefers-reduced-motion:no-preference){
  .portal-hero.is-phone h1.ph-title--1 .pp-char{
    display:inline-block; opacity:0; transform:translateY(30px);
    transition:opacity 550ms cubic-bezier(0.22,1,0.36,1), transform 650ms cubic-bezier(0.22,1,0.36,1);
    transition-delay:calc(var(--c) * 50ms + 100ms);
  }
  .portal-hero.is-phone.pp-title-in h1.ph-title--1 .pp-char{ opacity:1; transform:none; }
  .portal-hero.is-phone h1.ph-title--1 .ph-script{
    -webkit-mask-image:linear-gradient(90deg, #000 46%, transparent 54%); mask-image:linear-gradient(90deg, #000 46%, transparent 54%);
    -webkit-mask-size:220% 100%; mask-size:220% 100%;
    -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
    -webkit-mask-position:100% 0; mask-position:100% 0;
    transition:-webkit-mask-position 1900ms cubic-bezier(0.45,0,0.55,1), mask-position 1900ms cubic-bezier(0.45,0,0.55,1);
    transition-delay:calc(var(--pp-chars, 10) * 50ms + 700ms);
  }
  .portal-hero.is-phone.pp-title-in h1.ph-title--1 .ph-script{ -webkit-mask-position:0 0; mask-position:0 0; }
}
@media (max-width:767px){
  /* Houses: one rig per house (strings, house, balloons), placed by the script. */
  .portal-hero.is-phone .ph-scene--2{ z-index:auto !important; opacity:1 !important; transform:none !important; filter:none !important; will-change:auto !important; pointer-events:none; }
  .portal-hero.is-phone .ph-arc{ z-index:auto !important; transform:none !important; will-change:auto !important; }
  .portal-hero.is-phone .ph-arc{ position:absolute; inset:0; left:0; top:0; width:auto; height:auto; }
  .portal-hero.is-phone .ph-arc__item{
    position:absolute; left:10vw; top:30%; width:80vw; margin:0; opacity:0;
    transform:translate3d(0,120vh,0); transform-origin:50% 60%; pointer-events:none;
  }
  /* Layers are promoted only on houses that are on screen or moving; idle houses cost nothing. */
  .portal-hero.is-phone .ph-arc__item.pp-live{ will-change:transform, opacity; }
  .portal-hero.is-phone .ph-arc__item.pp-live a, .portal-hero.is-phone .pp-live .pp-balloon{ will-change:transform; }
  .portal-hero.is-phone .pp-live .pp-string{ will-change:transform, opacity; }
  .portal-hero.is-phone .ph-arc__item.pp-on{ pointer-events:auto; }
  .portal-hero.is-phone .ph-arc__item.pp-off, .portal-hero.is-phone .ph-arc__item.pp-off *{ pointer-events:none !important; }
  .portal-hero.is-phone .ph-arc__item a{ position:relative; z-index:1; display:block; transform-origin:50% 0; -webkit-tap-highlight-color:transparent; border-radius:18px; }
  .portal-hero.is-phone .ph-arc__item a:focus-visible{ outline:3px solid #fff; outline-offset:6px; }
  .portal-hero.is-phone .ph-arc__item img{ width:100%; height:auto; }

  .pp-string{ position:absolute; left:0; top:0; width:1.5px; height:100px; z-index:0; background:rgba(23,35,80,.7); transform-origin:50% 0; pointer-events:none; }
  .pp-balloon{ position:absolute; left:0; top:0; z-index:2; display:block; cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
  .pp-balloon svg{ display:block; width:100%; height:100%; overflow:visible; transform-origin:50% 42%; pointer-events:none; }
  .pp-balloon.pp-popped{ visibility:hidden; pointer-events:none; }
  .pp-frag{ position:absolute; left:50%; top:42%; width:9px; height:7px; margin:-3.5px 0 0 -4.5px; border-radius:2px 5px 2px 5px; opacity:0; pointer-events:none; }
}
/* The same drift and rise-and-fall as the "Pick your bounce" clouds (rentals-refresh.css). */
@media (max-width:767px) and (prefers-reduced-motion:no-preference){
  @keyframes pp-cloud-drift{ from{ transform:translateX(-100%); } to{ transform:translateX(var(--span, 100vw)); } }
  @keyframes pp-cloud-bob{ 0%, 100%{ translate:0 0; } 50%{ translate:0 -9px; } }
  .pp-cloud{ animation:pp-cloud-drift 110s linear infinite, pp-cloud-bob 9s ease-in-out infinite; }
  .portal-hero.pp-paused .pp-cloud{ animation-play-state:paused; }
}
@media (max-width:767px) and (prefers-reduced-motion:reduce){
  .pp-cloud{ transform:translateX(var(--x, 0px)); }
}

/* Client 2026-10-05: The Moonbounce Man logo takes over from the title (script-driven; see home-hero-phone.js).
   It sits exactly where the title was, on the screen's centre, in the title's layer. */
@media (max-width:767px){
  .portal-hero.is-phone .pp-logo{ position:absolute; left:50%; top:50%; translate:-50% -50%; width:min(64vw, 300px); aspect-ratio:420 / 393; pointer-events:none; }
  .portal-hero.is-phone .pp-logo img{ position:relative; z-index:1; display:block; width:100%; height:auto; opacity:0; filter:drop-shadow(0 12px 22px rgba(23,59,104,.18)); }
  .portal-hero.is-phone .pp-logo__glow{ position:absolute; inset:-34%; z-index:0; border-radius:50%; opacity:0;
    background:radial-gradient(closest-side, rgba(255,251,238,1), rgba(255,236,186,.85) 38%, rgba(255,214,140,.38) 60%, rgba(255,214,140,0) 76%); }
  .portal-hero.is-phone .pp-logo__shine{ position:absolute; inset:0; z-index:2; opacity:0;
    background:linear-gradient(112deg, rgba(255,255,255,0) 42%, rgba(255,255,255,.5) 50%, rgba(255,255,255,0) 58%) no-repeat; background-size:260% 100%; background-position:160% 0;
    -webkit-mask:var(--logo) center / 100% 100% no-repeat; mask:var(--logo) center / 100% 100% no-repeat; mix-blend-mode:screen; }
}

/* Client 2026-10-05: the hero logo is the new wide wordmark; same glow, rise and glint. */
@media (max-width:767px){
  .portal-hero.is-phone .pp-logo:not(#hl1){ width:min(86vw, 360px)!important; aspect-ratio:1630 / 250!important; }
  .portal-hero.is-phone .pp-logo:not(#hl1) .pp-logo__glow{ inset:-120% -18%!important; }
}
