*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    list-style: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}
html {
    font-size: 0.7em; /* 150% of default, adjust as needed for your screen */
}

:root{
    --background: #;         /* Deep dark with purple undertone */
    --second-background: #393552;  /* Lighter, muted purple */
    --accent: #a782e9;             /* Soft purple accent */
    --text-light: #f4f4f6;         /* Light text for dark backgrounds */
    --text-dark: #22223b;          /* Softer dark for light backgrounds */
    --box-border: #393552;         /* Border for boxes */
    --box-hover: #a782e9;          /* Border on hover */
}

body{
    min-height: 100vh;
    background: var(--background);
    color: var(--text-light);
}

ul{
    display: flex;
    gap: 3em;
    align-items: center;
}

nav{
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2em 15%;
    background: rgba(35, 33, 54, 0.85); /* matches --background with transparency */
    backdrop-filter: blur(10px);
    z-index: 1000;
}

nav ul a{
    font-size: 1.4em;
    font-weight: 500;
    color: var(--text-light);
    opacity: 0.9;
    transition: 0.2s ease-in-out;
}
nav ul a:hover{
    color: var(--accent);
    opacity: 1;
}

.logo{
    font-size: 2em;
    color: var(--accent);
    font-weight: 800;
    opacity: 0.9;
    transition: 0.2s ease-in-out;
}
.logo:hover{
    opacity: 1;
    color: var(--text-light);
}

.btn{
    padding: 0.5em 1.5em;
    border-radius: 0.5em;
    color: var(--background);
    background: var(--accent);
    font-weight: 500;
    font-size: 1.2em;
    letter-spacing: 1px;
    border: 2px solid var(--accent);
    transition: 0.3s ease-in-out;
    cursor: pointer;
}
.btn a,
.btn a:visited {
    font-size: 1.2em;
    color: var(--background);
    text-decoration: none;
}
.btn:hover{
    background-color: var(--background);
    color: var(--accent);
    border-color: var(--accent);
}

span{
    background: linear-gradient(to right, #a782e9, #ffd6a5);
    background-clip: text;
    color: transparent;
}

#menu{
    color: var(--accent);
    font-size: 3em;
    display: none;
}

section{
    min-height: 100vh;
    padding: 5% 15%;
    background: var(--background);
    color: var(--text-light);
}

#home{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2em;
    color: var(--text-light);
}
#home img{
    width: 18vw;
    border-radius: 50%;
    margin-top: 3em;
}

.info-box{
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 0.5em;
    max-width: 520px;
}
.info-box h1{
    font-size: 4em;
    font-weight: 500;
    color: var(--text-dark);
}
.info-box h3{
    font-size: 2.5em;
    font-weight: 500;
    color: var(--text-dark);
}
.info-box p{
    padding-top: 0.7em;
    font-size: 1.6em;
    font-weight: 400;
    color: var(--text-dark);
}

.btn-box{
    display: flex;
    gap: 1em;
}
.btn-box .btn:nth-of-type(2){
    background-color: var(--background);
    color: var(--accent);
    border: 2px solid var(--accent);
}
.btn-box .btn:nth-of-type(2):hover{
    background-color: var(--accent);
    color: var(--background);
}

::-webkit-scrollbar{
    width: 20px;
    background-color: var(--background);
}

::-webkit-scrollbar-thumb{
    background: linear-gradient(to bottom, #a782e9, #feb47b);
}

#about{
    background-color: var(--second-background);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5em;
    color: var(--text-light);
}
#about img{
    width: 30vw;
    border-radius: 1em;
}
.about-box h1{
    text-align: center;
    font-size: 3.5em;
    margin: 0.5em 0;
    color: var(--accent);
}
.about-box h2{
    font-size: 2.5em;
    color: var(--accent);
}
.about-box p{
    color: var(--text-dark);
    font-size: 1.6em;
    opacity: 0.9;
}
.about-cards {
    display: flex;
    gap: 2em;
    flex-wrap: wrap;
    margin-top: 2em;
}
.about-card {
    background: var(--second-background);
    border-radius: 1em;
    padding: 2em 2.5em;
    min-width: 220px;
    box-shadow: 0 4px 24px 0 rgba(35,33,54,0.08);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 220px;
    font-size: 1.2em;
}
.about-card h2 {
    font-size: 2em;            /* Larger subheading */
    font-weight: 700;          /* Bolder */
    margin-bottom: 0.5em;
    color: var(--accent);
}
.edu-title {
    font-size: 1.2em;          /* Larger education title */
    font-weight: 700;          /* Bolder */
}

.edu-detail {
    font-size: 1.15em;
    font-weight: 500;
    margin-top: 0.2em;
    margin-bottom: 0.2em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    align-items: center;
}
.honours {
    background: var(--accent);
    color: var(--background);
    font-weight: 700;
    border-radius: 0.4em;
    padding: 0.1em 0.5em;
    margin-left: 0.5em;
    font-size: 0.95em;
    letter-spacing: 0.5px;
    display: inline-block;
}
.edu-years {
    font-size: 1.2em;
    opacity: 0.8;
    margin-bottom: 0.2em;
}
.edu-special {
    font-size: 1.2em;
    opacity: 0.85;
    font-style: italic;
    font-weight: 550;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1em;
    align-items: stretch;
    padding: 0;
}

.skill-box {
    background: var(--background);
    border-radius: 0.7em;
    padding: 0.6em 0.2em;
    display: flex;
    align-items: center;
    gap: 0.7em;
    font-weight: 600;
    font-size: 1.25em;
    color: var(--text-light);
    box-shadow: 0 2px 8px 0 rgba(35,33,54,0.06);
    transition: transform 0.2s;
    flex: 1 1 180px;
    min-width: 150px;
    justify-content: flex-start;   /* Left align icon and text */
    text-align: left;
}
.skill-box i {
    font-size: 1.5em;
    color: var(--accent);
}
.skill-box:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 6px 20px 0 rgba(167,130,233,0.12);
}


.experience{
    display: flex;
    text-align: left;
    gap: 10em;
}
.experience ul{
    font-size: 1.4em;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    color: var(--text-light);
    opacity: 0.85;
    align-items: baseline;
}
.experience ul li{
    display: flex;
    gap: 0.5em;
    font-size: 1.2em;
    transition: 0.3s ease-in-out;
}
.experience ul li:hover{
    transform: translateX(10px);
    color: var(--accent);
}
.experience ul li i{
    font-size: 1.2em;
    color: var(--accent);
}

#portfolio{
    background-color: var(--background);
    color: var(--text-light);
}
.header {
    text-align: center;
    font-size: 3.5em;
    margin: 2em 0 1em 0; /* Increase gap above Projects, keep below as is */
    color: var(--accent);
}
.projects-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Force 2 columns */
    gap: 2.5em;
    margin-top: 2em;
}

.box {
    border: 3px solid var(--box-border);
    border-radius: 0.7em;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    overflow: hidden;
    object-fit: cover;
    padding: 2.5em 2em;
    gap: 1.5em;
    color: var(--text-light);
    background: var(--second-background);
    cursor: pointer;
    transition: 0.3s ease-in-out;
    min-height: 320px;      /* Make boxes taller */
    min-width: 0;           /* Prevent overflow */
}

.box h1 {
    font-size: 2em;
    color: var(--accent);
}

.box p {
    font-size: 1.6em;       /* Make text bigger */
    opacity: 0.95;
}

.box img {
    width: 100%;
    aspect-ratio: 9 / 16;      /* Makes the image 9:16 ratio */
    object-fit: cover;
    border-radius: 0.5em;
    max-height: 400px;         /* Optional: limit height for consistency */
    min-height: 200px;         /* Optional: ensure it's not too small */
}
.box:hover{
    border: 3px solid var(--box-hover);
}

#contact {
    background: #fff;
    color: var(--text-dark);
}
#contact .header span {
    background: linear-gradient(to right, #a782e9, #ffd6a5);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
#contact input,
#contact input:focus {
    background: #f4f4f6;
    color: var(--text-dark);
}

.game-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#game-sidebar {
    width: 180px;
    min-height: 400px;
    background: var(--second-background);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-left: -200px;
    margin-right: 32px;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#game-sidebar h3 {
    margin-top: 0;
    color: var(--accent);
    font-size: 2em;
    letter-spacing: 1px;
    text-align: center;
}

form{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2em;
}
form .input-box{
    display: flex;
    flex-direction: column;
    align-items: baseline;
    gap: 1em;
}
form input{
    font-size: 1.3em;
    padding: 1em 5em;
    border-radius: 0.5em;
    border: none;
    outline: none;
    background: var(--background);
    color: var(--text-light);
}
form input:focus{
    background: var(--accent);
    color: var(--background);
}

footer{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10em;
    bottom: 0;
    width: 100%;
    padding: 5em 15%;
    background-color: var(--background);
    color: var(--text-dark);
}
.col-left{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1em;
}
.col-box i{
    font-size: 1em;
    color: var(--accent);
}
.col-box span{
    font-size: 1.4em;
    color: var(--text-dark);
}

.col-right{
    display: flex;
    flex-direction: column;
    gap: 1em;
    color: var(--text-dark);
    max-width: 500px;
}
.col-right span{
    font-size: 1.4em;
    color: var(--accent);
}
.col-right p{
    font-size: 1.4em;
    color: var(--text-dark);
}
.col-box .social-icons{
    display: flex;
    align-items: baseline;
    justify-content: left;
    gap: 1em;
}
.col-right .social-icons i{
    font-size: 2em;
    transition: 0.2s ease-in-out;
    cursor: pointer;
    color: var(--accent);
}
.social-icons i:hover{
    color: var(--text-light);
    background: var(--accent);
}

@media(max-width: 968px){
    section{
        padding: 8em 15%;
    }
    nav .btn{
        display: none;
    }
    #menu{
        display: block;
    }
    .links {
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        padding: 0.5em 0.5em;      /* Less padding inside dropdown */
        background-color: rgba(35, 33, 54, 0.95);
        flex-direction: column;
        text-align: center;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }
    .links a {
        margin: 0.5em 0em;            /* Reduce vertical margin between links */
        font-size: 1.5em;         /* Slightly smaller font */
        padding: 0.2em 0;         /* Less padding for each link */
    }
    .links.active {
        max-height: 300px;        /* Reduce dropdown height */
    }

    #home h1{
        font-size: 3.5em;
    }
    #home h3{
        font-size: 2.5em;
    }
    #home img{
        width: 42vw;
    }
    
    #about{
        flex-direction: column;
    }
    #about img{
        width: 32vw;
    }
    #about h1{
        font-size: 3em;
    }
    #about ul{
        font-size: 1em;
    }
    .projects-container {
        grid-template-columns: 1fr;
    }
    .about-card h2{
        font-size: 1.6em; 
    }
    .skills-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }
    .skill-box {
        font-size: 1em; /* Smaller font size */
        padding: 0.2em 0.2em; /* Adjust padding */
        min-width: 100px; /* Ensure boxes are not too small */
    }
}

@media(max-width: 768px){
    #menu{
        display: block;
    }
    #home h1{
        font-size: 3em;
    }
    #home h3{
        font-size: 2.2em;
    }
    #home img{
        width: 52vw;
    }
    #home .btn a{
        font-size: 1em;
    }

    #about .skills{
        gap: 3em;
    }

    #portfolio .header{
        font-size: 3em;
    }

    #contact .header{
        font-size: 3em;
    }
    #contact input-box span{
        font-size: 1.2em;
    }
    .input-box input{
        padding: 0.5em 1em;
    }
    .projects-container {
        grid-template-columns: 1fr;
    }
    .skills-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }

    footer{
        flex-direction: column;
        gap: 5em;
        align-items: baseline;
    }
}