:root {
    --bg-color: #000;
    --text-color: #fff;
    --card-color: #111;
    --accent-color: #d48207;
}

body {
    font-family: 'Merriweather', serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    scroll-behavior: smooth;
    transition: background-color 0.3s, color 0.3s;
    box-shadow: inset 0 0 150px rgba(255, 100, 50, 0.25);
    overflow-x: hidden;   
    text-align: center;
}

header {
    position: relative;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    min-height: 100vh;
}

#matrix {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: black;
}

.perfil-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.perfil-info {
    flex: 1;
    padding: 0 20px;
}

.typewriter {
    font-size: 65px;
    overflow: hidden;        
    border-right: .15em solid var(--accent-color);
    white-space: nowrap;
    margin: 0 auto;
    display: inline-block;  
    max-width: 100%;      
    animation: typing 4s steps(40, end), blink .75s step-end infinite;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}
@keyframes blink {
  from, to { border-color: transparent }
  50% { border-color: var(--accent-color); }
}

.perfil-foto img {
    width: 280px;
    border-radius: 15px;
    object-fit: cover;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    background-color: var(--card-color);
    padding: 0.5rem;
    margin: 0;
    flex-wrap: wrap;
}
nav ul li {
    margin: 0.5rem 1rem;
}
nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.3rem;
    transition: color 0.3s ease;
}
nav ul li a:hover {
    color: var(--accent-color);
}

section {
    padding: 2rem;
    max-width: 1200px;
    margin: auto;
    text-align: center;
}

.proyectos {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}
.proyecto {
    flex: 1 1 calc(33.333% - 2rem);
    max-width: calc(33.333% - 2rem);
    background-color: var(--card-color);
    padding: 1rem;
    border-radius: 5px;
    border: 2px solid transparent;
    background-image: linear-gradient(var(--card-color), var(--card-color)),
                      linear-gradient(45deg, #ff7e00, #ffb347);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.proyecto img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 0.8rem;
}
.proyecto:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(255, 126, 0, 0.6);
}

@media (max-width: 992px) {
    .proyecto {
        flex: 1 1 calc(50% - 2rem);
    }
}
@media (max-width: 600px) {
    .proyecto {
        flex: 1 1 100%;
    }
    .perfil-container {
        flex-direction: column;
        text-align: center;
    }
}

#sobre-mi {
    background-color: var(--card-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    max-width: 900px;
    margin: 2rem auto;
    border-left: 6px solid #d48207; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#sobre-mi:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
}
#sobre-mi h2 {
    color: #ffb347; 
    font-size: 2rem;
    margin-bottom: 1rem;
}
#sobre-mi p {
    line-height: 1.8;
    font-size: 1.05rem;
    text-align: justify;
}

.habilidades-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    list-style: none;
    padding: 0;
    gap: 1rem;
    justify-items: center;
}
.habilidades-list li {
    display: flex;
    align-items: center;
    font-size: 1.3rem;
    justify-content: center;
}
.habilidades-list i {
    font-size: 2.5rem;
    margin-right: 0.5rem;
    color: var(--accent-color);
}

#contacto {
    background-color: var(--card-color);
    padding: 2rem;
    border-radius: 10px;
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
}
#contacto h2 {
    color: #ffb347;
    margin-bottom: 1rem;
}
#contacto p {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}
#contacto i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-right: 0.5rem;
}

i {
    font-size: 2.2rem; 
    transition: transform 0.3s, color 0.3s;
}
i:hover {
    transform: scale(1.2);
    color: #ff7e00;
}

.scroll-fade {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .6s ease, transform .6s ease;
}
.scroll-fade.is-visible {
    opacity: 1;
    transform: none;
}
