:root {
    --background-color: #0f172a;
    --letter-color: #94a3b8;
    --accent-color: #5eead4;
    --highlight-color: #e2e8f0;
    --accent-background:rgba(45, 212, 191, 0.1);
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--letter-color);
    padding: 6rem 2rem;
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 6rem;
    position: relative;
}

/* Language Toggle Button */
.language-toggle {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: none;
    border: none;
    color: var(--letter-color);
    font-size: 0.9rem;
    font-weight: 200;
    text-transform: uppercase;
    cursor: pointer;
    transition-duration: 200ms;
    z-index: 100;
}

.language-toggle:hover {
    color: var(--accent-color);
}

p {
    line-height: 1.5rem;
}

a {
    text-decoration: none
}

p::selection, 
h1::selection, 
h2::selection, 
h3::selection,
h4::selection, 
h5::selection, 
h6::selection,
img::selection,
button::selection {
    background: var(--accent-color);
    color: var(--background-color);
 }

header,
main,
footer {
    position: relative;
    z-index: 10;
}

header {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    max-width: 480px;
}

header h1,
header h4 {
    color: var(--highlight-color)
}

header h1 {
    font-size: 3.2rem;
    font-weight: 600;
    transition: transform 200ms;
}

header h1:hover {
    color: var(--accent-color);
}


header h4 {
    font-size: 1.1rem;
    font-weight: 400;
}

nav {
    display: none;
}

.mail {
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 6px;      /* Distancia entre el texto y la línea */
}


/*Social Links Container*/

.social-links-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-link {
    color: inherit;
    text-decoration: none;
    transition-duration: 200ms;
}

.social-link:hover {
    color: var(--highlight-color);
}

.social-links-container .social-link svg {
    width: 25px;
    height: 25px;
    vertical-align: middle;
    fill: currentColor; /* hace que el SVG use el color del enlace */
}


main {
    display: flex;
    flex-direction: column;
    gap: 6rem;
}

section {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    scroll-margin-top: 6rem;
}

section h2 {
    text-transform: uppercase;
    font-size: 1rem;
    font-weight: 500;
    color: var(--highlight-color);
}

.sticky-header {
    position: sticky;
    top: 0;
    padding: 1rem 0;
}

.sticky-header h2 {
    position: relative;
    z-index: 2;
}

.sticky-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--background-color);
    opacity: 0.85;
   
}

.about-contents {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.anchor-text {
    color: var(--highlight-color);
    text-decoration: none;
    transition-duration: 200ms;
}

.anchor-text:hover {
    color: var(--accent-color);
}

.anchor-text-secret {
  /* Elimina el color azul y el subrayado */
  color: inherit;
  text-decoration: none;
  
  /* MUY IMPORTANTE: Cambia el puntero de "mano" a la flecha normal */
  cursor: text;
}

.anchor-text-secret:hover, 
.anchor-text-secret:active, 
.anchor-text-secret:focus {
  /* Evita que cambie al pasar el ratón o hacer clic */
  color: inherit;
  text-decoration: none;
  outline: none; /* Elimina el borde de enfoque para accesibilidad */
}


.contents {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.card {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.2rem;
    scroll-margin-top: 6rem;
}

.card-header:hover i {
    transform: translateY(-0.3rem);
}

.card-header i {
    font-size: 0.8rem;
    padding-left: 0.3rem;
    transition: transform 200ms;
}

.no-break {
    white-space: nowrap;
}

.card-column1 {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-column2 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card p {
    font-size: 0.9rem;
}

.card p.tenure {
    opacity: 0.6;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.card-header {
    font-weight: 500;
    font-size: 1.1rem;
}

.card-links-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-link:hover i {
    transform: translateY(-0.3rem);
}

.card-link i {   
    color: var(--letter-color);
    transition-duration: 200ms;
    font-size: 0.8rem;
    padding-right: 1.3rem;
    transition: transform 200ms;
}

.italic {
    font-style: italic;
}

.anchor-text:hover i {
    color: inherit;
}

.tag-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--accent-color);
}

.tag {
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    background: var(--accent-background);
}

.tag p {
    font-size: 0.8rem;
}

.project-image-container {
    max-width: 200px;
    overflow: hidden;
    display: grid;
    place-items: center;
    aspect-ratio: 1/1;
    order: 2;
    border-radius: 0.5rem;
}

.project-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

footer {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    align-items: flex-start;
}

footer p {
    font-size: 0.9rem;
}

footer i {
    font-size: 0.8rem;
    padding-left: 0.1rem;
    transition: transform 200ms;
}

footer a:hover i {
    transform: translateY(-0.3rem);
}




@media (min-width: 640px) {

    .card {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5rem;
    }

    .card-column2 {
        grid-column: span 3 / span 3;
    }

    .card-column1 .tenure {
        order: 1;
    }
    .project-image-container {
        order: 0;
    }

}

@media (min-width: 1024px) {
    body {
        grid-template-columns: 2fr 3fr;
        gap: 5rem;
        padding: 4rem 4rem;
        padding-top: 0;
        padding-bottom: 0;
    }

    .language-toggle {
        position: fixed;
    }

    header {
        position: sticky;
        margin-left: auto;
        top: 0;
        height: 100vh;
        padding-bottom: 5rem;
        max-width: 480px;
        width: 100%;
        padding-top: 6rem;
    }

    main {
        max-width: 850px;
        width: 100%;
        padding-top: 6rem;
        margin-right: auto;
        gap: 10rem;
    }
    
    nav {
        display: flex;
        flex-direction: column;
        flex: 1;
        gap: 1rem;
        padding-top: 1rem;
    }
    
    nav a {
        font-size: 0.9rem;
        font-weight: 600;
        text-transform: uppercase;
        display: flex;
        align-items: center; /* Centra la línea verticalmente con el texto */
        gap: 0.5rem;
    }

    .line {
    display: inline-block;
    height: 1px;          /* Grosor de la línea */
    background-color: var(--letter-color);
    width: 40px;             /* Longitud cero */
    opacity: 0.8;           /* Invisible al inicio */
    transition: width 0.4s ease, opacity 0.3s ease, margin-right 0.4s ease;
    transition-duration: 200ms;
    }

    .text {
        color: var(--letter-color)
    }

    nav a:hover .line {
        height: 1px;          /* Grosor de la línea */
        width: 120px;          /* La longitud que quieras que alcance */
        opacity: 1;           /* Se hace visible */
    }
    
    .anchor-text.active .line {
        height: 1px;          /* Grosor de la línea */
        background-color: var(--highlight-color);
        width: 120px;          /* La longitud que quieras que alcance */
        opacity: 1;           /* Se hace visible */
    }

    .anchor-text.active .text {
        color: var(--highlight-color)
    }

    .sticky-header {
        display: none;
    }

    footer {
        grid-column: 2;
        max-width: 800px;
        width: 100%;
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}