/* ---
   Minecraft Developer Portfolio Stylesheet
   --- */

/* 1. CSS Variables (Theme Colors) */
/* 2. Global Styles & Typography */
/* 3. Header & Navigation */
/* 4. Hero Section */
/* 5. Content Sections (About, Projects, Skills, Contact) */
/* 6. Components (Buttons, Cards, etc.) */
/* 7. Footer */
/* 8. Responsive Design (Media Queries) */

/* 1. CSS Variables (Theme Colors)
--------------------------------------------- */
:root {
    /* Light Theme - Inspired by Overworld */
    --bg-color: #EAEAEA; /* Stone */
    --surface-color: #FFFFFF; /* White Wool */
    --surface-color-rgb: 255, 255, 255;
    --primary-text-color: #3A3A3A; /* Dark Gray */
    --secondary-text-color: #5E5E5E;
    --accent-color: #5C7C34; /* Grass Green */
    --border-color: #BFBFBF; /* Light Gray Wool */
    --shadow-color: rgba(0, 0, 0, 0.1);
    --mc-border-outer: #555555;
    --mc-border-inner: #FFFFFF;
    --hero-bg-image: url('https://www.transparenttextures.com/patterns/cubes.png'), linear-gradient(to bottom, #87CEEB, #B0E0E6); /* Sky */
}

body.dark-mode {
    /* Dark Theme - Inspired by The Nether/End */
    --bg-color: #1E1B22; /* End Stone */
    --surface-color: #2C2833; /* Deepslate */
    --surface-color-rgb: 44, 40, 51;
    --primary-text-color: #EAEAEA;
    --secondary-text-color: #A09DA6;
    --accent-color: #B366FF; /* Potion Purple */
    --border-color: #4A4553;
    --shadow-color: rgba(0, 0, 0, 0.25);
    --mc-border-outer: #111111;
    --mc-border-inner: #5E5E5E;
    --hero-bg-image: url('https://www.transparenttextures.com/patterns/cubes.png'), linear-gradient(to bottom, #160116, #320a32); /* End Sky */
}

/* 2. Global Styles & Typography
--------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Offset for fixed header */
}

body {
    font-family: 'Lato', sans-serif; /* Fallback font */
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
    /* Basic content protection */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    user-select: none; /* Standard syntax */
}

h1, h2, h3, .nav-logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-text-color);
    line-height: 1.2;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 20px;
    text-align: center; /* Center section content like h2 by default */
}

section h2 {
    font-size: 1.8rem;
    margin-bottom: 50px;
    position: relative;
    display: inline-block; /* Allows centering via parent's text-align */
    padding-bottom: 15px;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
    box-shadow: 0 0 15px var(--accent-color);
    transition: width 0.3s ease-in-out;
}

section h2:hover::after {
    width: 100px; /* Make it grow on hover */
}

section h2 i {
    margin-right: 10px;
    color: var(--accent-color);
}

/* 3. Header & Navigation
--------------------------------------------- */
header {
    background-color: var(--surface-color);
    border-bottom: 3px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

header.scrolled {
    /* Use rgba for a semi-transparent background on scroll */
    background-color: rgba(var(--surface-color-rgb), 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    border-bottom-color: transparent;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.5rem;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--secondary-text-color);
    font-weight: bold;
    transition: color 0.2s ease-in-out;
    position: relative;
    padding-bottom: 5px;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    transition: width 0.3s ease-in-out;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--primary-text-color);
}

/* 4. Hero Section
--------------------------------------------- */
#hero {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: calc(100vh - 80px);
    min-height: 500px;
    padding: 0 20px;
    background-image: var(--hero-bg-image);
    background-size: auto, cover;
    color: #FFFFFF;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

#hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #FFFFFF;
    animation: float 6s ease-in-out infinite;
}

#hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 30px; /* Center the paragraph block */
}

/* 5. Content Sections
--------------------------------------------- */
/* About Section */
.about-content {
    display: flex;
    align-items: center; /* Vertically center the avatar and text */
    gap: 40px;
    text-align: left; /* Align text to the left for readability */
}
.avatar {
    width: 150px; /* Set a fixed width for the circle */
    height: 150px; /* Set a fixed height for the circle */
    border-radius: 50%; /* This makes the element a circle */
    border: 5px solid var(--accent-color);
    object-fit: cover; /* This will zoom and crop the image to fit the circle */
    flex-shrink: 0; /* Prevent image from shrinking when the container is small */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--accent-color);
}

.about-content p {
    max-width: 80ch; /* Limit paragraph width for better readability */
}

/* Project Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
/* Skills Section */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

/* Contact Section */
#contact {
    text-align: center;
}
.contact-content p {
    max-width: 50ch;
    margin: 0 auto 30px;
}
.contact-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* For responsiveness */
}
.contact-buttons .btn i,
.contact-buttons .btn-secondary i {
    margin-right: 8px;
}

/* 6. Components
--------------------------------------------- */
/* Modern Button */
.btn, .btn-secondary {
    display: inline-block;
    padding: 12px 28px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border-radius: 5px;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px var(--shadow-color), 0 0 0px var(--accent-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:hover, .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--shadow-color);
}
.btn:active, .btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px var(--shadow-color);
}
.btn {
    background-color: var(--accent-color);
    color: #FFFFFF;
}
.btn:hover {
    background-color: color-mix(in srgb, var(--accent-color) 90%, #fff);
    box-shadow: 0 6px 20px var(--shadow-color), 0 0 15px color-mix(in srgb, var(--accent-color) 50%, transparent);
}
.btn-secondary {
    background-color: var(--surface-color);
    color: var(--primary-text-color);
    border-color: var(--border-color);
}

/* Project Card */
.project-card {
    background-color: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-color);
    padding: 20px;
    display: flex;
    flex-direction: column;    
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px var(--shadow-color);
}
.project-card img {
    width: 100%;
    aspect-ratio: 1024 / 512; /* Enforce a 2:1 aspect ratio */
    object-fit: cover; /* Ensures the image covers the area without distortion */
    margin-bottom: 15px;
    border-radius: 5px;
}
.project-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.project-card p { color: var(--secondary-text-color); flex-grow: 1; margin-bottom: 20px; }
.project-links { display: flex; gap: 10px; flex-wrap: wrap; }
.project-links .btn-secondary { font-size: 0.8rem; padding: 8px 16px; letter-spacing: 0.5px; }

/* Skill Item */
.skill-item {
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    border-radius: 5px;
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.skill-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    background-color: var(--accent-color);
    color: #FFFFFF;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary-text-color);
    position: relative;
    width: 24px;
    height: 24px;
}
.theme-toggle-btn .fa-sun, .theme-toggle-btn .fa-moon {
    position: absolute;
    top: 50%;
    left: 50%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.theme-toggle-btn .fa-sun {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}
.theme-toggle-btn .fa-moon {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

body.dark-mode .theme-toggle-btn .fa-sun { transform: translate(-50%, -50%) scale(0); opacity: 0; }
body.dark-mode .theme-toggle-btn .fa-moon { transform: translate(-50%, -50%) scale(1); opacity: 1; }

/* 7. Footer
--------------------------------------------- */
footer {
    background-color: var(--surface-color);
    border-top: 3px solid var(--border-color);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}
.view-counter {
    margin-bottom: 15px;
    color: var(--secondary-text-color);
}

.view-counter i {
    margin-right: 8px;
    color: var(--accent-color);
}

.footer-note {
    color: var(--secondary-text-color);
    font-size: 0.8rem;
    margin-top: 5px;
}

/* 9. Animations & Effects
--------------------------------------------- */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* For JS-driven scroll animations */
.hidden-anim {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.show-anim {
    opacity: 1;
    transform: translateY(0);
}




/* 8. Responsive Design
--------------------------------------------- */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: var(--surface-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        padding: 1.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .about-content {
        flex-direction: column; /* Stack image and text on mobile */
        align-items: center;
        text-align: center;
    }

    #hero h1 { font-size: 2rem; }
}
