@font-face{
    font-family:"Oswald";
    src:url("fonts/Oswald.ttf") format("truetype");
    font-weight:200 700;
    font-style:normal;
}

@font-face{
    font-family:"Geist";
    src:url("fonts/Geist.ttf") format("truetype");
    font-weight:100 900;
    font-style:normal;
}

:root{
    --bg:#F7F7F5;
    --header:#F7DE00;
    --text:#111111;
    --text-light:#6D6D6D;
    --line:#E7E7E7;
    --container:1280px;
    --logo-size:200px;
}

/* ---------- RESET ---------- */

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

img,
video{
    -webkit-user-drag:none;
    user-drag:none;
    -webkit-touch-callout:none;
}

html{
    scroll-behavior:smooth;
}

/* ---------- GENERAL ---------- */

body{
    font-family:"Geist",sans-serif;
    background:var(--bg);
    color:var(--text);
}

main{
    display:flow-root;
}

.container{
    width:90%;
    max-width:var(--container);
    margin:auto;
}

/* ---------- HEADER ---------- */

header{
    background:var(--header);
    padding:55px 0;
}

header .container{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
}

.logo{
    display:flex;
    text-decoration:none;
}

.logo video{
    height:var(--logo-size);
    width:auto;
    display:block;
}

.header-right{
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    align-items:flex-end;
    height:var(--logo-size);
}

.social-links{
    display:flex;
    gap:16px;
}

.social-links a{
    display:flex;
    align-items:center;
    justify-content:center;
}

.social-links img{
    width:32px;
    height:32px;
    display:block;
    transition:opacity .25s,transform .25s;
}

.social-links a:hover img{
    opacity:.5;
    transform:translateY(-2px);
}

nav{
    display:flex;
    gap:42px;
    padding-top:10px;
}

nav a{
    font-family:"Oswald",sans-serif;
    text-decoration:none;
    color:var(--text);
    font-size:32px;
    font-weight:700;
    letter-spacing:-.02em;
    opacity:1;
    transition:opacity .25s ease;
}

nav a:hover{
    opacity:.5;
}

/* ---------- NAV TOGGLE (hamburguesa) ---------- */

.nav-toggle{
    display:none;
    flex-direction:column;
    justify-content:center;
    gap:6px;
    width:32px;
    height:32px;
    background:none;
    border:none;
    padding:0;
    cursor:pointer;
    z-index:1100;
}

.nav-toggle span{
    display:block;
    width:100%;
    height:3px;
    background:var(--text);
    border-radius:2px;
    transition:transform .25s ease, opacity .25s ease;
}

body.nav-open .nav-toggle span:nth-child(1){
    transform:translateY(9px) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2){
    opacity:0;
}

body.nav-open .nav-toggle span:nth-child(3){
    transform:translateY(-9px) rotate(-45deg);
}

/* PROYECTOS */
html[data-page="index.html"] nav a[href="index.html"],
html[data-page^="proyecto"] nav a[href="index.html"]{
    opacity:.5;
}

/* LOGOFOLIO */
html[data-page="logofolio.html"] nav a[href="logofolio.html"]{
    opacity:.5;
}

/* SOBRE MÍ */
html[data-page="sobremi.html"] nav a[href="sobremi.html"]{
    opacity:.5;
}

/* CONTACTO */
html[data-page="contacto.html"] nav a[href="contacto.html"]{
    opacity:.5;
}

/* ---------- HERO ---------- */

.hero{
    padding:120px 0;
}

.hero h1{
    font-size:72px;
    margin-bottom:20px;
}

.subtitle{
    font-size:26px;
    color:var(--text);
}

/* ---------- PROJECTS ---------- */

#projects{
    width:100%;
}

#logofolio{
    width:100%;
}

#logofolio .projects-grid{
    gap:0;
}

.logo-item{
    display:flex;
    flex-direction:column;
    gap:24px;
}

.logo-image{
    position:relative;
    aspect-ratio:1/1;
    overflow:hidden;
    transition:box-shadow .3s ease;
}

.logo-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.logo-color{
    position:absolute;
    inset:0;
    opacity:0;
    transition:opacity .4s ease;
}

.logo-item:hover .logo-color{
    opacity:1;
}

.logo-item:hover .logo-image{
    box-shadow:0 10px 30px rgba(0,0,0,.12);
    z-index:2;
}

.logo-title{
    font-family:"Geist",sans-serif;
    font-size:14px;
    letter-spacing:.5px;
    text-transform:uppercase;
    color:var(--text-light);
    text-align:center;
    padding-bottom:32px;
}

.projects-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:0;
}

.project{
    position:relative;
    overflow:hidden;
    aspect-ratio:1/1;
    display:block;
}

.project img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    transition:transform .4s ease;
}

.project video{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    transition:transform .4s ease;
}

.overlay{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.80);
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:8px;
    opacity:0;
    transition:opacity .3s ease;
}

.overlay h3{
    font-family:"Oswald",sans-serif;
    color:white;
    font-size:22px;
    font-weight:700;
}

.overlay .category{
    font-family:"Oswald",sans-serif;
    color:white;
    font-size:18px;
    font-weight:400;
    letter-spacing:0px;
    text-transform:uppercase;
    opacity:.70;
}

.project:hover .overlay{
    opacity:1;
}

/* ---------- PROJECT PAGE ---------- */

.project-intro{
    display:grid;
    grid-template-columns:50% 50%;
    aspect-ratio:16/9;
}

.project-preview{
    width:100%;
    height:100%;
    position:relative;
    overflow:hidden;
}

.project-preview video,
.project-preview img{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.project-description{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    padding-left:90px;
    padding-right:calc((100vw - min(90vw,var(--container))) / 2);
    padding-top:90px;
}

.project-text{
    width:100%;
}

.project-description h1{
    font-family:"Oswald",sans-serif;
    font-size:72px;
    margin-bottom:30px;
    line-height: 1
}

.project-description p{
    font-size:22px;
    line-height:1.7;
}

.project-gallery{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:0;
    margin:90px 0 0;
}

.project-gallery img,
.project-gallery video{
    width:100%;
    aspect-ratio:1/1;
    object-fit:cover;
    display:block;
}

/* ---------- SOBRE MÍ ---------- */

.about-photo{
    width:100%;
    aspect-ratio:21/9;
    overflow:hidden;
}

.about-photo img{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center top;
    display:block;
}

.about-content{
    max-width:760px;
    margin:0 auto;
    text-align:center;
    padding:40px 0 80px;
}

.about-content .section-title{
    letter-spacing:0px;
    margin-bottom:16px;
}

.about-content p{
    font-family:"Geist",sans-serif;
    font-size:20px;
    line-height:1.8;
    color:var(--text);
}

.about-content p + p{
    margin-top:24px;
}

/* ---------- FOOTER ---------- */

footer {
    background:#EFEFEC;
    padding-bottom: 100px;
    padding-left: 0px;
    padding-right: 0px;
    padding-top: 60px;
    text-align: center;
    text-transform: none;
    width: 100%;
}

footer p {
    font-family: 'Geist', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #999; /* ajusta al color de texto que uses en el resto del sitio */
    letter-spacing: 0px;
}

/* ---------- BACK ARROW ---------- */

.back-arrow{
    position:sticky;
    top:32px;
    margin:32px 0 -80px 32px;
    width:48px;
    height:48px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--bg);
    border:1px solid var(--text);
    border-radius:10px;
    z-index:1000;
    text-decoration:none;
    transition:transform .25s ease, background-color .25s ease;
}

.back-arrow:hover{
    background:var(--header);
    transform:translateX(-4px);
}

.back-arrow svg{
    width:20px;
    height:20px;
    display:block;
}

.back-arrow svg path{
    stroke:var(--text);
    fill:none;
}

/* ---------- BACK TO TOP ARROW ---------- */

.back-arrow-top{
    position:fixed;
    top:auto;
    right:32px;
    bottom:32px;
    left:auto;
    margin:0;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .25s ease, visibility .25s ease, background-color .25s ease, transform .25s ease;
}

.back-arrow-top.visible{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
}

.back-arrow-top:hover{
    background:var(--header);
    transform:translateY(-4px);
}

.back-arrow-top svg{
    transform:rotate(90deg);
}

/* ---------- CONTACT ---------- */

#contact{
    padding:80px 0;
}

.section-title{
    font-family:"Oswald",sans-serif;
    font-size:56px;
    margin-bottom:60px;
}

.contact-form{
    max-width:640px;
    margin:0 auto;
    display:flex;
    flex-direction:column;
    gap:26px;
}

.form-field label{
    display:block;
    font-family:"Oswald",sans-serif;
    font-size:14px;
    letter-spacing:1px;
    text-transform:uppercase;
    color:var(--text-light);
    margin-bottom:8px;
}

.contact-form input,
.contact-form textarea{
    width:100%;
    padding:16px 18px;
    background:var(--bg);
    border:1px solid var(--text);
    border-radius:6px;
    font-family:"Geist",sans-serif;
    font-size:16px;
    color:var(--text);
    resize:none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder{
    color:var(--text-light);
}

.contact-form input:focus,
.contact-form textarea:focus{
    outline:none;
    border-color:var(--text);
    box-shadow:0 0 0 1px var(--text);
}

.btn-submit{
    align-self:flex-start;
    padding:16px 44px;
    background:var(--bg);
    border:1px solid var(--text);
    border-radius:10px;
    font-family:"Oswald",sans-serif;
    font-size:20px;
    letter-spacing:1px;
    color:var(--text);
    cursor:pointer;
    transition:background-color .25s ease;
}

.btn-submit:hover{
    background:var(--header);
}

.btn-submit:disabled{
    opacity:.5;
    cursor:default;
}

.form-status{
    font-family:"Geist",sans-serif;
    font-size:15px;
    margin-top:4px;
}

.form-status.success{
    color:#2e7d32;
}

.form-status.error{
    color:#c62828;
}

/* ---------- LIGHTBOX ---------- */

.lightbox{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.9);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:1000;
    cursor:pointer;
}

.lightbox.active{
    display:flex;
}

.lightbox-content img,
.lightbox-content video{
    max-width:90vw;
    max-height:90vh;
    width:auto;
    height:auto;
    display:block;
    object-fit:contain;
}

.lightbox-close{
    position:fixed;
    top:30px;
    right:40px;
    font-size:40px;
    color:white;
    cursor:pointer;
    z-index:1001;
}

.lightbox-nav{
    position:fixed;
    top:50%;
    transform:translateY(-50%);
    width:48px;
    height:48px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:transparent;
    border:1px solid rgba(255,255,255,.4);
    border-radius:10px;
    cursor:pointer;
    z-index:1001;
    transition:background-color .25s ease, border-color .25s ease;
}

.lightbox-nav:hover{
    background:var(--header);
    border-color:var(--header);
}

.lightbox-nav svg{
    width:20px;
    height:20px;
    display:block;
}

.lightbox-nav svg path{
    stroke:#ffffff;
    fill:none;
    transition:stroke .25s ease;
}

.lightbox-nav:hover svg path{
    stroke:var(--text);
}

.lightbox-prev{
    left:40px;
}

.lightbox-next{
    right:40px;
}

.project-gallery img,
.project-gallery video{
    cursor:pointer;
}

/* ---------- TRANSICIÓN ENTRE PÁGINAS ---------- */

body{
    opacity:0;
    transition:opacity .2s cubic-bezier(.4, 0, .2, 1);
}

body.page-transition-in{
    opacity:1;
}

body.page-transition-out{
    opacity:0;
}

/* =========================================
   ANIMACIÓN DE ENTRADA — PÁGINA DE PROYECTOS
   ========================================= */

/* Logo y navegación empiezan invisibles */
header .logo,
header nav,
header .social-links {
    opacity: 0;
}

/* Proyectos empiezan un poco más abajo e invisibles */
.projects-grid .project {
    opacity: 0;
    transform: translateY(55px);
}

/* Cuando la página está lista */
body.page-loaded header .logo,
body.page-loaded header nav,
body.page-loaded header .social-links {
    opacity: 1;
    transition: opacity .7s cubic-bezier(.22, 1, .36, 1);
}

body.page-loaded .projects-grid .project {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity .7s cubic-bezier(.22, 1, .36, 1),
        transform .7s cubic-bezier(.22, 1, .36, 1);
}

/* Entrada escalonada de izquierda a derecha */
body.page-loaded .projects-grid .project:nth-child(1) {
    transition-delay: .20s;
}

body.page-loaded .projects-grid .project:nth-child(2) {
    transition-delay: .27s;
}

body.page-loaded .projects-grid .project:nth-child(3) {
    transition-delay: .34s;
}

body.page-loaded .projects-grid .project:nth-child(4) {
    transition-delay: .41s;
}

body.page-loaded .projects-grid .project:nth-child(5) {
    transition-delay: .48s;
}

body.page-loaded .projects-grid .project:nth-child(6) {
    transition-delay: .55s;
}

body.page-loaded .projects-grid .project:nth-child(7) {
    transition-delay: .62s;
}

body.page-loaded .projects-grid .project:nth-child(8) {
    transition-delay: .69s;
}

body.page-loaded .projects-grid .project:nth-child(9) {
    transition-delay: .76s;
}

body.page-loaded .projects-grid .project:nth-child(10) {
    transition-delay: .83s;
}

body.page-loaded .projects-grid .project:nth-child(11) {
    transition-delay: .90s;
}

/* =========================================
   RESPONSIVE
   ========================================= */

/* ---------- TOUCH: overlay siempre visible ---------- */
/* En pantallas táctiles no existe :hover, así que el
   título/categoría de cada proyecto se muestra siempre,
   con un velo algo más suave que en desktop. */
@media (hover:none){
    .overlay{
        opacity:1;
        background:rgba(0,0,0,.55);
    }
}

/* ---------- TABLET (≤1024px) ---------- */

@media (max-width:1024px){

    :root{
        --logo-size:150px;
    }

    .nav-toggle{
        display:flex;
    }

    body.nav-open{
        overflow:hidden;
    }

    .header-right{
        position:fixed;
        top:0;
        right:0;
        height:100vh;
        width:min(320px,80vw);
        background:var(--header);
        flex-direction:column;
        justify-content:flex-start;
        align-items:flex-start;
        padding:110px 32px 32px;
        gap:40px;
        transform:translateX(100%);
        transition:transform .3s ease;
        z-index:1050;
    }

    body.nav-open .header-right{
        transform:translateX(0);
    }

    nav{
        flex-direction:column;
        gap:20px;
        padding-top:0;
    }

    nav a{
        font-size:28px;
    }

    .social-links{
        gap:16px;
    }

    .projects-grid{
        grid-template-columns:repeat(2,1fr);
    }

    .project-description{
        padding-left:60px;
        padding-top:60px;
        padding-right:60px;
    }

    .project-description h1{
        font-size:52px;
    }

    .project-description p{
        font-size:19px;
    }

    .project-gallery{
        margin:60px 0 0;
    }

    .section-title{
        font-size:48px;
    }

    .about-photo{
        aspect-ratio:16/9;
    }

    .back-arrow-top{
        position:fixed;
        top:auto;
        right:32px;
        bottom:32px;
        left:auto;
        margin:0;
    }
}

/* ---------- MÓVIL (≤640px) ---------- */

@media (max-width:640px){

    :root{
        --logo-size:110px;
    }

    .header-right{
        width:min(240px,70vw);
    }

    /* Header */
    header{
        padding:32px 0;
    }

    nav a{
        font-size:24px;
    }

    .social-links img{
        width:26px;
        height:26px;
    }

    /* Grids de proyectos y logofolio */
    .projects-grid{
        grid-template-columns:1fr;
    }

    .logo-item{
        gap:16px;
    }

    /* Página de proyecto individual */
    .project-intro{
        grid-template-columns:1fr;
        aspect-ratio:auto;
    }

    .project-preview{
        aspect-ratio:4/3;
    }

    .project-description{
        padding:48px 24px;
    }

    .project-description h1{
        font-size:36px;
    }

    .project-description p{
        font-size:17px;
    }

    .project-gallery{
        grid-template-columns:1fr;
        margin:48px 0 0;
    }

    /* Sobre mí */
    .about-photo{
        aspect-ratio:4/3;
    }

    .about-content{
        padding:32px 0 60px;
    }

    .about-content .section-title{
        font-size:36px;
    }

    .about-content p{
        font-size:17px;
    }

    /* Contacto */
    .section-title{
        font-size:36px;
        margin-bottom:36px;
    }

    .contact-form{
        gap:18px;
    }

    .btn-submit{
        width:100%;
        text-align:center;
    }

    /* Flechas */
    .back-arrow{
        top:16px;
        margin:16px 0 -64px 16px;
        width:40px;
        height:40px;
    }

    .back-arrow svg{
        width:16px;
        height:16px;
    }

    .back-arrow-top{
        top:auto;
        right:16px;
        bottom:16px;
        left:auto;
        margin:0;
    }

    /* Lightbox */
    .lightbox-prev{
        left:12px;
    }

    .lightbox-next{
        right:12px;
    }

    .lightbox-nav{
        width:40px;
        height:40px;
    }

    .lightbox-close{
        top:16px;
        right:16px;
        font-size:32px;
    }

    /* Footer */
    footer{
        padding-top:40px;
        padding-bottom:60px;
    }

    footer p{
        font-size:18px;
    }
}