/* ===========================
   GLOBAL RESET
=========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: "Poppins", sans-serif;
}

body {
    background: #050a0a;
    color: #fff;
}

/* ===========================
   HEADER
=========================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.8rem 10%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.logo {
    font-size: 2.2rem;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: 0.4s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo span {
    color: #00e5ff;
}

.navbar a {
    font-size: 1.3rem;
    color: #ccc;
    margin-left: 2.5rem;
    font-weight: 500;
    transition: 0.3s ease;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
}

.navbar a:hover,
.navbar a.active {
    color: #00e5ff;
    border-bottom: 2px solid #00e5ff;
}

#menu_icon {
    font-size: 3rem;
    color: #00e5ff;
    display: none;
    cursor: pointer;
}

/* ===========================
   HOME SECTION
=========================== */
.home {
    min-height: 100vh;
    padding: 10rem 10% 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    background: radial-gradient(ellipse at 70% 50%, rgba(0, 229, 255, 0.05) 0%, transparent 70%);
}

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

.home_content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.home_content h1 span {
    color: #00e5ff;
}

.text_animation {
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
    min-height: 2.5rem;
}

.text_animation span {
    color: #00e5ff;
    position: relative;
    display: inline-block;
}

.text_animation span::before {
    content: "Web Developer";
    color: #00e5ff;
    animation: words 20s infinite;
}

.text_animation span::after {
    content: "";
    background: #050a0a;
    position: absolute;
    width: calc(100% + 8px);
    height: 100%;
    border-left: 3px solid #00e5ff;
    right: -8px;
    animation: cursor 0.6s infinite, typing 20s steps(14) infinite;
}

@keyframes cursor {
    to { border-left: 2px solid #00e5ff; }
}

@keyframes words {
    0%,  20% { content: "Web Developer";      }
    21%, 40% { content: "Frontend Developer"; }
    41%, 60% { content: "Backend Developer";  }
    61%, 80% { content: "MERN Developer";     }
}

@keyframes typing {
    10%, 15%, 30%, 35%,
    50%, 55%, 70%, 75%,
    90%, 95% { width: 0; }

    5%,  20%, 25%, 40%,
    45%, 60%, 65%, 80%,
    85% { width: calc(100% + 8px); }
}

.home_content p {
    color: #bbb;
    font-size: 1.3rem;
    font-weight: 400;
    max-width: 55rem;
    line-height: 2rem;
}

.btn_group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 1rem 2.8rem;
    background: #00e5ff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
    border-radius: 50px;
    font-size: 1.3rem;
    color: #000;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s ease;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.8);
}

.btn_group a:nth-of-type(2) {
    background: transparent;
    color: #00e5ff;
    border: 2px solid #00e5ff;
    box-shadow: none;
}

.btn_group a:nth-of-type(2):hover {
    background: #00e5ff;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
}

.home_img img {
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    height: 300px;
    width: 300px;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.6);
    cursor: pointer;
    transition: 0.4s ease;
}

.home_img img:hover {
    transform: scale(1.08);
    box-shadow: 0 0 60px rgba(0, 229, 255, 0.9);
}

/* ===========================
   EDUCATION SECTION
=========================== */
.education {
    padding: 6rem 8% 6rem;
    background: rgba(0, 0, 0, 0.4);
}

.heading {
    font-size: 4.5rem;
    text-align: center;
    color: #fff;
    margin-bottom: 4rem;
    letter-spacing: 2px;
}

.heading span {
    color: #00e5ff;
}

/* Timeline wrapper - container for both rows */
.timeline_wrapper {
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* First row - 3 cards */
.first_row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

/* Second row - 2 cards centered */
.second_row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* Each card styling */
.timeline_content {
    background: #1c1c1c;
    border: 1px solid #00e5ff;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.timeline_content:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.5);
    border-color: #00c2c2;
    background: #242424;
}

.timeline_date {
    font-size: 1.5rem;
    font-weight: 800;
    color: #00e5ff;
    margin-bottom: 1rem;
    text-align: center;
}

.timeline_content h3 {
    font-size: 1.7rem;
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 700;
    text-align: center;
}

.timeline_content p {
    color: #ccc;
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: center;
    flex-grow: 1;
}

/* ===========================
   RESPONSIVE — 1200px
=========================== */
@media (max-width: 1200px) {
    .first_row {
        gap: 2rem;
    }
    
    .second_row {
        gap: 2rem;
    }
}

/* ===========================
   RESPONSIVE — 992px
=========================== */
@media (max-width: 992px) {
    .header { padding: 1.5rem 6%; }

    #menu_icon { display: block; }

    .navbar {
        position: absolute;
        top: 100%;
        right: 5%;
        background: rgba(0, 0, 0, 0.97);
        flex-direction: column;
        padding: 2rem;
        border-radius: 12px;
        border: 1px solid rgba(0, 229, 255, 0.2);
        display: none;
        min-width: 180px;
        z-index: 200;
    }

    .navbar.active { display: flex; }

    .navbar a {
        margin-left: 0;
        margin-bottom: 1rem;
        font-size: 1.4rem;
    }

    .home {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
        padding-top: 12rem;
        padding-bottom: 3rem;
    }

    .home_content { align-items: center; }

    .home_img img {
        height: 220px;
        width: 220px;
    }

    /* 2 columns for both rows on tablet */
    .first_row {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .second_row {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .timeline_content {
        padding: 2.2rem 1.8rem;
        min-height: 240px;
    }
}

/* ===========================
   RESPONSIVE — 768px (mobile)
=========================== */
@media (max-width: 768px) {
    .home_content h1 { font-size: 2.2rem; }
    .home_content p  { font-size: 1.1rem; }
    .heading          { font-size: 3rem; }

    .text_animation {
        font-size: 1.8rem;
        min-height: 3rem;
    }

    /* Fix cursor width on mobile to prevent cutting text */
    .text_animation span::after {
        width: calc(100% + 3px);
        right: -3px;
        border-left: 2px solid #00e5ff;
    }

    @keyframes typing {
        10%, 15%, 30%, 35%,
        50%, 55%, 70%, 75%,
        90%, 95% { width: 0; }

        5%,  20%, 25%, 40%,
        45%, 60%, 65%, 80%,
        85% { width: calc(100% + 3px); }
    }

    /* Single column on mobile for both rows */
    .first_row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .second_row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .timeline_content {
        border-radius: 12px;
        padding: 2rem 1.8rem;
        min-height: 220px;
    }
}

/* ===========================
   RESPONSIVE — 576px
=========================== */
@media (max-width: 576px) {
    .header { padding: 1.2rem 5%; }
    .logo   { font-size: 1.8rem;  }

    .home_content h1 { font-size: 1.9rem; }
    .heading          { font-size: 2.5rem; }

    .btn { padding: 0.9rem 2rem; font-size: 1.1rem; }

    .education { padding: 5rem 5% 5rem; }

    .text_animation {
        font-size: 1.5rem;
        min-height: 2.5rem;
    }

    .timeline_content {
        padding: 2rem 1.5rem;
        min-height: 200px;
    }

    .timeline_content h3 {
        font-size: 1.5rem;
    }

    .timeline_content p {
        font-size: 1rem;
    }

    .timeline_date {
        font-size: 1.3rem;
    }

    /* Further reduce cursor width on very small screens */
    .text_animation span::after {
        width: calc(100% + 2px);
        right: -2px;
    }

    @keyframes typing {
        10%, 15%, 30%, 35%,
        50%, 55%, 70%, 75%,
        90%, 95% { width: 0; }

        5%,  20%, 25%, 40%,
        45%, 60%, 65%, 80%,
        85% { width: calc(100% + 2px); }
    }
}