/* ==========================================================================
   Bhurtsoft — main stylesheet ("Paper & Ink" theme)
   All values come from variables.css. The only literals in this file are
   the media-query breakpoints, because media queries cannot read custom
   properties:
     - 40em (about 640px) : small screens / phones
     - 48em (about 768px) : tablets and up
   Naming convention: BEM (block__element--modifier).
   ========================================================================== */


/* --------------------------------------------------------------------------
   0. Fonts — self-hosted variable fonts (latin subset), no external requests
   The weight ranges are literals because @font-face descriptors cannot
   read custom properties; they describe what each font file supports.
   -------------------------------------------------------------------------- */

/* Body text */
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree.woff2") format("woff2");
}

/* Headings */
@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
}


/* --------------------------------------------------------------------------
   1. Reset — consistent defaults across browsers
   -------------------------------------------------------------------------- */

/* Include padding and border in an element's size */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default outer spacing; spacing is set explicitly per component */
body,
h1,
h2,
h3,
p,
figure,
ul {
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
}

/* Media scales with its container by default */
img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}


/* --------------------------------------------------------------------------
   2. Base — document-wide typography and colors
   -------------------------------------------------------------------------- */

html {
    color-scheme: light;

    /* Smooth in-page scrolling, only when the user has not asked for less motion */
    @media (prefers-reduced-motion: no-preference) {
        scroll-behavior: smooth;
    }
}

/* Column layout so the footer always sits at the bottom of short pages */
body {
    display: flex;
    flex-direction: column;
    min-height: var(--layout-min-height);
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-base);
}

/* Shared heading styles: heavy, tightly spaced display type */
h1,
h2,
h3 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-heading);
}

h1 {
    font-size: var(--font-size-h1);
    line-height: var(--line-height-display);
    letter-spacing: var(--letter-spacing-display);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h3);
}

/* Default links: ink colored and underlined, so they are not identified by color alone */
a {
    color: var(--color-text);
    text-decoration-line: underline;
    text-underline-offset: var(--underline-offset);

    &:hover {
        color: var(--color-link-hover);
    }
}

/* Clearly visible focus ring for keyboard users on every interactive element */
:focus-visible {
    outline-width: var(--focus-outline-width);
    outline-style: solid;
    outline-color: var(--color-focus);
    outline-offset: var(--focus-outline-offset);
}


/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */

/* Centered content wrapper with a maximum width and side padding */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-right: auto;
    margin-left: auto;
    padding-right: var(--container-padding);
    padding-left: var(--container-padding);
}

/* Main content grows to push the footer down */
.site-main {
    flex-grow: 1;
}


/* --------------------------------------------------------------------------
   4. Skip link — lets keyboard users jump straight to the main content
   -------------------------------------------------------------------------- */

.skip-link {
    position: absolute;
    top: var(--space-s);
    left: var(--space-s);
    z-index: var(--z-index-skip-link);
    padding-top: var(--space-xs);
    padding-right: var(--space-m);
    padding-bottom: var(--space-xs);
    padding-left: var(--space-m);
    border-top-left-radius: var(--border-radius-pill);
    border-top-right-radius: var(--border-radius-pill);
    border-bottom-right-radius: var(--border-radius-pill);
    border-bottom-left-radius: var(--border-radius-pill);
    background-color: var(--color-ink);
    color: var(--color-text-inverse);
    font-weight: var(--font-weight-semibold);
    transform: translateY(var(--skip-link-hidden-offset));

    /* Slide into view when focused */
    &:focus {
        transform: translateY(0);
    }
}


/* --------------------------------------------------------------------------
   5. Site header and navigation (component: site-header, site-nav)
   -------------------------------------------------------------------------- */

/* Sticky header that stays visible while scrolling */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-index-header);
    border-bottom-width: var(--border-width);
    border-bottom-style: solid;
    border-bottom-color: var(--color-border);
    background-color: var(--color-background-translucent);
    backdrop-filter: blur(var(--header-blur));
}

/* Logo on the left, navigation on the right; wraps on narrow screens */
.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    row-gap: var(--space-s);
    column-gap: var(--space-l);
    padding-top: var(--space-m);
    padding-bottom: var(--space-m);
}

/* Logo plus studio name, linking back to the homepage */
.site-header__logo-link {
    display: flex;
    align-items: center;
    column-gap: var(--space-s);
    border-top-left-radius: var(--border-radius-medium);
    border-top-right-radius: var(--border-radius-medium);
    border-bottom-right-radius: var(--border-radius-medium);
    border-bottom-left-radius: var(--border-radius-medium);
    color: var(--color-text);
    text-decoration-line: none;

    &:hover {
        color: var(--color-text);
    }
}

.site-header__logo {
    width: var(--header-logo-size);
    height: var(--header-logo-size);
    border-top-left-radius: var(--border-radius-medium);
    border-top-right-radius: var(--border-radius-medium);
    border-bottom-right-radius: var(--border-radius-medium);
    border-bottom-left-radius: var(--border-radius-medium);
}

/* Studio name next to the logo */
.site-header__name {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-heading);
}

/* Hamburger / close button: an outlined pill with an icon and a visible label.
   Only shown on small screens; it opens and closes the menu with the native
   Popover API (popovertarget), so no JavaScript is needed */
.menu-button {
    display: inline-flex;
    align-items: center;
    column-gap: var(--space-xs);
    height: var(--menu-button-height);
    padding-top: 0;
    padding-right: var(--space-m);
    padding-bottom: 0;
    padding-left: var(--space-m);
    border-top-width: var(--border-width-strong);
    border-right-width: var(--border-width-strong);
    border-bottom-width: var(--border-width-strong);
    border-left-width: var(--border-width-strong);
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: var(--color-ink);
    border-right-color: var(--color-ink);
    border-bottom-color: var(--color-ink);
    border-left-color: var(--color-ink);
    border-top-left-radius: var(--border-radius-pill);
    border-top-right-radius: var(--border-radius-pill);
    border-bottom-right-radius: var(--border-radius-pill);
    border-bottom-left-radius: var(--border-radius-pill);
    background-color: transparent;
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition-property: background-color, color;
    transition-duration: var(--transition-duration);
    transition-timing-function: var(--transition-timing);

    /* Fill with ink on hover, like the secondary button */
    &:hover {
        background-color: var(--color-ink);
        color: var(--color-text-inverse);
    }

    /* From tablet width the full navigation fits, so the button is not needed */
    @media (min-width: 40em) {
        display: none;
    }
}

/* Hamburger and close icons inside the menu button */
.menu-button__icon {
    width: var(--button-icon-size);
    height: var(--button-icon-size);
}

/* Main navigation.
   Small screens: a popover panel that slides down over the top of the page.
   Tablet and up: a plain horizontal list on the right of the header */
.site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    flex-direction: column;
    row-gap: var(--space-l);
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 100%;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    padding-top: calc(var(--space-m) + (var(--header-logo-size) - var(--menu-button-height)) / 2);
    padding-right: var(--container-padding);
    padding-bottom: var(--space-xl);
    padding-left: var(--container-padding);
    overflow-y: auto;
    border-top-width: 0;
    border-right-width: 0;
    border-bottom-width: var(--border-width);
    border-left-width: 0;
    border-bottom-style: solid;
    border-bottom-color: var(--color-border);
    border-bottom-right-radius: var(--border-radius-large);
    border-bottom-left-radius: var(--border-radius-large);
    background-color: var(--color-background);
    box-shadow: var(--shadow-menu);
    color: var(--color-text);
    opacity: 0;
    transform: translateY(var(--menu-slide-offset));
    transition-property: opacity, transform, display, overlay;
    transition-duration: var(--transition-duration);
    transition-timing-function: var(--transition-timing);
    transition-behavior: allow-discrete;

    /* Open: fade and slide into place */
    &:popover-open {
        display: flex;
        opacity: 1;
        transform: translateY(0);

        /* Start position of the opening animation */
        @starting-style {
            opacity: 0;
            transform: translateY(var(--menu-slide-offset));
        }
    }

    /* Dim the page behind the open menu; clicking it closes the menu */
    &::backdrop {
        background-color: var(--color-backdrop);
    }

    /* Tablet and up: always visible, in the normal flow of the header */
    @media (min-width: 40em) {
        display: block;
        position: static;
        width: auto;
        max-height: none;
        padding-top: 0;
        padding-right: 0;
        padding-bottom: 0;
        padding-left: 0;
        overflow-y: visible;
        border-bottom-width: 0;
        background-color: transparent;
        box-shadow: none;
        opacity: 1;
        transform: none;
    }
}

/* Close button: top right of the open panel, in the same spot as the hamburger button */
.site-nav__close {
    align-self: flex-end;
}

/* Keep the page behind the open menu from scrolling */
body:has(.site-nav:popover-open) {
    overflow-y: hidden;
}

/* List of navigation links: stacked in the panel, horizontal from tablet width */
.site-nav__list {
    display: flex;
    flex-direction: column;
    row-gap: var(--space-2xs);
    column-gap: var(--space-2xs);
    padding-left: 0;
    list-style-type: none;

    @media (min-width: 40em) {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Pill-shaped navigation link: large touch targets in the panel, compact in the header */
.site-nav__link {
    display: block;
    padding-top: var(--space-s);
    padding-right: var(--space-l);
    padding-bottom: var(--space-s);
    padding-left: var(--space-l);
    border-top-left-radius: var(--border-radius-pill);
    border-top-right-radius: var(--border-radius-pill);
    border-bottom-right-radius: var(--border-radius-pill);
    border-bottom-left-radius: var(--border-radius-pill);
    color: var(--color-text);
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-semibold);
    text-decoration-line: none;
    transition-property: background-color, color;
    transition-duration: var(--transition-duration);
    transition-timing-function: var(--transition-timing);

    @media (min-width: 40em) {
        padding-top: var(--space-xs);
        padding-right: var(--space-m);
        padding-bottom: var(--space-xs);
        padding-left: var(--space-m);
        font-size: var(--font-size-base);
    }

    &:hover {
        background-color: var(--color-surface-hover);
        color: var(--color-text);
    }

    /* Current page (or its parent section, e.g. Games on a game page): a filled ink pill,
       so it is marked by shape and not only by color */
    &[aria-current="page"],
    &[aria-current="true"] {
        background-color: var(--color-ink);
        color: var(--color-text-inverse);
    }
}


/* --------------------------------------------------------------------------
   6. Hero (component: hero) — page introduction with title and lead text
   -------------------------------------------------------------------------- */

/* Default hero: centered title and lead text (used on the sub pages) */
.hero {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-2xl);
    text-align: center;
}

.hero__title {
    margin-bottom: var(--space-l);
}

.hero__lead {
    max-width: var(--measure);
    margin-right: auto;
    margin-left: auto;
    color: var(--color-text-muted);
    font-size: var(--font-size-large);
}

/* Row of call-to-action buttons below the lead text */
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: var(--space-s);
    column-gap: var(--space-s);
    margin-top: var(--space-xl);
}

/* Split hero (homepage): text on the left, the owl on the right */
.hero--split {
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-3xl);
    text-align: start;

    .hero__inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        row-gap: var(--space-2xl);
        column-gap: var(--space-2xl);
    }

    .hero__text {
        flex-grow: 999;
        flex-shrink: 1;
        flex-basis: var(--hero-text-basis);
        min-width: 0;
    }

    .hero__lead {
        max-width: var(--measure-lead);
        margin-right: 0;
        margin-left: 0;
    }

    .hero__actions {
        justify-content: flex-start;
    }
}

/* Small outlined label above the title */
.hero__eyebrow {
    display: inline-block;
    margin-bottom: var(--space-l);
    padding-top: var(--space-2xs);
    padding-right: var(--space-m);
    padding-bottom: var(--space-2xs);
    padding-left: var(--space-m);
    border-top-width: var(--border-width-strong);
    border-right-width: var(--border-width-strong);
    border-bottom-width: var(--border-width-strong);
    border-left-width: var(--border-width-strong);
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: var(--color-ink);
    border-right-color: var(--color-ink);
    border-bottom-color: var(--color-ink);
    border-left-color: var(--color-ink);
    border-top-left-radius: var(--border-radius-pill);
    border-top-right-radius: var(--border-radius-pill);
    border-bottom-right-radius: var(--border-radius-pill);
    border-bottom-left-radius: var(--border-radius-pill);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-badge);
    text-transform: uppercase;
}

/* Bold inline text inside the lead, e.g. the game name */
.hero__highlight {
    color: var(--color-text);
}

/* Owl "sticker": the logo, slightly tilted, on an amber block */
.hero__art {
    display: flex;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: var(--hero-art-basis);
    justify-content: center;
}

.hero__art-frame {
    position: relative;
    width: var(--hero-art-size);
    height: var(--hero-art-size);

    /* Amber block offset behind the logo */
    &::before {
        content: "";
        position: absolute;
        top: var(--hero-art-offset);
        right: calc(var(--hero-art-offset) * -1);
        bottom: calc(var(--hero-art-offset) * -1);
        left: var(--hero-art-offset);
        border-top-left-radius: var(--border-radius-art);
        border-top-right-radius: var(--border-radius-art);
        border-bottom-right-radius: var(--border-radius-art);
        border-bottom-left-radius: var(--border-radius-art);
        background-color: var(--color-accent);
    }
}

.hero__art-image {
    position: relative;
    width: 100%;
    height: 100%;
    border-top-left-radius: var(--border-radius-art);
    border-top-right-radius: var(--border-radius-art);
    border-bottom-right-radius: var(--border-radius-art);
    border-bottom-left-radius: var(--border-radius-art);
    transform: rotate(var(--hero-art-rotation));
}


/* --------------------------------------------------------------------------
   7. Section (component: section) — generic content block
   -------------------------------------------------------------------------- */

.section {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
}

/* Section separated from the previous one by a thin line */
.section--divided {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    border-top-width: var(--border-width);
    border-top-style: solid;
    border-top-color: var(--color-border);
}

.section__title {
    margin-bottom: var(--space-l);
}

/* Title with a small note on the right, e.g. the number of games */
.section__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    row-gap: var(--space-xs);
    column-gap: var(--space-m);
    margin-bottom: var(--space-xl);

    .section__title {
        margin-bottom: 0;
    }
}

.section__meta {
    color: var(--color-text-subtle);
}

/* Short introduction directly below a section title */
.section__intro {
    max-width: var(--measure);
    margin-top: calc(var(--space-m) * -1);
    margin-bottom: var(--space-xl);
    color: var(--color-text-subtle);
}

/* Body text limited to a comfortable reading width */
.section__text {
    max-width: var(--measure);
    color: var(--color-text-muted);

    /* Space between consecutive paragraphs */
    & + & {
        margin-top: var(--space-s);
    }
}

/* Body text that uses the full width of the container, e.g. on the About Us page */
.section__text--full {
    max-width: none;
}


/* --------------------------------------------------------------------------
   8. Button (component: button) — pill-shaped call to action
   -------------------------------------------------------------------------- */

/* Primary button: solid ink */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    column-gap: var(--space-xs);
    min-height: var(--button-min-height);
    padding-top: var(--space-xs);
    padding-right: var(--space-l);
    padding-bottom: var(--space-xs);
    padding-left: var(--space-l);
    border-top-width: var(--border-width-strong);
    border-right-width: var(--border-width-strong);
    border-bottom-width: var(--border-width-strong);
    border-left-width: var(--border-width-strong);
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: var(--color-ink);
    border-right-color: var(--color-ink);
    border-bottom-color: var(--color-ink);
    border-left-color: var(--color-ink);
    border-top-left-radius: var(--border-radius-pill);
    border-top-right-radius: var(--border-radius-pill);
    border-bottom-right-radius: var(--border-radius-pill);
    border-bottom-left-radius: var(--border-radius-pill);
    background-color: var(--color-ink);
    color: var(--color-text-inverse);
    font-weight: var(--font-weight-semibold);
    text-decoration-line: none;
    transition-property: background-color, color;
    transition-duration: var(--transition-duration);
    transition-timing-function: var(--transition-timing);

    &:hover {
        background-color: var(--color-ink-hover);
        color: var(--color-text-inverse);
    }
}

/* Secondary button: ink outline that fills on hover */
.button--secondary {
    background-color: transparent;
    color: var(--color-text);

    &:hover {
        background-color: var(--color-ink);
        color: var(--color-text-inverse);
    }
}

/* Icon inside a button, e.g. an arrow or a platform logo */
.button__icon {
    width: var(--button-icon-size);
    height: var(--button-icon-size);
    flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   9. Card grid and card (components: card-grid, card)
   -------------------------------------------------------------------------- */

/* Stacked list of cards: every card takes up a full row */
.card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-l);
    column-gap: var(--space-l);
    padding-left: 0;
    list-style-type: none;
}

/* Clickable card with an ink outline; the whole surface is covered by the title link */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    border-top-width: var(--border-width-strong);
    border-right-width: var(--border-width-strong);
    border-bottom-width: var(--border-width-strong);
    border-left-width: var(--border-width-strong);
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: var(--color-ink);
    border-right-color: var(--color-ink);
    border-bottom-color: var(--color-ink);
    border-left-color: var(--color-ink);
    border-top-left-radius: var(--border-radius-xlarge);
    border-top-right-radius: var(--border-radius-xlarge);
    border-bottom-right-radius: var(--border-radius-xlarge);
    border-bottom-left-radius: var(--border-radius-xlarge);
    background-color: var(--color-surface);
    box-shadow: var(--shadow-card);
    transition-property: transform, box-shadow;
    transition-duration: var(--transition-duration);
    transition-timing-function: var(--transition-timing);

    /* Wider screens: image on the left, content on the right */
    @media (min-width: 48em) {
        flex-direction: row;
        align-items: stretch;
    }

    /* Lift the card and show an amber block shadow on hover or keyboard focus */
    &:hover,
    &:focus-within {
        box-shadow: var(--shadow-card-hover);
        transform: translateY(var(--hover-lift));
    }
}

.card__image {
    width: 100%;
    aspect-ratio: var(--aspect-ratio-media);
    object-fit: cover;
    border-bottom-width: var(--border-width-strong);
    border-bottom-style: solid;
    border-bottom-color: var(--color-ink);

    /* Wider screens: image takes a fixed share of the row, divider on the right */
    @media (min-width: 48em) {
        flex-shrink: 0;
        width: var(--card-image-width-wide);
        min-height: var(--card-image-min-height);
        border-right-width: var(--border-width-strong);
        border-right-style: solid;
        border-right-color: var(--color-ink);
        border-bottom-width: 0;
    }
}

.card__content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    row-gap: var(--space-m);
    padding-top: var(--space-xl);
    padding-right: var(--space-xl);
    padding-bottom: var(--space-xl);
    padding-left: var(--space-xl);
}

/* Large game title */
.card__title {
    font-size: var(--font-size-card-title);
    line-height: var(--line-height-tight);
}

.card__link {
    color: var(--color-text);
    text-decoration-line: none;

    &:hover {
        color: var(--color-text);
    }

    /* Stretch the link over the entire card so the whole card is clickable */
    &::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        border-top-left-radius: var(--border-radius-xlarge);
        border-top-right-radius: var(--border-radius-xlarge);
        border-bottom-right-radius: var(--border-radius-xlarge);
        border-bottom-left-radius: var(--border-radius-xlarge);
    }

    /* Draw the focus ring around the whole card instead of only the title */
    &:focus-visible {
        outline-style: none;

        &::after {
            outline-width: var(--focus-outline-width);
            outline-style: solid;
            outline-color: var(--color-focus);
            outline-offset: var(--focus-outline-offset);
        }
    }
}

.card__description {
    color: var(--color-text-muted);
}

/* Row of small labels above the title: status badge and engine tag(s) */
.card__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: var(--space-xs);
    column-gap: var(--space-xs);
    padding-left: 0;
    list-style-type: none;
}

/* Small status label, e.g. "In development": ink text on an amber fill */
.card__badge {
    align-self: flex-start;
    padding-top: var(--space-2xs);
    padding-right: var(--space-s);
    padding-bottom: var(--space-2xs);
    padding-left: var(--space-s);
    border-top-left-radius: var(--border-radius-pill);
    border-top-right-radius: var(--border-radius-pill);
    border-bottom-right-radius: var(--border-radius-pill);
    border-bottom-left-radius: var(--border-radius-pill);
    background-color: var(--color-accent);
    color: var(--color-accent-contrast);
    font-size: var(--font-size-xsmall);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-badge);
    text-transform: uppercase;
}

/* Engine label, e.g. "Unity": same pill shape as the badge, but an ink outline with a logo.
   The vertical padding subtracts the border so it lines up with the badge height. */
.card__tag {
    display: inline-flex;
    align-items: center;
    column-gap: var(--space-2xs);
    padding-top: calc(var(--space-2xs) - var(--border-width-strong));
    padding-right: var(--space-s);
    padding-bottom: calc(var(--space-2xs) - var(--border-width-strong));
    padding-left: var(--space-s);
    border-top-width: var(--border-width-strong);
    border-right-width: var(--border-width-strong);
    border-bottom-width: var(--border-width-strong);
    border-left-width: var(--border-width-strong);
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: var(--color-ink);
    border-right-color: var(--color-ink);
    border-bottom-color: var(--color-ink);
    border-left-color: var(--color-ink);
    border-top-left-radius: var(--border-radius-pill);
    border-top-right-radius: var(--border-radius-pill);
    border-bottom-right-radius: var(--border-radius-pill);
    border-bottom-left-radius: var(--border-radius-pill);
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-xsmall);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-badge);
    text-transform: uppercase;
}

/* Engine logo inside the tag, sized relative to the tag text */
.card__tag-icon {
    width: var(--tag-icon-size);
    height: var(--tag-icon-size);
    flex-shrink: 0;
}

/* Row of genre labels below the title, kept apart from the status and engine tags */
.card__genres {
    display: flex;
    flex-wrap: wrap;
    row-gap: var(--space-xs);
    column-gap: var(--space-xs);
    padding-left: 0;
    list-style-type: none;
}

/* Genre label: a soft filled pill in sentence case, quieter than the outlined tags */
.card__genre {
    padding-top: var(--space-2xs);
    padding-right: var(--space-s);
    padding-bottom: var(--space-2xs);
    padding-left: var(--space-s);
    border-top-left-radius: var(--border-radius-pill);
    border-top-right-radius: var(--border-radius-pill);
    border-bottom-right-radius: var(--border-radius-pill);
    border-bottom-left-radius: var(--border-radius-pill);
    background-color: var(--color-surface-hover);
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-semibold);
}

/* Buttons at the bottom of the card */
.card__actions {
    display: flex;
    flex-wrap: wrap;
    row-gap: var(--space-s);
    column-gap: var(--space-s);
    margin-top: auto;
    padding-top: var(--space-s);
}

/* A real link inside the card: raised above the stretched title link so it stays clickable */
.card__action {
    position: relative;
    z-index: var(--z-index-card-action);
}

/* Visual "Read more" button; clicks fall through to the stretched title link */
.card__more {
    pointer-events: none;
}


/* --------------------------------------------------------------------------
   10. Link tiles (component: tile-grid, tile) — e.g. "Follow the build"
   -------------------------------------------------------------------------- */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--tile-min-width)), 1fr));
    row-gap: var(--space-m);
    column-gap: var(--space-m);
    padding-left: 0;
    list-style-type: none;
}

/* Large link block with a small label and a heading-style title */
.tile {
    display: flex;
    flex-direction: column;
    row-gap: var(--space-2xs);
    height: 100%;
    padding-top: var(--space-xl);
    padding-right: var(--space-xl);
    padding-bottom: var(--space-xl);
    padding-left: var(--space-xl);
    border-top-width: var(--border-width-strong);
    border-right-width: var(--border-width-strong);
    border-bottom-width: var(--border-width-strong);
    border-left-width: var(--border-width-strong);
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: var(--color-border);
    border-right-color: var(--color-border);
    border-bottom-color: var(--color-border);
    border-left-color: var(--color-border);
    border-top-left-radius: var(--border-radius-large);
    border-top-right-radius: var(--border-radius-large);
    border-bottom-right-radius: var(--border-radius-large);
    border-bottom-left-radius: var(--border-radius-large);
    background-color: var(--color-surface);
    color: var(--color-text);
    text-decoration-line: none;
    transition-property: border-color;
    transition-duration: var(--transition-duration);
    transition-timing-function: var(--transition-timing);

    /* Darken the outline on hover */
    &:hover {
        border-top-color: var(--color-ink);
        border-right-color: var(--color-ink);
        border-bottom-color: var(--color-ink);
        border-left-color: var(--color-ink);
        color: var(--color-text);
    }
}

.tile__label {
    color: var(--color-text-subtle);
    font-size: var(--font-size-xsmall);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-badge);
    text-transform: uppercase;
}

/* Long titles, such as an email address, wrap instead of overflowing on small screens */
.tile__title {
    overflow-wrap: anywhere;
    font-family: var(--font-family-heading);
    font-size: var(--font-size-tile);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-heading);
}


/* --------------------------------------------------------------------------
   11. Gallery (component: gallery) — responsive grid of screenshots
   -------------------------------------------------------------------------- */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--gallery-min-width)), 1fr));
    row-gap: var(--space-l);
    column-gap: var(--space-l);
    padding-left: 0;
    list-style-type: none;
}

.gallery__figure {
    overflow-x: hidden;
    overflow-y: hidden;
    border-top-width: var(--border-width-strong);
    border-right-width: var(--border-width-strong);
    border-bottom-width: var(--border-width-strong);
    border-left-width: var(--border-width-strong);
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: solid;
    border-left-style: solid;
    border-top-color: var(--color-ink);
    border-right-color: var(--color-ink);
    border-bottom-color: var(--color-ink);
    border-left-color: var(--color-ink);
    border-top-left-radius: var(--border-radius-large);
    border-top-right-radius: var(--border-radius-large);
    border-bottom-right-radius: var(--border-radius-large);
    border-bottom-left-radius: var(--border-radius-large);
    background-color: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.gallery__image {
    width: 100%;
    aspect-ratio: var(--aspect-ratio-media);
    object-fit: cover;
}

.gallery__caption {
    padding-top: var(--space-s);
    padding-right: var(--space-m);
    padding-bottom: var(--space-s);
    padding-left: var(--space-m);
    border-top-width: var(--border-width-strong);
    border-top-style: solid;
    border-top-color: var(--color-ink);
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
}


/* --------------------------------------------------------------------------
   12. Site footer (component: site-footer, social-list) — solid ink band
   -------------------------------------------------------------------------- */

.site-footer {
    margin-top: var(--space-3xl);
    background-color: var(--color-ink);
    color: var(--color-text-inverse);

    /* Amber focus ring, visible on the dark background */
    & :focus-visible {
        outline-color: var(--color-focus-inverse);
    }
}

/* Copyright on the left, social links on the right */
.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    row-gap: var(--space-s);
    column-gap: var(--space-l);
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);

    /* Stack and center the footer content on small screens */
    @media (max-width: 40em) {
        flex-direction: column;
        text-align: center;
    }
}

.site-footer__copyright {
    color: var(--color-text-inverse);
    font-size: var(--font-size-small);
}

/* Horizontal list of social media icon links */
.social-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: var(--space-xs);
    column-gap: var(--space-xs);
    padding-left: 0;
    list-style-type: none;
}

/* Square, touch-friendly hit area around each icon */
.social-list__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--social-link-size);
    height: var(--social-link-size);
    border-top-left-radius: var(--border-radius-pill);
    border-top-right-radius: var(--border-radius-pill);
    border-bottom-right-radius: var(--border-radius-pill);
    border-bottom-left-radius: var(--border-radius-pill);
    color: var(--color-text-inverse);
    transition-property: background-color, color;
    transition-duration: var(--transition-duration);
    transition-timing-function: var(--transition-timing);

    &:hover {
        background-color: var(--color-accent);
        color: var(--color-accent-contrast);
    }
}

/* Brand icon; inherits the link color so hover and focus states apply */
.social-list__icon {
    width: var(--social-icon-size);
    height: var(--social-icon-size);
    fill: currentColor;
}

/* Visually hidden name, still announced by screen readers */
.social-list__label {
    position: absolute;
    width: var(--visually-hidden-size);
    height: var(--visually-hidden-size);
    overflow-x: hidden;
    overflow-y: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
