/* ==========================================================
   1. DESIGN VARIABLES
   ========================================================== */

:root {
    --navy: #101b33;
    --ink: #18243a;
    --muted: #617088;
    --blue: #3267e8;
    --pale: #f3f6fb;
    --line: #e2e8f1;

    --white: #ffffff;
    --dark-bg: #070a15;

    --nav-text: #465570;
    --nav-border: #e2e8f1;

    --focus: #86a9ff;

    --radius-sm: 9px;
    --radius-md: 12px;
    --radius-lg: 18px;
}


/* ==========================================================
   2. GLOBAL RESET
   ========================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--white);
    color: var(--ink);

    font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;

    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img,
svg {
    max-width: 100%;
}

img {
    height: auto;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}


/* ==========================================================
   3. SHARED CONTAINERS
   ========================================================== */

.wrap {
    width: min(1160px, calc(100% - 36px));
    margin-inline: auto;
}

main {
    min-width: 0;
}


/* ==========================================================
   4. ACCESSIBILITY
   ========================================================== */

.skip {
    position: absolute;
    top: -100px;
    left: 12px;

    z-index: 1000;

    padding: 9px 13px;

    border-radius: 9px;

    background: #ffffff;
    color: #101b33;

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

.skip:focus {
    top: 12px;
}


/* ==========================================================
   5. SHARED HEADER
   ========================================================== */

.header {
    position: relative;
    z-index: 100;

    background: #ffffff;

    border-bottom: 1px solid var(--nav-border);
}

.header .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    min-height: 76px;
}


/* ==========================================================
   6. WEBSITE BRANDING
   ========================================================== */

.header .brand {
    display: inline-flex;
    align-items: center;

    flex-shrink: 0;

    gap: 10px;

    color: #18243a;

    font-size: 15px;
    font-weight: 750;

    line-height: 1.3;
    white-space: nowrap;
}

.header .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    min-width: 39px;
    min-height: 39px;

    padding: 7px;

    border-radius: 11px;

    background: var(--blue);
    color: #ffffff;

    font-size: 13px;
    font-weight: 800;
}

.header .brand b {
    font-weight: 800;
}


/* ==========================================================
   7. DESKTOP NAVIGATION
   ========================================================== */

.research-nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex: 1;
    min-width: 0;

    gap: 24px;
}

.research-nav-menu nav {
    display: flex;
    align-items: center;

    gap: 19px;
}

.research-nav-menu nav a {
    display: inline-flex;
    align-items: center;

    min-height: 40px;

    color: var(--nav-text);

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

    white-space: nowrap;

    transition: color 0.2s ease;
}

.research-nav-menu nav a:hover {
    color: var(--blue);
}

.research-nav-menu nav a[aria-current="page"] {
    color: var(--blue);
    font-weight: 750;
}


/* ==========================================================
   8. NAVIGATION ACCOUNT ACTIONS
   ========================================================== */

.research-nav-menu .nav-actions {
    display: flex;
    align-items: center;

    gap: 13px;
}

.research-nav-menu .nav-actions form {
    margin: 0;
}

.research-nav-menu .login {
    color: #33435f;

    font-size: 13px;
    font-weight: 650;
}

.research-nav-menu .login:hover {
    color: var(--blue);
}

.research-nav-menu .login[aria-current="page"] {
    color: var(--blue);
    font-weight: 750;
}


/* ==========================================================
   9. SHARED BUTTONS
   ========================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 13px 22px;

    border: 0;
    border-radius: 11px;

    background: var(--blue);
    color: #ffffff;

    font-weight: 700;
    line-height: 1.4;

    text-align: center;

    cursor: pointer;

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

.btn:hover {
    background: #2457d4;
    transform: translateY(-1px);
}

.btn.small {
    padding: 9px 15px;
    font-size: 13px;
}

.btn.ghost {
    background: transparent;

    border: 1px solid #8998b6;

    color: #ffffff;
}

.btn.ghost:hover {
    background: rgba(255, 255, 255, 0.09);
}


/* ==========================================================
   10. LOGOUT BUTTON
   ========================================================== */

.research-nav-menu .nav-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 9px 14px;

    border: 1px solid #d6dfec;
    border-radius: 10px;

    background: #f4f7fc;
    color: #34445f;

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

    line-height: 1.4;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.research-nav-menu .nav-logout:hover {
    background: #e8eef9;
    border-color: #b7c8e5;
}


/* ==========================================================
   11. MOBILE MENU TOGGLE
   ========================================================== */

.research-nav-toggle {
    display: none;

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

    flex-shrink: 0;

    width: 42px;
    height: 42px;

    padding: 9px;

    border: 1px solid #d7e0ed;
    border-radius: 11px;

    background: #f5f7fc;
    color: #233756;
}

.research-nav-toggle:hover {
    background: #eaf0fa;
}

.research-nav-toggle svg {
    display: block;

    width: 21px;
    height: 21px;
}


/* ==========================================================
   12. HERO SECTION
   ========================================================== */

.hero {
    padding: 92px 0;

    background: linear-gradient(
        125deg,
        #101b33,
        #1b335c
    );

    color: #ffffff;
}

.hero-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(0, 0.9fr);

    align-items: center;

    gap: 60px;
}

.eyebrow {
    color: #9bbcff;

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

    letter-spacing: 0.15em;
}

.eyebrow.dark {
    color: var(--blue);
}

h1 {
    margin: 17px 0 24px;

    font-size: clamp(38px, 5vw, 65px);
    font-weight: 800;

    line-height: 1.12;
    letter-spacing: -0.04em;
}

h1 em {
    color: #8ab5ff;
    font-style: normal;
}

.hero p,
.page-head p {
    max-width: 600px;

    color: #c2cee0;

    font-size: 17px;
}

.cta {
    display: flex;
    align-items: center;

    flex-wrap: wrap;

    gap: 12px;

    margin-top: 30px;
}

.hero-note {
    margin-top: 25px;

    color: #b5c2d6;

    font-size: 12px;
}


/* ==========================================================
   13. RESEARCH PREVIEW
   ========================================================== */

.preview {
    padding: 28px;

    border-radius: 22px;

    background: #ffffff;
    color: var(--ink);

    box-shadow: 0 30px 60px #050c1b60;
}

.preview-top,
.preview-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    color: var(--muted);

    font-size: 11px;
}

.preview h3 {
    margin: 28px 0 2px;
}

.preview p {
    color: var(--muted);
    font-size: 13px;
}

.dot {
    color: var(--blue);
}

.bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;

    gap: 12px;

    height: 185px;

    margin: 20px 0 24px;

    border-bottom: 1px solid var(--line);
}

.bars > div {
    position: relative;

    flex: 1;

    height: var(--h);
    max-width: 50px;

    border-radius: 8px 8px 0 0;

    background: linear-gradient(
        #6ca3ff,
        #3267e8
    );
}

.bars span {
    position: absolute;
    bottom: -24px;

    width: 100%;

    color: var(--muted);

    font-size: 11px;
    text-align: center;
}

.preview-bottom {
    margin-top: 40px;
}


/* ==========================================================
   14. GENERAL SECTIONS
   ========================================================== */

.section {
    padding-top: 76px;
    padding-bottom: 76px;
}

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

    gap: 20px;

    margin-bottom: 27px;
}

.section-heading h2,
.cta-section h2 {
    margin: 10px 0 0;

    font-size: clamp(27px, 3vw, 38px);

    line-height: 1.2;
    letter-spacing: -0.025em;
}

.section-heading p {
    max-width: 330px;

    color: var(--muted);

    font-size: 14px;
}


/* ==========================================================
   15. CARDS AND GRIDS
   ========================================================== */

.cards,
.game-grid {
    display: grid;

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

    gap: 18px;
}

.card {
    min-width: 0;

    padding: 27px;

    border: 1px solid var(--line);
    border-radius: 16px;

    background: #ffffff;
}

.card h3 {
    margin: 15px 0 7px;
}

.card p,
.card small {
    color: var(--muted);
}

.card-icon {
    color: var(--blue);
    font-size: 26px;
}

.tinted {
    background: var(--pale);
}


/* ==========================================================
   16. COUNTRY CARDS
   ========================================================== */

.country-grid {
    display: grid;

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

    gap: 14px;
}

.country {
    display: flex;
    flex-direction: column;

    min-width: 0;

    padding: 22px;

    border: 1px solid var(--line);
    border-radius: 14px;

    background: #ffffff;
}

.country span {
    color: var(--muted);
    font-size: 13px;
}


/* ==========================================================
   17. EMPTY STATES AND LINKS
   ========================================================== */

.empty {
    padding: 30px;

    border: 1px dashed #b9c6d9;
    border-radius: 14px;

    background: #ffffff;
    color: var(--muted);
}

.text-link {
    color: var(--blue);
    font-weight: 700;
}

.text-link:hover {
    text-decoration: underline;
}


/* ==========================================================
   18. CALL TO ACTION
   ========================================================== */

.cta-section {
    text-align: center;
}

.cta-section p {
    color: var(--muted);
}


/* ==========================================================
   19. PAGE HEADERS
   ========================================================== */

.page-head {
    padding: 70px 0;

    background: var(--navy);
    color: #ffffff;
}

.page-head h1 {
    font-size: clamp(32px, 4vw, 52px);
}

.page-head .btn {
    margin-top: 15px;
}


/* ==========================================================
   20. FILTER CONTROLS
   ========================================================== */

.filter {
    display: flex;
    align-items: center;

    flex-wrap: wrap;

    gap: 14px;

    margin-bottom: 26px;
}

.filter label {
    font-weight: 650;
}

.filter select {
    min-width: 200px;

    padding: 10px;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: #ffffff;
    color: var(--ink);
}


/* ==========================================================
   21. PRICING
   ========================================================== */

.pricing-card {
    max-width: 560px;

    margin-inline: auto;

    padding: 35px;

    border: 1px solid var(--line);
    border-radius: 20px;

    background: #ffffff;

    box-shadow: 0 15px 40px #17243a0b;
}

.pricing-card p,
.narrow p {
    color: var(--muted);
}

.pricing-card li {
    margin: 8px 0;
}

.status {
    display: inline-block;

    padding: 8px 12px;

    border-radius: 9px;

    background: #e9eefb;
    color: #274a91;

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


/* ==========================================================
   22. NARROW CONTENT
   ========================================================== */

.narrow {
    max-width: 760px;
}

.narrow h2 {
    margin-top: 25px;
}


/* ==========================================================
   23. AUTHENTICATION FORMS
   ========================================================== */

.auth-form {
    display: grid;

    gap: 1rem;

    max-width: 450px;

    margin: 1.5rem 0;
}

.auth-form label {
    display: grid;
    gap: 0.4rem;

    font-weight: 600;
}

.auth-form input {
    width: 100%;
    min-height: 44px;

    padding: 0.85rem;

    border: 1px solid #bac4d3;
    border-radius: 0.6rem;

    background: #ffffff;
    color: #17243a;

    font: inherit;
}

.auth-form button {
    justify-self: start;

    border: 0;

    cursor: pointer;
}

[role="alert"] {
    color: #a51d24;
    font-weight: 600;
}

/*
 * Allow dark page-specific stylesheets to
 * define their own alert colours.
 */
.catalogue-message[role="alert"] {
    color: #ffe0a8;
}


/* ==========================================================
   24. FOOTER
   ========================================================== */

.footer {
    padding: 40px 0 24px;

    background: #0e192e;
    color: #ffffff;
}

.foot {
    display: flex;
    justify-content: space-between;

    gap: 20px;
}

.foot p,
.legal {
    color: #a4b2c7;
    font-size: 12px;
}

.foot > div:last-child {
    display: flex;

    gap: 20px;

    font-size: 13px;
}

.legal {
    margin-top: 25px;
    padding-top: 20px;

    border-top: 1px solid #2c3a51;
}


/* ==========================================================
   25. TABLET NAVIGATION
   ========================================================== */

@media (max-width: 800px) {

    .header .nav {
        flex-wrap: wrap;

        gap: 12px;

        min-height: 65px;

        padding-top: 12px;
        padding-bottom: 12px;
    }

    .research-nav-toggle {
        display: inline-flex;
    }

    /*
     * Hidden until navigation.js adds .is-open.
     */
    .research-nav-menu {
        display: none;

        flex: 0 0 100%;

        width: 100%;
        min-width: 0;

        flex-direction: column;
        align-items: stretch;

        gap: 12px;

        padding: 13px;

        border: 1px solid rgba(157, 177, 219, 0.2);
        border-radius: 14px;

        background: #111b32;
        color: #ffffff;

        box-shadow: 0 12px 28px
            rgba(0, 0, 0, 0.15);
    }

    .research-nav-menu.is-open {
        display: flex;
    }

    .research-nav-menu nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 3px;
    }

    .research-nav-menu nav a {
        display: block;

        min-height: 40px;

        padding: 9px 12px;

        border-radius: 9px;

        color: #d8e3f7;

        font-size: 13px;
    }

    .research-nav-menu nav a:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
    }

    .research-nav-menu nav a[aria-current="page"] {
        background: rgba(116, 147, 255, 0.13);
        color: #b9caff;
    }

    .research-nav-menu .nav-actions {
        flex-direction: column;
        align-items: stretch;

        gap: 9px;

        padding-top: 12px;

        border-top: 1px solid
            rgba(255, 255, 255, 0.12);
    }

    .research-nav-menu .nav-actions form {
        width: 100%;
    }

    .research-nav-menu .nav-actions a,
    .research-nav-menu .nav-actions button {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 100%;
        min-height: 42px;

        text-align: center;
    }

    .research-nav-menu .login {
        color: #e3ebfa;
    }

    .research-nav-menu .nav-logout {
        border-color: rgba(255, 255, 255, 0.2);

        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
    }

    .research-nav-menu .nav-logout:hover {
        background: rgba(255, 255, 255, 0.15);
    }

}


/* ==========================================================
   26. TABLET CONTENT
   ========================================================== */

@media (max-width: 850px) {

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

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

}


/* ==========================================================
   27. MOBILE CONTENT
   ========================================================== */

@media (max-width: 540px) {

    .wrap {
        width: min(1160px, calc(100% - 24px));
    }

    .header .nav {
        gap: 10px;
        min-height: 60px;
    }

    .header .brand {
        font-size: 12px;
        gap: 8px;
    }

    .header .brand-mark {
        min-width: 34px;
        min-height: 34px;

        padding: 6px;

        font-size: 11px;
    }

    .research-nav-toggle {
        width: 39px;
        height: 39px;
    }

    .hero {
        padding: 54px 0;
    }

    .hero p,
    .page-head p {
        font-size: 14px;
    }

    .preview {
        padding: 19px;
    }

    .section {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .section-heading {
        display: block;
    }

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

    .card {
        padding: 20px;
    }

    .country {
        padding: 18px;
    }

    .foot {
        display: block;
    }

    .foot > div:last-child {
        flex-wrap: wrap;
        margin-top: 22px;
    }

    .page-head {
        padding: 50px 0;
    }

    .pricing-card {
        padding: 23px;
    }

    .empty {
        padding: 20px;
    }

}


/* ==========================================================
   28. VERY SMALL PHONES
   ========================================================== */

@media (max-width: 360px) {

    .header .brand {
        font-size: 11px;
    }

    .header .brand-mark {
        min-width: 32px;
        min-height: 32px;
    }

    .research-nav-toggle {
        width: 37px;
        height: 37px;
    }

    .hero {
        padding: 43px 0;
    }

    .preview {
        padding: 15px;
    }

    .card {
        padding: 17px;
    }

    .pricing-card {
        padding: 18px;
    }

}


/* ==========================================================
   29. REDUCED MOTION
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    .btn,
    .research-nav-menu nav a,
    .research-nav-menu .nav-logout {
        transition: none;
    }

    .btn:hover {
        transform: none;
    }

}


/* ==========================================================
   HEADER NAVIGATION ALIGNMENT FIX
   ========================================================== */

@media (min-width: 801px) {

    .header .nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .header .research-nav-menu {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex: 1;
        flex-wrap: nowrap;
        gap: 24px;
    }

    .header .research-nav-menu nav,
    .header .research-nav-menu .nav-actions {
        display: flex;
        align-items: center;
        flex-direction: row;
        flex-wrap: nowrap;
        width: auto;
        gap: 18px;
    }

    .header .research-nav-menu a {
        white-space: nowrap;
    }

}