/* Variables */
:root {
    --color-bg: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-text: #f1f5f9;
    --color-dim-text: #b3b8c1;
    --color-primary: #38bdf8;
    --color-primary-hover: #0284c7;
    --font-family: 'Inter', sans-serif;
    --font-size-base: 16px;
    --transition-speed: 0.3s ease;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Space Grotesk", serif;
    font-optical-sizing: auto;
}


html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
}

.main {
    max-width: 80%;
    margin: auto;
}

/* Section */
.section {
    padding: 4rem 1rem;
    margin: auto;
    text-align: center;
}

@media (max-width: 768px) {
    .section {
        padding: 3rem 1rem;
    }

    .section:first-of-type {
        padding-top: 2rem;
    }

    /* Adjust vertical margins for section elements */
    .section__heading {
        margin-bottom: 1.5rem;
    }

    .tech__stack__wrapper {
        margin: 1.5rem 0;
    }

    .project__card {
        margin-bottom: 1.5rem;
    }

    .blog__card {
        margin-bottom: 1.5rem;
    }

    /* Adjust spacing for specific sections */
    #about {
        padding-top: 5rem;
        /* Extra padding for first section due to fixed header */
    }

    #tech-stack,
    #journey,
    #education,
    #projects,
    #blogs,
    #contact {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }


    .tech__item {
        margin: 0.5rem;
    }

    .project__description,
    .blog__description {
        margin: 0.75rem 0;
    }

    .contact__text {
        margin: 1rem 0;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 2rem 0.75rem;
    }

    #about {
        padding-top: 4rem;
    }

    .section__heading {
        margin-bottom: 1.25rem;
    }

    .tech__item {
        margin: 0.4rem;
    }
}

/* Section Title */
.section__heading {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--color-text);
    text-align: center;
}

/* Section Description */
.section__description {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

.show__on__mobile {
    display: none;
}


/* Animations  */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-120px * 7));
    }
}

/* End of animations */


/* Base Header Styles */
.top__header {
    width: 100%;
    color: #fff;
    padding: 2rem 2rem;
    position: relative;
    top: 0;
    z-index: 999;
    background: transparent;
    transition: all 0.3s ease;
    backdrop-filter: none;
    border-bottom: none;
}


/* Nav Container */
.top__nav.new__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* Nav Groups */
.nav__right {
    display: flex;
    gap: 1.5rem;
}

.nav__logo a {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(to right, #00c6ff, #0072ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    border-radius: 50%;
    border: 1px solid var(--color-primary);
    padding: 6px;
}


/* Link styles */
.top__nav a {
    color: #ccc;
    text-decoration: none;
    font-size: 1rem;
    transition: 0.3s ease;
}

.top__nav a:hover {
    color: #fff;
}

/* Toggle Button */
.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 99;
    width: 40px;
    height: 40px;
    position: relative;

}

.hamburger,
.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    position: relative;
    transition: transform 0.3s ease-in-out, background 0.3s ease-in-out;
}


.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

.nav__toggle.active {
    background: var(--color-primary);
    border-radius: 50%;
}

.nav__toggle.active .hamburger {
    background: transparent;
    left: -2px;
}

.nav__toggle.active .hamburger::before {
    transform: rotate(45deg) translate(5.5px, 5.5px);
    background: var(--color-bg);
}

.nav__toggle.active .hamburger::after {
    transform: rotate(-45deg) translate(5.5px, -5.5px);
    background: var(--color-bg);
}

@media (max-width: 768px) {
    .nav__right {
        display: none;
    }

    .nav__toggle {
        display: block;
    }
}


/* Mobile Menu */
.mobile__menu {
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
}

.mobile__menu a {
    color: #ccc;
    font-size: 1.1rem;
}

.mobile__menu.show {
    display: flex;

}

/* Responsive */
@media (max-width: 768px) {

    .nav__left,
    .nav__right {
        display: none;
    }

    .nav__toggle {
        display: flex;
    }
}


/* Mobile Menu Styles */
.mobile__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background-color: var(--color-bg-secondary);
    padding: 80px 20px 20px;
    transition: right 0.3s ease-in-out;
    z-index: 98;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile__menu.show {
    right: 0;
}

.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 99;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    position: relative;
    transition: background 0.2s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: transform 0.2s ease-in-out;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    bottom: -6px;
}

.nav__toggle.active .hamburger {
    background: transparent;
}

.nav__toggle.active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav__toggle.active .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

@media (max-width: 768px) {
    .nav__right {
        display: none;
    }

    .nav__toggle {
        display: block;
    }

    .main {
        max-width: 95%;
    }
}


/* Main Section */
#about p {
    font-size: 1.2rem;
    color: var(--color-primary);
}

.main__intro {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 2rem 1rem;
}


.profile__image {
    width: 150px;
    height: 150px;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--color-primary);
    margin: 20px 0;
}

.profile__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title {
    font-size: 2.5rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--color-dim-text);
    margin-bottom: 2rem;
}


/* Tech Stack Section */

.tech__stacks__and__tools {
    padding: 2rem 1rem;
    text-align: center;
    width: 100%;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

.tech__stacks__and__tools h2 {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    color: var(--color-text);
}

.tech__stack__wrapper {
    display: flex;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.tech__stack__items {
    display: flex;
    width: max-content;
    animation: scroll 22s linear infinite;
}

.tech__stack__items:hover {
    animation-play-state: paused;
}

.tech__stack__items .tech__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    flex-shrink: 0;
}

.tech__stack__items .tech__item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.tech__stack__items .tech__item p {
    font-size: 1rem;
    color: var(--color-text);
}


@media (max-width: 640px) {
    .tech__stack__items {
        width: calc(120px * 4);
        animation-duration: 14s;
    }
}

@media (max-width: 1024px) {
    .tech__stack__items {
        width: calc(120px * 4);
        animation-duration: 18s;
    }
}

/* End of tech stacks */

/* Timeline Section */
.timeline {
    position: relative;
    padding: 2rem 0;
}

/* Vertical Bar in the Center */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--color-primary);
}

/* Timeline Items */
.timeline__item {
    position: relative;
    width: 50%;
    padding: 1rem 2rem;
    box-sizing: border-box;
}

/* Odd Items - Left Side */
.timeline__item:nth-child(odd) {
    left: 4px;
    text-align: right;
}

/* Even Items - Right Side */
.timeline__item:nth-child(even) {
    left: 50%;
    text-align: left;
}

/* Circular Markers */
.timeline__item::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 4px solid var(--color-primary);
}

/* Marker for odd items */
.timeline__item:nth-child(odd)::before {
    right: -8px;
}

/* Marker for even items */
.timeline__item:nth-child(even)::before {
    left: -12px;
}

/* Timeline Content Box */
.timeline__content {
    background: var(--color-bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    position: relative;
}

.timeline__content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.timeline__content h4 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    color: var(--color-text);
}

.timeline__date {
    font-size: 0.9rem;
    color: var(--color-dim-text);
    display: block;
    margin-bottom: 0.5rem;
}


/* Education Section */
.education__container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

/* Education Cards */
.education__card {
    background: var(--color-bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    text-align: center;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* Hover Effect */
.education__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* Degree Icons */
.education__icon {
    width: 60px;
    height: 60px;
    margin: auto;
    margin-bottom: 1rem;
}

.education__icon img {
    width: 100%;
    height: auto;
    filter: invert(1);
}

/* Degree Title */
.education__card h3 {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

/* Institution Name */
.education__card h4 {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

/* Date */
.education__date {
    font-size: 0.9rem;
    color: var(--color-dim-text);
    display: block;
    margin-bottom: 0.8rem;
}

/* Paragraph */
.education__card p {
    font-size: 1rem;
    color: var(--color-text);
}


/* Projects Section start */
.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project__card {
    background: var(--color-bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.project__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.project__info {
    padding: 1.5rem;
    text-align: left;
}

.project__info h3 {
    font-size: 1.4rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.project__info p {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.project__links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.project__links a {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.project__links a:hover {
    color: var(--color-primary-hover);
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .projects__grid {
        grid-template-columns: 1fr;
    }
}

/* End projects section */

/* Blog Section Starts */
.blog__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.blog__card {
    background: var(--color-bg-secondary);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog__card:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.blog__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.blog__card:hover .blog__image {
    opacity: 0.8;
}

.blog__info {
    padding: 20px;
    text-align: left;
}

.blog__info h3 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 15px;
    text-transform: capitalize;
}

.blog__info p {
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 15px;
    text-align: justify;
}

/* End Blog section */

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .main {
        max-width: 94%;
    }

    .top__header {
        padding: 1rem 0.5rem;
    }

    .title .full__name {
        display: block;
    }

    .show__on__pc {
        display: none;
    }

    .show__on__mobile {
        display: block;
    }

    .about__me p {
        text-align: justify;
    }

    .timeline__item {
        width: 100%;
        padding-left: 2.5rem;
        padding-right: 0;
        text-align: left !important;
        margin-bottom: 2rem;
    }

    .timeline__item:nth-child(odd),
    .timeline__item:nth-child(even) {
        left: 0;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline__item::before {
        left: 8px !important;
    }

    .education__container {
        flex-direction: column;
        align-items: center;
    }

    .education__card {
        max-width: 100%;
    }
}

/* For tablets: show about 4 items per view */
@media (min-width: 601px) and (max-width: 1024px) {
    .tech__item {
        flex: 0 0 calc(100% / 4);
    }
}

/* For mobile: show about 3 items per view */
@media (max-width: 600px) {
    .tech__item {
        flex: 0 0 calc(100% / 3);
    }
}

/* Start Footer Section */
.footer__content {
    margin-bottom: 60px;
}

.footer__description {
    max-width: 800px;
    text-align: center;
    font-size: 18px;
    margin-bottom: 60px;
    margin-left: auto;
    margin-right: auto;
    color: var(--color-text);
}

.footer__cta-button {
    border: 2px solid var(--color-primary);
    color: var(--color-text);
    font-size: 16px;
    padding: 10px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.3s ease;
}

.footer__cta-button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-3px);
}

.footer__copyright {
    font-size: 14px;
    color: var(--color-dim-text);
    margin-top: 20px;
}

/* End Footer Section */

/* Responsive Design */
@media (max-width: 600px) {
    .footer__title {
        font-size: 24px;
    }

    .footer__description {
        font-size: 16px;
    }

    .footer__cta-button {
        font-size: 14px;
        padding: 12px 25px;
    }
}

.go-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background-color: var(--color-primary);
    color: var(--color-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
}

.go-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.go-to-top:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    .go-to-top {
        bottom: 20px;
        right: 20px;
    }
}

/* Responsive Typography */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .main__intro {
        padding: 0;
        margin: 0;
    }

    .main__intro .profile__image {
        margin-top: 0;
    }

    .main__intro .full__name {
        font-size: 3rem;
        line-height: 1.2;
    }


    .section__heading {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }

    .title {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .subtitle {
        font-size: 1.4rem;
        margin: 0;
    }

    .about__me p {
        font-size: 1rem;
        line-height: 1.6;
        margin: 1rem auto;
        max-width: 100%;
        padding: 0 1rem;
    }

    .tech__item p {
        font-size: 0.9rem;
    }

    .project__title {
        font-size: 1.3rem;
    }

    .project__description {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .blog__title {
        font-size: 1.3rem;
    }

    .blog__description {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .contact__text {
        font-size: 1rem;
        line-height: 1.5;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .section__heading {
        font-size: 1.5rem;
    }

    .title {
        font-size: 1.6rem;
    }

    .full__name {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }
}