:root {
    --primary-color: #5C4033; /* deep brown */
    --secondary-color: #A0522D; /* sienna */
    --background-color: #FFF8F0; /* warm cream */
    --text-color: #3E2723; /* dark brown */
    --card-bg: #EAD7C2; /* light tan */
    --header-bg: #D2B48C; /* tan */
    --transition: all 0.3s ease;
    --accent-color: #D2691E; /* chocolate */
}

.dark-mode {
    --primary-color: #FFF8F0;
    --secondary-color: #EAD7C2;
    --background-color: #3E2723;
    --text-color: #FFF8F0;
    --card-bg: #5C4033;
    --header-bg: #4E342E;
    --accent-color: #FFB74D;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
    padding-left: 12px;
    padding-right: 12px;
}

/* Header and Navigation */
header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--header-bg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 100;
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
    font-weight: 500;
}

nav a:hover {
    color: var(--secondary-color);
}

nav a.active {
    color: var(--accent-color);
    font-weight: 700;
}

/* Sections */
.section {
    padding: 80px 5%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

h1, h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    min-height: 2.4em;
}

/* Typing animation */
.typing {
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    animation: typing 2.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

.resume-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--secondary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition);
}

.resume-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Projects Grid */
.projects-grid, .skills-grid, .tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s;
    min-height: 420px;
    padding: 0;
}

.project-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
}

.project-img-bg {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.project-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--card-bg);
    text-align: left;
}

.project-content h3,
.project-date,
.project-caption {
    text-align: left;
}

.project-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.project-date {
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.project-caption {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 14px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: flex-start;
}

.project-tags span {
    background: #fff;
    color: var(--primary-color);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid #ddd;
    margin-bottom: 2px;
    display: inline-flex;
    align-items: center;
}

.project-links {
    margin-top: auto;
    display: flex;
    gap: 10px;
}

.project-btn {
    background: var(--primary-color);
    color: #fff;
    border-radius: 6px;
    padding: 7px 16px 7px 12px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.project-btn .icon-img {
    height: 18px;
}

#theme-toggle .icon-img {
    height: 24px;
    width: 24px;
}

.project-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 20px;
    margin: 20px auto;
    justify-content: center;
}

.social-icon {
    width: 50px;
    height: 50px;
    background-color: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-icon:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Theme Toggle */
#theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 99;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    nav ul li {
        margin: 0 10px;
    }

    .heart-img {
        animation: riseHeart 2.5s ease-out forwards;
        width: 90vw;
        max-width: 650px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        opacity: 0;
        position: absolute;
        pointer-events: none;
        z-index: 0;
    }

    .typing {
        white-space: normal;
        border: none;
        animation: none;
    }
}

/* Skills and Tools Grid */
.skills-grid {
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0 40px;
}

.skill-card {
    background-color: var(--card-bg);
    height: 80px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    padding: 10px;
    text-align: center;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Tools Section */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.tool-category {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
}

.tool-category h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.tool-card {
    background-color: var(--background-color);
    height: 60px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    margin-bottom: 10px;
    padding: 10px;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

#skills h2 {
    margin-top: 40px;
}

#skills h2:first-child {
    margin-top: 0;
}

.about-paragraph {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: 18px;
}

.connect-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: rgb(80, 81, 88);
    text-align: center;
}

.icon-img {
    height: 20px;
    width: 20px;
    object-fit: contain;
    vertical-align: middle;
}

.icon-email {
    margin-right: 8px;
}

.heart-img {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 650px;
    opacity: 0;
    z-index: 0;
    animation: riseHeart 2.5s ease-out forwards;
    pointer-events: none;
}

@keyframes riseHeart {
    from {
        top: 100%;
        opacity: 0;
        transform: translateX(-50%) translateY(0%);
    }
    to {
        top: 60%;
        opacity: 1;
        transform: translateX(-50%) translateY(-50%);
    }
}

#home .container {
    position: relative;
    z-index: 1;
}

/* Dark mode fixes */
.dark-mode .heart-img {
    opacity: 0.6;
    filter: grayscale(100%) brightness(0.4);
}

.dark-mode .project-tags span {
    background: #fff;
    color: #000;
    border: 1px solid #ddd;
}

.dark-mode .project-btn {
    background: #ffffff;
    color: #000;
}

.dark-mode .project-btn:hover {
    background: #e5e7eb;
}

.dark-mode .connect-text {
    color: #ffffff;
}

.dark-mode .resume-button {
    background-color: #fff;
    color: #000;
    border: 1px solid #ccc;
}

.dark-mode .resume-button:hover {
    background-color: #f3f4f6;
}

/* Avatar and Home Section Layout */
.home-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.avatar-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(92, 64, 51, 0.15);
    background: var(--card-bg);
    border: 4px solid var(--header-bg);
    margin-bottom: 20px;
}

.home-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 250px;
}

@media (max-width: 768px) {
    .home-container {
        flex-direction: column;
        gap: 20px;
    }
    .home-text {
        align-items: center;
        min-width: unset;
    }
    .avatar-img {
        width: 140px;
        height: 140px;
    }
}

/* Remove heart-img styles
.heart-img {
    display: none !important;
} */