:root {
    /* Tema claro */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent: #4361ee;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}
[data-theme="dark"] {
    /* Tema oscuro - por defecto ahora */
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent: #ffd700;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Estilos para la máscara de revelado */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Capa negra inicial que cubre todo */
#black-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: black;
    z-index: -1;
    pointer-events: none;
}

/* Fondo con la máscara y animación de revelado */
#background-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url("../assets/images/fondo.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    mask-image: url("../assets/images/lock.svg");
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: 50px;
    
    -webkit-mask-image: url("../assets/images/lock.svg");
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 50px;

    animation: lock-reveal 5s forwards ease-in-out;
    z-index: 1;
}

@keyframes lock-reveal {
    0% {
        mask-size: 50px;
        -webkit-mask-size: 50px;
        filter: brightness(0.5);
    }
    100% {
        mask-size: 1000vh;
        -webkit-mask-size: 1000vh;
        filter: brightness(1);
    }
}

/* El contenido aparece solo después de la animación */
.content {
    position: relative;
    z-index: 3;
    color: var(--text-primary);
    opacity: 0;
    animation: fadeIn 1.5s forwards 0.8s;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--text-secondary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: rotate(20deg);
}

.theme-toggle i {
    font-size: 18px;
    color: var(--text-primary);
    transition: var(--transition);
}

/* Sección Intro */
#intro {
    padding: 100px 0;
}

.intro-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.intro-text {
    flex: 1;
}

.intro-text h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.intro-text p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.intro-text .subtitle {
    font-size: 1rem;
    color: var(--accent);
}

.intro-image {
    flex: 1;
    text-align: right;
}

.intro-image img {
    max-width: 350px;
    border-radius: 10%;
    box-shadow: var(--shadow);
}

.scroll-more {
    display: block;
    margin-top: 20px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* Sección Skillset */
#skillset {
    padding: 60px 0;
}

.skillset-content {
    display: flex;
    gap: 40px;
}

.skillset-title {
    flex: 1;
}

.skillset-title h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.skillset-title a {
    color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
}

.skillset-desc {
    flex: 1;
    color: var(--text-secondary);
}

/* Sección Process */
#process {
    padding: 60px 0;
}

.process-title {
    font-size: 3rem;
    margin-bottom: 40px;
}

.process-columns {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.process-column {
    flex: 1;
    min-width: 200px;
}

.process-column h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.process-column ul {
    list-style: none;
}

.process-column li {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

/* Sección Recent Projects */
#recent-projects {
    padding: 60px 0;
}

.projects-title {
    font-size: 3rem;
    margin-bottom: 40px;
}

/* Contenedor de proyectos en cuadrícula - MODIFICADO */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    width: 100%;
    margin-top: 30px;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%; /* Asegura que todas las tarjetas tengan la misma altura */
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(67, 97, 238, 0.15);
}

.project-img-container {
    height: 400px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.8rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.tag {
    background: rgba(67, 97, 238, 0.15);
    color: var(--accent);
    padding: 0.35rem 0.9rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
}

[data-theme="dark"] .tag {
    background: rgba(94, 114, 235, 0.2);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin-top: auto;
    padding: 8px 0;
    width: fit-content;
    transition: var(--transition);
}

.project-link:hover {
    color: #3a0ca3;
    text-decoration: underline;
}

[data-theme="dark"] .project-link:hover {
    color: #729bfa;
}

/* Sección Career */
#career {
    padding: 60px 0;
}

.career-title {
    font-size: 3rem;
    margin-bottom: 40px;
}

.career-list {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.career-item {
    flex: 1;
    min-width: 200px;
}

.career-item h4 {
    font-size: 1.5rem;
}

.career-item p {
    color: var(--text-secondary);
}

/* Sección About */
#about {
    padding: 60px 0;
    position: relative;
}

.about-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('') no-repeat center/cover;
    opacity: 0.2;
}

.about-content {
    position: relative;
    z-index: 1;
}

.about-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--accent);
}

.about-desc h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.about-desc p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.about-link {
    color: var(--accent);
    text-decoration: none;
}

/* Sección Case Studies */
#case-studies {
    padding: 60px 0;
}

.case-title {
    font-size: 3rem;
    margin-bottom: 40px;
}

.case-grid {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.case-item {
    flex: 1;
    min-width: 300px;
}

.case-item img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Sección Contact */
#contact {
    padding: 60px 0;
    text-align: center;
}

.contact-title {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.contact-desc {
    font-size: 3rem;
    margin-bottom: 20px;
}

.contact-text {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.contact-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--accent);
}

footer {
    text-align: center;
    padding: 40px 0;

    font-size: 0.95rem;

    background-color: #000000;
    color: #ffffff;
    border-top: 1px solid #333333;
}

.footer-made {
    margin-top: 20px;
    font-size: 1rem;
}

.social-icons {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-icons a {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: var(--accent);
}

/* Media queries para responsividad - MODIFICADO */
@media (max-width: 768px) {
    .intro-content, .skillset-content {
        flex-direction: column;
    }
    
    .intro-image {
        text-align: center;
    }
    
    .process-columns {
        flex-direction: column;
    }
    
    /* Cambiar a una sola columna en móviles */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    @keyframes lock-reveal {
        0% {
            mask-size: 30px;
            -webkit-mask-size: 30px;
        }
        100% {
            mask-size: 200vh;
            -webkit-mask-size: 200vh;
        }
    }
}

/* Efecto de carga suave */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

section {
    animation: fadeIn 0.6s ease forwards;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 30px;
    backdrop-filter: blur(5px);
    padding: 60px;
    margin-bottom: 20px;

}

/* Recorder styles */
.recorder-container {
    margin-top: 20px;
}

.audio-visualizer {
    display: flex;
    gap: 4px;
    height: 40px;
    align-items: flex-end;
}

.visualizer-bar {
    width: 6px;
    height: 10px;
    background: var(--accent);
    transform-origin: bottom;
    transition: height 0.1s ease;
}

.recording-active .visualizer-bar {
    animation: barAnimate 1s infinite alternate;
}

@keyframes barAnimate {
    0% { height: 10px; }
    50% { height: 30px; }
    100% { height: 10px; }
}

.recorder-status {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.status-info { color: var(--accent); }
.status-warning { color: #ffcc00; }
.status-success { color: #00cc00; }
.status-error { color: #ff0000; }

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}