/*
 * spellbindstudios.com
 *
 * Layout: the studio logo and one sentence about the studio at the top, then
 * each game's key art as a full-width block that links to the game's website.
 * The game logo sits over the quiet side of each picture; on phones it moves
 * to the bottom of the picture.
 */

@font-face {
    font-family: "Josefin Sans";
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url(../fonts/josefin-sans-latin.woff2) format("woff2");
}

:root {
    color-scheme: dark;
    --ink: #05060d;       /* page background, matched to the night sky in the Subspace Flux art */
    --paper: #ffffff;     /* logo lettering */
    --mist: #c5cbdc;      /* body text */
    --gem: #3fcaa5;       /* the crystal in the studio logo */
    --staff: #7a4508;     /* the staff in the studio logo */
}
*, *::before, *::after { box-sizing: border-box; }

html { background: var(--ink); }
body {
    margin: 0;
    color: var(--mist);
    font-family: "Josefin Sans", "Century Gothic", "Trebuchet MS", sans-serif;
    font-weight: 300;
    line-height: 1.5;
}
img { display: block; max-width: 100%; height: auto; }

/* ---------- Studio logo and description ---------- */
.studio {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(28px, 6vh, 64px) 24px clamp(28px, 5vh, 56px);
    text-align: center;
}
.studio-logo {
    width: clamp(230px, 30vw, 400px);
    margin: 0;
}
.studio-about {
    max-width: 34em;
    margin: clamp(16px, 3vh, 28px) 0 0;
    color: #dde1ee;
    font-size: clamp(1.0625rem, 0.95rem + 0.55vw, 1.375rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-wrap: balance;
}

/* ---------- Game blocks ---------- */
.game {
    position: relative;
    display: grid;
    height: min(56.25vw, 88vh);
    min-height: 420px;
    overflow: hidden;
    color: var(--paper);
    text-decoration: none;
    isolation: isolate;
}
.game-art {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* Each picture fades out at its top and bottom edges, so it melts into the page
   and into the next picture instead of ending on a hard line. */
.game-art,
.game::before {
    /* Several steps rather than a straight ramp, so the fade starts and ends softly. */
    -webkit-mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,0.06) 4%, rgba(0,0,0,0.3) 10%, rgba(0,0,0,0.75) 17%, #000 24%, #000 74%, rgba(0,0,0,0.75) 82%, rgba(0,0,0,0.3) 90%, rgba(0,0,0,0.06) 96%, transparent);
    mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,0.06) 4%, rgba(0,0,0,0.3) 10%, rgba(0,0,0,0.75) 17%, #000 24%, #000 74%, rgba(0,0,0,0.75) 82%, rgba(0,0,0,0.3) 90%, rgba(0,0,0,0.06) 96%, transparent);
}
/* The second picture slides up under the first, so the two faded edges cross over. */
.game + .game { margin-top: calc(-1 * min(10vw, 16vh)); }
/* Darkens the side of the picture the logo sits on. */
.game::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
}
.game:hover .game-art { transform: scale(1.03); }
.game:focus-visible { outline: 4px solid var(--gem); outline-offset: -4px; }

.game-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.game-logo {
    width: 100%;
    margin: 0;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
}
.game-status {
    max-width: 22em;
    margin: clamp(10px, 2vh, 22px) 0 0;
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3125rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px #000, 0 0 14px rgba(0, 0, 0, 0.9);
    text-wrap: balance;
}
.game-site {
    margin-top: clamp(12px, 2.2vh, 22px);
    /* Josefin Sans sits high in its line, so the top padding is larger than the bottom. */
    padding: 0.72em 1.5em 0.5em;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    background: rgba(5, 6, 13, 0.55);
    font-size: clamp(1rem, 0.9rem + 0.4vw, 1.1875rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.game:hover .game-site,
.game:focus-visible .game-site {
    border-color: var(--gem);
    background: var(--gem);
    color: var(--ink);
}

/* Subspace Flux: the funnel is on the left, so the logo goes on the right. */
.game-flux .game-art { object-position: 0% 50%; }
.game-flux::before { background: linear-gradient(to left, rgba(3, 4, 12, 0.72), rgba(3, 4, 12, 0) 62%); }
.game-flux .game-info {
    align-self: center;
    justify-self: end;
    width: min(50%, 780px);
    margin-right: clamp(20px, 5vw, 96px);
}

/* Rogue Wizards: the heroes are right of centre, so the logo goes lower left. */
.game-wizards .game-art { object-position: 60% 32%; }
.game-wizards::before { background: linear-gradient(to right, rgba(8, 4, 12, 0.8), rgba(8, 4, 12, 0) 58%); }
.game-wizards .game-info {
    align-self: end;
    justify-self: start;
    width: min(36%, 520px);
    margin: 0 0 clamp(20px, 5vh, 64px) clamp(20px, 5vw, 96px);
}

/* ---------- Footer ---------- */
.site-footer {
    padding: 28px 24px 36px;
    text-align: center;
    font-size: 0.9375rem;
    letter-spacing: 0.04em;
}
.site-footer p { margin: 0; }
.site-footer a {
    display: inline-block;
    margin-bottom: 14px;
    color: #dde1ee;
    font-size: 1.0625rem;
    font-weight: 400;
    text-underline-offset: 0.25em;
}
.site-footer a:hover { color: var(--gem); }
.site-footer a:focus-visible { outline: 3px solid var(--gem); outline-offset: 4px; }

/* ---------- Phones and upright tablets ----------
 * Each picture is shown whole, across the full width, and fades into the page
 * at the bottom. The game logo overlaps that faded edge, with the text below.
 */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
    .game {
        display: flex;
        flex-direction: column;
        align-items: center;
        height: auto;
        min-height: 0;
        padding-bottom: clamp(36px, 9vw, 64px);
    }
    .game::before { display: none; }
    .game + .game { margin-top: 0; }
    .game-art {
        position: static;
        height: auto;
        -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 62%, transparent);
        mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 62%, transparent);
    }
    .game:hover .game-art { transform: none; }
    .game-flux .game-info,
    .game-wizards .game-info {
        align-self: center;
        margin: 0;
    }
    .game-flux .game-info {
        width: min(86%, 600px);
        margin-top: -13vw;
    }
    .game-wizards .game-info {
        width: min(86%, 600px);
        margin-top: -20vw;
    }
    .game-wizards .game-logo { width: min(64%, 400px); }
}

@media (prefers-reduced-motion: reduce) {
    .game-art, .game-site { transition: none; }
    .game:hover .game-art { transform: none; }
}
