
:root {
    --text-color: #1a1c20;
    --link-color: #b97a04;
    --background-color: #eeeff1;
}

/* Dark mode */
body.dark-mode {
    --text-color: #eeeff1;
    --link-color: #f0a500;
    --background-color: #1a1c20;
}

h2, h3, h4, h5, h6 {
    color: var(--text-color);
}

* {
    border:0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
}

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

/* Navigation Bar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
    height: 80px;
}

nav .Name a {
    color: var(--text-color);
    font-size: 22px;
    font-weight: 600;
}

nav .Navigation a {
    color: var(--text-color);
    margin: 0 10px;
}
nav .Navigation button i {
    margin: 0 10px;
}

nav .Navigation a:last-child {
    color: var(--background-color);
    background-color: var(--text-color);
    padding: 5px 15px;
    border-radius: 5px;
}

nav .Navigation a span {
    margin-left: 5px;
}

/* Home */
@media (max-width: 600px) {
    .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
}
.Home {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
    margin: 50px 0 100px;
    gap: 40px;
    flex-wrap: wrap; /* allows wrap on small screens */
}

.Home .text {
    flex: 5;
    min-width: 280px;
}

.Home .text h2 {
    font-size: 42px;
}

.Home .text .links {
    margin-top: 25px;
}

/* typing text */
.Home .text .container .intro {
    font-size: 18px;
    letter-spacing: 1px;
    border-right: 2px solid;
    width: 26ch;
    white-space: nowrap;
    overflow: hidden;
    animation:
        typing 3s steps(26) infinite alternate,
        cursor .4s step-end infinite alternate;
}
  
/* cursor blinking */
@keyframes cursor {
    50% { border-color: transparent;}
}

/* typing effect */
@keyframes typing { 
    from { width: 0; }
    to { width: 26ch;}
}

.Home .text .links a {
    display: inline-block;
    padding: 5px 10px;
    border: 2px solid var(--link-color);
    border-radius: 5px;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: .1s;
}

.Home .text .links a:hover {
    color: var(--text-color);
    border: 2px solid var(--text-color);
}

.Home .profile {
    flex: 2;
    display: flex;
    justify-content: center;
}

.Home .profile img {
    max-width: 100%;
    width: 350px;
    border-radius: 50%;
}

p {
    text-align: justify;
    margin: 20px 0px 20px 5px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
}

/* Skills */
.skills-selection {
    padding: 0 50px;
    margin-bottom: 100px;
}

.skills-selection h2 {
    text-align: center;
    font-size: 35px;
}

.skills-selection .text {
    text-align: center;
    margin-bottom: 20px;
}

.skills-selection .cells {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.skills-selection .cells .cell {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 200px;
    padding: 10px 20px;
    margin: 10px;
    border: 1.5px solid var(--link-color);
    border-radius: 5px;
}

.skills-selection .cells .cell img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 2px;
}

.skills-selection .cells .cell span {
    font-size: 18px;
    color: var(--text-color);
}

/* Projects */
.project-intro {
    display: flex;
    flex-direction: column;     /* Stack intro text vertically */
    justify-content: flex-start;
    align-items: flex-start;      /* Align text to the right */
    flex: 1 1 300px;            /* Allow intro to grow/shrink */
    min-width: 250px;
    padding: 0 50px;
    margin-bottom: 53px;
}

.project-intro h2 {
    text-align: right;
    font-size: 35px;
}

.project-intro .project-intro-text {
    text-align: right;
    margin-bottom: 30px;
}

.project-selection {
    display: flex;
    flex-direction: row;        /* Arrange children side by side */
    flex-wrap: wrap;            /* Allow wrapping on smaller screens */
    align-items: flex-start;    /* Align items to the top */
    justify-content: center;    /* Center children horizontally */
    gap: 40px;                  /* Space between children */
    background-color: var(--background-color);
    margin: 10px 10px 50px 10px;
    padding-bottom: 50px;
    min-height: 100%;
}

.card-container {
    display: flex;
    flex-direction: row;        /* Cards in a row */
    flex-wrap: wrap;            /* Wrap cards on small screens */
    gap: 30px;
    justify-content: center;
    align-items: stretch;       /* Cards stretch to same height */
    width: auto;
}

.card {
    position: relative;
    list-style: none;
    width: 220px;
    transition: .3s ease;
}

.card::before {
    content: "";
    display: block;
    padding-bottom: 150%;
    width: 100%;
}

.card-background {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    border-radius: 20px;
    background-size: 100%;
    background-position: center;
    filter: brightness(.9) saturate(1) contrast(1);
    transform-origin: bottom;
    transform: scale(1) translateZ(0);
    transition: .3s ease;
}
.card:hover .card-background {
    transform: scale(1.15) translateZ(0);
    background-size: 80%;
}
.card-container:hover .card:not(:hover){
    transform: scale(.9);
}

.card-container:hover > .card:not(:hover) .card-background,
.card-container:hover > .card:not(:hover) .card-category {
    filter: brightness(.5) saturate(0) contrast(1.2) blur(20px);
}

.content {
    top: 50%;
    left: 0;
    padding: 25px;
    position: absolute;   
    color: var(--text-color);
}

.card-category {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 5px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.card-heading {
    font-size: 25px;
    line-height: 1;
    text-shadow: 2px 2px 20px rgba(0, 0, 0, .2);
}

/* Contact */
/* Center align h1 and p in contact section */
.contact-selection {
    padding-bottom: 50px;
    margin-bottom: 100px;
}

.contact-selection h1,
.contact-selection p {
    text-align: center;
    color: var(--text-color);
}

/* Make contact-info-upper-container flex */
.contact-info-upper-container {
  width: fit-content;        
  max-width: 500px;         
  height: auto;             
  display: flex;
  justify-content: center;
  align-items: center;     
  gap: 15px;                 
  border-radius: 2rem;
  border-width: 0.1rem;
  border-style: solid;
  border-color: var(--text-color);
  margin: 1rem auto;       
  padding: 0.5rem 1rem;       
}

.contact-info-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-info-container a {
    color: var(--text-color);
    font-size: 18px;
}

.contact-info-upper-container img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Responsive Breakpoints */
/* Project Cards */
@media (max-width: 768px) {
    .card-container {
        flex-wrap: wrap;
        gap: 20px;
    }

    .card {
        width: 45%; /* make 2 cards per row */
    }

    .card-heading {
        font-size: 18px;
    }

    .card-category {
        font-size: 10px;
        letter-spacing: 3px;
    }

    .card-background {
        background-size: cover; /* ensure full coverage */
        background-position: center;
        transform: none !important; /* stop hover zoom breaking layout */
    }
}

/* Home */
@media (max-width: 850px) {
    .Home .text h2 {
        font-size: 35px;
    }
}

@media (max-width: 740px) {
    .Home {
        flex-direction: column-reverse;
        text-align: center;
    }

    .Home .profile img {
        width: 300px;
    }
}

/* Navigation */
@media (max-width: 600px) {
    nav {
        padding: 0 20px; 
    }

    nav .Navigation {
        font-size: 20px;
    }

    nav .Navigation a:last-child {
        color: var(--link-color);
        /* On mobile, remove background color for last navigation link */
        background-color: transparent;
        padding: 0;
    }
    
    nav .Navigation a span {
        display: none;
    }

    .Home {
        padding: 0 20px;
    }

    .Home .text h2 {
        font-size: 28px;
    }

    .skills-selection {
        padding: 0 20px; 
    }

    /* Skills */
    .skills-selection .text {
        font-size: 16px;
    }

    .skills-selection .cells .cell span {
        font-size: 16px;
    }

    /* Projects */
    .project-intro {
        padding: 0 20px;
    }

    .project-intro h2 {
        font-size: 28px;
    }

    .project-intro .project-intro-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    /* Home */
    .Home .text h2 {
        font-size: 24px;
    }

    .Home .profile img {
        width: 250px;
    }

    /* Skills */
    .skills-selection {
        padding: 0 15px; 
    }

    .skills-selection .cells .cell {
        width: 100%;
    }

    /* Projects */
    .project-intro {
        padding: 0 15px;
    }

    .project-intro h2 {
        font-size: 24px;
    }

    .project-intro .project-intro-text {
        font-size: 15px;
    }

    /* Project cards */
    .card {
        width: 100%; /* 1 card per row */
    }

    .card-heading {
        font-size: 16px;
    }

    .card-category {
        font-size: 9px;
        letter-spacing: 2px;
    }

    .content {
        padding: 15px; /* smaller padding for text */
    }

    .card-background {
        background-size: cover;
        background-position: center;
    }
}

/* Project Selection Flexbox Layout */
.project-selection {
    display: flex;
    flex-direction: row;       
    flex-wrap: wrap;          
    align-items: flex-start;    
    justify-content: center;    
    gap: 40px;                  
    background-color: var(--background-color);
    margin: 10px 10px 50px 10px;
    padding-bottom: 50px;
    min-height: 100%;
}

.card-container {
    display: flex;
    flex-direction: row;        
    flex-wrap: wrap;            
    gap: 30px;
    justify-content: center;
    align-items: stretch;      
    width: auto;
}

.project-intro {
    display: flex;
    flex-direction: column;     
    justify-content: flex-start;
    align-items: flex-end;     
    flex: 1 1 300px;           
    min-width: 250px;
    padding: 0 50px;
    margin-bottom: 53px;
}

/* Fix project-selection children overlap */
.project-selection {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 40px;
    background-color: var(--background-color);
    margin: 10px 10px 50px 10px;
    padding-bottom: 50px;
    min-height: 100%;
}

.card-container {
    flex: 2 1 400px;     
    min-width: 300px;    
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    align-items: stretch;
    width: auto;
}

.project-intro {
    flex: 1 1 250px;      
    min-width: 220px;
    max-width: 400px;     
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 0 50px;
    margin-bottom: 53px;
    box-sizing: border-box;
}

/* Responsive: Stack vertically on small screens */
@media (max-width: 900px) {
    .project-selection {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    .project-intro {
        align-items: flex-start;
        padding: 0 20px;
        margin-bottom: 20px;
        max-width: 100%;
        min-width: 0;
    }
    .card-container {
        min-width: 0;
        width: 100%;
        gap: 20px;
    }
}

/* White Sun */
body.dark-mode #darkModeToggle .fa-sun {
    color: #fff;
}
body.dark-mode #darkModeToggle{
    margin: -10px 0 0 0;
}


/* Add to your style.css */
.section-hidden {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(.4,0,.2,1), transform 0.7s cubic-bezier(.4,0,.2,1);
}

.section-visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 900px) {
    .contact-info-upper-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 10px;
    }
    .contact-info-container {
        width: 100%;
        max-width: 350px;
        justify-content: flex-start;
        padding: 10px 12px;
    }
}

@media (max-width: 600px) {
    .contact-info-upper-container {
        padding: 5px;
        gap: 12px;
    }
    .contact-info-container {
        max-width: 100%;
        font-size: 15px;
        padding: 8px 8px;
    }
    .contact-info-upper-container img {
        width: 28px;
        height: 28px;
    }
}