:root {
    --primary-color: #000000;
    --secondary-color: #ffffff;
    --accent-color: #0071e3;
    --text-color: #1d1d1f;
    --text-secondary: #86868b;
    --bg-light: #f5f5f7;
    --header-bg: rgba(255, 255, 255, 0.8);
    --card-bg: #f5f5f7;
    --card-hover-bg: #ffffff;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary-color: #ffffff;
    --secondary-color: #000000;
    --accent-color: #0a84ff;
    --text-color: #f5f5f7;
    --text-secondary: #a1a1a6;
    --bg-light: #1c1c1e;
    --header-bg: rgba(0, 0, 0, 0.8);
    --card-bg: #1c1c1e;
    --card-hover-bg: #2c2c2e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    line-height: 1.5;
    background-color: var(--secondary-color);
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}
/* Top Carousel Styles */
.top-carousel {
    width: 100%;
    height: 400px;
    overflow: hidden;
    position: relative;
    background: #000;
}

.carousel-track {
    display: flex;
    width: 500%; /* 5 items */
    height: 100%;
    animation: scroll 40s linear infinite; /* 8s per item (5 items * 8s = 40s) */
}

.carousel-item {
    width: 20%; /* 1/5 of the track */
    height: 100%;
    position: relative;
    flex-shrink: 0;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    20% { transform: translateX(-20%); } /* Stay on 1st? No, this needs to be stepped or continuous */
    100% { transform: translateX(-100%); }
}

/* Redefining scroll for stepped feel (8s per image) */
@keyframes scroll {
    0%, 15% { transform: translateX(0); }
    20%, 35% { transform: translateX(-20%); }
    40%, 55% { transform: translateX(-40%); }
    60%, 75% { transform: translateX(-60%); }
    80%, 95% { transform: translateX(-80%); }
    100% { transform: translateX(-100%); }
}

/* Header adjustment for carousel */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
    transition: background-color 0.5s ease;
}

nav {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.theme-btn {
    background: none;
    border: 1px solid rgba(128, 128, 128, 0.3);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-color);
}

.theme-btn:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

.dark-icon { display: none; }
[data-theme="dark"] .light-icon { display: none; }
[data-theme="dark"] .dark-icon { display: block; }

.logo {
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 400;
    transition: var(--transition);
    opacity: 0.8;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

/* Sections */
.section {
    padding: 100px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.section-title {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 3rem;
    text-align: center;
    letter-spacing: -1px;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, var(--secondary-color) 0%, var(--bg-light) 100%);
}

.hero-content h1 {
    font-size: 5rem;
    font-weight: 600;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 2rem;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 980px;
    text-decoration: none;
    font-weight: 400;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px);
    background: var(--card-hover-bg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* About Flex */
.about-flex {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.about-image {
    flex: 1;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-light);
    border-radius: 20px;
}

/* Portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.img-responsive {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
    filter: brightness(var(--img-brightness, 1));
}

[data-theme="dark"] .img-responsive {
    --img-brightness: 0.8;
}

.portfolio-item {
    background: var(--bg-light);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

footer {
    padding: 4rem 0;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.fade-in-delay {
    opacity: 0;
    animation: fadeIn 1s ease-out 0.3s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    nav {
        gap: 1rem;
    }
    .nav-links {
        display: none; /* Simplificado para el ejemplo */
    }
    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-content p {
        font-size: 1.2rem;
    }
    .about-flex {
        flex-direction: column;
    }
    .section-title, .about-text h2 {
        font-size: 2.5rem;
    }
}

