/**
 * Portal Coming Soon — page styles.
 *
 * Scoped to the Portal Coming Soon page template. Uses the theme's existing
 * design tokens and button/component classes; only adds the dog stage layout,
 * the pixel-art rendering, and the walk / wag / blink / bubble keyframes.
 *
 * Enqueued only on is_page_template( 'template-portal-coming-soon.php' ).
 */

/* =====================================================================
   PORTAL — page-level spacing
   ===================================================================== */
.blok-is-portal-coming-soon .blok-main {
    background: var(--color-bg-base);
}

/* =====================================================================
   DOG STAGE
   ===================================================================== */
.blok-portal-dog {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.blok-portal-dog__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.blok-portal-dog__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: blok-portal-orb 14s ease-in-out infinite alternate;
}
.blok-portal-dog__orb--purple {
    width: 340px;
    height: 340px;
    left: 6%;
    top: 10%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.55), transparent 70%);
}
.blok-portal-dog__orb--pink {
    width: 300px;
    height: 300px;
    right: 8%;
    top: 5%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.45), transparent 70%);
    animation-delay: -4s;
}
.blok-portal-dog__orb--orange {
    width: 280px;
    height: 280px;
    left: 40%;
    bottom: -10%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.40), transparent 70%);
    animation-delay: -8s;
}

@keyframes blok-portal-orb {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(20px, -16px, 0) scale(1.12); }
}

.blok-portal-dog__head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--sp-10);
}

/* The walking area */
.blok-portal-dog__stage {
    position: relative;
    width: 100%;
    max-width: var(--container-wide);
    height: 340px;
    margin: 0 auto;
    padding: 0 var(--sp-6);
    box-sizing: border-box;
}

.blok-portal-dog__ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 56px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(139, 92, 246, 0.35) 20%,
        rgba(236, 72, 153, 0.45) 50%,
        rgba(249, 115, 22, 0.35) 80%,
        transparent 100%);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.30);
}

/* Soft reflection / grass strip under the ground line */
.blok-portal-dog__stage::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: linear-gradient(180deg,
        rgba(139, 92, 246, 0.06) 0%,
        transparent 100%);
    pointer-events: none;
}

.blok-portal-dog__hint {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 6px 14px;
    background: var(--color-bg-glass);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0.85;
    transition: opacity var(--dur) var(--ease);
    pointer-events: none;
}
.blok-portal-dog__hint::before {
    content: "🐾";
    font-size: 0.9em;
    filter: grayscale(0.2);
}
.blok-portal-dog__hint.is-hidden {
    opacity: 0;
}

/* =====================================================================
   THE DOG (pixel art)
   ===================================================================== */
.pd-dog {
    position: absolute;
    bottom: 56px;           /* feet sit on the ground line */
    left: 0;
    width: 144px;
    will-change: transform;
    cursor: pointer;
    /* JS sets: transform: translateX(Npx) scaleX(dir); */
}

.pd-dog__inner {
    position: relative;
    display: block;
    width: 100%;
    will-change: transform;
    /* CSS handles vertical bob / pat bounce here. */
}

.pd-svg {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    /* drop-shadow gives the sprite a soft grounded feel */
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

.pd-dog__name {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 4px);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    background: var(--color-bg-glass);
    border: 1px solid var(--color-border-soft);
    padding: 3px 10px;
    border-radius: var(--r-full);
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 300ms var(--ease);
}
.pd-dog:hover .pd-dog__name,
.pd-dog:focus-visible .pd-dog__name,
.pd-dog.is-sitting .pd-dog__name {
    opacity: 1;
}

.pd-dog:focus-visible {
    outline: 2px solid var(--color-purple-400);
    outline-offset: 6px;
    border-radius: var(--r-md);
}

/* ---- Leg frames: only one visible at a time ---- */
.pd-legs { opacity: 0; }
.pd-dog.is-walking .pd-legs--a,
.pd-dog.is-walking .pd-legs--b { opacity: 1; }
.pd-dog.is-sitting .pd-legs--sit { opacity: 1; }
.pd-dog:not(.is-walking):not(.is-sitting) .pd-legs--a { opacity: 1; } /* idle = stand */

/* Stride toggle while walking (JS flips .is-stride every ~180ms) */
.pd-dog.is-walking .pd-legs--b { opacity: 0; }
.pd-dog.is-walking.is-stride .pd-legs--a { opacity: 0; }
.pd-dog.is-walking.is-stride .pd-legs--b { opacity: 1; }

/* ---- Eye blink ---- */
.pd-eye-closed { opacity: 0; }
.pd-dog.is-blink .pd-eye { opacity: 0; }
.pd-dog.is-blink .pd-eye-closed { opacity: 1; }

/* ---- Tail wag ---- */
.pd-tail {
    transform-box: view-box;
    transform-origin: 4px 8px;
}
.pd-dog.is-wagging .pd-tail {
    animation: pd-wag 0.42s ease-in-out infinite alternate;
}
@keyframes pd-wag {
    0%   { transform: rotate(-18deg); }
    100% { transform: rotate(18deg); }
}

/* ---- Heart bubble (bark / pat) ---- */
.pd-bubble {
    opacity: 0;
    transform-box: view-box;
    transform-origin: 20px 4px;
    transform: scale(0.4);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.pd-dog.is-bubbling .pd-bubble {
    opacity: 1;
    transform: scale(1);
    animation: pd-bubble-float 1.4s ease-out forwards;
}
@keyframes pd-bubble-float {
    0%   { opacity: 0; transform: scale(0.4) translateY(0); }
    20%  { opacity: 1; transform: scale(1.1) translateY(-0.5px); }
    60%  { opacity: 1; transform: scale(1) translateY(-1.5px); }
    100% { opacity: 0; transform: scale(0.9) translateY(-3px); }
}

/* ---- Walk bob (vertical hop) ---- */
.pd-dog.is-walking .pd-dog__inner {
    animation: pd-bob 0.36s ease-in-out infinite alternate;
}
@keyframes pd-bob {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-3px); }
}

/* ---- Pat bounce (happy) ---- */
.pd-dog.is-patted .pd-dog__inner {
    animation: pd-bounce 0.5s var(--ease-out);
}
@keyframes pd-bounce {
    0%   { transform: translateY(0) scale(1); }
    30%  { transform: translateY(-14px) scale(1.04); }
    55%  { transform: translateY(0) scale(0.98); }
    75%  { transform: translateY(-4px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}
/* Tail wags faster & longer after a pat */
.pd-dog.is-patted.is-wagging .pd-tail {
    animation-duration: 0.26s;
}

/* =====================================================================
   STATUS STRIP — reuse .blok-steps but tighten spacing
   ===================================================================== */
.blok-portal-status .blok-steps {
    max-width: 960px;
    margin: 0 auto;
}
.blok-portal-status .blok-step__number {
    background: var(--grad-accent);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.40);
}

/* =====================================================================
   FINAL CTA — reuse .blok-cta
   ===================================================================== */
.blok-portal-cta {
    padding-bottom: clamp(80px, 12vw, 140px);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 880px) {
    .blok-portal-dog__stage { height: 280px; }
    .pd-dog { width: 120px; }
}

@media (max-width: 540px) {
    .blok-portal-dog__stage { height: 240px; }
    .pd-dog { width: 104px; }
    .blok-portal-dog__hint { font-size: 0.7rem; padding: 5px 10px; }
}

/* =====================================================================
   REDUCED MOTION — dog sits calmly, no roaming, no bob
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
    .blok-portal-dog__orb { animation: none; }
    .pd-dog.is-walking .pd-dog__inner,
    .pd-dog.is-wagging .pd-tail,
    .pd-dog.is-patted .pd-dog__inner {
        animation: none;
    }
    .pd-dog__inner { transform: none !important; }
    /* Heart bubble still shows on pat, but without the float animation. */
    .pd-dog.is-bubbling .pd-bubble {
        opacity: 1;
        transform: scale(1);
        animation: none;
    }
    /* JS will detect reduced-motion and keep the dog seated + static. */
}
