* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: hsl(187, 100%, 16%);
    --primary-dark: hsla(194, 84%, 48%, 0.947);
    --secondary: hsl(25, 99%, 63%);
    --secondary-dark: hsl(25, 99%, 60%);
    --white: #f5f9fa;
    --white2: #ebf3f5;
    --gray: #e1e4e5;
    --gray2: #c0c6c9;
    --gray3: #4b4c4d;
    --black: #323333;
    --black2: #2a2b2b;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: "Montserrat", sans-serif;
    color: var(--gray3);
    text-align: center;
    font-size: 14px;
    background: linear-gradient(var(--white), var(--white2));
}

header, footer, section.even {
    color: var(--white);
}

h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }

h2, h3, h4 {
    letter-spacing: 0.3rem;
}

h1, h3 {
    text-transform: uppercase;
}


h1, h2, h3, h4, p, span {
    word-wrap: break-word; 
    overflow-wrap: break-word;
}

.circle {
    border-radius: 50%;
}

section {
    padding-top: 3rem;
    padding-bottom: 3rem;
    width: 100%; 
}

#navbar, section.even {
    background: linear-gradient(var(--primary), var(--primary-dark));
}

footer {
    background: linear-gradient(var(--black), var(--black2));
    padding: 2rem 0;
}

/* LÍNEAS SEPARADORAS */
body hr {
    height: 0.1rem;
    max-width: 100%;
    border: 0;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--primary), rgba(0, 0, 0, 0));
}

section.even hr {
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--white), rgba(0, 0, 0, 0));
}

section hr {
    margin-bottom: 5rem;
}


/* --- HEADER --- */

header {
    position: relative; 
    overflow: hidden;   
    padding: 5rem 1rem 3rem;
    background: linear-gradient(var(--black), var(--black2));
    
    
    display: flex;
    flex-direction: column;
    align-items: center;
}


header video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    
    opacity: 0.1; 
    z-index: 0;  
    object-fit: cover;
}

header img, 
header h1, 
header h2, 
header hr {
    position: relative;
    z-index: 1;
}


/* --- NAVBAR --- */

#navbar {
    box-shadow: 0px 0px 10px 1px var(--gray3);
    width: 100%;
    z-index: 1000; 
}

#navbar > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 10px; 
}

#navbar div a {
    padding: 1rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--black);
    max-width: 80%; 
}

#navbar div a:hover {
    color: var(--white);
    transition: color .3s ease;
}

span { margin-right: 0.5rem; }
#navbar div img { margin-right: 0.5rem; }

#navbar button {
    background-color: transparent;
    color: var(--white);
    font-size: 2rem; 
    padding: 0.2rem 0.7rem;
    cursor: pointer;
    border: none;
}

#navbar ul {
    background: linear-gradient(var(--primary), var(--primary-dark));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    margin: 0;
    max-height: 0;
    transition: max-height .3s ease;
    width: 100%;
    overflow: hidden;
}

#navbar.open ul {
    max-height: 200px; 
}

#navbar li { list-style: none; }

#navbar ul a {
    display: block;
    padding: 15px;
    text-decoration: none;
    color: var(--white);
    transition: color .3s ease, background-color .3s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

#navbar ul a:hover {
    color: var(--black);
    background-color: var(--white);
}

.navbar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}


/* --- PORTFOLIO --- */

#portafolio .proyecto-card {
    display: block;
    position: relative;
    margin: 1rem auto;
    width: 90%;        
    max-width: 400px;  
   overflow: hidden;
    box-shadow: 0 0 10px var(--gray2);
    padding: 0;
    border: none;
    cursor: zoom-in;
    text-decoration: none;
    color: inherit;
}

#portafolio img {
    display: block;
    height: auto; 
    width: 100%;
    transition: transform ease 0.3s;
}

#portafolio .proyecto-card:hover img { transform: scale(1.25); }

#portafolio .proyecto-card:before {
    content: "";
    background-color: var(--primary);
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    transition: opacity ease 0.3s;
    opacity: 0;
}

#portafolio .proyecto-card:hover:before { opacity: 0.75; }

#portafolio h4 {
    display: block;
    margin: 0;
    position: absolute;
    z-index: 2;
    bottom: 0%;
    left: 50%;
    transform: translate(-50%, 50%);
    color: var(--white);
    opacity: 0;
    transition: bottom ease 0.3s, opacity ease 0.3s;
    width: 100%;
    text-align: center;
}

#portafolio .proyecto-card:hover h4 {
    bottom: 40%; 
}


/* --- SKILLSET --- */

#skillset > div {
    display: grid;
    
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); 
    gap: 1rem;
    margin: 1rem;
    padding: 0 1rem; 
}

#skillset img {
    border-radius: 1rem;
    max-width: 100%; 
    width: 7rem;
    cursor: context-menu;
}

#skillset > div > div { position: relative; }

#skillset span.Tooltip {
    width: 100px; 
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    text-align: center;
    padding: 0.5rem 0;
    border-radius: 0.5rem;
    position: absolute;
    z-index: 10;
    top: -40px;
    left: 50%;
    transform: translate(-50px, 10px); 
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

#skillset > div > div:hover span.Tooltip {
    opacity: 1;
    transform: translate(-50px, 0px);
}


/* --- EXPERIENCE --- */
#experience img {
    background: white;
    width: 150px;
    height: 150px;
    padding: 2rem;
    border: 5px solid var(--primary);
    border-radius: 25px;
    cursor: pointer;
    transition: border-radius 0.3s ease, box-shadow 0.3s;
    max-width: 100%; 
}

#experience img:hover {
    border-radius: 0;
    box-shadow: 0px 0px 10px 1px var(--gray2);
}


/* --- MEDIA QUERY (MÓVILES) --- */

@media (max-width: 768px) {

   
    h2, h3, h4 {
        letter-spacing: 0.1rem;
    }
    
    h1 { font-size: 1.5rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.2rem; }

    section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    section hr { margin-bottom: 3rem; }
    header { padding: 3rem 1rem 2rem; }

    
 
    #navbar div a small {
        display: none;
    }
 
    #navbar div a span {
        font-size: 0.9rem;
        white-space: nowrap; 
    }
    
    #portafolio img { max-height: none; }
    #experience img {
        width: 120px;
        height: 120px;
        padding: 1.5rem;
    }
}