/* Each slide is drawn on a 1366 x 670 stage, the size of the original slide images.
   Items are placed with --x, --y and --w (plus --h when cropped) in those same units.
   On wide screens the whole stage scales. On narrow screens it becomes one column,
   where --m is an item's width as a percentage of the column. */

@font-face {
    font-family: 'LAZYDOG';
    src: url('../LAZYDOG.TTF') format('truetype');
    font-style: normal;
    font-display: swap;
}

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

html, body {
    height: 100%;
    background: #efebe6;
    color: #1d1713;
    font-family: 'LAZYDOG', 'Comic Relief', sans-serif;
}

/* --- firefly cursor --- */
.custom-cursor {
    width: 10px;
    height: 10px;
    background: #f7e375;
    border-radius: 50%;
    position: fixed;
    left: -20px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px 4px #ffe76080;
    z-index: 9999;
}

.firefly {
    animation: drift 1.2s ease-out forwards;
}

@keyframes drift {
    to {
        opacity: 0;
        transform: translate(var(--dx), -60px) scale(.2);
    }
}

@media (hover: none) {
    .custom-cursor { display: none; }
}

/* --- scrolling --- */
.container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.slide {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
    scroll-snap-align: start;
    background: center / cover no-repeat url('../images/web/bg-pink.webp');
}

.slide.blue {
    background-image: url('../images/web/bg-blue.webp');
}

/* --- the stage and what sits on it --- */
.stage {
    position: relative;
    width: min(100vw, 100vh * 1366 / 670);
    width: min(100vw, 100dvh * 1366 / 670);
    aspect-ratio: 1366 / 670;
    container-type: inline-size;
}

.item {
    position: absolute;
    left: calc(var(--x) / 1366 * 100%);
    top: calc(var(--y) / 670 * 100%);
    width: calc(var(--w) / 1366 * 100%);
    font-size: calc(var(--fs, 17.5) * 100cqw / 1366);
    line-height: 1.55;
}

img {
    display: block;
    height: auto;
}

.crop {
    aspect-ratio: var(--w) / var(--h);
    object-fit: cover;
}

.tall {
    aspect-ratio: var(--w) / var(--h);
}

.round-s { border-radius: calc(6 * 100cqw / 1366); }
.round-b { border-radius: calc(6 border* 100cqw / 1366); transition-delay: 0.3s;}
.round-b:hover { transform: scale(1.05); }
.round-m { border-radius: calc(18 * 100cqw / 1366); }
.round-l { border-radius: calc(32 * 100cqw / 1366); }

.panel {
    aspect-ratio: var(--w) / var(--h);
    background: #c7cfd9;
    border-radius: calc(10 * 100cqw / 1366);
}

.mobile-only { display: none; }

.centre { text-align: center; }
.right { text-align: right; }
.heading { --fs: 38; line-height: 1.1; text-align: center; }
.tiny-label { --fs: 12; text-align: center; }

a { color: inherit; }

/* parts inside a group are placed in percentages of that group,
   so a group keeps its overlaps at every size */
.group > * {
    position: absolute;
}

/* --- home slide --- */
.logo, .kiwi-home, .shop { pointer-events: none; }
.logo { z-index: 3; }
.kiwi-home { z-index: 2; }
.shop { z-index: 1; }

.menu-button {
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: var(--w) / 87;
    padding: 0 1cqw;
    border-radius: calc(7 * 100cqw / 1366);
    --fs: 25;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.menu-button:hover {
    transform: translateY(-3%) scale(1.02);
    box-shadow: 0 .4cqw .8cqw #0003;
}

.menu-button:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

.about-button { background: #fda3bd; }
.work-button { background: #93b282; }
.modelling-button { background: #a58a72; }
.character-button { background: #f8dc98; }
.art-button { background: #e3debd; }
.games-button { background: #bb9ae6; }
.contact-button { background: #9dbace; }

/* --- about slide --- */
.band { overflow: hidden; aspect-ratio: 1366 / 106; }
.band img { position: absolute; width: 100%; left: 0; }
.band .programs { top: 21%; }

/* --- colour palettes --- */
.palette .swatch {
    width: var(--sw);
    height: var(--sh);
    border-radius: calc(5 * 100cqw / 1366);
}

/* --- link card on the games slide --- */
.game-card {
    display: flex;
    align-items: center;
    gap: 3.2%;
    aspect-ratio: 440 / 118;
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none;
    overflow: hidden;
    border-radius: calc(4 * 100cqw / 1366);
    --fs: 14;
    line-height: 1.7;
    transition: box-shadow .15s ease;
}

.game-card:hover { box-shadow: 0 .3cqw 1cqw #0005; }
.game-card img { height: 100%; width: 26.6%; object-fit: cover; }
.game-card strong { display: block; }
.game-card span { display: block; }
.game-card .site { color: #999; }


.corner-button {
position: fixed;
height: 50px;
width: 100px;
bottom: 20px;
right: 20px;
z-index: 1000;
font-family: 'LAZYDOG', 'Comic Relief', sans-serif;
background-color: #bb9ae6;
}

.construction-button {
position: fixed;
height: 50px;
width: 110px;
bottom: 20px;
right: 140px;
z-index: 1000;
font-family: 'LAZYDOG', 'Comic Relief', sans-serif;
background-color: #f592ab;
}


/* --- narrow screens: same elements, one column --- */
@media (max-width: 760px), (max-aspect-ratio: 1 / 1) {
    .container {
        scroll-snap-type: none;
        overflow-y: auto;
    }

    .slide {
        height: auto;
        display: block;
        padding: 28px 0;
    }

    .stage {
        width: min(100%, 620px);
        aspect-ratio: auto;
        margin: 0 auto;
        padding: 0 16px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        gap: 14px 10px;
    }

    .item {
        position: relative;
        left: auto;
        top: auto;
        width: calc(var(--m, 100) * 1% - (100 - var(--m, 100)) * .1px);
        font-size: 16px;
        line-height: 1.6;
    }

    .round-s { border-radius: 6px; }
    .round-b { border-radius: 6px; }
    .round-b:hover {
        transform: translateY(-3%) scale(1.02);
    }
    .round-m { border-radius: 14px; }
    .round-l { border-radius: 22px; }

    .desktop-only { display: none; }
    .mobile-only { display: block; }

    .heading { font-size: clamp(26px, 8vw, 40px); }
    .tiny-label { font-size: 14px; }

    /* the big grey panels would stack as empty boxes */
    .panel.backdrop { display: none; }

    .stage.on-panel {
        width: min(100% - 24px, 600px);
        background: #c7cfd9;
        border-radius: 12px;
        padding: 16px;
    }

    .palette .swatch { border-radius: 4px; }

    /* home: the couple stands on the contact button, as in the design */
    .home-stage { gap: 10px; }
    .logo-word { width: 100%; }
    .kiwi-home { position: absolute; top: -18px; right: 8px; width: 30%; }
    .menu-button {
        width: calc(50% - 5px);
        aspect-ratio: auto;
        min-height: 72px;
        padding: 8px 10px;
        font-size: clamp(14px, 4.3vw, 20px);
        border-radius: 7px;
    }
    .menu-button:hover { box-shadow: 0 2px 6px #0003; }
    .shop { width: 86%; margin-bottom: -10px; }
    .contact-button { width: 100%; }

    /* programs band: full bleed and large enough to read */
    .band {
        width: 100vw;
        max-width: 100vw;
        margin: -28px calc(50% - 50vw) 6px;
        aspect-ratio: auto;
        height: 66px;
    }
    .band img { width: 850px; left: calc(50% - 425px); }

    .thanks { font-size: clamp(44px, 15vw, 96px); margin-top: 40px; }
    .ufo { margin-top: 30px; }
    .contactb {margin-top: 10px};

    .game-card { font-size: clamp(11px, 3.4vw, 15px); }
    .work-text { text-align: center; }
    .label-panel { aspect-ratio: 16 / 10; display: grid; place-items: center; }
}

@media (prefers-reduced-motion: reduce) {
    .container { scroll-behavior: auto; }
    .firefly { display: none; }
    .menu-button, .game-card { transition: none; }
}

