       :root {
            --bg-primary: #0a0a0f;
            --bg-secondary: #12121a;
            --bg-card: #1a1a24;
            --text-primary: #f5f5f7;
            --text-secondary: #a0a0b0;
            --accent-primary: #ff6b35;
            --accent-secondary: #ffd23f;
            --accent-tertiary: #3a86ff;
            --border-subtle: rgba(255,255,255,0.08);
            --gradient-warm: linear-gradient(135deg, #ff6b35 0%, #ffd23f 100%);
            --gradient-cool: linear-gradient(135deg, #3a86ff 0%, #8338ec 100%);
        }

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

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: 'Outfit', sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.7;
            min-height: 100vh;
            overflow-x: hidden;
        }

        .bg-pattern {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
            opacity: 0.4;
            background: 
                radial-gradient(circle at 20% 20%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(58, 134, 255, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(255, 210, 63, 0.05) 0%, transparent 60%);
        }

        .noise {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1;
            opacity: 0.03;
            background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
        }

        .container {
            position: relative;
            z-index: 2;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 24px;
        }

        /* Vista llista */
        #vista-llista {
            transition: opacity 0.3s ease, transform 0.3s ease;
        }

        #vista-llista.hidden {
            opacity: 0;
            transform: translateX(-20px);
            pointer-events: none;
            position: absolute;
        }

        /* Vista detall */
        #vista-detall {
            display: none;
            opacity: 0;
            transform: translateX(20px);
            transition: opacity 0.3s ease, transform 0.3s ease;
        }

        #vista-detall.visible {
            display: block;
            opacity: 1;
            transform: translateX(0);
        }

        header {
            padding: 80px 0 60px;
            text-align: center;
        }

        .wave-emoji {
            font-size: 4rem;
            display: inline-block;
            /* animation: wave 2.5s ease-in-out infinite; */
            animation: wave 2.5s ease-in-out;
            transform-origin: 70% 70%;
        }

        @keyframes wave {
            0%, 100% { transform: rotate(0deg); }
            10%, 30% { transform: rotate(14deg); }
            20% { transform: rotate(-8deg); }
            40% { transform: rotate(14deg); }
            50%, 100% { transform: rotate(0deg); }
        }

        .header-title {
            font-family: 'Instrument Serif', serif;
            font-size: clamp(2.5rem, 6vw, 4rem);
            font-weight: 400;
            margin-top: 24px;
            letter-spacing: -0.02em;
        }

        .header-title span {
            background: var(--gradient-warm);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .header-subtitle {
            font-size: 1.15rem;
            color: var(--text-secondary);
            margin-top: 16px;
            font-weight: 300;
        }

        .projects-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 24px;
            padding: 40px 0 100px;
        }

        .project-card {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 20px;
            padding: 32px;
            position: relative;
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            opacity: 0;
            transform: translateY(30px);
        }

        .project-card.visible {
            animation: fadeInUp 0.6s ease forwards;
        }

        @keyframes fadeInUp {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .project-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: var(--gradient-warm);
            transform: scaleX(0);
            transform-origin: left;
            transition: transform 0.4s ease;
        }

        .project-card:hover {
            transform: translateY(-8px);
            border-color: rgba(255, 107, 53, 0.3);
            box-shadow: 
                0 20px 40px rgba(0, 0, 0, 0.3),
                0 0 60px rgba(255, 107, 53, 0.08);
        }

        .project-card:hover::before {
            transform: scaleX(1);
        }

        .project-icon {
            font-size: 2.5rem;
            margin-bottom: 20px;
            display: inline-block;
        }

        .project-title {
            font-family: 'Instrument Serif', serif;
            font-size: 1.5rem;
            font-weight: 400;
            margin-bottom: 12px;
            color: var(--text-primary);
            cursor: pointer;
            transition: color 0.3s ease;
            display: inline-block;
        }

        .project-title:hover {
            color: var(--accent-primary);
        }

        .project-description {
            color: var(--text-secondary);
            font-size: 0.95rem;
            line-height: 1.7;
            margin-bottom: 24px;
            font-weight: 300;
        }

        .project-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 24px;
        }

        .tag {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.7rem;
            padding: 6px 12px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 100px;
            color: var(--text-secondary);
            letter-spacing: 0.02em;
        }

        .tag.privacy {
            background: rgba(58, 134, 255, 0.15);
            color: var(--accent-tertiary);
        }

        .tag.free {
            background: rgba(255, 210, 63, 0.15);
            color: var(--accent-secondary);
        }

        .project-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--accent-primary);
            text-decoration: none;
            font-weight: 500;
            font-size: 0.95rem;
            transition: all 0.3s ease;
        }

        .project-link:hover {
            gap: 14px;
            color: var(--accent-secondary);
        }

        .project-link svg {
            width: 18px;
            height: 18px;
            transition: transform 0.3s ease;
        }

        .project-link:hover svg {
            transform: translateX(4px);
        }

        .project-card.featured {
            grid-column: 1 / -1;
            background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 107, 53, 0.08) 100%);
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 40px;
            align-items: center;
        }


        .logo-text {
            font-family: 'Space Mono', monospace;
            font-size: 4.8rem;
            font-weight: 700;
            letter-spacing: 15px;
        }

        .logo-text span {
            color: var(--accent-primary);
        }

        @media (max-width: 768px) {
            .project-card.featured {
                grid-template-columns: 1fr;
            }
        }

        .featured-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.7rem;
            padding: 6px 14px;
            background: var(--gradient-warm);
            border-radius: 100px;
            color: var(--bg-primary);
            font-weight: 500;
            margin-bottom: 16px;
            letter-spacing: 0.05em;
        }

        .featured-icon-large {
            text-align: center;
            font-size: 6rem;
            opacity: 0.6;
        }

        /* Pàgina de detall */
        .detail-header {
            padding: 40px 0 20px;
        }

        .back-button {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.95rem;
            transition: all 0.3s ease;
            cursor: pointer;
            background: none;
            border: none;
            font-family: inherit;
            padding: 12px 0;
        }

        .back-button:hover {
            color: var(--accent-primary);
            gap: 12px;
        }

        .back-button svg {
            width: 18px;
            height: 18px;
            transition: transform 0.3s ease;
        }

        .back-button:hover svg {
            transform: translateX(-4px);
        }

        .detail-hero {
            padding: 40px 0;
            border-bottom: 1px solid var(--border-subtle);
            margin-bottom: 40px;
        }

        .detail-icon {
            font-size: 4rem;
            margin-bottom: 24px;
        }

        .detail-title {
            font-family: 'Instrument Serif', serif;
            font-size: clamp(2rem, 5vw, 3rem);
            font-weight: 400;
            margin-bottom: 16px;
        }

        .detail-short-desc {
            font-size: 1.15rem;
            color: var(--text-secondary);
            max-width: 700px;
            margin-bottom: 24px;
        }

        .detail-actions {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            margin-top: 32px;
        }

        .detail-btn {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 14px 28px;
            border-radius: 100px;
            text-decoration: none;
            font-weight: 500;
            font-size: 0.95rem;
            transition: all 0.3s ease;
        }

        .detail-btn-primary {
            background: var(--gradient-warm);
            color: var(--bg-primary);
        }

        .detail-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
        }

        .detail-btn-secondary {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border-subtle);
            color: var(--text-primary);
        }

        .detail-btn-secondary:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: var(--accent-primary);
        }

        .detail-content {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 60px;
            padding-bottom: 100px;
        }

        @media (max-width: 900px) {
            .detail-content {
                grid-template-columns: 1fr;
                gap: 40px;
            }
        }

        .detail-main h3 {
            font-family: 'Instrument Serif', serif;
            font-size: 1.5rem;
            font-weight: 400;
            margin: 32px 0 16px;
            color: var(--text-primary);
        }

        .detail-main h3:first-child {
            margin-top: 0;
        }

        .detail-main p {
            color: var(--text-secondary);
            margin-bottom: 16px;
            font-weight: 300;
        }

        .detail-main ul, .detail-main ol {
            color: var(--text-secondary);
            margin-bottom: 16px;
            padding-left: 24px;
            font-weight: 300;
        }

        .detail-main li {
            margin-bottom: 8px;
        }

        .detail-main strong {
            color: var(--text-primary);
            font-weight: 500;
        }

        .detail-sidebar {
            position: sticky;
            top: 40px;
            height: fit-content;
        }

        .sidebar-section {
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 24px;
        }

        .sidebar-title {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 16px;
        }

        .features-list {
            list-style: none;
        }

        .features-list li {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 0;
            color: var(--text-primary);
            font-size: 0.95rem;
            border-bottom: 1px solid var(--border-subtle);
        }

        .features-list li:last-child {
            border-bottom: none;
        }

        .features-list li::before {
            content: '✓';
            color: var(--accent-secondary);
            font-weight: bold;
        }

        .detail-images {
            margin: 32px 0;
        }

        .detail-image {
            width: 100%;
            border-radius: 12px;
            border: 1px solid var(--border-subtle);
            margin-bottom: 16px;
        }

        .detail-image-caption {
            font-size: 0.85rem;
            color: var(--text-secondary);
            text-align: center;
            font-style: italic;
        }

        .detail-image-fallback {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: 120px;
            border-radius: 12px;
            border: 1px dashed var(--border-subtle);
            background: var(--bg-secondary);
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin-bottom: 16px;
        }

        footer {
            text-align: center;
            padding: 60px 0;
            border-top: 1px solid var(--border-subtle);
        }

        .footer-text {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .github-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            margin-top: 20px;
            padding: 12px 24px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border-subtle);
            border-radius: 100px;
            color: var(--text-primary);
            text-decoration: none;
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }

        .github-link:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: var(--accent-primary);
        }

        .github-link svg {
            width: 20px;
            height: 20px;
        }

        .loading {
            text-align: center;
            padding: 100px 0;
            color: var(--text-secondary);
        }

        .loading-spinner {
            width: 40px;
            height: 40px;
            border: 3px solid var(--border-subtle);
            border-top-color: var(--accent-primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .error-message {
            text-align: center;
            padding: 100px 0;
            color: var(--accent-primary);
        }

        @media (max-width: 640px) {
            .projects-grid {
                grid-template-columns: 1fr;
            }
            
            .project-card {
                padding: 24px;
            }
            
            header {
                padding: 60px 0 40px;
            }
        }