*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgb(0, 0, 0);
    padding: 6px 30px;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

header img {
    width: 160px;
}

.nav-anim {
    position: relative;
    display: flex;
    align-items: center;
    height: 50px;
}

.nav-anim a {
    position: relative;
    display: inline-block;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 0 22px;
    z-index: 1;
}

.nav-anim a.active {
    color: white;
}

.nav-anim a.active:nth-child(2) ~ span {
    left: 90px;
    width: 95px;
}

.nav-anim a.activeP {
    color: white;
}

.nav-anim a.activeP:nth-child(3) ~ span {
    left: 185px;
    width: 110px;
}

.nav-anim a.activeC {
    color: white;
}

.nav-anim a.activeC:nth-child(4) ~ span {
    left: 295px;
    width: 120px;
}

.nav-anim a.activeAb {
    color: white;
}

.nav-anim a.activeAb:nth-child(5) ~ span {
    left: 435px;
    width: 105px;
}

.nav-anim span {
    position: absolute;
    top: 0;
    left: 0;
    width: 90px;
    height: 100%;
    background: linear-gradient(45deg, #ff9800, #ff5722);
    border-radius: 6px;
    transition: 0.5s;
    z-index: 0;
} 

.nav-anim a:nth-child(1):hover ~ span {
    left: 0;
    width: 90px;
}

.nav-anim a:nth-child(2):hover ~ span {
    left: 90px;
    width: 95px;
}

.nav-anim a:nth-child(3):hover ~ span {
    left: 185px;
    width: 110px;
}

.nav-anim a:nth-child(4):hover ~ span {
    left: 295px;
    width: 120px;
}

.nav-anim a:nth-child(5):hover ~ span {
    left: 435px;
    width: 105px;
}

.hamburger {
    display: none;
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
        cursor: pointer;
        width: 30px;
        height: 3px;
        background-color: white;
        position: relative;
        margin-right: 20px;
        transition: background-color 0.3s;
        flex-shrink: 0;
    }

    .hamburger::before,
    .hamburger::after {
        content: '';
        position: absolute;
        width: 30px;
        height: 3px;
        background-color: white;
        transition: transform 0.3s ease, top 0.3s ease;
    }

    .hamburger::before { top: -10px; }
    .hamburger::after  { top: 10px; }

    .hamburger.open { background-color: transparent; }
    .hamburger.open::before { top: 0; transform: rotate(45deg); }
    .hamburger.open::after  { top: 0; transform: rotate(-45deg); }

    .nav-anim {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        background-color: rgba(0, 0, 0, 0.97);
        position: fixed;
        top: 62px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 62px);
        transition: left 0.35s ease;
        padding-top: 30px;
        z-index: 999;
        overflow-y: auto;
    }

    .nav-anim.active { left: 0; }

    .nav-anim a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 18px 20px;
        color: white;
        font-size: 20px;
        position: relative;
        z-index: 1;
        transition: color 0.2s;
    }

    .nav-anim a:hover { color: #ff9800; }

    .nav-anim span { display: none; }

    .nav-anim a:nth-child(1):hover ~ span,
    .nav-anim a:nth-child(2):hover ~ span,
    .nav-anim a:nth-child(3):hover ~ span,
    .nav-anim a:nth-child(4):hover ~ span,
    .nav-anim a:nth-child(5):hover ~ span { display: none; }

    .nav-anim a + a { border-top: 1px solid rgba(255, 255, 255, 0.08); }

    .hero h2 { font-size: 30px; }
    .hero p  { font-size: 16px; }
    .topic h2 { font-size: 26px; }
    .grid { grid-template-columns: 1fr; }
}



body{
    background:#000814;
    color:white;
}

.hero{
    padding:140px 40px 80px;
    text-align:center;
}

.hero h2{
    font-size:44px;
    color:#ff9800;
}

.hero p{
    margin-top:15px;
    font-size:20px;
    color:#ccc;
}

.topic{
    padding:70px 40px;
}

.topic h2{
    color:#00aaff;
    text-align:center;
    font-size:36px;
    margin-bottom:40px;
}

.grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(360px,1fr));
    gap:30px;
}

.card{
    background:#0d1b2a;
    padding:25px;
    border-radius:18px;
    box-shadow:0 0 60px rgba(26,62,141,0.35);
    transition:0.3s;
}

.card:hover{
    transform:translateY(-8px);
    box-shadow:0 0 80px rgba(26,62,141,0.8);
}

.card h3{
    color:#ff9800;
    margin-bottom:10px;
}

.card h4{
    text-decoration: underline;
}

.card p{
    font-size:16px;
    line-height:1.6;
}

.card span{
    display:block;
    margin-top:10px;
    color:#00aaff;
    font-style:italic;
}

footer {
    background-color: black;
    padding: 18px 30px;
    width: 100%;
    z-index: 1000;
}

footer p {
    color: white;
    text-align: center;
    font-size: 16px;
}



/* Algebra - 9 Basci Function */
.basic-functions{
display: flex;
gap:20px;
margin-top:10px;
}

.functions-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
    flex:1;
}

.func{
    cursor:pointer;
    text-align:center;
}

.func img{
    width:100%;
}

.func p{
    font-size: 12px;
}

.func p:hover{
    text-decoration: underline;
}

.function-desc{
    background:#0d1b2a;
    padding:15px;
    border-radius:10px;
}

.desc{
    display:none;
}

.desc.active{
    display:block;
}

#scrollBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-size: 18px;
    border: none;
    color: white;
    cursor: pointer;
    padding: 14px 16px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff9800, #ff5722);
    box-shadow: 0 0 10px #ff9800;
    transition: 0.3s;
}

#scrollBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px #ff5722;
}
