/* Hytale Portfolio Styles */

:root {
    /* Enhanced Earthy Palette */
    --forest-green: #375e21;
    /* Slightly more vibrant */
    --forest-green-light: #528a30;
    --warm-brown: #8b6f47;
    --warm-brown-dark: #6d5438;
    --sky-blue: #70c4e8;
    --sky-blue-dark: #4a90e2;
    --stone-gray: #7a7a7a;
    --light-bg: #e6e0d4;
    /* Darker warm beige/parchment */
    --white: #fdfbf7;
    /* Soft cream, not harsh white */
    --text-color: #2b2218;
    /* Dark warm brown text */

    /* Spacing & Sizing */
    --container-max-width: 1100px;
    --border-radius: 8px;
    /* Softer, more modern blocky */
    --sp-sm: 0.5rem;
    --sp-md: 1rem;
    --sp-lg: 2rem;
    --sp-xl: 5rem;
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--light-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(var(--warm-brown) 0.5px, transparent 0.5px),
        radial-gradient(var(--warm-brown) 0.5px, var(--light-bg) 0.5px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    background-attachment: fixed;
    /* Parallax-like feel */
    background-blend-mode: soft-light;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--sp-lg);
}

/* Typography */
h1,
h2,
h3 {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    color: var(--forest-green);
    margin-bottom: var(--sp-md);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 2.2rem;
    text-align: center;
    position: relative;
    padding-bottom: var(--sp-md);
}

/* Decorative underline for headings - Tool/Weapon style */
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 6px;
    background-color: var(--warm-brown);
    margin: var(--sp-sm) auto 0;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

p {
    margin-bottom: var(--sp-md);
}

/* Buttons */
.cta-button {
    display: inline-block;
    background-color: var(--warm-brown);
    color: var(--white);
    padding: 0.9rem 2rem;
    font-weight: 600;
    font-family: 'Rubik', sans-serif;
    border-radius: var(--border-radius);
    border-bottom: 5px solid var(--warm-brown-dark);
    /* Deeper 3D effect */
    transition: all 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

.cta-button:hover {
    transform: translateY(2px);
    border-bottom: 3px solid var(--warm-brown-dark);
    background-color: #967a50;
}

.cta-button:active {
    transform: translateY(5px);
    border-bottom: 0px solid transparent;
    /* Full press */
}

/* SECTION 1: HERO / ABOUT */
.hero-section {
    padding: var(--sp-xl) 0;
    text-align: center;
    background: linear-gradient(180deg, rgba(253, 251, 247, 0.95) 0%, rgba(230, 224, 212, 0.9) 100%);
    border-bottom: 1px solid rgba(139, 111, 71, 0.1);
    backdrop-filter: blur(5px);
}

.profile-container {
    margin-bottom: var(--sp-lg);
    position: relative;
    display: inline-block;
}

.avatar {
    width: 160px;
    height: 160px;
    border-radius: 24px;
    /* Squircle for blocky feel */
    object-fit: cover;
    border: 4px solid var(--forest-green);
    box-shadow: 0 8px 20px rgba(45, 80, 22, 0.2);
    background-color: var(--white);
    padding: 4px;
    /* Inner whitespace */
}

.avatar-fallback {
    font-size: 100px;
    line-height: 150px;
    width: 150px;
    height: 150px;
    border-radius: 20px;
    background-color: var(--stone-gray);
    color: white;
    margin: 0 auto;
    display: block;
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--stone-gray);
    margin-bottom: var(--sp-lg);
    font-weight: 500;
}

.bio-text {
    max-width: 650px;
    margin: 0 auto var(--sp-lg);
    font-size: 1.1rem;
    color: #4a4a4a;
}

.social-link {
    display: block;
    color: var(--sky-blue-dark);
    font-weight: 600;
    margin-bottom: var(--sp-lg);
    font-size: 1.1rem;
}

.social-link:hover {
    color: var(--sky-blue);
}

/* SECTION 2: PROJECTS */
.projects-section {
    padding: var(--sp-xl) 0;
    background: transparent;
    /* Show body texture */
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: var(--sp-lg);
}

.project-card {
    background-color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02), 0 10px 15px rgba(0, 0, 0, 0.03);
    /* Softer, deeper shadows */
    position: relative;
    top: 0;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.project-image-container {
    height: 220px;
    overflow: hidden;
    background-color: var(--stone-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Add a subtle overlay on hover */
.project-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.2));
    opacity: 0.6;
    transition: opacity 0.3s;
}

.project-card:hover .project-image-container::after {
    opacity: 0.3;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image {
    transform: scale(1.08);
}

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.project-description {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    flex-grow: 1;
}

.project-link {
    color: var(--forest-green);
    font-weight: 600;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.project-link:hover {
    color: var(--forest-green-light);
    gap: 8px;
    /* Arrow moves */
}

/* SECTION 3: CONTACT */
.contact-section {
    padding: var(--sp-xl) 0;
    text-align: center;
    background-color: var(--white);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
    /* Above background pattern */
}

.contact-intro {
    font-size: 1.2rem;
    margin-bottom: var(--sp-lg);
    color: #555;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: var(--sp-md);
    flex-wrap: wrap;
}

.contact-button {
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--forest-green);
    border-radius: var(--border-radius);
    font-weight: 600;
    font-family: 'Rubik', sans-serif;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.contact-button.email {
    background-color: var(--forest-green);
    color: var(--white);
    box-shadow: 0 4px 6px rgba(45, 80, 22, 0.2);
}

.contact-button.email:hover {
    background-color: var(--forest-green-light);
    border-color: var(--forest-green-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(45, 80, 22, 0.3);
}

.contact-button.twitter {
    color: var(--forest-green);
    background-color: transparent;
}

.contact-button.twitter:hover {
    background-color: rgba(45, 80, 22, 0.05);
    transform: translateY(-2px);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: var(--sp-lg);
    background-color: #3e3223;
    /* Darker brown */
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .hero-section {
        padding: var(--sp-lg) 0;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        /* Full width cards on mobile */
        padding: 0 var(--sp-md);
        /* Extra breathing room */
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-button {
        width: 100%;
        max-width: 300px;
    }
}

/* Project Detail Styles */
.detail-header {
    padding: var(--sp-md) 0;
    background-color: var(--white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.back-link {
    font-weight: 600;
    color: var(--forest-green);
    display: inline-flex;
    align-items: center;
}

.back-link:hover {
    color: var(--forest-green-light);
    transform: translateX(-5px);
}

.project-detail-container {
    padding-top: var(--sp-xl);
    padding-bottom: var(--sp-xl);
    min-height: 80vh;
}

.detail-title {
    margin-bottom: var(--sp-sm);
}

.detail-description {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto var(--sp-lg);
    text-align: center;
}

.project-header {
    text-align: center;
    margin-bottom: var(--sp-xl);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--sp-lg);
}

.gallery-item {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-img {
    width: 100%;
    height: auto;
    display: block;
}

.loading-state {
    text-align: center;
    padding: var(--sp-xl);
    font-size: 1.2rem;
    color: var(--stone-gray);
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-lightbox {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: var(--warm-brown);
    text-decoration: none;
    cursor: pointer;
}

@media only screen and (max-width: 700px) {
    .lightbox-content {
        width: 100%;
    }
}