/* Fondo general */
body {
    background-color: #000;
    color: #fff;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

html { scroll-behavior: smooth; }

/* HEADER */
/* HEADER FIJO */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    transition: all 0.25s ease;
    height: auto;
    background: #000E75;
    backdrop-filter: blur(10px);
}


/* TOP BAR NORMAL */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 40px;
    transition: padding 0.3s ease;
}

/* LOGO NORMAL */
.logo img {
    height: 70px;
    width: auto;
    transition: height 0.3s ease;
}



/* ESTADO COLAPSADO */
.header-small .top-bar {
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hide subtitle when header is collapsed */
.header-small .logo img {
    height: 40px; /* reduced logo size when scrolled */
}

/* When header is collapsed, reduce top-bar padding to make it a compact bar */
.main-header.header-small .top-bar {
    padding: 8px 20px;
}

/* Make header transparent when collapsed */
.main-header.header-small {
    background: transparent !important;
    backdrop-filter: none !important;
}

/* Site hero (title/subtitle) moved outside header */
.site-hero {
    background-color: #000E75;
    position: relative;
    width: 100%;
    min-height: calc(0vh - var(--header-height, 0px)) ;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 0px 0px;
    padding-bottom: 0px;
    color: #fff;
    margin: 0 0 3vh 0;
}
.site-hero .main-subtitle {
    margin-top: -300px !important;
    font-size: clamp(20px, 3.5vw, 27px);
    margin-bottom: -10px;
    font-weight: normal;
    letter-spacing: 10px !important;
    pointer-events: auto;
}

/* Make header hero image smaller and responsive */
.site-hero img {
    width: 80%; /* reduce image to ~50% of container width */
    max-width: 6000px; /* cap size on large screens */
    height: auto;
    display: block;
    margin-top: -200px; /* nudge image up to reduce gap with title */
}


/* MENÚ */
.main-menu ul {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}

/* Estado normal */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 2002;
    transition: transform 0.3s ease;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: rgb(255, 255, 255);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mostrar hamburguesa cuando el header está colapsado */
.header-small .hamburger {
    display: flex;
}

/* ANIMACIÓN: hamburguesa → X */
.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}


.header-small .main-menu {
    display: none;
}

.main-menu.open {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
    position: absolute;
    top: 100%;
    right: 20px;
    background: rgb(0, 0, 0);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 2002;}

/* Fondo difuminado al abrir menú */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(6px);
    background: rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1200; /* MÁS BAJO QUE EL HEADER */
}

.menu-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.main-menu a {
    position: relative;
    padding: 6px 14px;      /* controla el espacio alrededor del texto */
    display: inline-block;
}

/* CÍRCULO/ÓVALO AJUSTADO AL ENLACE */
.main-menu a::after {
    content: "";
    position: absolute;
    inset: 0;               /* ocupa todo el área del enlace */
    border: 2px solid #fff;
    border-radius: 999px;   /* lo hace redondeado tipo píldora/círculo */
    opacity: 0;
    transform: scale(0.2);  /* empieza pequeño */
    transition: opacity 0.25s ease, transform 0.25s ease;
}



.main-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    transition: opacity 0.2s ease;
}

.main-menu a:hover {
    opacity: 0.6;
}

/* Wrapper for subtitle to guarantee horizontal centering inside header */
.subtitle-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-menu a:hover::after {
    opacity: 1;
    transform: scale(1);    /* crece hasta rodear el texto */
}

.carousel {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 420px; /* Ajusta según tus imágenes verticales */
    margin: 40px auto;
    overflow: visible;
}
.carousel .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Wrapper que contiene video + caption */
.slide-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    pointer-events: auto; /* allow hover/events on child video */
}

/* El video mantiene tu estilo original */
.carousel video.carousel-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 35%;
    height: auto;
    transform: translate(-50%, -50%) scale(0.7);
    object-fit: cover;
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
    z-index: 2; /* el caption irá encima */
}

.caption {
    position: absolute;
    bottom: -110px; /* lo baja fuera del área del video */
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    font-size: 18px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 5;
    pointer-events: none;
}

/* Solo visible en el slide activo */
.carousel video.carousel-video.active + .caption {
    opacity: 1;
}

/* Video inserted into carousel should match image sizing/positioning */
.carousel video.carousel-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 35%;
    height: auto;
    transform: translate(-50%, -50%) scale(0.7);
    object-fit: cover;
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.carousel video.carousel-video.active:hover {
    transform: translate(-50%, -50%) scale(1.15);
    transition: transform 0.4s ease-out;
    cursor: pointer;
}

/* Video state rules to match image behavior */
.carousel video.carousel-video.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    z-index: 3;
}

.carousel video.carousel-video.prev {
    opacity: 0.8;
    transform: translate(-150%, -50%) scale(0.8);
    z-index: 2;
}

.carousel video.carousel-video.next {
    opacity: 0.8;
    transform: translate(50%, -50%) scale(0.8);
    z-index: 2;
}

/* Carousel arrow buttons */
.carousel .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}


.carousel .prev-btn { left: -70px; }
.carousel .next-btn { right: -70px; }


/* Contenedor de contenido con transición suave */
.contenido {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease;
    height: 0;
    overflow: hidden;
}

.contenido.visible {
    opacity: 1;
    visibility: visible;
    height: auto;
    overflow: visible;
}

/* Estilo de la tabla */
.TRABAJOS {
    position: relative;
    margin: 0 auto 20px auto; /* centrado */
    text-align: center;
}


.TRABAJOS th {
    cursor: pointer;
    padding: 15px 40px;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
    overflow: hidden;
}

/* El óvalo */
.TRABAJOS th::after {
    content: "";
    position: absolute;
    inset: 0;               /* ocupa todo el área del th */
    border: 2px solid #fff;
    border-radius: 999px;   /* píldora/óvalo */
    opacity: 0;
    transform: scale(0.2);  /* empieza pequeño */
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: -1;
}

/* Hover: animar igual que el menú superior */
.TRABAJOS th:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* Activo: mostrar contorno sólido */
.TRABAJOS th.active::after {
    opacity: 1;
    transform: scale(1);
}

/* Texto activo */
.TRABAJOS th.active {
    color: white;
}

/* Highlight animado */
.tab-highlight {

    top: 0;
    left: 0;
    background: black;
    border-radius: 6px;
    z-index: 1;

}

/* Footer layout: white bar with logo left and contact + socials right */
.main-footer {
    background: #ffffff;
    color: #000000;
    padding: 20px 24px;
}
.main-footer .footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.main-footer .footer-logo {
    height: 56px;
    width: auto;
    display: block;
}
.main-footer .footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.footer-contact { display:flex; align-items:center; gap:10px; font-weight:600; }
.footer-icon { display:inline-flex; }
.footer-icon svg { width:18px; height:18px; display:block; }
.footer-email { color: #000; text-decoration: none; }
.footer-socials { margin-top:8px; display:flex; gap:14px; }
.social-link { color: #000; text-decoration: none; font-size:15.5px; opacity:0.9; }
.social-link:hover { opacity:1; text-decoration:underline; }

@media (max-width: 720px) {
    .main-footer .footer-inner { flex-direction: column; align-items: center; text-align:center; }
    .main-footer .footer-right { align-items: center; }
}

/* Small author line below footer */
.footer-author {
    text-align: left;
    color: rgba(0,0,0,0.6);
    font-size: 12px;
    margin-top: 8px;
    letter-spacing: 1px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px; /* align with footer padding */
}

/* About section */
.about-section {
    max-width: 900px; 
    margin: 36px auto;
    padding: 20px;
}

.about-title {
    font-size: 56px;
    text-align: left;
    margin: 0;
}

.about-card {
    display: block;
    margin-top: 0;
}
.about-card::after { content: ""; display: table; clear: both; }

.about-image {
    float: left;
    width: 272px; /* slightly narrower */
    margin-right: 80px; /* moderate spacing to the right */
    margin-left: 0px; /* nudge slightly more to the left */
}
.about-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.about-text {
    /* allow text to occupy more horizontal space */
    display: block;
    background: transparent;
    padding: 10px 24px 10px 0;
    color: #fff;
    font-size: 18px;
    line-height: 1.6;
}

/* Responsive: stack image above text on small screens */
@media (max-width: 720px) {
    .about-card {
        flex-direction: column;
        text-align: center;
    }

    .about-image img {
        width: 160px;
        height: 160px;
    }
}

/* Contact form styles (minimal, underline-only inputs) */
.contact-section {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}
.contact-title {
    font-size: 40px;
    margin-bottom: 18px;
    color: #fff;
}

.contact-row {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}
.contact-field { flex: 1; display: flex; flex-direction: column; }
.contact-field.full { flex: 1 1 100%; }
.contact-field label { font-size: 14px; color: #bbb; margin-bottom: 6px; }
.contact-field input,
.contact-field select,
.contact-field textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.6);
    color: #fff;
    padding: 8px 6px;
    outline: none;
    font-size: 16px;
}
.contact-field input::placeholder,
.contact-field textarea::placeholder { color: rgba(255,255,255,0.45); }
.contact-field select { appearance: none; -webkit-appearance: none; }
.contact-submit {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
}

.form-success {
    margin-top: 12px;
    color: #8fd19e;
    font-weight: 600;
}

@media (max-width: 720px) {
    .contact-row { flex-direction: column; }
    .contact-title { text-align: center; }
}

/* Validation / placeholder-only select styling */
.contact-field .field-error {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 6px;
    display: none;
}

.contact-field input.invalid,
.contact-field textarea.invalid,
.contact-field select.invalid {
    border-bottom-color: #ff6b6b;
}

.contact-field select.empty {
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* Make description line closer */
.contact-field.full label { margin-bottom: 4px; }
.contact-field.full textarea { min-height: 80px; }

.motion-graphics {
    width: 100%;
    max-width: 1200px;
    margin: 120px auto;
    padding: 0 20px;
}

.mg-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: left;
}

.mg-grid {
    display: flex;
    gap: 84px; /* slightly increased horizontal spacing between videos (+20px) */
    justify-content: center;
}

.mg-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* captions and content align to left */
    position: relative;
    max-width: 540px; /* prevent items from stretching too wide */
}

.design-graphics {
    width: 100%;
    max-width: 1200px;
    margin: 130px auto;
    padding: 0 0px;
}

.design-grid {
    align-items: flex-start;
    display: flex;
    gap: 150px; 
    justify-content: center;
}

.design-item {
    width: 50%;
    height: auto;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    position: relative;
    max-width: 540px; 
}

.design-item img {
    width: 100%;
    max-width: 300px;
    height: 400px; /* o el valor que quieras */
    object-fit: cover;
    display: block;
}

.apps-grid {
    align-items: flex-start;
    display: flex;
    gap: 20px; 
    justify-content: center;
}

.apps-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    position: relative;
    max-width: 100px; 
}

.apps-item img {
    width: 100%;
    max-width: 300px;
    height: auto; 
    object-fit: cover;
    display: block;
}


.mg-item video {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.4s ease;
}

.mg-item video:hover {
    transform: scale(1.05);
}

@media (max-width: 900px) {
    .mg-grid { flex-direction: column; gap: 20px; }
    .mg-item { max-width: 100%; }
}

.mg-caption {
    margin-top: 15px;
    font-size: 18px;
    text-align: center;
    opacity: 0.9;
}

/* Overlay caption inside the video container, bottom-left */
.mg-item { position: relative; }
.mg-item .mg-caption {
    position: static;
    margin: 12px 0 0 0;
    text-align: left;
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: #fff;
    pointer-events: auto;
}
.mg-caption-title {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.15;
}
.mg-caption-sub {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 6px;
}

/* Subtle play/pause icon overlay */
.mg-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 180ms ease, transform 220ms ease;
    pointer-events: none;
    z-index: 5;
}
.mg-item .play-icon.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.mg-item .play-icon svg { width: 22px; height: 22px; fill: #fff; }

/* 📱 OPTIMIZACIÓN GLOBAL PARA MÓVIL */
@media (max-width: 720px) {

    /* Reset de overflow global */
    html, body {
        overflow-x: hidden;
        max-width: 100%;
    }

    /* HEADER */
    .top-bar {
        padding: 10px 16px;
    }

    .logo img {
        height: 40px;
    }

    /* HERO */
    .site-hero {
        margin-top: 60px;
        padding: 0 10px;
    }

    .site-hero img {
        width: 70%;
        margin-top: -60px;
    }

    .site-hero .main-subtitle {
        margin-top: -100px !important;
        font-size: 14px;
        letter-spacing: 4px !important;
    }

    /* BOTONES VIDEO / DISEÑO */
    .TRABAJOS th {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* MOTION GRAPHICS */
    .motion-graphics {
        padding: 0 10px;
        margin: 40px auto;
    }

    .mg-grid {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }

    .mg-item img,
    .mg-item video {
        max-width: 85%;
        height: auto;
    }

    /* DESIGN GRAPHICS */
    .design-graphics {
        padding: 0 10px;
        margin: 60px auto;
    }

    .design-grid {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }

    .design-item img {
        max-width: 75%;
        height: auto;
        object-fit: contain;
    }

    /* APPS GRID */
    .apps-grid {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .apps-item {
        max-width: 140px;
    }

    /* ABOUT */
    .about-section {
        padding: 10px;
        margin: 30px auto;
    }

    .about-title {
        font-size: 30px;
        text-align: center;
    }

    .about-image {
        width: 150px;
        margin: 0 auto 16px auto;
        float: none;
    }

    .about-text {
        font-size: 15px;
        text-align: center;
        padding: 0;
    }

    /* CONTACT */
 .contact-section {
        padding: 10px;
        margin: 30px auto;
    }

    .contact-title {
        font-size: 28px;
        text-align: center;
    }

    .contact-row {
        flex-direction: column;
        gap: 12px;
    }

    /* FOOTER */
    .main-footer .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .footer-author {
        text-align: center;
        padding-left: 0;
    }
        .site-hero {
        margin-top: 0;
        padding-top: 120px; /* espacio exacto para compensar el header */
    }

    .site-hero img {
        margin-top: -40px; /* ajusta la imagen para que quede como en PC */
    }

    .site-hero .main-subtitle {
        margin-top: -60px !important;
    }
}