/* =====================================================
   BAYQUEN.COM — Pattern Showcase
   Two animated patterns, one masked by a CSS-generated
   pattern mask (polka dots / checkers / stripes).
   Uses CSS gradients for masks so it works directly
   from the filesystem (no server required).
   ===================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ── Hero container ──────────────────────────────── */
.hero-area {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #1a1a2e;
    /* fallback if images fail */
    cursor: pointer;
    /* Indicates it's clickable */
}

/* Pause animations when .paused class is active */
.hero-area.paused .background-pattern,
.hero-area.paused .masked-pattern {
    animation-play-state: paused;
}

/* ── Layer 1: Base background pattern (moves left) ── */
.background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-image: url('ideogram_seamless-hawaiian.png');
    background-size: 4500px auto;
    background-repeat: repeat;

    animation: moveLeft 90s linear infinite;
}

/* ── Layer 2: Top pattern (moves up) + B&W CSS mask ─ */
.masked-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-image: url('Seamless-Aloha-Monstera-Background-Pattern-Tile.jpg');
    background-size: 2000px auto;
    background-repeat: repeat;

    animation: moveUp 90s linear infinite;

    /* ─────────────────────────────────────────────────
       CSS MASK — Polka Dots
       White circles = opaque (monstera visible)
       Black gaps   = transparent (hawaiian shows through)

       Switch to one of the other mask options below
       by commenting out this block and uncommenting
       the one you want.
    ───────────────────────────────────────────────── */
    /* Use the precise organic mask provided by the user and tile it */
    -webkit-mask-image: url('bw_mask_9k.png');
    -webkit-mask-size: 800px auto;
    -webkit-mask-repeat: repeat;
    -webkit-mask-mode: luminance;

    mask-image: url('bw_mask_9k.png');
    mask-size: 800px auto;
    mask-repeat: repeat;
    mask-mode: luminance;
}


/* ══════════════════════════════════════════════════
   ALTERNATIVE MASK OPTIONS
   (Uncomment one block, comment out the one above)
   ══════════════════════════════════════════════════

   ── Option B: Checkerboard ─────────────────────────
   .masked-pattern {
       -webkit-mask-image: conic-gradient(
           black 90deg,
           white 90deg 180deg,
           black 180deg 270deg,
           white 270deg
       );
       -webkit-mask-size: 120px 120px;
       -webkit-mask-repeat: repeat;
       mask-image: conic-gradient(
           black 90deg,
           white 90deg 180deg,
           black 180deg 270deg,
           white 270deg
       );
       mask-size: 120px 120px;
       mask-repeat: repeat;
   }

   ── Option C: Diagonal Stripes ─────────────────────
   .masked-pattern {
       -webkit-mask-image: repeating-linear-gradient(
           45deg,
           white 0px,
           white 50px,
           black 50px,
           black 100px
       );
       -webkit-mask-size: auto;
       -webkit-mask-repeat: repeat;
       mask-image: repeating-linear-gradient(
           45deg,
           white 0px,
           white 50px,
           black 50px,
           black 100px
       );
       mask-size: auto;
       mask-repeat: repeat;
   }

   ── Option D: Use the provided bw_mask_9k.png ───────
   NOTE: This ONLY works when served from a web server
   (e.g. VS Code Live Server, or `python3 -m http.server`).
   It will NOT work when opening index.html directly as
   a file:// URL due to browser CORS restrictions.

   .masked-pattern {
       -webkit-mask-image: url('bw_mask_9k.png');
       -webkit-mask-size: 100% 100%;
       -webkit-mask-repeat: no-repeat;
       mask-image: url('bw_mask_9k.png');
       mask-size: 100% 100%;
       mask-repeat: no-repeat;
   }
   ══════════════════════════════════════════════════ */


/* ── Keyframe Animations ─────────────────────────── */

/* Background pattern scrolls LEFT (negative = leftward) */
@keyframes moveLeft {
    0% {
        background-position-x: 0;
    }

    100% {
        background-position-x: -4500px;
    }

    /* exact tile width for seamless loop */
}

/* Top masked pattern scrolls UPWARD */
@keyframes moveUp {
    0% {
        background-position-y: 0;
    }

    100% {
        background-position-y: -2000px;
    }

    /* exact tile height for seamless loop */
}

/* ── UI Controls Panel ──────────────────────────── */
.controls-panel {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(26, 26, 46, 0.85);
    padding: 10px 20px;
    border-radius: 50px;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    gap: 16px;
    align-items: center;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
    text-decoration: none;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.control-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Toggle icons based on hero-area state */
body:has(.hero-area.paused) .btn-pause {
    display: none;
}

body:not(:has(.hero-area.paused)) .btn-play {
    display: none;
}