/* Homepage layout. Shared tokens, fonts, header and footer live in css/site.css. */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--sg-header-h) + 16px);
}

body.home-page {
    margin: 0;
    min-height: 100dvh;
    background:
        radial-gradient(1100px 620px at 12% -8%, rgba(240, 178, 74, 0.075), transparent 62%),
        radial-gradient(900px 500px at 100% 4%, rgba(196, 120, 64, 0.05), transparent 60%),
        var(--sg-bg);
    color: var(--sg-ink);
    font-family: var(--sg-font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Film grain so the dark surfaces don't look flat. */
body.home-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.home-page main {
    display: block;
}

/* The hero has its own big search box; the header one appears once it scrolls away. */
.home-page .sg-search {
    transition: opacity 0.2s var(--sg-ease), visibility 0.2s;
}

.home-page.hero-search-visible .sg-search {
    opacity: 0;
    visibility: hidden;
}

.home-page main {
    --home-gutter: 20px;
    --home-rule: linear-gradient(var(--sg-line), var(--sg-line)) center top / calc(100% - 2 * var(--home-gutter)) 1px no-repeat;
}

.home-page main > * {
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: var(--home-gutter);
}

.home-page main h1,
.home-page main h2,
.home-page main h3 {
    margin: 0;
    text-wrap: balance;
}

.home-page p {
    text-wrap: pretty;
}

.home-page a {
    color: inherit;
}

.home-page a:focus-visible,
.home-page button:focus-visible,
.home-page input:focus-visible {
    outline: 2px solid var(--sg-accent);
    outline-offset: 3px;
    border-radius: 6px;
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: var(--sg-ink-3);
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.home-eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--sg-accent);
}

/* ---------- Hero ---------- */

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    gap: 32px 48px;
    padding-top: 40px;
    padding-bottom: 64px;
}

.home-hero__media {
    display: grid;
    gap: 16px;
}

.home-hero h1 {
    font-size: clamp(2.6rem, 5vw, 4.25rem);
    font-weight: 780;
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.home-hero h1 span {
    display: block;
    color: var(--sg-ink-2);
    font-weight: 380;
    letter-spacing: -0.035em;
}

.home-hero__lede {
    max-width: 44ch;
    margin: 22px 0 28px;
    color: var(--sg-ink-2);
    font-size: 17.5px;
    line-height: 1.55;
}

.home-search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 480px;
    margin: 0;
}

.home-search input {
    width: 100%;
    height: 56px;
    margin: 0;
    padding: 0 52px 0 50px;
    border: 1px solid var(--sg-line-2);
    border-radius: 12px;
    background: var(--sg-bg-2);
    color: var(--sg-ink);
    font: 450 17px/1 var(--sg-font);
    transition: border-color 0.2s var(--sg-ease), box-shadow 0.2s var(--sg-ease), background-color 0.2s var(--sg-ease);
    -webkit-appearance: none;
    appearance: none;
}

.home-search input::placeholder {
    color: var(--sg-ink-3);
}

.home-search input:hover {
    border-color: rgba(240, 230, 214, 0.3);
}

.home-search input:focus {
    outline: none;
    border-color: var(--sg-accent);
    background: var(--sg-bg-3);
    box-shadow: 0 0 0 4px rgba(240, 178, 74, 0.14);
}

.home-search__icon {
    position: absolute;
    left: 18px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--sg-ink-3);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.home-search__key {
    position: absolute;
    right: 16px;
    min-width: 24px;
    padding: 4px 7px;
    border: 1px solid var(--sg-line-2);
    border-bottom-width: 2px;
    border-radius: 6px;
    color: var(--sg-ink-3);
    font: 500 12px/1 var(--sg-font);
    text-align: center;
    pointer-events: none;
    transition: opacity 0.15s;
}

.home-search input:focus ~ .home-search__key {
    opacity: 0;
}

.home-search__try {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    margin: 14px 0 0;
    color: var(--sg-ink-3);
    font-size: 14px;
}

.home-search__try button {
    padding: 0;
    border: 0;
    border-bottom: 1px dashed rgba(240, 230, 214, 0.28);
    background: none;
    color: var(--sg-ink-2);
    font: inherit;
    cursor: pointer;
    transition: color 0.18s var(--sg-ease), border-color 0.18s var(--sg-ease);
}

.home-search__try button:hover {
    color: var(--sg-accent-2);
    border-bottom-color: var(--sg-accent);
}

/* Phones get a pointer to the touch-friendly picks instead of a redirect, so Google indexes one homepage. */
.home-phone-link {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 13px 14px;
    border: 1px solid var(--sg-line-2);
    border-radius: 12px;
    background: var(--sg-bg-2);
    color: var(--sg-ink-2);
    font-size: 15px;
    line-height: 1.35;
    text-decoration: none;
}

.home-phone-link::before {
    content: "";
    flex: none;
    width: 14px;
    height: 22px;
    border: 2px solid var(--sg-accent);
    border-radius: 4px;
}

.home-phone-link::after {
    content: "→";
    margin-left: auto;
    color: var(--sg-accent);
}

.home-phone-link strong {
    color: var(--sg-ink);
    font-weight: 650;
    white-space: nowrap;
}

@media (max-width: 760px), (pointer: coarse) {
    .home-phone-link {
        display: flex;
    }
}

.hero-actions {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 10px 32px;
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--sg-line);
}

.hero-actions a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--sg-ink-2);
    font-size: 15px;
    font-weight: 540;
    text-decoration: none;
    transition: color 0.18s var(--sg-ease);
}

.hero-actions a::after {
    content: "→";
    color: var(--sg-ink-3);
    transition: transform 0.2s var(--sg-ease), color 0.2s var(--sg-ease);
}

.hero-actions a:hover {
    color: var(--sg-ink);
}

.hero-actions a:hover::after {
    color: var(--sg-accent);
    transform: translateX(3px);
}

.home-hero__feature {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 18px;
    background: var(--sg-bg-3);
    text-decoration: none;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--sg-line);
}

.home-hero__feature img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--sg-ease);
}

.home-hero__feature::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 38%, rgba(12, 10, 9, 0.55) 62%, rgba(12, 10, 9, 0.94));
}

.home-hero__feature:hover img {
    transform: scale(1.035);
}

.home-hero__feature-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: grid;
    justify-items: start;
    gap: 8px;
    padding: 28px 30px 28px;
}

.home-flag {
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--sg-accent);
    color: var(--sg-accent-ink);
    font-size: 12.5px;
    font-weight: 650;
}

.home-hero__feature-body strong {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 760;
    line-height: 1;
    letter-spacing: -0.035em;
}

.home-hero__feature-body > span:not([class]) {
    max-width: 48ch;
    color: var(--sg-ink-2);
    font-size: 15.5px;
}

.home-hero__play {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    padding: 10px 18px 10px 15px;
    border-radius: 9px;
    background: var(--sg-ink);
    color: var(--sg-bg);
    font-size: 15px;
    font-weight: 650;
    transition: background-color 0.2s var(--sg-ease), transform 0.15s var(--sg-ease);
}

.home-hero__play::before {
    content: "";
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 9px solid currentColor;
}

.home-hero__feature:hover .home-hero__play {
    background: var(--sg-accent);
    color: var(--sg-accent-ink);
}

.home-hero__feature:active .home-hero__play {
    transform: translateY(1px);
}

.home-hero__side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.home-mini {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 9px;
    border: 1px solid var(--sg-line);
    border-radius: 13px;
    background: var(--sg-bg-2);
    text-decoration: none;
    transition: background-color 0.2s var(--sg-ease), border-color 0.2s var(--sg-ease);
}

.home-mini img {
    width: 104px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
}

.home-mini span {
    color: var(--sg-ink-3);
    font-size: 14px;
    line-height: 1.35;
}

.home-mini strong {
    display: block;
    margin-bottom: 2px;
    color: var(--sg-ink);
    font-size: 15.5px;
    font-weight: 650;
}

.home-mini:hover {
    border-color: var(--sg-line-2);
    background: var(--sg-bg-3);
}

/* ---------- Ads: empty slots take no space ---------- */

.home-page .ad {
    display: block;
}

/* AdSense sizes unfilled slots (90-280px of blank space). Collapse every slot until it is filled. */
.home-page .ad ins.adsbygoogle:not([data-ad-status="filled"]) {
    max-height: 0 !important;
    overflow: hidden;
}

.home-page .ad:has(ins[data-ad-status="filled"]) {
    margin-block: 8px 48px;
}

/* ---------- Section heads ---------- */

.home-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 24px;
    margin-bottom: 22px;
}

.home-head h2 {
    grid-column: 1;
    font-size: clamp(1.65rem, 2.6vw, 2.15rem);
    font-weight: 730;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.home-head p {
    grid-column: 1;
    max-width: 62ch;
    margin: 8px 0 0;
    color: var(--sg-ink-3);
    font-size: 15.5px;
}

.home-head__tools {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    gap: 14px;
}

.home-head__link {
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: 0 0 2px;
    border: 0;
    border-bottom: 1px solid var(--sg-line-2);
    background: none;
    color: var(--sg-ink-2);
    font: 560 15px/1.3 var(--sg-font);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.18s var(--sg-ease), border-color 0.18s var(--sg-ease);
}

.home-head__link:hover {
    color: var(--sg-accent-2);
    border-bottom-color: var(--sg-accent);
}

.home-arrows {
    display: flex;
    gap: 6px;
}

.home-arrows button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--sg-line-2);
    border-radius: 9px;
    background: transparent;
    color: var(--sg-ink-2);
    font: 500 17px/1 var(--sg-font);
    cursor: pointer;
    transition: background-color 0.18s var(--sg-ease), color 0.18s var(--sg-ease), border-color 0.18s var(--sg-ease);
}

.home-arrows button:hover:not(:disabled) {
    border-color: var(--sg-accent);
    color: var(--sg-ink);
}

.home-arrows button:active:not(:disabled) {
    transform: translateY(1px);
}

.home-arrows button:disabled {
    opacity: 0.35;
    cursor: default;
}

/* ---------- Search results ---------- */

.search-results {
    padding-bottom: 48px;
}

.search-results[hidden] {
    display: none;
}

.search-results .search-summary {
    font-variant-numeric: tabular-nums;
}

/* ---------- "New on Supagames" strip ---------- */

.home-feature-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 72px;
}

.home-feature-strip > .home-feature-card,
.home-feature-strip__more {
    margin-inline: 0;
}

.home-feature-card {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 22px 26px 24px;
    border-top: 1px solid var(--sg-line);
    border-bottom: 1px solid var(--sg-line);
    text-decoration: none;
    transition: background-color 0.2s var(--sg-ease);
}

.home-feature-card + .home-feature-card {
    border-left: 1px solid var(--sg-line);
}

.home-feature-card:first-child {
    padding-left: 0;
}

.home-feature-card__kind {
    color: var(--sg-accent);
    font-size: 13px;
    font-weight: 600;
}

.home-feature-card strong {
    color: var(--sg-ink);
    font-size: 17.5px;
    font-weight: 680;
    letter-spacing: -0.015em;
    transition: color 0.18s var(--sg-ease);
}

.home-feature-card span:last-child {
    color: var(--sg-ink-3);
    font-size: 14.5px;
    line-height: 1.45;
}

.home-feature-card:hover strong {
    color: var(--sg-accent-2);
}

.home-feature-strip__more {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin: 14px 0 0;
    color: var(--sg-ink-3);
    font-size: 14px;
}

.home-feature-strip__more a {
    color: var(--sg-ink-2);
    text-decoration: none;
    border-bottom: 1px solid var(--sg-line-2);
}

.home-feature-strip__more a:hover {
    color: var(--sg-accent-2);
    border-bottom-color: var(--sg-accent);
}

/* ---------- Big games shelf ---------- */

.home-shelf {
    margin-bottom: 80px;
}

.home-shelf__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3 * 20px) / 4.25);
    gap: 20px;
    margin: 0;
    padding: 4px 0 18px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--sg-bg-3) transparent;
}

.home-tile {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    scroll-snap-align: start;
    color: var(--sg-ink);
    text-decoration: none;
}

.home-tile img,
.home-tile__art {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    margin-bottom: 9px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--sg-bg-3);
    box-shadow: 0 0 0 1px var(--sg-line);
    transition: transform 0.3s var(--sg-ease), box-shadow 0.3s var(--sg-ease), filter 0.3s var(--sg-ease);
}

.home-tile:hover img,
.home-tile:hover .home-tile__art {
    transform: translateY(-4px);
    box-shadow: 0 0 0 1px var(--sg-line-2), 0 18px 30px -18px rgba(0, 0, 0, 0.8);
    filter: brightness(1.08);
}

.home-tile__tag {
    color: var(--sg-ink-3);
    font-size: 13px;
    font-weight: 500;
}

.home-tile strong {
    font-size: 17px;
    font-weight: 680;
    line-height: 1.2;
    letter-spacing: -0.015em;
    transition: color 0.18s var(--sg-ease);
}

.home-tile > span:last-child {
    display: -webkit-box;
    overflow: hidden;
    color: var(--sg-ink-3);
    font-size: 14px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.home-tile:hover strong {
    color: var(--sg-accent-2);
}

.home-tile__art {
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 18px;
    overflow: hidden;
    background:
        repeating-linear-gradient(135deg, rgba(240, 230, 214, 0.035) 0 2px, transparent 2px 12px),
        linear-gradient(160deg, #2b231c, #17130f);
    color: var(--sg-ink);
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.045em;
}

.home-tile__art::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 18px;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--sg-accent);
}

.home-tile--type:nth-last-child(2) .home-tile__art {
    background:
        repeating-linear-gradient(135deg, rgba(240, 230, 214, 0.035) 0 2px, transparent 2px 12px),
        linear-gradient(160deg, #1f2a1d, #121611);
}

.home-tile--type:last-child .home-tile__art {
    background:
        repeating-linear-gradient(135deg, rgba(240, 230, 214, 0.035) 0 2px, transparent 2px 12px),
        linear-gradient(160deg, #1d2530, #11151b);
}

/* ---------- Classics with screenshots ---------- */

.home-classics {
    margin-bottom: 80px;
}

.home-classics__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 26px 20px;
}

.home-shot {
    display: grid;
    align-content: start;
    gap: 3px;
    min-width: 0;
    color: var(--sg-ink);
    text-decoration: none;
}

.home-shot img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    margin-bottom: 9px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--sg-bg-3);
    box-shadow: 0 0 0 1px var(--sg-line);
    transition: transform 0.3s var(--sg-ease), box-shadow 0.3s var(--sg-ease);
}

.home-shot:hover img {
    transform: translateY(-3px);
    box-shadow: 0 0 0 1px var(--sg-line-2), 0 16px 28px -18px rgba(0, 0, 0, 0.85);
}

.home-shot strong {
    font-size: 16px;
    font-weight: 660;
    letter-spacing: -0.01em;
    transition: color 0.18s var(--sg-ease);
}

.home-shot span {
    color: var(--sg-ink-3);
    font-size: 14px;
    line-height: 1.4;
}

.home-shot:hover strong {
    color: var(--sg-accent-2);
}

.home-shot--lead {
    grid-column: span 2;
    grid-row: span 2;
}

.home-shot--lead img {
    border-radius: 14px;
}

.home-shot--lead strong {
    font-size: 24px;
    font-weight: 720;
    letter-spacing: -0.03em;
}

.home-shot--lead span {
    font-size: 15.5px;
}

/* ---------- Random picks (rendered by js/main.js) ---------- */

.featured {
    margin-bottom: 72px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 20px;
}

.featured-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 12px 14px 12px 12px;
    border: 1px solid var(--sg-line);
    border-radius: 12px;
    color: var(--sg-ink);
    text-decoration: none;
    transition: background-color 0.2s var(--sg-ease), border-color 0.2s var(--sg-ease), transform 0.15s var(--sg-ease);
}

.featured-card:hover {
    border-color: var(--sg-line-2);
    background: var(--sg-bg-2);
}

.featured-card:active {
    transform: translateY(1px);
}

.featured-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 11px;
    background: var(--sg-bg-3);
    font-size: 26px;
    line-height: 1;
}

.featured-body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.featured-body h3 {
    overflow: hidden;
    font-size: 16px;
    font-weight: 650;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.featured-body p {
    overflow: hidden;
    margin: 0;
    color: var(--sg-ink-3);
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.featured-tag {
    color: var(--sg-accent);
    font-size: 12.5px;
    font-weight: 560;
}

.featured-grid.is-shuffling .featured-card {
    animation: home-fade-in 0.35s var(--sg-ease) both;
}

.featured-grid.is-shuffling .featured-card:nth-child(2) { animation-delay: 0.03s; }
.featured-grid.is-shuffling .featured-card:nth-child(3) { animation-delay: 0.06s; }
.featured-grid.is-shuffling .featured-card:nth-child(4) { animation-delay: 0.09s; }
.featured-grid.is-shuffling .featured-card:nth-child(5) { animation-delay: 0.12s; }
.featured-grid.is-shuffling .featured-card:nth-child(6) { animation-delay: 0.15s; }

@keyframes home-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

/* ---------- Category lists ---------- */

.home-cat,
.home-random-stack .category--random {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px 44px;
    padding-top: 30px;
    padding-bottom: 34px;
    background: var(--home-rule);
}

.home-random-stack .category--random {
    padding-inline: 0;
    background-size: 100% 1px;
}

.home-cat__label h2,
.home-random-stack .category--random > h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.home-cat__label p {
    margin: 8px 0 12px;
    color: var(--sg-ink-3);
    font-size: 14.5px;
}

.home-cat__label a {
    color: var(--sg-ink-2);
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px solid var(--sg-line-2);
}

.home-cat__label a:hover {
    color: var(--sg-accent-2);
    border-bottom-color: var(--sg-accent);
}

.home-page .game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2px 18px;
    align-content: start;
}

.home-page .game-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 9px 10px 9px 8px;
    border-radius: 10px;
    color: var(--sg-ink);
    text-decoration: none;
    transition: background-color 0.18s var(--sg-ease);
}

.home-page .game-card:hover {
    background: var(--sg-bg-2);
}

.home-page .game-card .game-icon {
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: var(--sg-bg-2);
    font-size: 20px;
    line-height: 1;
    transition: background-color 0.18s var(--sg-ease);
}

.home-page .game-card:hover .game-icon {
    background: var(--sg-bg-3);
}

.home-page .game-card h3 {
    overflow: hidden;
    font-size: 15px;
    font-weight: 620;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: color 0.18s var(--sg-ease);
}

.home-page .game-card p {
    overflow: hidden;
    margin: 1px 0 0;
    color: var(--sg-ink-3);
    font-size: 13.5px;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home-page .game-card:hover h3 {
    color: var(--sg-accent-2);
}

.home-random {
    margin-top: 48px;
    margin-bottom: 40px;
}

.home-random-stack {
    display: grid;
}

/* ---------- Tutorials ---------- */

.home-learn {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 32px 64px;
    margin-top: 40px;
    margin-bottom: 72px;
    padding-top: 56px;
    background: var(--home-rule);
}

.home-learn__intro {
    align-self: start;
    position: sticky;
    top: calc(var(--sg-header-h) + 28px);
}

.home-learn__intro h2 {
    font-size: clamp(1.9rem, 3.4vw, 2.75rem);
    font-weight: 750;
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.home-learn__intro > p:not(.home-eyebrow) {
    max-width: 42ch;
    margin: 18px 0 26px;
    color: var(--sg-ink-2);
    font-size: 16.5px;
}

.home-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--sg-accent);
    color: var(--sg-accent-ink);
    font-size: 15.5px;
    font-weight: 650;
    text-decoration: none;
    transition: background-color 0.2s var(--sg-ease), transform 0.15s var(--sg-ease);
}

.home-page .home-button {
    color: var(--sg-accent-ink);
}

.home-button::after {
    content: "→";
    transition: transform 0.2s var(--sg-ease);
}

.home-button:hover {
    background: var(--sg-accent-2);
}

.home-button:hover::after {
    transform: translateX(3px);
}

.home-button:active {
    transform: translateY(1px);
}

.home-learn__list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: lesson;
}

.home-learn__list li {
    counter-increment: lesson;
}

.home-learn__list a {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 8px;
    padding: 15px 0 16px;
    border-bottom: 1px solid var(--sg-line);
    text-decoration: none;
}

.home-learn__list li:first-child a {
    border-top: 1px solid var(--sg-line);
}

.home-learn__list a::before {
    content: counter(lesson, decimal-leading-zero);
    grid-row: 1 / span 2;
    padding-top: 2px;
    color: var(--sg-ink-3);
    font-size: 15px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    transition: color 0.18s var(--sg-ease);
}

.home-learn__list strong {
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.015em;
    transition: color 0.18s var(--sg-ease);
}

.home-learn__list span {
    color: var(--sg-ink-3);
    font-size: 14.5px;
}

.home-learn__list a:hover strong {
    color: var(--sg-accent-2);
}

.home-learn__list a:hover::before {
    color: var(--sg-accent);
}

/* ---------- Guides + about ---------- */

.home-guides,
.home-about {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 16px 44px;
    padding-top: 30px;
    padding-bottom: 40px;
    background: var(--home-rule);
}

.home-guides h2,
.home-about h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.home-guides ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-guides a {
    display: block;
    padding: 8px 0 10px;
    color: var(--sg-ink-3);
    font-size: 14.5px;
    line-height: 1.45;
    text-decoration: none;
}

.home-guides a strong {
    display: block;
    color: var(--sg-ink);
    font-size: 16px;
    font-weight: 640;
    transition: color 0.18s var(--sg-ease);
}

.home-guides a:hover strong {
    color: var(--sg-accent-2);
}

.home-about__text {
    max-width: 70ch;
}

.home-about__text p {
    margin: 0 0 14px;
    color: var(--sg-ink-2);
    font-size: 15.5px;
    line-height: 1.65;
}

.home-about__text a {
    color: var(--sg-ink);
    text-decoration: underline;
    text-decoration-color: var(--sg-accent);
    text-underline-offset: 3px;
}

.home-about__text a:hover {
    color: var(--sg-accent-2);
}

.home-page .sg-footer {
    margin-top: 32px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
    .home-classics__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .home-shelf__track {
        grid-auto-columns: calc((100% - 2 * 20px) / 3.25);
    }
}

@media (max-width: 960px) {
    .home-hero {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 28px;
    }


    .home-feature-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-feature-card:nth-child(3) {
        border-left: 0;
        padding-left: 0;
    }

    .home-feature-card:nth-child(n + 3) {
        border-top: 0;
    }

    .featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-cat,
    .home-random-stack .category--random,
    .home-guides,
    .home-about,
    .home-learn {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-learn__intro {
        position: static;
    }
}

@media (max-width: 760px) {
    .home-page main {
        --home-gutter: 16px;
    }

    .home-hero h1 {
        font-size: clamp(2.3rem, 10vw, 3rem);
    }

    .home-hero__lede {
        font-size: 16.5px;
    }

    .home-search__key {
        display: none;
    }

    .hero-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-hero__feature {
        aspect-ratio: 4 / 3;
        border-radius: 14px;
    }

    .home-hero__feature-body {
        padding: 18px;
    }

    .home-hero__feature-body > span:not([class]) {
        font-size: 14.5px;
    }

    .home-hero__side {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .home-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-head__link,
    .home-head__tools {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
        margin-top: 12px;
    }

    .home-arrows {
        display: none;
    }

    .home-feature-strip {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-feature-card,
    .home-feature-card + .home-feature-card {
        padding: 16px 0;
        border-left: 0;
        border-top: 0;
    }

    .home-feature-card:first-child {
        border-top: 1px solid var(--sg-line);
    }

    .home-shelf__track {
        grid-auto-columns: 72%;
        margin-inline: -16px;
        padding-inline: 16px;
        scroll-padding-inline: 16px;
    }

    .home-classics__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 14px;
    }

    .home-shot--lead {
        grid-row: auto;
    }

    .home-shot span {
        font-size: 13.5px;
    }

    .featured-grid,
    .home-guides ul {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-page .game-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .home-page *,
    .home-page *::before,
    .home-page *::after {
        animation: none !important;
        transition: none !important;
    }
}
