:root {
    /* Palette Option C: Warm & Creative - REFINED */
    --bg-color: #FDF8F5;
    --surface-color: #FFFFFF;
    --primary-color: #7A3E0F; /* Marrón más profundo para jerarquía */
    --primary-light: #BC6C25; 
    --secondary-color: #4A562B; /* Verde más saturado y profundo */
    --accent-gold: #D4AF37; /* Dorado suave para detalles */
    --accent-beige: #F5EBE0; /* Beige cálido */
    --text-main: #1D2612;
    --text-muted: #4A4A4A;
    --white: #ffffff;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --shadow: 0 15px 45px rgba(122, 62, 15, 0.08); /* Sombra con matiz marrón */
    --border-elegant: 1px solid rgba(212, 175, 55, 0.2);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(253, 248, 245, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1.2rem 0;
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
}

.logo span {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    font-size: 1rem;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(253, 248, 245, 0.8), rgba(253, 248, 245, 0.8)), 
                url('assets/hero_bg.png');
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent-gold), transparent);
}

.hero-content h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-content h1 span {
    color: var(--primary-color);
}

.role {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

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

.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    display: inline-block;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.btn-secondary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* About Section */
.about {
    padding: 10rem 0;
    background: linear-gradient(to bottom, #FFFFFF, #FDF8F5);
    border-top: var(--border-elegant);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.about-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.2rem;
}

/* Projects Section */
.projects {
    padding: 10rem 0;
    background: linear-gradient(to bottom, #FDF8F5, #FFFFFF);
    border-top: var(--border-elegant);
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

.project-card {
    background: var(--surface-color);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: row;
    border: 1px solid rgba(188, 108, 37, 0.05);
}

.project-card.project-reverse {
    flex-direction: row-reverse !important;
    background: #FFFBF0; /* Un tono crema ligeramente más cálido para alternar */
}

@media (max-width: 900px) {
    .project-card, .project-card:nth-child(even) {
        flex-direction: column;
    }
}

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

.project-img {
    flex: 1.1;
    min-height: 400px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.browser-mockup {
    width: 100%;
    height: 320px;
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.browser-header {
    height: 30px;
    background: #ececec;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 6px;
    flex-shrink: 0;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.dot:nth-child(1) { background: #ff5f56; }
.dot:nth-child(2) { background: #ffbd2e; }
.dot:nth-child(3) { background: #27c93f; }

.browser-mockup img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Cambio clave: no se corta ni se estira */
    padding: 10px;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(240,240,240,1) 100%);
    transition: transform 0.5s ease;
}

.project-card:hover .browser-mockup img {
    transform: scale(1.05); /* Un zoom sutil y elegante en lugar del scroll */
}

.project-card:hover .project-img {
    transform: scale(1.02);
}

.project-info {
    padding: 2.5rem;
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

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

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-stack span {
    background: var(--accent-color);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.btn-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-link:hover {
    color: var(--secondary-color);
}

/* Skills Section */
.skills {
    padding: 10rem 0;
    background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(253, 248, 245, 0.9)), 
                url('assets/pattern_bg.png');
    background-size: 400px;
    background-repeat: repeat;
    border-top: var(--border-elegant);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.skill-category ul li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

.skill-category i {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

/* Courses Section */
.courses {
    padding: 10rem 0;
    background: linear-gradient(to bottom, #FDF8F5, #FFFFFF);
    border-top: var(--border-elegant);
}

.courses-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.course-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.course-item:hover {
    transform: translateY(-5px);
    border-left: 4px solid var(--accent-gold);
}

.course-item i {
    font-size: 2rem;
    color: var(--accent-gold);
}

.course-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.course-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.highlight-edu {
    border: 2px solid var(--accent-gold);
    background: #FFFBF0;
    transform: scale(1.02);
}

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

/* Project Detail Pages */
.project-detail-hero {
    padding: 8rem 0 4rem;
    text-align: center;
    background: linear-gradient(rgba(253, 248, 245, 0.9), rgba(253, 248, 245, 0.9)), 
                url('assets/pattern_bg.png');
    background-size: 200px;
}

.project-detail-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.project-grid-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.project-main-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.project-sidebar {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.sidebar-item {
    margin-bottom: 1.5rem;
}

.sidebar-item h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--accent-gold);
    padding-bottom: 0.3rem;
}

.detail-section {
    margin-bottom: 4rem;
}

.detail-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.detail-section ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-section ul li {
    background: var(--white);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    border-left: 3px solid var(--accent-gold);
}

@media (max-width: 850px) {
    .project-grid-info {
        grid-template-columns: 1fr;
    }
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-info p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-links a {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-links a:hover {
    color: var(--primary-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    background: var(--bg-color);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
    }
}
footer {
    padding: 3rem 0;
    text-align: center;
    background: var(--surface-color);
    border-top: 1px solid rgba(188, 108, 37, 0.1);
}

footer i {
    color: #e63946;
}

/* Animations */
.fade-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-left.appear, .fade-right.appear {
    opacity: 1;
    transform: translateX(0);
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-color);
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        transform: translateY(-150%);
        transition: transform 0.4s ease-in-out;
        z-index: -1;
    }

    .nav-links.active {
        transform: translateY(0);
    }
    
    .menu-toggle {
        display: block;
    }
    .hero-btns {
        flex-direction: column;
        gap: 1rem;
    }
}
