:root {
    --primary: #005ea2;
    --primary-dark: #162e51;
    --primary-tint: #e6f0f9;
    --accent: #d83933;
    --text: #1b1b1b;
    --muted: #5b616b;
    --bg-light: #f9f9f9;
    --bg-light-blue: #f0f6fd;
    --bg-white: #ffffff;
    --border: #dfe1e2;
    --border-dark: #a9aeb1;
    --radius: 0px;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    --transition: all 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html {
    scroll-behavior: smooth;
}
body {
    color: var(--text);
    line-height: 1.5;
    background: var(--bg-white);
    font-weight: 400;
}

section {
    margin: 0 auto;
    padding: 3rem 1rem;
}
.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: -0.02em;
    text-transform: none;
}

.btn-primary,
.btn-login {
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    font-size: 0.875rem;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    box-shadow: none;
    border: 2px solid var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: none;
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}
.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 0.9375rem;
}
.btn-login {
    margin-left: auto;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    line-height: 1;
}
.btn-login:hover {
    background: var(--primary);
    color: #fff;
    transform: none;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

@supports (-webkit-backdrop-filter: blur(0)) {
    header {
        background: var(--bg-white);
        -webkit-backdrop-filter: none;
    }
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0;
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 0;
    margin-left: 1.5rem;
    align-items: center;
}
.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    position: relative;
    padding: 0.5rem 1.25rem;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
}
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background: var(--primary);
    transition: width 0.2s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.hero {
    width: 100%;
    padding: 4rem 1.5rem;
    position: relative;
    overflow: hidden;
    margin: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}
.hero-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem 4rem;
}
.hero-content {
    max-width: 600px;
}
.hero-img {
    width: 100%;
    max-width: 500px;
    height: auto;
}
.hero h1 {
    font-size: clamp(2.25rem, 5vw + 1rem, 3.5rem);
    line-height: 1.15;
    margin-bottom: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.hero p {
    font-size: 1.125rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    color: var(--muted);
    line-height: 1.6;
}
.hero::before {
    display: none;
}

@media (min-width: 768px) {
    .hero {
        text-align: left;
    }
    .hero-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
    .hero-content {
        max-width: 540px;
    }
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
}
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: none;
    transition: var(--transition);
    position: relative;
}
/* Hover only for cards inside .cards (e.g. landing page); test pages use .card without .cards */
.cards .card:hover {
    transform: none;
    box-shadow: inset 0 0 0 2px var(--primary);
    background: #f8f9fa;
}
.card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.card p {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    color: var(--muted);
    line-height: 1.5;
}

details {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0;
    box-shadow: none;
}
details summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.faq {
    background: var(--bg-white);
    padding: 4rem 1.5rem;
    width: 100%;
    margin: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.faq-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}
.faq-title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-align: left;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.faq-items details {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    overflow: visible;
}
.faq-items summary {
    padding: 1.25rem 0;
    font-size: 1.0625rem;
    font-weight: 700;
}
.faq-items details + details {
    margin-top: 0;
}

.faq-items p {
    padding: 0 0 1.25rem;
    font-size: 0.9375rem;
    color: var(--muted);
    line-height: 1.6;
}

.faq-items summary::after {
    width: 12px;
    height: 12px;
    border-width: 2px;
    border-color: var(--text);
}

.faq-items summary:hover {
    background: transparent;
    color: var(--primary);
}

.faq-items ul {
    margin: 0.6rem 0 0.8rem;
    padding-left: 1.1rem;
}

.faq-items li {
    margin-bottom: 0.3rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
}

.brand__img {
    height: 34px;
    width: 34px;
    object-fit: cover;
    border-radius: 50%;
}

.brand__text {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
}

.brand__text--gradient {
    background: linear-gradient(90deg, #0a37aa 0%, #619ce3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}


@media (max-width: 768px) {
    .section-title {
        font-size: 1.8rem;
    }
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .faq-title {
        margin-bottom: 0;
        text-align: center;
    }
}

.bell-curve {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    width: 100%;
    max-width: 450px;
    height: 190px;
    margin: 0 auto;
    overflow: visible;
}

@media (max-width: 600px) {
    .bell-curve {
        height: 140px;
        gap: 2px;
    }
    .bell-curve span {
        flex: 0 0 4px;
    }
}

.bell-curve span {
    flex: 0 0 8px;
    height: 0;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    animation: popUp 0.8s forwards;
    animation-delay: calc(var(--i) * 0.04s);
}

.bell-curve span:nth-child(n) {
    --i: calc(var(--n, 0));
}

.bell-curve span {
    position: relative; /* anchor for ::after  */
    display: inline-block;
}

.bell-curve span::after {
    content: attr(data-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-0.4rem);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    background: #222;
    color: #fff;
    white-space: nowrap;
    line-height: 1.3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    font-size: 0.9rem;
    padding: 0.25rem 0.55rem;
    white-space: pre;
    z-index: 10;
}

.bell-curve span::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);

    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-top-color: #222;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 9;
}

.bell-curve span:hover::before,
.bell-curve span:focus-visible::before {
    opacity: 1;
}

.bell-curve span:hover::after,
.bell-curve span:focus-visible::after {
    opacity: 1;
}

.bell-curve span.default::after,
.bell-curve span.default::before {
    opacity: 1;
}

.bell-curve:hover span.default::after,
.bell-curve:hover span.default::before {
    opacity: 0;
}

.bell-curve:not(:hover) span.default::after {
    content: "Explore your IQ";
    transform: translateX(-0.5rem) translateY(-0.3rem);
    text-align: left;
}

@supports (counter-set: section) {
    .bell-curve {
        counter-reset: idx;
    }
    .bell-curve span {
        counter-increment: idx;
        --n: counter(idx);
    }
}

@keyframes popUp {
    to {
        height: var(--h);
    }
}

.material-symbols-rounded,
.material-icons {
    color: var(--primary);
    font-variation-settings: "wght" 600;
    font-size: 2.25rem;
    vertical-align: -2px;
}

.strip {
    background: var(--bg-light);
    padding: 4rem 1.5rem;
    margin-inline: 0;
    margin: 0;
    position: relative;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

#how.strip {
    background: var(--primary-tint);
}

#how .card > .material-symbols-rounded {
    font-size: 2.25rem;
    flex-shrink: 0;
    display: block;
    margin-bottom: 0.75rem;
}

.icon-inline {
    font-size: 1.25em;
    margin: 0.25em;
    vertical-align: -0.15em;
    color: var(--text);
}

.section-lead {
    margin: 0 auto 3rem;
    text-align: center;
    font-size: clamp(1rem, 1vw + 0.9rem, 1.125rem);
    line-height: 1.6;
    color: var(--muted);
    max-width: 1000px;
}

.feature-split {
    padding: 4rem clamp(3rem, 8vw, 8rem);
    margin: 0 auto;
    background: var(--bg-white);
}

.feature-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 768px) {
    .feature-inner {
        flex-direction: row;
    }
}

@media (max-width: 767.98px) {
    .hero h1,
    .hero p {
        text-align: center;
    }
    .nav-container {
        justify-content: space-between;
        gap: 0.75rem;
    }

    .btn-login {
        margin-left: 0;
        padding: 0.55rem 1rem;
        font-size: 0.9rem;
        border-width: 1.5px;
        flex-shrink: 0;
    }
    .faq-title {
        flex-direction: row;
    }
    .faq-title span {
        margin-right: 0.25em;
    }
    .faq-title span:last-child {
        margin-right: 0;
    }
}

.feature-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
}

.feature-head {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.feature-text p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.6;
}

.feature-img {
    flex: 1;
}

.feature-img img {
    width: 100%;
    height: auto;
}

.why-bell-wrap {
    width: 100%;
    max-width: 100%;
}

.why-bell-curve {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 767px) {
    .why-bell-wrap {
        display: none;
    }
}

.why-bell-sigma,
.why-bell-pct {
    font-family: inherit;
    fill: var(--muted);
}

.why-bell-sigma {
    font-weight: 600;
}

footer {
    font-size: 0.9375rem;
    background: var(--primary-dark);
}

.footer-top,
.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    text-decoration: none;
}
.footer-brand img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.footer-contact a {
    color: #ffae6d;
    font-weight: 700;
    text-decoration: none;
}

.footer-bottom {
    padding: 1rem 2rem;
    font-size: 0.85rem;
}
.copy {
    margin: 0;
    font-weight: 600;
}

.footer-nav {
    display: flex;
    gap: 1.4rem;
}
.footer-nav a {
    text-decoration: none;
    position: relative;
}
.footer-nav a:not(:first-child)::before {
    content: "";
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
}

.footer-nav a:hover {
    color: #d1d1d1;
}

footer,
footer a,
.footer-brand span,
.footer-contact,
.copy {
    color: #fff;
}

@media (max-width: 600px) {
    .footer-top,
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .footer-nav a::before {
        display: none;
    }
}

.countries-section {
    background: var(--bg-white);
    padding: 4rem clamp(3rem, 8vw, 8rem);
    margin: 0;
    border-top: 1px solid var(--border);
    overflow-x: hidden;
}
.carousel-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}
.countries-carousel {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0;
}
.country {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f9f9f9;
    border-radius: 0;
    padding: 0.875rem 1rem;
    box-shadow: none;
    border: 1px solid var(--border);
    border-right: none;
    box-sizing: border-box;
    overflow: hidden;
}
.country:last-child {
    border-right: 1px solid var(--border);
}
.country .fi {
    font-size: 2rem;
    line-height: 1;
}
.text-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.rating {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}
.name {
    font-size: 0.9rem;
    color: var(--muted);
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    color: var(--primary);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}
.scroll-btn:hover {
    background: var(--primary);
    color: #fff;
}
.scroll-left {
    left: -20px;
}
.scroll-right {
    right: -20px;
}

.countries-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    border: 1px solid var(--border);
}
.countries-grid .country {
    border: none;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}
.countries-grid .country:nth-child(4n) {
    border-right: none;
}
@media (max-width: 900px) {
    .countries-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .countries-grid .country:nth-child(4n) {
        border-right: 1px solid var(--border);
    }
    .countries-grid .country:nth-child(2n) {
        border-right: none;
    }
}
@media (max-width: 600px) {
    .countries-grid .country:nth-child(4n) {
        border-right: 1px solid var(--border);
    }
    .countries-grid .country:nth-child(2n) {
        border-right: none;
    }
    .country .fi {
        font-size: 1.5rem;
    }
    .country {
        gap: 0.5rem;
        padding: 0.75rem 0.6rem;
    }
    .rating {
        font-size: 1.05rem;
    }
    .name {
        font-size: 0.78rem;
    }
    .countries-section {
        padding: 3rem 1.5rem;
    }
}
.countries-grid .country:nth-child(n + 9) {
    display: none;
}
.countries-grid.expanded .country {
    display: flex;
}

.btn-show {
    margin: 2rem auto 0;
    display: block;
    background: var(--bg-white);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.75rem 2rem;
    border-radius: 0;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}
.btn-show:hover {
    background: var(--primary);
    color: #fff;
}

#tests {
    background: var(--primary-tint);
}

#tests .cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid var(--border);
    align-items: stretch;
}

#tests .card {
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#tests .card > p:last-of-type {
    flex: 1;
}

#tests .card > .btn-primary {
    margin-top: auto;
    align-self: center;
}

#tests .card:nth-child(4n) {
    border-right: none;
}

@media (max-width: 1024px) {
    #tests .cards {
        grid-template-columns: repeat(2, 1fr);
    }
    #tests .card:nth-child(4n) {
        border-right: 1px solid var(--border);
    }
    #tests .card:nth-child(2n) {
        border-right: none;
    }
}

@media (max-width: 600px) {
    #tests .cards {
        grid-template-columns: 1fr;
    }
    #tests .card {
        border-right: none;
    }
}

header .nav-toggle {
    display: none;
}

@media (max-width: 767.98px) {
    header .nav-toggle {
        all: unset;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 32px;
        height: 32px;
        cursor: pointer;
        background: transparent;
        gap: 5px;
        border: 0;
        padding: 0;
    }

    header .nav-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background: var(--text);
        border-radius: 2px;
        transition: var(--transition);
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        width: 260px;
        margin-left: 0;
        padding: 3rem 1.5rem 2rem;
        flex-direction: column;
        gap: 1.25rem;
        background: #fff;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
        transform: translateX(-100%);
        transition: transform 0.5s cubic-bezier(0.33, 1.55, 0.68, 1);
        z-index: 1200;
    }

    .nav-links a {
        padding: 0.25rem 0;
        font-size: 1.05rem;
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-toggle.open span:nth-child(1) {
        transform: translateY(4px) rotate(45deg);
    }
    .nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.open span:nth-child(3) {
        transform: translateY(-4px) rotate(-45deg);
    }

    .hero-content {
        text-align: center;
    }

    .hero-content .btn-primary {
        display: inline-block;
        margin: 1.25rem auto 0;
    }
}

.card-logo {
    width: 175px;
    aspect-ratio: 1 / 1;
    object-fit: contain;

    display: block;
    margin: 0 auto 1rem;

    background: transparent;
    border-radius: 0;
    border: none;
    padding: 0;

    transition: none;
}
.card:hover .card-logo {
    transform: none;
    border-color: transparent;
}

.tests-carousel {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tests-carousel > .card {
    scroll-snap-align: start;
    width: 260px;
}

@media (min-width: 768px) {
    .tests-carousel {
        overflow: visible;
    }
    .tests-carousel > .card {
        width: auto;
    }
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: var(--primary);
    font-size: 1.8rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}
.arrow:hover {
    background: var(--primary);
    color: #fff;
}
.arrow-left {
    left: 8px;
}
.arrow-right {
    right: 8px;
}

@media (max-width: 767.98px) {
    .arrow {
        display: none;
    }
}

.game-list-container {
    overflow: hidden;
    padding: 0 48px;
}

.cards.tests-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}
.cards.tests-carousel::-webkit-scrollbar {
    display: none;
}

.cards.tests-carousel > .card {
    flex: 0 0 260px;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .cards.tests-carousel {
        display: grid;
        overflow: visible;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
    .cards.tests-carousel > .card {
        flex: 0 0 auto;
    }
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    font-size: 0;
}

.btn-icon::before {
    content: "\f007";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.25rem;
    line-height: 1;
}

.btn-icon .btn-label {
    display: none;
}

@media (min-width: 768px) {
    .btn-icon {
        width: auto;
        height: auto;
        padding: 0.8rem 1.6rem;
        font-size: inherit;
    }
    .btn-icon::before {
        content: none;
    }
    .btn-icon .btn-label {
        display: inline;
        white-space: nowrap;
    }
}
