/* Improved UI: typography, layout, hero, cards, and responsive tweaks */
:root {
    --container: 1200px;
    --gap: 1.25rem;
    --radius: 14px;
    --primary-500: #6f42c1;
    --primary-600: #5b2fa3;
    --muted: #6b7280;
    --surface: rgba(255, 255, 255, 0.85);
    --glass: rgba(255, 255, 255, 0.6);
    --card-shadow: 0 8px 30px rgba(33, 37, 41, 0.08);
}

/* Base typography */
html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
    color: #0f1724;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* containers */
.hero>*,
.features>*,
.classes-section>* {
    max-width: var(--container);
}

.hero {
    position: relative;
    min-height: calc(100vh - 92px);
    display: grid;
    padding: 6rem 1rem;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    inset: 0;
    background: radial-gradient(1200px 400px at 10% 20%, rgba(111, 66, 193, 0.08), transparent 10%), radial-gradient(1000px 360px at 90% 80%, rgba(243, 156, 18, 0.04), transparent 10%);
    pointer-events: none;
}

.hero h1 {
    font-weight: 800;
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    line-height: 1.02;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    color: var(--primary-600);
}

.hero p {
    max-width: 780px;
    margin: 0 auto 1.75rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem 1.25rem;
    border-radius: 999px;
}

.logo-symbol {
    font-weight: 600;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    color: #fff;
    transform: translateZ(0);
    box-shadow: 0 10px 30px rgba(111, 66, 193, 0.18);
}

.btn-primary:hover {
    transform: translateY(-3px);
    filter: brightness(.98);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(15, 23, 36, 0.06);
    color: var(--primary-600);
}

/* class cards */
.classes-section {
    padding: 4rem 1rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2.25rem;
}

.section-header h2 {
    font-size: 1.6rem;
    margin-bottom: .5rem;
}

.class-grid {
    column-count: 4;
    column-gap: 1.5rem;
    display: block;
}

.class-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.75rem;
    min-height: auto;
    margin-bottom: 1.5rem;
    break-inside: avoid;
    width: 100%;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: .8rem;
    transition: transform .28s cubic-bezier(.2, .9, .3, 1), box-shadow .28s;
    position: relative;
    overflow: hidden;
}

.class-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(15, 23, 36, 0.12);
}

.card-bg-icon {
    position: absolute;
    right: 16px;
    top: 12px;
    font-weight: 900;
    font-size: 3rem;
    color: rgba(15, 23, 36, 0.06);
}

.card-content h3 {
    margin: 0 0 .25rem 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.class-card p {
    font-size: 1.05rem;
    line-height: 1.6;
}

.class-badge {
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    color: white;
    font-size: .75rem;
    padding: .25rem .5rem;
    border-radius: 999px;
}

.card-action {
    margin-top: auto;
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    color: var(--primary-600);
    font-weight: 600;
    font-size: 1rem;
}

/* Maths Mastery Card Distinct Style */
.card-maths-mastery {
    background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-maths-mastery h3,
.card-maths-mastery p {
    color: #ffffff;
}

.card-maths-mastery .card-bg-icon {
    color: rgba(255, 255, 255, 0.1);
}

.card-maths-mastery .card-action {
    color: #f1c40f;
}

/* features */
.features {
    padding: 4rem 1rem;
}

.feature-grid {
    column-count: 3;
    column-gap: 1.5rem;
    display: block;
}

.feature-card {
    background: transparent;
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform .25s, box-shadow .25s;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.6));
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    break-inside: avoid;
    width: 100%;
}

.feature-card:hover {
    transform: translateY(-6px);
}

.f-icon {
    font-size: 1.6rem;
    color: var(--primary-600);
    margin-bottom: .6rem;
}

/* responsive */
@media (max-width:1100px) {
    .class-grid {
        column-count: 3;
    }

    .feature-grid {
        column-count: 2;
    }
}

@media (max-width:760px) {
    .class-grid {
        column-count: 2;
    }

    .hero {
        padding: 4rem 1rem;
    }
}

@media (max-width:480px) {
    .class-grid {
        column-count: 1;
    }

    .feature-grid {
        column-count: 1;
    }

    nav ul {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 1.85rem;
    }

    header {
        padding: 0 0.75rem;
    }

    .class-card {
        text-align: center;
    }

    .feature-card {
        align-items: center;
        text-align: center;
    }
}

/* small accessibility and focus states */
.btn:focus {
    outline: 3px solid rgba(111, 66, 193, 0.14);
    outline-offset: 3px;
}

/* minor tweaks for footer readability */
footer {
    background: #07080a;
}

/* subtle animation for headings */
@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.hero h1,
.hero p,
.cta-group {
    animation: floatUp .6s ease both;
}

/* Header & search overrides */
header {
    height: 84px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 1100;
}

.logo {
    font-size: 1.35rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--primary-600);
    font-weight: 800;
}

.logo-symbol {
    font-size: 1.35rem;
    color: var(--primary-500);
}

.search-wrapper {
    margin-left: auto;
    margin-right: 1rem;
}

.header-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--glass);
    padding: .35rem .5rem;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(15, 23, 36, 0.06);
}

.header-search input {
    border: 0;
    background: transparent;
    padding: .4rem .5rem;
    min-width: 220px;
    font-size: .95rem;
}

.header-search button {
    background: transparent;
    border: 0;
    color: var(--primary-600);
    padding: .25rem;
    font-size: 1rem;
}

nav ul {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

nav ul li a {
    padding: .25rem .25rem;
    border-radius: 6px;
}

nav ul li a:hover {
    background: rgba(111, 66, 193, 0.06);
    color: var(--primary-600);
}

.nav-btn {
    padding: 8px 14px;
    border-radius: 10px;
}

/* ensure mobile-toggle stays visible on small screens */
.mobile-toggle {
    display: none;
}

@media (max-width:992px) {
    .search-wrapper {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    header {
        padding: 0 1rem;
    }
}

/* end */