/* VARIABLES - VARIABLES LIGTH MODE */
:root {
    /* Colores generales */
    --bg-color: #faf8f2;
    --text-color: #0f0f0f;
    --border-color: #222;
    --icon-filter: invert(0);
    /* iconos negros */
    --grid-color: rgba(0, 0, 0, 0.05);

    /* Íconos */
    --icon-filter: brightness(0);

    /* Tipografía */
    --font-main: 'Poppins', sans-serif;
    --font-display: 'Lora', serif;

    /* Tamaños base */
    --fs-base: 1rem;
    --fs-large: 1.25rem;
    --fs-h1: 2.2rem;
    --fs-h2: 2rem;
}

/* VARIABLES DARK-MODE */
.dark-mode {
    --bg-color: #0f0f0f;
    --text-color: #ffffff;
    --border-color: #ffffff;
    --icon-filter: invert(1) brightness(1.2) contrast(1.1);

    --grid-color: rgba(255, 255, 255, 0.05);
}

.theme-icon {
    filter: var(--icon-filter);
    transition: filter .3s ease;
}

/* CONFIGURACIÓN INICIAL */
/* Pantallas móvil */
html {
    scroll-behavior: smooth;
    font-size: 20px;
    /*base real para rem en celulares*/
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    font-family: var(--font-main, 'Poppins', sans-serif);
    font-size: var(--fs-base, 1.6rem);

    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color .3s ease, color .3s ease;

    /* Fondo con cuadrícula usando la variable */
    background-image:
        linear-gradient(to right, var(--grid-color) 1.5px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1.5px, transparent 1px);
    background-size: 4rem 4rem;
    /* usa rem-friendly */
    animation: gridMove 20s linear infinite;
}

/* Dark mode: solo sobreescribimos la variable */
body.dark-mode {
    /* cuadricula blanca suave en dark mode */
    --grid-color: rgba(255, 255, 255, 0.03);
}

@keyframes gridMove {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 40px 40px;
    }
}

/* Pantallas Desktop */
@media (min-width: 1024px) {
    html {
        scroll-behavior: smooth;
        font-size: 16px;
        /* base real para rem */
    }

    body {
        margin: 0;
        display: flex;
        flex-direction: column;
        min-height: 100vh;

        font-family: var(--font-main, 'Poppins', sans-serif);
        font-size: var(--fs-base, 1.6rem);

        background-color: var(--bg-color);
        color: var(--text-color);
        transition: background-color .3s ease, color .3s ease;

        /* Fondo con cuadrícula usando la variable */
        background-image:
            linear-gradient(to right, var(--grid-color) 1.5px, transparent 1px),
            linear-gradient(to bottom, var(--grid-color) 1.5px, transparent 1px);
        background-size: 6rem 6rem;
        /* usa rem-friendly */
        animation: gridMove 20s linear infinite;
    }

    /* Dark mode: solo sobreescribimos la variable */
    body.dark-mode {
        /* cuadricula blanca suave en dark mode */
        --grid-color: rgba(255, 255, 255, 0.03);
    }

    @keyframes gridMove {
        from {
            background-position: 0 0;
        }

        to {
            background-position: 40px 40px;
        }
    }

}

/* HEADER Y NAVBAR */

/* Pantalla para móviles */

.logo img {
    padding-top: 0.5rem;
    padding-left: 0.5rem;
    width: 3rem;
}

@media (max-width: 1023px) {
    .nav-links {
        background-color: var(--bg-color);
        border: 1px solid var(--border-color);

        position: absolute;
        top: 0;
        right: 0.8rem;
        list-style: none;
        display: none;
        flex-direction: column;
        align-items: center;
        /* Esto centra horizontalmente */
        gap: 1rem;
        padding: 1rem;
        padding-top: 3rem;

    
    }

    .nav-links.active {
        display: flex;
    }
}

.nav-links a {
    text-decoration: none;
    font-family: var(--font-main);
    color: var(--text-color);
}

.hamburger img {
    width: 2.1rem;
    position: absolute;
    top: 1rem;
    right: 1rem;

}

/* Botón de modo oscuro */
#theme-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

#theme-toggle img {
    width: 28px;
    height: 28px;
    filter: var(--icon-filter);
    transition: transform .2s ease, filter .2s ease;
}


/* Pantallas desktop */
@media (min-width: 1024px) {
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.25rem 10rem;
        transition: background-color .3s ease;
    }

    .logo img {
        width: 70px;
    }

    .logo img:hover {
        opacity: 0.70;
    }

    /* Lista horizontal */
    .nav-links {
        display: flex;
        gap: 2.5rem;
        list-style: none;
        margin: 0;
        padding: 0;
        align-items: center;
    }

    /* Links */
    .nav-links a {
        position: relative;
        text-decoration: none;
        color: var(--text-color);
        padding-bottom: .3rem;
        font-weight: 500;
        transition: color 0.3s ease;
    }

    /* Línea animada */
    .nav-links a::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 0;
        width: 0%;
        height: 2px;
        background-color: var(--text-color);
        transform: translateX(-50%);
        transition: width 360ms cubic-bezier(.2, .9, .2, 1);
    }

    .nav-links a:hover::after {
        width: 100%;
    }

    /* Botón de modo oscuro */
    #theme-toggle {
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
    }

    #theme-toggle img {
        width: 28px;
        height: 28px;
        filter: var(--icon-filter);
        transition: transform .2s ease, filter .2s ease;
    }

    #theme-toggle img:hover {
        transform: scale(1.15);
    }

    main {
        flex: 1;
    }

    .hamburger {
        display: none;
    }
}


/* HERO SECTION  */
/* Pantalla para móviles */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

.hero h1 {
    font-size: var(--fs-h1);
    margin: 1rem 0 0;
    text-align: center;
}

.hero p {
    text-align: center;
    font-size: var(--fs-large);
    margin-bottom: 2rem;
}

/* Foto con borde dinámico */
.mifoto {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: border-color .3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Íconos del LinkTree */
.link-tree {
    display: flex;
    gap: 40px;
}

.link-tree img {
    width: 30px;
    height: 30px;
    filter: var(--icon-filter);
    transition: transform .2s ease, filter .2s ease;
}

.link-tree img:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2)) var(--icon-filter);
}



/* HERO SECTION -> DESKTOP */
@media (min-width: 1024px) {
    .hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: var(--fs-h1);
        margin: 1rem 0 0;
    }

    .hero p {
        font-size: var(--fs-large);
        margin-bottom: 1rem;
    }

    /* Foto con borde dinámico */
    .mifoto {
        width: 200px;
        height: 200px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--border-color);
        transition: border-color .3s ease;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    }

    /* Íconos del LinkTree */
    .link-tree {
        display: flex;
        gap: 40px;
    }

    .link-tree img {
        width: 30px;
        height: 30px;
        filter: var(--icon-filter);
        transition: transform .2s ease, filter .2s ease;
    }

    .link-tree img:hover {
        transform: scale(1.2);
        filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2)) var(--icon-filter);
    }
}


/* MRN FONDO GRANDE*/
/* MRN FONDO GRANDE -> Móviles */

#mrn {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 800;
    opacity: 0.2;
    color: rgba(170, 98, 98, 0.336);
    -webkit-text-stroke: 2px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 60%;
    left: 1%;
    user-select: none;
    pointer-events: none;
}

/* MRN FONDO GRANDE -> DESKTOP */
@media (min-width: 1024px) {
    #mrn {
        font-family: var(--font-display);
        font-size: 12rem;
        font-weight: 900;
        opacity: 0.2;
        color: rgba(170, 98, 98, 0.336);
        -webkit-text-stroke: 2px rgba(0, 0, 0, 0.1);
        position: absolute;
        top: 40%;
        left: 5%;
        user-select: none;
        pointer-events: none;
    }
}

/* FOOTER -> DESKTOP */

footer {
    font-size: 0.5rem;
    text-align: center;
    padding: 0.5rem;
}

@media (min-width: 1024px) {
    footer {
        text-align: center;
        padding: 1rem;
        font-size: 0.9rem;
    }
}