html{
    scroll-behavior: smooth;
}


* {
    box-sizing: border-box;
}

body{
    margin:0;
    color:#222;
    background:#f7f7f9;
}

header{
    background:url('graduationPic.jpg') center center/contain no-repeat, rgba(0,0,0,0.3); /* fallback solid color */
    color: #fff;
    position: relative;
    top:0;
    z-index:999;
    min-height: 400px;
}

nav ul {
    display:flex;
    list-style:none;
    gap: 2rem;
    background: rgba(0,0,0,0.3); /* semi transparent for contrast over image */
}

nav ul li a{
    color:white;
    font-size:1.5rem;
    text-decoration: none;
}

nav ul li.right{
    margin-left:auto; /*pushes moon to the far right */
    margin-right: 2px;
    margin-top: 5px;
    margin-bottom:2px;
}

.bg {
    min-height: 400px;
    display: flex;
    align-items: center;       /* Vertically center the section */
    justify-content: center;   /* Horizontally center the section */
}

.firstSection {
    display: flex;
    flex-direction: column;
    align-items: center;       /* Center inner content horizontally */
    justify-content: center;   /* Center inner content vertically */
    padding: 30px;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    color: #fff;
    max-width: 600px;
    width: 100%;
    margin: 30px 0;
}

/* Center the leftSection and its children */
.leftSection {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#typewriter {
    font-size: 1.6rem;
    font-weight: bold;
    color: #ffd700;
    font-family: monospace;
    margin-top: 10px;
    height:20px;
}


#about{
    padding: 40px 20px;
    max-width: 1000px;
    margin:0 auto;
}

#about h2{
    text-align:center;
    margin-bottom:30px;
}

.about-content{
    display:flex;
    align-items:center;
    gap: 30px;
}

.about-content figure,
.about-content .about-text{
    flex:1;
}

.about-content figure{
    margin:0;
    text-align: center;
}

.about-content img{
    max-width:100%;
    height:auto;
    border-radius: 10px;
}

.about-text{
    text-align: justify;
}


#experience{
    padding:40px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

#experience h2{
    text-align: center;
    margin-bottom: 30px;
}

.exp-row{
    display:flex;
    flex-wrap:wrap;
    gap:20px;
    justify-content: center;
}

.exp-item{
    background:#fff;
    border-radius: 12px;
    padding:18px 22px;
    margin-bottom: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    flex: 1 1 280px;
    max-width: 320px;
    text-align: center;
}


.exp-header{
    display:flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap:8px;
}

.exp-header h3{
    margin:0;
    font-size: 1.1rem;
}

.exp-header h4{
    margin:2px 0 0;
    font-weight: 500;
    color:#555;
}

.exp-logo{
    width:60px;
    height:auto;
    object-fit: contain;
}

.exp-desc{
    margin-top:10px;
    margin-bottom: 0;
    color:#333;
    text-align: justify;
    font-size:0.95rem;
    text-align: center;
}

#milestones{
    padding:40px 20px;
    max-width: 1000px;
    margin:0 auto;   
}


#milestones h2{
    text-align: center;
    margin-bottom: 24px;
}

.milestones-card{
    background:#fff;
    border-radius: 12px;
    padding:24px 28px;
    box-shadow:0 4px 10px rgba(0,0,0,0.12);
    display:flex;
    align-items: center;
    gap:24px;
}

.milestone-img{
    width:500px;
    max-width: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.milestone-text{
    flex:1;
}

.milestone-text h3{
    margin-top: 0;
    margin-bottom: 8px;
}

.milestone-text p{
    margin: 0;
}

#projects{
    padding:40px 20px;
    max-width: 1000px;
    margin:0 auto;   
}

#projects h2{
    text-align: center;
}



.projects-title{
    margin-top: 10px;
    margin-bottom: 20px;
}

.projects-row{
    display:flex;
    flex-wrap: wrap;
    gap:20px;
    justify-content: center;
}


.project-card{
    background:#fff;
    border-radius: 12px;
    padding:18px 22px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    flex:1 1 260px;
    max-width: 300px;
    text-align: center;
    display:flex;
    height:200px;
}

.project-content{
    display:flex;
    flex-direction: column;
    height:100%;
    justify-content: space-between;
}

.project-card h3{
    margin-top: 0;
    margin-bottom: 8px;
}

.project-card p{
    margin:0;
    font-size: 0.95rem;
    color:#333;
}

.project-link:hover{
    color:gray;
}


/* Skills Section */
#skills {
    padding: 40px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

#skills h2 {
    text-align: center;
    margin-bottom: 40px;
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.skill-item {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 4px;
}

.skill-header {
    flex: 0 0 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.skill-header span:first-child {
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
}

.skill-percentage {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    pointer-events: none;
}

.skill-bar {
    flex:1;
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 12x;
    width: 0%;
    transition: width 2s ease-in-out;
    position: relative;
    display:flex;
    align-items: center;
    justify-content: center;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}


/* Footer (W3CSS parallax–style colors) */
footer {
    background-color: rgba(0, 0, 0, 0.8);
    color: #f1f1f1;
    padding: 40px 20px 20px;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
}
    
.footer-main {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}
    
.footer-column {
    flex: 1 1 220px;
}
    
    
.footer-column h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
}
    
.footer-column p {
    margin: 4px 0;
    font-size: 0.95rem;
}
    
.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
    
.footer-column ul li {
    margin-bottom: 8px;
}
    
.footer-column a {
    color: #f1f1f1;
    text-decoration: none;
    font-size: 0.95rem;
}
    
.footer-column a:hover {
    color: #ccc;
}
    
.footer-socials {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}
    
.footer-socials a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f1f1f1;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
    opacity: 0.9;
}
    
.footer-socials a:hover {
    background-color: #f1f1f1;
    color: #000;
    transform: translateY(-2px);
    opacity: 1;
}
    
.footer-bottom {
    border-top: 1px solid #444;
    margin: 0 auto 0;
    text-align: center;
    font-size: 0.85rem;
    color: #ccc;
}

nav ul li.right i:hover{    
    color:blue;
}


/* Dark mode styles */

/* Dark mode base styles */

html.dark-mode{
    background:#1a1a1a;
    color: #e0e0e0;
}

html.dark-mode body{
    background: #1a1a1a;
    color: #e0e0e0;
}

html.dark-mode header {
    background:
        linear-gradient(rgba(64,64,64,0.3), rgba(64,64,64,0.3)),  /* Layer 1: GRAY overlay */
        url('graduationPic.jpg') center center/contain no-repeat;    /* Layer 2: Image */
}

html.dark-mode nav ul {
    background: rgba(0,0,0,0.7);
}

html.dark-mode nav ul li a {
    color: #f0f0f0;
}

html.dark-mode nav ul li a:hover {
    color: #ffd700;
}

/* Dark mode first section */
html.dark-mode .firstSection {
    background: rgba(0,0,0,0.8);
}

/* Dark mode cards and sections */
html.dark-mode .exp-item,
html.dark-mode .milestones-card,
html.dark-mode .project-card,
html.dark-mode .skill-item {
    background: #2a2a2a;
    color: #e0e0e0;
}

html.dark-mode .exp-desc,
html.dark-mode .project-card p,
html.dark-mode .milestone-text p {
    color: #d0d0d0;
}

html.dark-mode .exp-header h4 {
    color: #b0b0b0;
}

/* Dark mode skills */
html.dark-mode .skill-bar {
    background: #404040;
}

html.dark-mode .skill-header span:first-child {
    color: #e0e0e0;
}

/* Dark mode about text */
html.dark-mode .about-text {
    color: #d0d0d0;
}

html.dark-mode .about-text p {
    color: #d0d0d0;
}

/* Dark mode footer */
html.dark-mode footer {
    background-color: rgba(20, 20, 20, 0.95);
    color: #e0e0e0;
}

html.dark-mode .footer-column a {
    color: #e0e0e0;
}

html.dark-mode .footer-column a:hover {
    color: #ffd700;
}

html.dark-mode .footer-bottom {
    color: #b0b0b0;
}



/* dark mode toggle button hover */
html.dark-mode nav ul li.right i{
    color:#fff; 
}

html.dark-mode nav ul li.right i:hover{    
    color:#ffd700;
}


/* Tablet styles(577-768)px */
@media only screen and (min-width:577px) and (max-width:768px){
    /* Milestones section - stack image above text */
    #milestones .milestones-card {
        flex-direction: column;
        text-align: center;
        padding:20px 18px;
        gap:16px;
    }

    #milestones .milestone-img{
        width:100%;
        max-width: 380px;
        height:240px;
        margin:0 auto;
        border-radius: 10px;
    }

    #milestones .milestone-text{
        flex:none;
        max-width: 100%;
        padding:0 8px;
    }

    /* Section padding adjustment */
    #milestones {
        padding:32px 16px;        
    }

    #milestones h2{
        margin-bottom: 24px;
        font-size: 1.6rem;
    }

    /* Dark Mode Compatiblity */
    html.dark-mode #milestones .milestones-card{
        background:#2a2a2a;
    }

    #projects .projects-row{
        flex-direction: column;   /* stack the cards */
        align-items: center;
    }

    #projects .project-card{
        display:flex;
        max-width: 320px;
        width:100%;
        height:auto;
        min-height: 180px;
        margin-bottom: 20px;
    }

    #projects .project-content{
        display:flex;
        flex-direction: column;
        justify-content: center;  /* content at center */
        height:100%;
    }

    #projects .project-link { 
        margin-top:15%;   /* pushes link to bottom of column */
        align-self: center;  /* center horizontally */
    }

    html.dark-mode #projects .project-card{
        background:#2a2a2a;
    }


    #skills .skill-container{
        flex-direction: column;
        gap:20px;
    }

    #skills .skill-item{
        flex-direction:row;
        align-items: center;
        max-width: 500px;
        width:100%;
        margin:0 auto;
        padding:20px;
    }

    #skills .skill-header{
        flex:0 0 120px;
        justify-content: flex-start;
    }

    #skills .skill-bar{
        flex:50%;
        max-width: 350px;
    }

    #milestones h2,
    #skills h2,
    #projects h2 {
        margin-bottom: 24px;
        font-size: 1.6rem;
    }

    html.dark-mode #skills .skill-item {
        background: #2a2a2a;
    }


    footer{
        display:flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }


    .footer-main{
        max-width: 1000px;
        width:100%;
        display:flex;
        flex-wrap: wrap;
        gap:24px;
        justify-content: center;
        text-align: center;
    }

    .footer-column{
        flex:0 1 260px;           /* shrink-to-content columns */
        display: flex;
        flex-direction: column;
        align-items: center;      /* center content inside each column */
    }

    .footer-bottom{
        max-width: 1000px;
        width:100%;
        margin-top: 20px;
        text-align: center;
    }

    .footer-socials{
        display:flex;
        gap:12px;
        margin-top: 6px;
    }

    .footer-socials a{
        width:24px;
        height:34px;
        border-radius: 50%;
        border:1px solid #f1f1f1;
        display:flex;
        align-items: center;
        justify-content: center;
        color:#f1f1f1;
        text-decoration: none;
        padding:0;
    }

    
    .footer-socials a:hover {
        background-color: #f1f1f1;
        color: #000;
        transform: translateY(-2px);
        opacity: 1;
    }

    .footer-socials a i {
        pointer-events: none;   /* clicks on the whole circle, not only icon glyph */
    }


    #experience .exp-row{
        flex-direction: column;
        align-items: center;
        gap:20px;
    }

    #experience .exp-item {
        flex: none;               /* ignore flex: 1 1 280px; */
        max-width: 320px;         /* keep same card width */
        width: 100%;
        margin:0;      /* spacing between cards */
    }
}


/*Mobile styles */
@media only screen and (max-width:576px){
    #about .about-content{
        flex-direction: column;
        gap:20px;
        text-align: center;
    }

    #about .about-content figure,
    #about .about-content .about-text{
        flex:none;
        max-width: 100%;
        align-items: justify;
    }

    #about .about-content figure{
        order:-1;
    };

    #about .about-text {
        text-align:left;
        padding: 0 10px;
    }

    .footer-main{
        flex-direction: column;
        align-items: center;
        gap:25px;
        text-align: center;
    }

    .footer-column{
        flex:none;
        width:100%;
        max-width: 300px;
    }

    .footer-column h2{
        font-size: 1rem;
        margin-bottom: 12px;
    }

    #about{
        padding: 30px 15px;
    }

    #about h2{
        font-size: 1.5rem;
        margin-bottom:25px;
    }


    html.dark-mode #about .about-content{
        gap:20px;
    }

    .footer-socials a {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: 1px solid #f1f1f1;
        display: flex;
        align-items: center;       /* Vertically center icon */
        justify-content: center;   /* Horizontally center icon */
        color: #f1f1f1;
        font-size: 1rem;
        padding: 0;
        opacity: 0.9;
    }

    .footer-socials{
        display:flex;
        gap:12px;
        margin-top:6px;
        justify-content: center;
    }




    #milestones .milestones-card{
        flex-direction: column;
        text-align: center;
        padding: 20px 18px;
        gap:20px;
    }

    #milestones .milestone-img{
        width:100%;
        max-width: 300px;
        height:200px;
        margin:0 auto;
        order:-1;
    }

    #milestones{
        padding: 30px 15px;
    }

    #milestones h2{
        font-size: 1.5 rem;
        margin-bottom: 25px;
    }

    html.dark-mode #milestone .milestones-card{
        background:#2a2a2a;
    }

    nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 0 8px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    nav li {
        flex: 1;
        text-align: center;
        font-size: 0.8rem;
        white-space: nowrap;
        list-style: none;
    }
    
    nav li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 2px;
        text-decoration: none;
    }
    
    nav .right {
        flex: 0 0 auto;
        padding: 6px 8px;
        order: 5;
    }
    
    nav .right i {
        font-size: 1.1rem;
        display: block;
    }

    /* 5th li: content aligned to start (left inside its own box) */
    nav ul li:nth-child(5){
        display: flex;
        justify-content: center;
        align-items: center;
        flex:auto;
    }

    nav ul li:nth-child(4){
        margin-left:auto;
    }   

    nav ul li:nth-child(5){
        margin-right:auto;
    }

    nav ul li:nth-child(4) ,nav ul li:nth-child(5){
        padding-bottom: 50px;
    }
}