:root {
    --lila-fosc: #4a2c5a;
    --lila-mitja: #6b4e7d;
    --lila-clar: #9b7bb8;
    --lila-pastel: #d4c5e8;
    --lila-blanc: #f8f5ff;
    --accent-violeta: #8b5cf6;
    --accent-rosa: #ec4899;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--lila-blanc), var(--lila-pastel));
    color: var(--lila-fosc);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(74, 44, 90, 0.15);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--lila-fosc), var(--lila-mitja));
    color: white;
    padding: 60px 40px;
    text-align: center;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.subtitle {
    font-size: 1.4rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.description {
    font-size: 1.1rem;
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto;
}

.main-content {
    padding: 60px 40px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 35px;
    margin-top: 50px;
}

.project-card {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(74, 44, 90, 0.1);
    transition: all 0.4s ease;
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.project-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(74, 44, 90, 0.2);
    border-color: var(--accent-violeta);
}

.project-header {
    background: linear-gradient(135deg, var(--lila-clar), var(--lila-mitja));
    color: white;
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.project-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.project-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.project-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-details {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0;
    flex-shrink: 0;
}

.project-details.expanded {
    max-height: 1000px;
    opacity: 1;
    margin-bottom: 30px;
}

.project-description {
    color: var(--lila-fosc);
    margin-bottom: 25px;
    line-height: 1.7;
}

.project-features {
    list-style: none;
    margin-bottom: 30px;
}

.project-features li {
    color: var(--lila-mitja);
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
}

.project-features li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--accent-violeta);
    font-weight: bold;
}

.project-link {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-violeta), var(--accent-rosa));
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    margin-top: auto;
    flex-shrink: 0;
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.toggle-details {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    align-self: flex-end;
}

.toggle-details:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.toggle-details.expanded .toggle-icon {
    transform: rotate(180deg);
}

.toggle-text {
    font-size: 0.85rem;
}

.palette-showcase {
    background: white;
    padding: 40px;
    margin-top: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(74, 44, 90, 0.1);
}

.palette-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--lila-fosc);
    margin-bottom: 30px;
}

.palette-colors {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.color-item {
    text-align: center;
}

.color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 10px;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.color-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--lila-fosc);
}

footer {
    background: linear-gradient(135deg, var(--lila-fosc), var(--lila-mitja));
    color: white;
    text-align: center;
    padding: 40px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-info h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--lila-pastel);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 20px;
}

.footer-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.contact-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-info p {
    margin-bottom: 8px;
    font-size: 0.95rem;
    opacity: 0.9;
}

.contact-info a {
    color: var(--lila-pastel);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--accent-violeta);
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    header {
        padding: 40px 20px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .main-content {
        padding: 40px 20px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}