/* ================= CSS VARIABLES & FONTS ================= */
:root {
    --text-color: #151515; 
    --text-light: #ffffff; 
    --bg-light: #ffffff;  
    --bg-green: #ff3c00;  
    --bg-dark:  #161616;  
    --bg-peach: #fd6e16;  
    --bg-blue:  #3700cf;  
    --bg-lavender:#292929;
    --font-headline: 'SFProUltraSoft', 'Inter', sans-serif;
    --font-body:  'SFProUltraSoft', 'Inter', sans-serif;
    
    --font-jura: "Jura", sans-serif;
    --font-contact: 'ClashDisplay', sans-serif; 
}

@font-face {
    font-family: 'SFProUltraSoft';
    src: url('fonts/SFProUltraSoft-ExtraExpandedHeavy.otf') format('opentype');
    font-weight: normal; 
    font-style: normal;
}

@font-face {
    font-family: 'ClashDisplay';
    src: url('fonts/ClashDisplay-Medium.otf') format('opentype');
    font-weight: normal; 
    font-style: normal;
}

.dm-serif-display-regular {
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.2em;
}

.dm-serif-display-regular-italic {
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  font-style: italic;
}

.font-clash {
    font-family: var(--font-contact);
    text-transform: uppercase;
}

/* ================= BẠN CÓ THỂ TỰ CHỈNH CHỮ FILMMAKER Ở ĐÂY ================= */
.filmmaker-text {
    font-weight: 600;
    /* Khoảng cách chữ đã giảm thêm 50% (từ 0.03em xuống 0.015em). Bạn có thể thay đổi số này. */
    letter-spacing: 0.01em; 
}

/* ================= RESET ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
a { text-decoration: none; color: inherit; }

/* ================= TYPOGRAPHY ================= */
body {
    font-family: var(--font-body); 
    -webkit-font-smoothing: antialiased;
    color: var(--text-color);
    line-height: 1;
    background: #161616;
    overflow-x: hidden; 
}

h1, h2, h3 {
    font-family: var(--font-headline); 
    text-transform: uppercase; 
    font-weight: normal; 
}

/* ================= COLORS ================= */
.bg-light { background-color: var(--bg-light); color: var(--text-color); }
.bg-green { background-color: var(--bg-green); color: var(--text-color); }
.bg-peach { background-color: var(--bg-peach); color: var(--text-light); }
.bg-blue  { background-color: var(--bg-blue);  color: var(--text-light); }
.bg-lavender { background-color: var(--bg-lavender); color: var(--text-light); }
.bg-dark { background-color: var(--bg-dark); color: var(--text-light); }

.bg-dark .proj-category, .bg-blue .proj-category, .bg-lavender .proj-category, .bg-peach .proj-category { color: #aaa; }
.bg-dark .proj-link a, .bg-blue .proj-link a, .bg-lavender .proj-link a, .bg-peach .proj-link a { border-bottom-color: var(--text-light); }

/* ================= TOP NAV ============== === */
#main-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 29px; 
    font-family: var(--font-headline); 
    font-size: 15px;
    letter-spacing: 0.02em;
    font-weight: 500;
    /* Đổi từ fixed sang absolute để cuộn dính theo block Hero */
    position: absolute; 
    width: 100%;
    top: 0;
    z-index: 1000;
    color: white;
}

.nav-col.right-align { text-align: right; }

/* ================= HERO SECTION ================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center; 
    justify-content: center; 
    position: relative; 
}

.hero h1 {
    font-size: clamp(1.25rem, 3vw, 2.75rem); 
    font-weight: 500;
    line-height: 1.05; 
    letter-spacing: -0.03em; 
    z-index: 2; 
    text-align: center; 
    transition: color 0.3s ease; 
}

.hero h1:hover { color: #ff3c00; }

.scroll-arrow {
    position: absolute;
    bottom: 29px; 
    /* PHỤC HỒI LẠI TRUNG TÂM NHƯ CŨ TRÊN DESKTOP */
    left: 50%;
    transform: translateX(-50%); 
    font-size: 56px; 
    color: var(--text-light);
    animation: blinkArrow 1.5s infinite ease-in-out;
    cursor: pointer; 
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes blinkArrow {
    0%, 100% { color: #ffffff; opacity: 1; }
    50% { color: #ff3c00; opacity: 1; } 
}

.hero-contact {
    position: absolute;
    bottom: 29px; 
    left: 29px;   
    z-index: 3;
    font-size: 17px;
    line-height: 1.3;
    font-family: var(--font-contact); 
    font-optical-sizing: auto;
    font-weight: normal; 
    font-style: normal;
}

.hero-contact a:hover { color: #ff3c00; }

.hero-avatar {
    position: absolute;
    bottom: 29px; 
    right: 29px;
    width: 15.75vw; 
    max-width: 189px; 
    min-width: 126px; 
    aspect-ratio: 1 / 1; 
    overflow: hidden;
    z-index: 1; 
}

.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ================= PROJECTS ================= */
.project-item {
    min-height: 110vh; 
    display: grid;
    grid-template-columns: 1fr 2.5fr 1fr; 
    align-items: center; 
    position: relative; 
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.project-item.bg-lavender {
    min-height: 90vh; 
}

.proj-details {
    grid-column: 2 / 3; 
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-track {
    position: absolute; 
    top: 0; 
    bottom: 15%; 
    left: 29px; 
    padding-top: 29px; 
    z-index: 10; 
    pointer-events: none; 
}

.title-group {
    position: sticky;
    top: 29px; 
    pointer-events: auto; 
}

.proj-role {
    font-family: var(--font-contact);
    font-size: 18px;
    font-weight: 800; 
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.proj-details h2 {
    font-size: clamp(1.25rem, 3vw, 2.75rem); 
    font-weight: 500;
    line-height: 1.05; 
    letter-spacing: -0.03em; 
}

.proj-link { margin-top: 15px; }
.proj-link a {
    font-size: 18px;
    font-weight: 500;
    border-bottom: 1px solid var(--text-color); 
    padding-bottom: 2px;
    text-transform: uppercase;
}

.media-container {
    width: 59.5%; 
    aspect-ratio: 16 / 9; 
    background-color: #000;
    overflow: hidden;
    position: relative;
}

.media-container iframe, .media-container img {
    width: 100%; height: 100%; object-fit: cover; border: none; display: block;
}

/* ================= VIDEO GALLERY DOTS ================= */
.video-gallery-wrapper {
    width: 59.5%; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.video-gallery-wrapper .media-container {
    width: 100%; 
}

.video-slide {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.video-slide.active {
    display: block;
}

.slider-dots {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: var(--text-color);
    border-radius: 50%;
    opacity: 0.3;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    opacity: 1;
    transform: scale(1.3);
}

.dot:hover {
    opacity: 0.7;
}

.slider-btn { display: none; }

/* ================= FLASH GALLERY (CẮT THẲNG - 6 ẢNH) ================= */
.flash-gallery { position: relative; }
.flash-gallery img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; 
    animation: cutEffect 12s infinite step-end; 
}
.flash-gallery img:nth-child(1) { animation-delay: 0s; }
.flash-gallery img:nth-child(2) { animation-delay: 2s; }
.flash-gallery img:nth-child(3) { animation-delay: 4s; }
.flash-gallery img:nth-child(4) { animation-delay: 6s; }
.flash-gallery img:nth-child(5) { animation-delay: 8s; }
.flash-gallery img:nth-child(6) { animation-delay: 10s; }

@keyframes cutEffect {
    0% { opacity: 1; }
    16.666% { opacity: 0; }
    100% { opacity: 0; }
}

/* ================= BEFORE/AFTER SLIDER (VIKKI BANK) ================= */
.ba-container {
    position: relative;
    overflow: hidden;
    left: 5%;
    top: 50px;
}
.ba-container img {
    width: 100%;
    height: auto;
    object-fit: contain;
    pointer-events: none;
}
.img-base {
    position: relative; 
    z-index: 1;
    display: block;
}
.img-overlay {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.ba-slider {
    position: absolute;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 100%;
    background: transparent;
    outline: none;
    margin: 0;
    top: 0;
    left: 0;
    z-index: 10;
    cursor: ew-resize;
}
.ba-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 100vh;
    background: transparent;
    cursor: ew-resize;
}
.ba-slider::-moz-range-thumb {
    width: 40px;
    height: 100vh;
    background: transparent;
    cursor: ew-resize;
    border: none;
}
.ba-slider-line {
    position: absolute;
    top: 0;
    left: 45%; 
    bottom: 0;
    width: 2px;
    background: #ffffff;
    z-index: 5;
    pointer-events: none;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ba-slider-button {
    width: 46px;
    height: 46px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #151515;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}
.ba-slider-button svg {
    margin: 0 -2px; 
}


/* ------------------------------------------------------------- */
/* OVERRIDE KHUNG TRÀN VIỀN: LAPTOP, CELLPHONES, AL PUBG, VIKKI  */
/* ------------------------------------------------------------- */

.project-item.bg-dark .media-container.flash-gallery,
.freestyle-media,
.ba-container {
    width: 83.3%; 
}

.project-item.bg-dark .media-container.flash-gallery,
.freestyle-media,
.ba-container {
    aspect-ratio: auto; 
    height: auto; 
    background-color: transparent; 
}

.project-item.bg-dark .media-container.flash-gallery img,
.freestyle-media img {
    width: 100%; 
    height: auto; 
    object-fit: contain; 
}

.project-item.bg-dark .media-container.flash-gallery img:first-child {
    position: relative;
}

.featured-media {
    width: 100.3%; 
    aspect-ratio: 16 / 9;
    background-color: transparent; 
    position: relative;
}

.featured-media iframe {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100% !important; 
    width: calc(100% * (9 / 16) * (9 / 16)) !important; 
    aspect-ratio: 9 / 16; 
}

.project-item.bg-dark .media-container.flash-gallery {
    width: 75%;
}

.ba-container {
    width: 63.75%;
}

.al-sect .freestyle-media {
    width: 66.6%;
}

/* ================= FOOTER ================= */
.footer {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    padding: 29px; 
    font-family: var(--font-contact); 
    font-optical-sizing: auto;
    font-weight: normal; 
    font-style: normal;
    font-size: 14px;
}

.footer-brand {
    font-family: var(--font-headline);
    font-size: 20px;
    margin-bottom: 10px;
}

/* ĐÃ ĐỔI: Chữ Website inspired giờ nằm ở thẻ .footer-right nên được canh qua sát lề phải */
.footer-right { text-align: right; }

.footer-title { 
    font-family: var(--font-headline);
    font-size: 20px; 
    color: #ffffff; 
    margin-bottom: 10px; 
}

.footer a:hover { opacity: 0.5; }

/* Tăng thông số margin-bottom để chỉnh khoảng cách 15% giữa 2 hàng */
.footer-contact-info a:first-child {
    display: inline-block;
    margin-bottom: 3px; 
}

/* ================= UTILS ================= */
.section-up-arrow {
    position: absolute;
    bottom: 29px; 
    left: 50%;
    right: auto;
    transform: translateX(-50%); 
    font-size: 56px; 
    color: var(--text-light); 
    animation: blinkArrow 1.5s infinite ease-in-out;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================= MOBILE RESPONSIVE ================= */
@media (max-width: 768px) {

    /* === ĐÁNH DẤU: FIX LỖI DƯ KHOẢNG TRỐNG BÊN PHẢI TRÊN ĐIỆN THOẠI === */
    html, body {
        overflow-x: hidden !important;
        width: 100%;
        max-width: 100%;
        position: relative;
    }

    .hero {
        align-items: flex-start; /* Đẩy lên cao */
        justify-content: flex-start; 
        /* Đã gỡ lề padding trái/phải ở thẻ cha để lùi việc chỉnh sửa vào bên trong thẻ h1 */
        padding: 280px 0px 29px 0px; 
    }
    
    .hero h1 { 
        /* === ĐÁNH DẤU: FONT SIZE CỤM CHỮ HERO TRÊN ĐIỆN THOẠI === */
        /* Giảm nhỏ lại 15% (Từ 2.6rem -> 2.2rem) */
        font-size: 2.4rem; 
        
        text-align: left !important; 
        width: 100%;
        display: block;
        margin: 0; 
        
        /* === ĐÁNH DẤU: PADDING CỤM CHỮ HERO TRÊN ĐIỆN THOẠI === */
        /* Bạn có thể dễ dàng thay đổi con số 29px này để tinh chỉnh lề cho chữ */
        padding-left: 29px;
        padding-right: 29px;
    }

    .footer { 
        display: flex; 
        flex-direction: column; /* Sắp xếp theo chiều dọc */
        
        /* === ĐÁNH DẤU: CANH LỀ FOOTER TRÊN ĐIỆN THOẠI === */
        text-align: left; 
        
        padding: 29px; 
        gap: 30px; /* Khoảng cách giữa 2 phần Contact và Lê Ninh */
    }
    
    /* Vị trí phần CONTACT (Bây giờ nó là footer-left vì đã tráo HTML) */
    .footer-left {
        order: 1; /* Đưa lên trên */
    }
    
    /* Vị trí phần Website inspired (Bây giờ nó là footer-right) */
    .footer-right { 
        order: 2; /* Đẩy xuống dưới */
        text-align: left; /* Canh trái */
        margin-top: 0; 
    }
    
    .project-item { 
        padding: 29px; 
        grid-template-columns: 1fr; 
        align-items: stretch; 
    }
    
    .proj-details { 
        grid-column: 1; 
        width: 100%;
        height: 100%; 
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    .title-track {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        padding-top: 0;
        pointer-events: auto;
        width: 100%;
    }
    
    .title-group { 
        position: relative; 
        top: auto; 
        width: 100%; 
        text-align: left; 
        margin-bottom: 40px; 
    }
    
    .proj-details h2 {
        font-size: 2.2rem; 
        font-weight: 500;
        line-height: 1.05; 
    }
    
    .proj-role {
        font-size: 14px; 
        margin-bottom: 10px;
    }
    
    .proj-link { 
        display: flex; 
        justify-content: flex-start; 
    }
    
    .proj-link a {
        font-size: 17px; 
    }
    
    .media-container { 
        width: 100%; 
        margin: auto 0; 
    }
    
    /* === ĐÁNH DẤU: THU NHỎ HÌNH MEDIA CELLPHONES 15% TRÊN ĐIỆN THOẠI === */
    .cellphones-sect .freestyle-media {
        width: 120%;
        margin-left: 15%; 
        margin-top: auto;   
        margin-bottom: auto; 
        flex-shrink: 0; 
        transform: scale(0.85); /* Thu nhỏ 15% */
        transform-origin: top left; /* Giữ góc trên bên trái */
    }

    .project-item.bg-dark .media-container.flash-gallery {
        width: 108%;
        margin-left: -1%; 
        margin-top: auto;   
        margin-bottom: auto; 
        flex-shrink: 0; 
        
        /* === ĐÁNH DẤU: CHO LAPTOP CAO LÊN 15% TRÊN ĐIỆN THOẠI === */
        transform: translateY(-15%);
    }

    .ba-container {
        width: 91.8%;
        margin-left: 4.1%; 
        margin-top: auto;   
        margin-bottom: auto; 
        flex-shrink: 0; 
        
        /* === ĐÁNH DẤU: DỊCH HÌNH VIKKI QUA TRÁI 9% VÀ CAO LÊN 15% TRÊN ĐIỆN THOẠI === */
        /* Translate(X, Y) -> X là trái phải, Y là lên xuống. -15% đẩy nó lên trên */
        transform: translate(-9%, -15%);
        
        /* Xóa bóng của toàn bộ khu vực container Vikki nếu có */
        box-shadow: none !important;
        filter: none !important;
    }

    /* === ĐÁNH DẤU: XÓA ĐƯỜNG BÓNG MỜ DỌC THEO THANH LINE VÀ NÚT KÉO TRÊN ĐIỆN THOẠI === */
    .ba-slider-line, .ba-slider-button {
        box-shadow: none !important;
        filter: none !important;
    }

    .project-item.bg-blue {
        margin-top: -15%; /* Nhích cao hơn 15% */
    }

    .al-sect .freestyle-media {
        width: 96%;
        margin-left: -5%; 
        margin-top: auto;   
        margin-bottom: auto; 
        flex-shrink: 0; 
    }
    
    .video-gallery-wrapper {
        width: 100%; 
        margin: auto; 
        
        /* === ĐÁNH DẤU: THU NHỎ VIDEO VIMEO PHIM NGẮN 10% TRÊN ĐIỆN THOẠI === */
        transform: scale(0.95);
        transform-origin: center;
        margin-bottom: 60%;
    }

    /* === ĐÁNH DẤU: LÀM VIDEO VIMEO COMMERCIAL SHORT VIDEO TO HƠN 20% TRÊN ĐIỆN THOẠI === */
    .featured-media {
        width: 143.75%;
        margin-left: 0; 
        position: relative;
        left: 72%;
        transform: translateX(-50%) scale(1.09); /* To hơn 20%, giữ căn giữa */
        margin-top: auto;
        margin-bottom: auto;
        flex-shrink: 0;
    }
    
    .hero-contact { 
        bottom: 50px; 
        left: 17px; 
        font-size: 16px; 
    }
    
    .hero-avatar { 
        display: none;
    }
    
    .scroll-arrow { 
        display: none;
    }

    .section-up-arrow { 
        bottom: 29px; 
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        font-size: 40px; 
    }
}