* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f5f7;
    --text: #1d1d1f;
    --secondary: #6e6e73;
    --blue: #007aff;
    --blue-hover: #006ee6;
    --card: rgba(255, 255, 255, 0.72);
    --border: rgba(0, 0, 0, 0.07);
    --shadow:
        0 10px 30px rgba(0, 0, 0, 0.07),
        0 2px 8px rgba(0, 0, 0, 0.04);
}


/* =========================
   BASE
   ========================= */

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "SF Pro Display",
        "SF Pro Text",
        "Helvetica Neue",
        Arial,
        sans-serif;

    color: var(--text);

    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(0, 122, 255, 0.10),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 20%,
            rgba(175, 82, 222, 0.09),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            #fafafa 0%,
            #f5f5f7 100%
        );

    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}


/* =========================
   PAGE
   ========================= */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* =========================
   TOP BAR
   ========================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;

    height: 64px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 34px;

    background:
        rgba(255, 255, 255, 0.72);

    border-bottom:
        1px solid rgba(0, 0, 0, 0.06);

    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-icon {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background:
        linear-gradient(
            145deg,
            #007aff,
            #5856d6
        );

    box-shadow:
        0 4px 10px rgba(0, 122, 255, 0.22);

    font-size: 20px;
}

.brand-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.brand-subtitle {
    margin-top: 1px;

    color: var(--secondary);

    font-size: 11px;
}


/* macOS window dots */

.window-controls {
    display: flex;
    gap: 7px;
}

.window-controls span {
    width: 11px;
    height: 11px;

    display: block;

    border-radius: 50%;

    background: #d1d1d6;
}

.window-controls span:nth-child(1) {
    background: #ff5f57;
}

.window-controls span:nth-child(2) {
    background: #febc2e;
}

.window-controls span:nth-child(3) {
    background: #28c840;
}


/* =========================
   MAIN
   ========================= */

.main {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;

    flex: 1;
}


/* =========================
   HERO
   ========================= */

.hero {
    padding: 70px 0 52px;
}

.hero-content {
    max-width: 720px;
}

.eyebrow {
    display: inline-flex;

    padding: 7px 11px;

    margin-bottom: 16px;

    border-radius: 999px;

    background:
        rgba(0, 122, 255, 0.09);

    color: var(--blue);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 1.2px;
}

.hero h1 {
    margin: 0;

    font-size: clamp(42px, 6vw, 72px);

    line-height: 0.98;

    letter-spacing: -3px;

    font-weight: 700;
}

.hero p {
    max-width: 540px;

    margin: 22px 0 0;

    color: var(--secondary);

    font-size: 20px;

    line-height: 1.45;

    letter-spacing: -0.3px;
}


/* =========================
   SECTION HEADER
   ========================= */

.games-section {
    padding-bottom: 60px;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;

    margin-bottom: 22px;
}

.section-header h2 {
    margin: 0;

    font-size: 28px;
    letter-spacing: -1px;
}

.section-header p {
    margin: 5px 0 0;

    color: var(--secondary);

    font-size: 14px;
}

.games-count {
    color: var(--secondary);

    font-size: 14px;

    white-space: nowrap;
}


/* =========================
   GAMES GRID
   ========================= */

.games-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 22px;
}


/* =========================
   GAME CARD
   ========================= */

.game-card {
    min-width: 0;

    display: flex;
    flex-direction: column;

    padding: 20px;

    border:
        1px solid var(--border);

    border-radius: 22px;

    background:
        var(--card);

    box-shadow:
        var(--shadow);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);

    border-color:
        rgba(0, 122, 255, 0.16);

    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.10),
        0 4px 12px rgba(0, 0, 0, 0.05);
}


/* =========================
   GAME ICON
   ========================= */

.game-icon {
    width: 100%;
    height: 150px;

    flex: 0 0 150px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 17px;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            #f2f2f7,
            #e9e9ee
        );
}

.game-icon img {
    display: block;

    width: 118px;
    height: 118px;

    object-fit: contain;

    border-radius: 22px;

    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.10);

    transition:
        transform 0.2s ease;
}

.game-card:hover .game-icon img {
    transform: scale(1.04);
}


/* =========================
   GAME CONTENT
   ========================= */

.game-content {
    flex: 1;

    min-height: 112px;

    display: flex;
    flex-direction: column;
}

.game-content h2 {
    margin: 0 0 7px;

    font-size: 21px;

    line-height: 1.2;

    letter-spacing: -0.5px;
}

.game-content p {
    margin: 0;

    color: var(--secondary);

    font-size: 14px;

    line-height: 1.45;
}

.game-category {
    display: inline-flex;

    align-self: flex-start;

    margin-top: auto;
    padding-top: 13px;

    color: #8e8e93;

    font-size: 12px;
    font-weight: 500;
}


/* =========================
   PLAY BUTTON
   ========================= */

.play-button {
    width: 100%;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 18px;

    border-radius: 11px;

    background:
        linear-gradient(
            180deg,
            #0a84ff 0%,
            #007aff 100%
        );

    color: white;

    text-decoration: none;

    font-size: 13px;
    font-weight: 700;

    letter-spacing: 0.4px;

    box-shadow:
        0 5px 12px rgba(0, 122, 255, 0.20);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.play-button:hover {
    background:
        linear-gradient(
            180deg,
            #007aff 0%,
            #006ee6 100%
        );

    box-shadow:
        0 7px 16px rgba(0, 122, 255, 0.27);
}

.play-button:active {
    transform: scale(0.98);
}


/* =========================
   ERROR
   ========================= */

.error {
    grid-column: 1 / -1;

    padding: 30px;

    border-radius: 18px;

    background: white;

    text-align: center;

    color: #ff3b30;
}


/* =========================
   FOOTER
   ========================= */

.footer {
    padding: 28px 20px 34px;

    text-align: center;

    color: #8e8e93;

    font-size: 12px;
}


/* =========================
   TABLET
   ========================= */

@media (max-width: 900px) {

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

    .hero {
        padding-top: 54px;
    }
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 600px) {

    .topbar {
        height: 58px;

        padding:
            0 17px;
    }

    .main {
        width:
            calc(100% - 28px);
    }

    .window-controls {
        display: none;
    }

    .brand-icon {
        width: 34px;
        height: 34px;

        font-size: 18px;
    }

    .hero {
        padding:
            42px 0 36px;
    }

    .hero h1 {
        font-size: 43px;

        letter-spacing: -2px;
    }

    .hero p {
        margin-top: 17px;

        font-size: 17px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .game-card {
        padding: 15px;

        border-radius: 18px;
    }

    .game-icon {
        height: 130px;
        flex-basis: 130px;

        margin-bottom: 15px;
    }

    .game-icon img {
        width: 102px;
        height: 102px;
    }

    .game-content {
        min-height: 100px;
    }

    .section-header {
        margin-bottom: 16px;
    }

    .section-header h2 {
        font-size: 25px;
    }

    .games-count {
        font-size: 12px;
    }
}
