/* Boo & Roo's home page intro (#30). Loaded on the home page only.
   Two jobs: (1) the cover, which hides the page from the very first paint while the head script has said "this visit plays";
   (2) the look of the scene that intro.js builds. Motion lives in intro.js (Web Animations API, transform and opacity only). */

/* While the intro waits or plays the page does not scroll; the cover is the sky colour so it joins the scene without a flash. */
html.intro-wait, html.intro-live { overflow: hidden; }
html.intro-wait::before { content: ""; position: fixed; inset: 0; z-index: 2147483000; background: #8FD3F2; }

#intro { position: fixed; inset: 0; z-index: 2000; overflow: hidden; background: #8FD3F2; cursor: pointer; touch-action: none;
  contain: strict; -webkit-user-select: none; user-select: none; }
#intro svg { display: block; overflow: visible; }

/* The stage is a fixed-size world (units = px before scaling) that intro.js scales to the screen. Its origin is the boat's waterline. */
#intro .in-art { position: absolute; inset: 0; }
#intro .in-stage { position: absolute; left: 50%; top: var(--oy, 68%); width: 0; height: 0; transform: scale(var(--s, 1)); transform-origin: 0 0; }
#intro .in-stage > *, #intro .in-boat > *, #intro .in-kick > *, #intro .in-ride > * { position: absolute; }
#intro .in-boat, #intro .in-kick, #intro .in-ride { left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
#intro .in-hullback { left: -260px; top: -520px; width: 520px; height: 560px; }
#intro .in-hullfront { left: -260px; top: -520px; width: 520px; height: 560px; }
#intro .in-sun { left: -240px; top: -532px; width: 540px; height: 540px; transform-origin: 270px 270px; }
#intro .in-cloud { width: 168px; height: 93px; }
#intro .in-pelw, #intro .in-farw, #intro .in-midw, #intro .in-townw { left: 0; top: 0; width: 0; height: 0; }
#intro .in-town { position: absolute; left: 0; top: 0; }
#intro .t-blade, #intro .t-board, #intro .t-moss, #intro .in-flag { transform-box: fill-box; transform-origin: 50% 0; }
#intro .in-flag { transform-origin: 0 100%; }
#intro .in-pel { position: absolute; }
#intro .in-sea { left: 0; top: 0; width: 0; height: 0; }
#intro .in-wave { position: absolute; background-repeat: no-repeat; background-position: 0 0; }
#intro .in-toys, #intro .in-fly { left: 0; top: 0; }

/* The toys. Each one is 120 by 132 stage units, turning about its middle. */
#intro .toy { position: absolute; width: 120px; height: 132px; transform-origin: 60px 66px; }
#intro .toy-fly { left: -60px; top: -66px; opacity: 0; }
#intro .toy-bob { width: 120px; height: 132px; transform-origin: 60px 96px; }
#intro .toy svg { width: 120px; height: 132px; }

/* Skip: a white pill, ink text, one big touch target, always the topmost thing. */
#intro .in-skip { position: absolute; z-index: 5; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right));
  min-width: 5.5rem; min-height: 3.25rem; padding: .7rem 1.6rem; border: 3px solid #0E2747; border-radius: 999px; background: #FFFFFF; color: #0E2747;
  font: 700 1.25rem/1.2 var(--font-body, system-ui, -apple-system, "Segoe UI", sans-serif); box-shadow: 4px 4px 0 #0E2747; cursor: pointer; touch-action: manipulation; }
#intro .in-skip:focus-visible { outline: 4px solid #0E2747; outline-offset: 3px; box-shadow: none; }

/* The ending (#42): "Welcome to" in the heading font, then the shop's own logo (the unaltered site/img/logo.png, a white pill, so it needs no plate),
   centred in the clear sky once the empty boat has sailed off. Both start invisible; intro.js animates opacity and transform only. */
#intro .in-welcome { position: absolute; z-index: 3; left: 0; right: 0; top: max(14%, 4.5rem); display: flex; flex-direction: column; align-items: center;
  gap: clamp(.5rem, 2.2vh, 1.4rem); padding: 0 4vw; pointer-events: none; }
#intro .in-words { margin: 0; opacity: 0; color: #0E2747; text-align: center; font: 800 clamp(2.1rem, 6.4vw, 4rem)/1.1 var(--font-head, Georgia, "Times New Roman", serif);
  font-variation-settings: "SOFT" 100; text-shadow: 0 2px 0 rgba(255, 255, 255, .6); }
#intro .in-logo { display: block; width: min(92vw, 760px, 135vh); height: auto; opacity: 0; }

/* Southport and the sizzle layers (#51): the swaying parts, haze, halo, rays, glitter, wave streaks, and the stars and confetti. */
#intro .in-rays, #intro .in-halo { left: 30px; top: -262px; transform-origin: 0 0; }
#intro .in-haze { background: linear-gradient(to bottom, rgba(255, 224, 168, 0), rgba(255, 224, 168, .6)); }
#intro .in-streaks, #intro .in-glints { left: 0; top: 0; width: 0; height: 0; }
#intro .in-streak { position: absolute; }
#intro .in-glint { position: absolute; margin: -5px 0 0 -5px; background: #fff; opacity: 0;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
#intro .in-spark { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
#intro .sp { position: absolute; left: 0; top: 0; opacity: 0; }
#intro .sp-star { width: 26px; height: 26px; margin: -13px 0 0 -13px; clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); }
#intro .sp-c { width: 9px; height: 15px; margin: -7px 0 0 -4px; border-radius: 2px; }
