/* RESET & VARIABLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: default;
}

:root {
    --primary-color: #2c1810;
    --secondary-color: #f4f1eb;
    --accent-color: #d4af37;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --bg-light: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --spacing-unit: 1rem;
    --font-primary: 'Alexandria', sans-serif;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f9f6f3 0%, #e3d5cb 50%, #f2ebe5 100%);
    overflow-x: hidden;
}

/* BUBBLES BACKGROUND */
#bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -10;
}

.bubble {
    position: absolute;
    width: 600px;
    height: 600px;
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: opacity 1s ease, transform 1.5s ease;
    pointer-events: none;
    background: radial-gradient(circle, rgba(158, 100, 87, 0.2), transparent);
}

.bubble.visible {
    opacity: 0.5;
    transform: translateY(0) scale(1);
}

@media (max-width: 768px) {
    .bubble {
        width: 300px;
        height: 300px;
    }
}

/* SECTIONS */
.section {
    padding: calc(var(--spacing-unit) * 4) var(--spacing-unit);
    max-width: 1280px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 2);
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* PROJECTS GRID */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: calc(var(--spacing-unit) * 1.5);
    margin-top: calc(var(--spacing-unit) * 2);
}

.project-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: var(--spacing-unit);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.project-card img {
    width: 100%;
    height: auto;
    max-height: 531px;
    object-fit: cover;
    border-radius: calc(var(--radius) - 8px);
    margin-bottom: var(--spacing-unit);
}

.project-card h3 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.project-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    flex-grow: 1;
    line-height: 1.5;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 0.5);
    margin-top: var(--spacing-unit);
}

.tech-tag {
    background: rgba(192, 179, 169, 0.15);
    color: var(--text-light);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(192, 179, 169, 0.2);
    transition: background 0.3s ease;
}

.tech-tag:hover {
    background: rgba(192, 179, 169, 0.3);
}

/* LANGUAGE SELECTOR */
#language-selector {
    position: fixed;
    bottom: calc(var(--spacing-unit) * 2);
    left: calc(var(--spacing-unit) * 2);
    z-index: 1001;
    display: flex;
    gap: calc(var(--spacing-unit) * 0.8);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.8rem;
    border-radius: 40px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#language-selector:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.lang-flag {
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.lang-flag:hover {
    opacity: 1;
    transform: scale(1.15);
}

.lang-flag.active {
    opacity: 1;
    border: 2px solid var(--accent-color);
    transform: scale(1.1);
}

/* HOME BUTTON */
#casa-link {
    position: fixed;
    bottom: calc(var(--spacing-unit) * 2);
    right: calc(var(--spacing-unit) * 2);
    z-index: 1001;
    background: var(--primary-color);
    padding: 0.8rem;
    border-radius: 50%;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#casa-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.casa-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .section {
        padding: calc(var(--spacing-unit) * 2.5) var(--spacing-unit);
    }

    .section-title {
        font-size: 1.8rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-unit);
    }

    .project-card img {
        max-height: 180px;
    }

    .project-card h3 {
        font-size: 1.2rem;
    }

    .project-card p {
        font-size: 0.9rem;
    }

    #language-selector {
        bottom: calc(var(--spacing-unit) * 1.5);
        left: calc(var(--spacing-unit) * 1.5);
        padding: 0.6rem;
        gap: calc(var(--spacing-unit) * 0.5);
    }

    .lang-flag {
        width: 32px;
        height: 32px;
    }

    #casa-link {
        bottom: calc(var(--spacing-unit) * 1.5);
        right: calc(var(--spacing-unit) * 1.5);
        padding: 0.6rem;
    }

    .casa-icon {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .section {
        padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 0.75);
    }

    .section-title {
        font-size: 1.6rem;
    }

    .project-card {
        padding: calc(var(--spacing-unit) * 0.75);
    }

    .project-card img {
        max-height: 150px;
    }

    .project-card h3 {
        font-size: 1.1rem;
    }

    .project-card p {
        font-size: 0.85rem;
    }

    .tech-tag {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }

    #language-selector {
        bottom: var(--spacing-unit);
        left: var(--spacing-unit);
        padding: 0.5rem;
    }

    .lang-flag {
        width: 28px;
        height: 28px;
    }

    #casa-link {
        bottom: var(--spacing-unit);
        right: var(--spacing-unit);
        padding: 0.5rem;
    }

    .casa-icon {
        width: 24px;
        height: 24px;
    }
}