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

html {
    scroll-behavior: smooth;
}

:root {
    --color-primary: #93cacc;       
    --color-bg-secondary: #F4F4F4;
    --color-accent: #22727c;         
    --color-shadow: #a0a6a8;         
    --color-text: #1e1e1e;          
    --color-text-inverted: #ffffff;
}

/* ------------ESTILOS GENERALES------------- */
body, h2 {
    font-family: "Roboto", sans-serif;
    color: var(--color-text);
}

h1, .section-title {
    font-family: "Squada One", sans-serif;
}

.section-title {
    font-size: clamp(2rem, 5vw, 5rem); /* mínimo, adaptable, máximo */
    color: var(--color-text);
}

.subtitle {
    color: var(--color-text);
}

.section-text-title {
    color: #1e1e1ed8;
    font-family: "Squada One", sans-serif;
    font-size: clamp(1.2rem, 3.7vw, 3.7rem); 
}

.text-color {
    color: var(--color-primary);
    display: inline-block;
    transition: transform 0.3s ease-in-out;
}

.text-color:hover, .icon:hover {
    transform: scale(1.1);
    transition: transform 0.3s ease-in-out
}

i {
    font-size: clamp(1.2em, 3vw, 2em); 
    color: var(--color-text-inverted);
}

i:hover {
    color: var(--color-accent);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.text-pacifico {
    font-size: 1.7rem;
    font-family: "Pacifico", serif;
    color: var(--color-accent);
    transform: rotate(-0.01turn);
}

.header-right img, .project-item {
    filter: drop-shadow(6px 6px 4px var(--color-shadow));
}

/* -----------------animaciones------------- */
/* textos */
.fade-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.4s ease-out, transform 0.9s ease-out;
    will-change: opacity, transform;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* imagenes */
.fade-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.5s ease-out, transform 0.9s ease-out;
    will-change: opacity, transform;
}

.fade-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* -------------secciones------------------ */
/*HEADER*/
.header{
    position: relative;
    min-height: 100vh;
}

.wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--color-primary) 57%, var(--color-bg-secondary) 43%);
    z-index: -1; 
} 

.glow-border {
    height: 12px;
    width: 100%;
    background: linear-gradient(-45deg, #dfdede 40%, #fafafa 50%, #eee 60%);
    background-size: 300%;
    background-position-x: 100%;
    animation: shimmer 1s infinite linear;
}

@keyframes shimmer {
    to {
        background-position-x: 0%
    }
}

.header-right {
    max-width: 100%;
}

.header-left {
    color: var(--color-text-inverted);
}

.title-1 h1 {
    color: var(--color-text-inverted);
    font-family: "Squada One", sans-serif;
    font-size: clamp(2rem, 7vw, 6rem); /* mínimo, adaptable, máximo */
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--color-accent), 0 0 15px var(--color-accent), 0 0 30px var(--color-accent);
}

.header-right img {
    animation: move 3s linear infinite;
}

/* avatar*/
@keyframes move {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/*-----------------MAIN----------------*/
/*proyectos*/
.layout {
    display: grid;
    grid-template-columns:4fr 5fr;
    gap: 1rem;
}

.col {
    min-height: 100vh;
}

.col-left {
    position: sticky;
    top: 0;
    height: 100vh;
}

.layout-project {
    background-color: var(--color-text-inverted);
}

.layout-about {
    background-color: var(--color-bg-secondary);
} 

.project-item {
    position: relative;
}

.img-project {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.img-project img {
    width: 100%;
    height: 100%;
    transform: perspective(1200px) rotateY(-25deg) rotateX(20deg) skewY(-7deg);
    clip-path: path("M 0 0 Q 50% -20px, 100% 0 L 100% 100% Q 50% 120px, 0 100%");
    transform-origin: top right;
    transition: transform 0.4s ease;
    display: block;
}

.img-project:hover img {
    transform: perspective(1000px) rotateY(0deg) skewY(0deg);
    border-radius: 10px;
}

.project-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-accent);
    color: var(--color-text-inverted);
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    padding: 1rem;
    pointer-events: none; /* Desactiva eventos excepto en enlace */
}

.img-project:hover .project-info {
    opacity: 1;
    border-radius: 10px;
}

.project-info a {
    pointer-events: auto;
    color: var(--color-text-inverted);
    text-decoration: underline;
    z-index: 2;
    position: relative;
}

.project-info i {
    font-size: 42px;
    margin: 10px;
}

.btn-project {
    background-color: var(--color-primary);
    border-radius: 2em;
    box-shadow: 6px 6px 4px var(--color-shadow);
}

.btn-project a {
    text-decoration: none;
    color: var(--color-text-inverted);
}

.btn-project:hover {
    background-color: var(--color-accent);
    transform: translateY(-6px);
    animation: none;
}

/*--------------carrusel----------------*/
.carousel {
    width: 100%;
    height: 14vh;
    background: var(--color-bg-secondary);
    background: linear-gradient(0deg, rgba(244, 244, 244, 1) 0%, rgba(255, 255, 255, 1) 100%);
    text-shadow: 0 0 5px #434444, 0 0 15px #555555, 0 0 30px #4e4e4e;
}

.carousel-phrases {
    display: flex;
    overflow-x: hidden;
    overflow-y: auto; 
}

.carousel-text {
    min-width: 640px;
    max-width: 400px;
    height: 100px;
    display: inline-block;
}
    
.carousel-text p {
    font-size: 1.3rem;
    margin-bottom: 0;
    font-weight: bold;
    letter-spacing: 1px;
    font-style: italic;
    color: var(--color-texto);
}

/* ------------------SOBRE MI--------------------- */
.flip-container {
    perspective: 1000px;
    width: 360px;
    height: 390px;
    margin: 0 auto;
}

.flip-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    border-radius: 10px;
}

.flip-card img {
    border-radius: 10px;
}

.flip-container:hover .flip-card {
    transform: rotateY(180deg);
}

.flip-perfil, .flip-reverse {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 0px 6px 12px var(--color-shadow);
}

.flip-reverse {
    transform: rotateY(180deg);
    background-color: var(--color-primary);
    color: var(--color-texto-invertido);
}

details i {
    color: var(--color-primary);
}

#candyLevel {
    color: var(--color-text);
}

#candyLevel:hover {
    color: var(--color-accent);
}

hr {
    display: block;
    width: 7vw;
    height: 4px;
    background-color: var(--color-accent);
    border: none;
    opacity: 1;
}

.icon {
    width: 66px;
    max-height: 52px;
}

.icon-width {
    width: 80px;
    height: 45;
}

details h4, summary {
    color: var(--color-primary);
}

summary:focus {
    border: none;
}

/*----------------contacto-----------------*/
.contact{
    width: 100%;
    height: 100%;
    position: relative;
}

.contact::before{
    content: "";
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/keyboard.jpg');
    background-repeat: no-repeat; 
    background-attachment: fixed; 
    background-size: 125%; 
    filter: blur(5px);
    z-index: -1;
    animation: movemBg 20s linear infinite;
}

.contact h2{
    font-size: clamp(2rem, 5vw, 5rem); 
}

.contact h3 {
    font-family: "Squada One", sans-serif;
    font-size: 2.5rem;
}

.contact img{
    width: 42px;
    transform: rotate(-0.05turn);
}

@keyframes movemBg {
    0%{
		background-position: bottom left;
    }   
    30%{		
		background-position: top right;
    }
    60%{
        background-position: top left;
    }
    100%{
        background-position: bottom right;
    }
}

footer {
    background-color: #1D242AE6;
    position: relative;
}

/* ----------------Responsive-------------------*/
@media (max-width: 768px) {
    .text1, .header-left .header-icons {
        text-align: center;
    }

    .header-icons {
        display: block; 
        margin: 0 auto; 
        text-align: center;
    }

    .header-icons a {
        margin: 10px 0; 
        display: inline-block; 
    }

    .header h1 {
        padding-top: 1rem;
        text-align: center;
    }

    .wrapper {
        background: linear-gradient(to bottom, var(--color-primary) 70%, var(--color-bg-secondary) 30%);
    }

    .layout {
        grid-template-columns: 1fr;
    }
    .col {
        margin-bottom: 1rem;
    }

    .project-info {
        padding: 15px 20px !important;
    }

    .project-info i {
    font-size: 27px;
    margin: 10px;
    }
}

@media (max-width: 992px) {
    /*-no fijo */
    .layout {
        display: block;
    }

    .col-left {
        position: static;
        top: auto;
        height: auto;
    }

    .col {
        min-height: auto;
    }
    /*termina no fijo*/

    .col-freelance h3{
    margin-top: 0;
    }

    .project-item img {
        text-align: center;
    }

    .contact::before {
    background-size: cover;
    }
}

@media (max-width: 1200px) {
    .header {
        padding-top: 2.5rem;
    }
}