/* Playground page, layered on styles.css (fonts, colours, Game of Life canvas and settings menu). */

:root {
    --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

body {
    line-height: 1.6;
}

/* The page scrolls inside .content-wrap; keep the Life grid fixed behind it. */
.content-wrap canvas {
    position: fixed;
    inset: 0;
}

.playground {
    position: relative;
    max-width: 68rem;
    margin: 4rem auto 6rem;
    padding: 2.5rem 3rem 3.5rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(254, 254, 255, .7);
    box-shadow: 0 .8rem 2.5rem rgba(40, 44, 52, .12);
    backdrop-filter: blur(3px);
}

.intro {
    margin-bottom: 3.5rem;
}

.home-link {
    display: inline-grid;
    width: 2.25rem;
    height: 2.25rem;
    margin-left: -.5rem;
    color: var(--ink-soft);
    place-items: center;
}

.home-link svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.intro h1 {
    margin: 2rem 0 .5rem;
    font-family: var(--font-display);
    font-size: 3.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.025em;
}

.intro p {
    max-width: 38rem;
    margin: 0;
    color: var(--ink-soft);
    font-size: 1.15rem;
}

.gallery {
    display: grid;
    gap: 4rem;
}

.viz {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2.5rem;
    align-items: center;
}

.viz-shot {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: var(--paper);
    box-shadow: 0 .6rem 2rem rgba(40, 44, 52, .12);
    transition: transform .2s ease, box-shadow .2s ease;
}

.viz-shot:hover {
    box-shadow: 0 .8rem 2.4rem rgba(40, 44, 52, .18);
    transform: translateY(-2px);
}

.viz-shot img {
    display: block;
    width: 100%;
    height: auto;
}

.viz h2 {
    margin: 0 0 .75rem;
    font-family: var(--font-display);
    font-size: 1.9rem;
    line-height: 1.15;
}

.viz h2 a {
    color: var(--ink);
}

.viz h2 a:hover {
    color: var(--accent);
}

.viz p {
    margin: 0 0 1.5rem;
}

.viz code {
    font-family: var(--font-mono);
    font-size: .85em;
}

.viz-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.viz-links a {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: .04em;
}

.viz-links svg {
    width: 1.1em;
    height: 1.1em;
    flex: none;
}

.icon-stroke {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

.icon-fill {
    fill: currentColor;
}

.viz-links .play {
    padding: .55rem 1.4rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--paper);
    transition: color .18s ease, background-color .18s ease;
}

.viz-links .play:hover,
.viz-links .play:focus-visible {
    color: var(--paper);
    background: var(--accent);
}

@media screen and (max-width: 48em) {
    .playground {
        margin: 1rem .75rem 5rem;
        padding: 1.5rem 1.25rem 2.5rem;
    }

    .intro {
        margin-bottom: 2.5rem;
    }

    .intro h1 {
        margin-top: 1.5rem;
        font-size: 2.75rem;
    }

    .viz {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .viz-shot,
    .viz-links .play {
        transition: none;
    }
}
