/*
 * Jumpin Games — the shelf the cartridges sit on.
 *
 * Deliberately plain: one stylesheet, no scripts, no webfonts. The page is a
 * doorway to the games, and a doorway should load before you finish blinking.
 * The palette is the Game Boy one the games themselves are drawn in.
 */

:root {
    --ink: #0b0f0a;
    --ink-soft: #121a10;
    --panel: #16200f;
    --lcd: #6ab04c;
    --lcd-dim: #3e5a30;
    --gold: #f8e058;
    --paper: #c8d8b8;
    --paper-dim: #8a9a7a;
    --px: 4px; /* the "pixel" size the chunky borders are built from */
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    background: var(--ink);
    /* A whisper of scanlines, because the whole point is the vibe. Cheap: one
     repeating gradient the compositor tiles. */
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(200, 216, 184, 0.025) 0 1px,
        transparent 1px 3px
    );
    color: var(--paper);
    font-family:
        ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    line-height: 1.5;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

/* ------------------------------------------------------------- masthead */

.masthead {
    text-align: center;
    padding: 3.5rem 1rem 2rem;
    position: relative;
}

/* Language switcher: small, in the corner, out of the wordmark's way. */
.lang {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: var(--paper-dim);
}

.lang a {
    color: var(--paper-dim);
    text-decoration: none;
    padding: 0.2rem 0.35rem;
}

.lang a[aria-current="page"] {
    color: var(--gold);
}

.lang a:hover,
.lang a:focus {
    color: var(--lcd);
}

.wordmark {
    font-size: clamp(1.6rem, 6vw, 2.8rem);
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--lcd);
    /* Chunky drop shadow reads as depth without an image. */
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
    margin: 0;
}

.wordmark .blink {
    color: var(--gold);
    animation: blink 1.2s steps(2, start) infinite;
    margin: 0 0.08em;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.strapline {
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 700;
    color: var(--paper);
    margin: 1.4rem 0 0.3rem;
}

.sub {
    color: var(--paper-dim);
    margin: 0;
    font-size: 0.9rem;
}

/* The one paragraph a search engine can chew on. Kept narrow and dim enough
   to stay out of the wordmark's way. */
.intro {
    max-width: 34rem;
    margin: 1.6rem auto 0;
    color: var(--paper-dim);
    font-size: 0.85rem;
    line-height: 1.7;
}

/* ------------------------------------------------------------------- faq */

.faq {
    width: min(42rem, 100% - 2rem);
    margin: 0 auto 3rem;
}

.faq-title {
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lcd);
    margin: 0 0 1rem;
    text-align: center;
}

.faq details {
    border: 2px solid var(--panel);
    margin-bottom: 0.6rem;
    padding: 0.7rem 1rem;
    background: rgba(22, 32, 15, 0.6);
}

.faq summary {
    cursor: pointer;
    color: var(--paper);
    font-weight: 700;
    font-size: 0.9rem;
}

.faq details[open] summary {
    color: var(--gold);
}

.faq details p {
    margin: 0.6rem 0 0;
    color: var(--paper-dim);
    font-size: 0.85rem;
    line-height: 1.7;
}

/* --------------------------------------------------------------- games */

.games {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 1.5rem;
    width: min(60rem, 100% - 2rem);
    margin: 1rem auto 3rem;
}

/* A cartridge: dark shell, stepped pixel corners, one bright screen. */
.cart {
    background: var(--panel);
    border: var(--px) solid var(--lcd-dim);
    box-shadow:
        0 var(--px) 0 rgba(0, 0, 0, 0.6),
        inset 0 0 0 var(--px) rgba(0, 0, 0, 0.35);
    transition:
        transform 90ms steps(2),
        border-color 90ms linear;
}

.cart:hover,
.cart:focus-within {
    transform: translateY(calc(-1 * var(--px)));
    border-color: var(--lcd);
}

.cart-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.screen {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-bottom: var(--px) solid rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
}

.screen svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cart-body {
    padding: 1.1rem 1.2rem 1.3rem;
}

.cart-title {
    font-size: 1.25rem;
    letter-spacing: 0.12em;
    color: var(--gold);
    margin: 0;
    text-transform: uppercase;
}

.cart-tag {
    color: var(--lcd);
    margin: 0.3rem 0 0.7rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.cart-desc {
    margin: 0 0 1rem;
    color: var(--paper);
    font-size: 0.9rem;
}

.cart-cta {
    margin: 0;
    color: var(--lcd);
    font-weight: 700;
    letter-spacing: 0.15em;
    font-size: 0.85rem;
}

.cart-link:hover .cart-cta,
.cart-link:focus .cart-cta {
    color: var(--gold);
}

/* -------------------------------------------------------------- footer */

footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem 1rem 2.5rem;
    color: var(--paper-dim);
    font-size: 0.85rem;
    max-width: 44rem;
    margin-inline: auto;
}

footer .fine {
    letter-spacing: 0.25em;
    color: var(--lcd-dim);
    text-transform: lowercase;
}

/* Respect people who ask for less movement — the blink is the only motion
   the page has, and it goes too. */
@media (prefers-reduced-motion: reduce) {
    .wordmark .blink {
        animation: none;
    }
    .cart {
        transition: none;
    }
}
