/* ===== PizzaTits — Retro ===== */

:root {
    --cream: #ffe9c2;
    --cream-btn: #fff3da;
    --red: #c5281f;
    --red-bright: #e8443a;
    --red-deep: #7c130b;
    --red-dark: #8c1810;
    /* Artwork aspect ratio (1880 x 2195) */
    --art-w: 1880;
    --art-h: 2195;
    /* Pizza size + chest placement, as % of the stage. Tuned to the artwork. */
    --pizza-size: 40%;
    --pizza-bottom: 2%;
    --pizza-x-left: 30%;
    --pizza-x-right: 70%;
}

* { box-sizing: border-box; margin: 0; }

/* Visually hidden, but available to search engines + screen readers. */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

html { -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
    font-family: "Fredoka", system-ui, sans-serif;
    color: var(--cream);
    overflow: hidden;
    min-height: 100dvh;
    user-select: none;
    -webkit-user-select: none;
    background:
        repeating-conic-gradient(from 0deg at 50% 34%, rgba(255, 255, 255, 0.05) 0deg 7deg, transparent 7deg 14deg),
        radial-gradient(circle at 50% 36%, var(--red-bright) 0%, var(--red) 60%, var(--red-dark) 100%);
}
/* Edge vignette for depth (purely decorative, never blocks taps). */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9;
    box-shadow: inset 0 0 240px rgba(60, 8, 4, 0.5);
}

/* ===== Layout frame ===== */
.frame { position: relative; width: 100vw; height: 100dvh; }

/* The "side" holds the brand + buttons. Portrait: pinned to the top.
   Square/wider: becomes the left column of a split (see media query). */
.side {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
    width: 100%;
    padding: calc(14px + env(safe-area-inset-top)) 12px 8px;
}
.btn {
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 600;
    font-size: clamp(13px, 3.4vw, 16px);
    color: var(--red);
    background: var(--cream-btn);
    border: 0;
    border-radius: 999px;
    padding: 0.55em 1em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--red-deep), 0 5px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.08s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-deep), 0 2px 6px rgba(0, 0, 0, 0.25); }
.btn:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }

.brand { text-align: center; padding: 1% 16px 0; }
.wordmark {
    font-family: "Lobster", cursive;
    font-weight: 400;
    line-height: 0.92;
    font-size: clamp(52px, 16vw, 128px);
    color: var(--cream);
    text-shadow: 3px 3px 0 var(--red-deep), 5px 6px 0 rgba(0, 0, 0, 0.25);
}
.flag {
    height: 7px;
    width: min(62%, 300px);
    margin: 14px auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, #1b9e4b 0 33%, #fff 33% 66%, #cd2b27 66% 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.tagline {
    margin: 14px 0 0;
    font-family: "Anton", system-ui, sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 3.8vw, 20px);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream);
}

/* ===== Stage (the figure) ===== */
.stage {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100vw, 100dvh * var(--art-w) / var(--art-h));
    height: min(100dvh, 100vw * var(--art-h) / var(--art-w));
}
.lady {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    z-index: 1;
    filter: drop-shadow(0 14px 30px rgba(50, 8, 4, 0.45));
    opacity: 0;
    transition: opacity 0.8s ease;
}

/* ===== Hidden, scalable tap zones (Easter eggs) ===== */
.hotspot {
    position: absolute;
    z-index: 2;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.hotspot:focus-visible { outline: 3px dashed rgba(255, 255, 255, 0.9); outline-offset: -3px; }
.hotspot--hair { left: 31%; top: 0%;  width: 38%; height: 30%; }
.hotspot--face { left: 37%; top: 27%; width: 26%; height: 22%; }

/* ===== Spinnable pizzas ===== */
.pizza {
    position: absolute;
    z-index: 3;
    width: var(--pizza-size);
    aspect-ratio: 1 / 1;
    margin-left: calc(var(--pizza-size) / -2);
    bottom: var(--pizza-bottom);
    transform-origin: center center;
    will-change: transform;
    touch-action: none;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.8s ease 0.15s;
}
.pizza:active { cursor: grabbing; }
.pizza--left  { left: var(--pizza-x-left); }
.pizza--right { left: var(--pizza-x-right); }
.pizza:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.9); outline-offset: 4px; border-radius: 50%; }
.pizza img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

/* Idle "breathing" wobble on the inner image so it composes with the JS spin
   on the parent. Removed while actively spinning. */
.pizza:not(.is-spinning) img { animation: wobble 3.4s ease-in-out infinite; }
.pizza--right:not(.is-spinning) img { animation-delay: -1.7s; }
@keyframes wobble {
    0%, 100% { transform: rotate(-3deg); }
    50%      { transform: rotate(3deg); }
}

body.is-ready .lady,
body.is-ready .pizza { opacity: 1; }
/* Peek-a-boo: hide the pizzas quickly, hold, then let them fade back in. */
body.is-ready .pizza.is-peeking { opacity: 0; transition: opacity 0.18s ease; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    z-index: 20;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(40, 8, 4, 0.9);
    color: var(--cream);
    padding: 0.6em 1.1em;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* ===== Confetti (fast-spin Easter egg) =====
   z-index 4 sits above the figure + pizzas (1-3) but below the UI (.side = 5),
   so it rains "in the scene" while keeping the wordmark/buttons crisp. */
.confetti {
    position: fixed;
    top: -8vh;
    z-index: 4;
    /* vmin keeps the emoji the same size in portrait and landscape. */
    font-size: clamp(18px, 5vmin, 28px);
    pointer-events: none;
    will-change: transform;
    animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
    to { transform: translateY(118vh) rotate(720deg); }
}

/* ===== Square & wider: split layout (text left, figure right) ===== */
@media (min-aspect-ratio: 1/1) {
    .frame { display: flex; align-items: stretch; }
    .side {
        position: static;
        flex: 1;
        min-width: 0;
        align-items: flex-start;
        justify-content: center;
        text-align: left;
        gap: 8px;
        padding: 0 clamp(24px, 5vw, 110px);
    }
    .controls { width: auto; justify-content: flex-start; padding: 0; margin-top: 22px; }
    .brand { order: -1; text-align: left; padding: 0; }
    .flag { margin: 16px 0 0; }
    .tagline { text-align: left; }
    .wordmark { font-size: clamp(66px, 9vw, 180px); }
    .stage {
        position: relative;
        transform: none;
        left: auto;
        align-self: flex-end;
        margin-right: clamp(12px, 4vw, 64px);
        width: min(42vw, 100dvh * var(--art-w) / var(--art-h));
        height: min(100dvh, 42vw * var(--art-h) / var(--art-w));
    }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    .pizza:not(.is-spinning) img { animation: none; }
    .lady, .pizza { transition: none; }
    .confetti { display: none; }
}
