:root {
    /* Color Palette - Catalan Inspired (Senyera colors modernized) + Dark Theme Base */
    --primary-hue: 45; /* Golden Yellow */
    --primary-sat: 95%;
    --primary-light: 60%;
    
    --accent-hull: 355; /* Deep Red */
    --accent-sat: 85%;
    --accent-light: 55%;

    --bg-dark: 220 15% 10%;
    --bg-card: 220 15% 14%;
    --text-main: 220 20% 95%;
    --text-muted: 220 15% 70%;

    /* Light Theme Overrides (Applied via class or media query if desired, defaulting directly to dark for premium feel) */
    --color-primary: hsl(var(--primary-hue), var(--primary-sat), var(--primary-light));
    --color-accent: hsl(var(--accent-hull), var(--accent-sat), var(--accent-light));
    --color-bg: hsl(var(--bg-dark));
    --color-bg-card: hsl(var(--bg-card));
    --color-text: hsl(var(--text-main));
    --color-text-muted: hsl(var(--text-muted));

    --font-main: 'Outfit', sans-serif;
    --transition-fast: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none; /* Custom cursor */
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-primary);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body:hover .cursor-outline {
    opacity: 1;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(17, 20, 29, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.highlight {
    color: var(--color-primary);
}

.navbar {
    display: none; /* Mobile first, shown in media query */
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.lang-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}

.lang-toggle span.active {
    color: var(--color-primary);
    font-weight: 700;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 0.5rem;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--color-primary);
}

.sun-icon { display: block; }
.moon-icon { display: none; }

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.gradient-text {
    background: linear-gradient(to right, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary {
    background-color: var(--color-primary);
    color: #111; /* Dark text on yellow */
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-text-muted);
    color: var(--color-text);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.5);
}

.hero-visual {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.abstract-shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.3;
}

.shape-1 {
    top: 10%;
    left: 10%;
    width: 300px;
    height: 300px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: float 10s infinite alternate;
}

.shape-2 {
    bottom: 10%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: var(--color-accent);
    border-radius: 40%;
    animation: float 15s infinite alternate-reverse;
}

/* Sections */
.section {
    padding: 6rem 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-primary);
    transform: scaleX(0.3);
    transform-origin: center;
    transition: transform var(--transition-smooth);
}

.section:hover .section-title::after {
    transform: scaleX(1);
}

/* About Grid */
.about-grid {
    display: grid;
    gap: 3rem;
    grid-template-columns: 1fr;
}

.skills-list {
    list-style: none;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.skills-list li {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--color-bg-card);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.project-card {
    background: var(--color-bg-card);
    border-radius: 16px;
    overflow: hidden;
    transition: transform var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-image {
    height: 200px;
    width: 100%;
}

.project-info {
    padding: 2rem;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.project-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

/* Contact */
.contact-wrapper {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--color-bg-card);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.contact-text {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.email-btn {
    font-size: 1.5rem;
    padding: 1rem 3rem;
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-links a {
    color: var(--color-text);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.social-links a:hover {
    color: var(--color-primary);
    transform: scale(1.1);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 40px); }
}

/* Media Queries */
@media (min-width: 768px) {
    .navbar {
        display: flex;
        gap: 2rem;
    }
    
    .nav-link {
        color: var(--color-text);
        text-decoration: none;
        opacity: 0.8;
        transition: opacity var(--transition-fast);
    }
    
    .nav-link:hover {
        opacity: 1;
        color: var(--color-primary);
    }

    .hero-title {
        font-size: 5rem;
    }

    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}
