/* --- GOOGLE FONTS & VARIABLES --- */
:root {
    --font-family: 'Montserrat', sans-serif;
    --font-script: 'Dancing Script', cursive;
    --primary-color: #2c3e50;
    --secondary-color: #7f8c8d;
    --background-color: #ffffff;
    --section-bg-color: #f8f9fa;
    --border-color: #ecf0f1;
    --accent-color: #3498db;
}

/* --- BASIC RESET & GLOBAL STYLES --- */
body.no-scroll {
    overflow: hidden;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--primary-color);
    line-height: 1.7;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

body.is-visible {
    opacity: 1;
}

.container {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- PAGE TRANSITION --- */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}
.is-exiting .page-transition-overlay {
    transform: translateY(0);
}

/* === HEADER STYLES === */

/* --- Main Header Container --- */
.main-header {
    position: relative;
    min-height: 50vh;
    padding: 2rem 0 7rem 0;
    display: flex;
    align-items: center;
    color: #ffffff;
    background-image: linear-gradient(rgba(211, 203, 93, 0.6), rgba(46, 96, 68, 0.6)),  url('images/header.jpeg');
    background-size: cover;
    background-position: center;
}

/* --- Container & Layout inside Header --- */
.main-header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    position: static;
}

.logo {
    position: absolute;
    top: 2.5rem;
    left: 5%;
}

.logo img {
    max-height: 100px;
}

.main-nav {
    display: block;
    position: absolute;
    top: 2.5rem;
    right: 5%;
}

/* --- "Ghost" Button Style --- */
.main-nav a {
    font-weight: 600;
    padding: 10px 30px;
    border: 2px solid #ffffff;
    border-radius: 50px;
    background-color: transparent;
    color: #ffffff;
    transition: all 0.3s ease;
}

.main-nav a:hover {
    background-color: #ffffff;
    color: var(--primary-color);
}

/* --- Centered Text Styling --- */
.header-center {
    gap: 1rem;
}

.header-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    background: linear-gradient(90deg, #FFFFFF, #6efaa9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.6);
    text-stroke: 1px rgba(0, 0, 0, 0.6);
    text-shadow: none;
}

.header-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.9);
}

.invitation-text {
    font-size: clamp(2rem, 3.5vw, 2.2rem); /* Giảm cỡ chữ của phần chữ thường */
    font-weight: 500;
    text-align: center; /* Căn giữa để phù hợp với layout mới */
    text-transform: uppercase;
    color: #f0f0f0; /* Màu sáng cho phần chữ thường */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-top: 5rem;
    line-height: 1.5;
}

/* --- Scroll Down Arrow --- */
.scroll-arrow {
    display: block;
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    animation: bounce 2s infinite;
}

/* --- Mobile Nav Toggle (always hidden) --- */
.mobile-nav-toggle {
    display: none !important;
}

/* --- SCROLL ANIMATIONS --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- PORTFOLIO SECTION --- */
.portfolio-section { padding: 5rem 0; }
.portfolio-section:first-of-type { padding-top: 3rem; }

/* --- THIẾT KẾ LẠI TIÊU ĐỀ CÁC MỤC (HIỆN ĐẠI HƠN) --- */

.section-title {
    display: flex;
    flex-direction: column; /* Xếp icon và chữ theo chiều dọc */
    align-items: center;
    gap: 0.75rem; /* Khoảng cách giữa icon, chữ và đường kẻ */
    margin: 0 auto 5rem auto; /* Tăng khoảng cách dưới cho thoáng */
    color: var(--primary-color); /* Màu chữ xám đậm chủ đạo */
    position: relative;
}

/* Trang trí cho icon */
.section-title i {
    font-size: 2rem; /* Icon to và rõ hơn */
    color: var(--accent-color); /* Dùng màu nhấn (xanh dương) cho icon */
    line-height: 1;
}

/* Trang trí cho chữ */
.section-title span {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px; /* Tăng khoảng cách ký tự cho sang trọng */
    line-height: 1;
    border: 2px solid var(--primary-color); /* Tạo viền màu xám đậm, dày 2px */
    padding: 0.6rem 1.8rem;
}

/* Thêm đường kẻ trang trí bên dưới */
.section-title::after {
    content: '';
    display: block;
    width: 70px; /* Độ dài đường kẻ */
    height: 2px; /* Độ dày đường kẻ */
    background-color: var(--accent-color); /* Cùng màu với icon */
    margin-top: 0.75rem; /* Khoảng cách từ chữ xuống đường kẻ */
}

.section-title i::after {
    display: none;
}


.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    
    /* --- PHẦN VIỀN KÉP MỚI --- */
    
    /* 1. Viền trong: màu xám nhạt */
    border: 3px solid var(--border-color); 
    
    /* 2. Viền ngoài (dùng box-shadow) + bóng đổ mặc định */
    box-shadow: 0 0 0 2px var(--primary-color), 0 4px 15px rgba(0,0,0,0.05);
    
    /* 3. Transition để hiệu ứng mượt mà */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.portfolio-item:hover {
    /* Hiệu ứng nhấc lên và bóng đổ đậm hơn khi hover */
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);

    /* --- PHẦN LẬT MÀU VIỀN KHI HOVER --- */
    
    /* 1. Viền trong đổi sang màu nhấn */
    border-color: #118f3b; 
    
    /* 2. Viền ngoài cũng đổi sang màu nhấn (cập nhật lại box-shadow) */
    box-shadow: 0 0 0 2px var(--accent-color), 0 8px 25px rgba(0,0,0,0.1);
}

.portfolio-item img {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.4s ease;
    background-color: var(--border-color);
}

.portfolio-item:hover img { transform: scale(1.05); }

.item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    padding: 2rem 1rem 1rem 1rem;
    font-weight: 600;
    text-align: center;
    transition: opacity 0.3s ease;
}

/* --- FOOTER --- */
.main-footer {
    background-color: var(--section-bg-color);
    color: var(--primary-color);
    padding: 3rem 0;
}

.footer-content {
    text-align: center;
    margin-bottom: 2rem;
}

.footer-logo-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.footer-logo-container img {
    max-width: 500px;
    height: auto;
}

.footer-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem 2.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.footer-info p {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin: 0;
}

.footer-info i {
    margin-right: 8px;
    width: 15px;
    text-align: center;
}

.footer-info a {
    color: var(--primary-color);
    font-weight: 500;
}

.footer-info a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* --- KEYFRAMES --- */
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-15px); } 60% { transform: translateY(-10px); } }

/* === RESPONSIVE DESIGN (Consolidated) === */

@media (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}



/* === PHẦN NÀY ĐI KÈM VỚI HEADER GỐC === */
.invitation-text span {
    display: block; /* Giúp cụm từ tự động xuống dòng */
    font-size: clamp(2.2rem, 7vw, 3.5rem); /* Cỡ chữ LỚN cho phần nổi bật */
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.2;
    padding-bottom: 0.5rem;
    text-shadow: none; /* Bỏ bóng mờ cũ để dùng hiệu ứng mới */
}


/* === WELCOME SCREEN (Phiên bản đã hoàn thiện) === */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

#welcome-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: center;
    padding: 2rem;
    padding-top: 5vh;
    
    background-size: cover;
    background-position: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#welcome-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}
#welcome-screen.hidden { opacity: 0; visibility: hidden; }
.welcome-content {
    text-align: center;
    color: #fff;
    width: 100%;
    max-width: 900px;
    position: relative;
    z-index: 2;
}
.welcome-text-container {
    background-color: rgba(255, 255, 255, 0.5);
    display: inline-block;
    opacity: 0;
    padding: 1rem 1.5rem;
    /* clip-path đã được xóa */
    filter: drop-shadow(0 0 20px rgb(118, 118, 118));
    animation: fadeIn 1s ease-out 0.3s forwards;
}
.welcome-main-title {
    color: #FFFFFF;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.welcome-subtitle {
    font-family: 'Montserrat', sans-serif;
    ccolor: #ffffff; /* Chữ màu trắng đồng nhất */
    font-weight: 600; /* Tăng độ đậm (semi-bold) */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6); 
    font-size: clamp(0.5rem, 1.5vw, 1rem);
    text-transform: uppercase;
    margin-top: -2rem;
    letter-spacing: 2px
    animation: slideInLeft 0.8s ease-out 0.8s forwards;
}

/* Lời mời được thiết kế lại */
.welcome-invitation {
    display: inline-flex; /* Căn chỉnh icon và chữ trên một hàng */
    align-items: center;
    padding: 12px 25px;
    margin: 1.5rem 0;
    font-weight: 600; /* Chữ đậm hơn */
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    border-radius: 50px; /* Bo tròn các góc */
    position: relative;
    
    /* Nền đen trong suốt 50% */
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);

    /* Bỏ animation cũ, chỉ giữ lại hiệu ứng xuất hiện */
    opacity: 0;
    animation: slideInRight 0.8s ease-out 0.8s forwards;
}

.welcome-invitation span {
    font-size: 1.1rem; 
    background-color: transparent; 
    padding: 0;
    border-radius: 0;
    display: block;

    /* Thêm khoảng cách giữa chữ và icon */
    margin: 0 15px; 
}

/* Định dạng cho 2 icon ngôi sao */
.welcome-invitation i.fa-star {
    color: #FFD700; /* Màu vàng kim cho ngôi sao */
    font-size: 0.9em;
    /* Hiệu ứng nhấp nháy nhẹ nhàng */
    animation: icon-pulse 2.5s infinite ease-in-out;
}

/* Vùng chứa các nút hạng mục */
.welcome-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    /* 1. Giới hạn chiều cao tối đa của khu vực này */
    max-height: 60vh; /* Chỉ cho phép cao tối đa bằng 45% chiều cao màn hình */

    /* 2. Tự động hiển thị thanh cuộn dọc khi cần */
    overflow-y: auto; 

    /* 3. Thêm một khoảng đệm nhỏ để thanh cuộn không che mất nội dung */
    padding-right: 10px; 
    scrollbar-width: none; /* Ẩn thanh cuộn trên các trình duyệt Firefox */
}
/* Ẩn thanh cuộn trên các trình duyệt WebKit */
.welcome-grid::-webkit-scrollbar {
    display: none;
}

.welcome-grid a i { 
    margin-right: 8px; 
    font-size: 1em; 
}

/* === CSS CHO BỐ CỤC WELCOME SCREEN NÂNG CAO (PHIÊN BẢN CUỐI CÙNG) === */

/* 1. VÙNG CHỨA CHÍNH */
#welcome-categories {
    width: 100%;
    max-width: 1200px; /* THAY ĐỔI: Mở rộng chiều ngang */
    
    /* SỬA LỖI 3: Giúp cuộn hết danh sách */
    flex: 1; /* Cho phép co giãn theo chiều cao còn lại */
    min-height: 0; /* Bắt buộc phải có để flex: 1 hoạt động đúng */
    
    overflow-y: auto;
    padding: 1rem 10px 1rem 1.5rem;

    /* SỬA LỖI 4: Ẩn thanh cuộn */
    scrollbar-width: none; 
}
#welcome-categories::-webkit-scrollbar {
    display: none;
}

/* 2. BỐ CỤC CHO MỖI SECTION */
.welcome-section {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.welcome-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.welcome-section--reverse {
    flex-direction: row-reverse;
}

/* 3. KHỐI TIÊU ĐỀ */
.welcome-section__title-box {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.2);
    transition: border-color 0.3s ease, background-color 0.3s ease;
    min-width: 220px;
}
.welcome-section__title-box i {
    font-size: 2rem;
    color: #FFD700;
    margin-bottom: 1rem;
}
.welcome-section__title-box h3 {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
}

/* 4. ĐƯỜNG NỐI */
.welcome-section__connector {
    width: 50px;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.4); /* Thay đổi thành màu nền đồng nhất */
    transition: background-color 0.3s ease; /* Đổi transition cho phù hợp */
}

/* 5. KHỐI LƯỚI NÚT BẤM */
.welcome-section__grid-box {
    flex: 1;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.2);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.welcome-grid-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* 6. NÚT BẤM VÀ CÁC HIỆU ỨNG */
/* SỬA LỖI 1: Bố cục nút mới (Icon trên, chữ ngang dưới) */
.welcome-grid-group a {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-weight: 300;
    text-align: center; 
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column; /* Icon trên, chữ dưới */
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
    padding: 15px 10px; /* Tăng padding trên dưới */
    font-size: 0.9rem;
    border-radius: 12px;
    background-color: rgba(90, 104, 120, 0.7);
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 90px;
    white-space: nowrap; /* Đảm bảo chữ luôn trên 1 hàng */
}
.welcome-grid-group a i { 
    margin: 0 0 10px 0; /* Khoảng cách giữa icon và chữ */
    font-size: 1.5em; /* Icon to hơn một chút */
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands";
    font-weight: 900;
}

/* Hiệu ứng viền sáng xoay tròn */
.welcome-grid-group a::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(transparent, rgba(255, 255, 255, 0.3), transparent 30%);
    animation: spin-border 4s linear infinite;
}

/* Hiệu ứng vệt sáng vàng khi hover */
.welcome-grid-group a::after {
    content: '';
    position: absolute;
    z-index: -2;
    top: 0; left: -150%;
    width: 100%; height: 100%;
    transition: left 0.7s ease;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.4), transparent);
}

/* 7. HIỆU ỨNG TƯƠNG TÁC KHI HOVER */
.welcome-section:hover .welcome-section__title-box,
.welcome-section:hover .welcome-section__grid-box {
    border-color: #FFD700;
}
.welcome-section:hover .welcome-section__connector {
    background-color: #FFD700;
}
.welcome-grid-group a:hover {
    transform: translateY(-4px); 
    background-color: rgba(44, 62, 80, 0.85);
}
.welcome-grid-group a:hover::after {
    left: 150%;
}

/* 1. Kiểu dáng chung của nút */
.welcome-grid a {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    margin: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease;

    /* Kiểu dáng viền sáng */
    padding: 12px 24px;
    font-size: 0.7rem;
    transform: scale(1, 1.5);
    border-radius: 12px;
    border: none;
    box-shadow: none;

    /* Nền và chữ */
    background-color: rgba(90, 104, 120, 0.7);
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);

    outline: 1.5px solid rgba(90, 104, 120, 0.7);
    outline-offset: 2px;
}

/* 2. Lớp viền sáng (trạng thái mặc định) */
.welcome-grid a::before {
    content: '';
    position: absolute;
    z-index: -1; /* Nằm dưới nút */
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent 30%
    );
    animation: spin-border 4s linear infinite;
}

/* 3. Lớp ánh vàng kim (chỉ kích hoạt khi hover) */
.welcome-grid a::after {
    content: '';
    position: absolute;
    z-index: 2; /* Nằm trên nút */
    top: 0;
    left: -150%; /* Ẩn ở bên trái */
    width: 100%;
    height: 100%;
    transition: left 0.7s ease;

    /* Hiệu ứng ánh sáng vàng kim */
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.4), transparent);
}

/* 4. Kích hoạt các hiệu ứng khi hover */
.welcome-grid a:hover {
    /* Hiệu ứng nhấc lên và tối nền */
    transform: translateY(-4px); 
    background-color: rgba(44, 62, 80, 0.85);
}

.welcome-grid a:hover::after {
    left: 150%; /* Di chuyển vệt sáng vàng kim qua phải */
}


#close-welcome-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    z-index: 10;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}
#close-welcome-btn:hover {
    opacity: 1;
    transform: scale(1.1) rotate(90deg);
}

/* === KEYFRAMES === */
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rotate-border { to { --angle: 360deg; } }
@keyframes gradient-move {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* --- CSS cho Video Nền --- */
#bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0; /* Đặt video nằm dưới lớp phủ và nội dung */
    object-fit: cover; /* Đảm bảo video lấp đầy không gian */
}
.welcome-logo {
    max-width: 350px;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto;
    position: relative;
    bottom: 10px;
}
@keyframes icon-pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

/* ================================================
   === RESPONSIVE DESIGN (CHO ĐIỆN THOẠI) ===
   ================================================ */

@media (max-width: 768px) {
    /* --- Styles cho Header trên Mobile --- */
    #welcome-screen {
        justify-content: flex-start; /* Thay đổi từ căn giữa sang căn lề trên */
        ppadding: 5vh 2rem 2rem;
    }
    .main-header {
        min-height: auto;
        padding: 4rem 0 5rem 0;
        background-position: center 30%;
    }
    .invitation-text {
        font-size: clamp(19px, 4vw, 15px);
        margin-top: 4rem;
    }
    .invitation-text span {
        font-size: 3em; 
        letter-spacing: normal;
    }
    .logo {
        top: 2.0rem;
    }
    .main-nav {
        top: 0.5rem; 
        right: 3%; 
    }
    .main-nav a {
        padding: 4px 16px;
        font-size: 0.8rem;
    }
    .logo img {
        max-height: 100px;
    }
    .header-center {
        gap: 0.75rem;
    }
    .header-title {
        font-size: clamp(1.8rem, 9vw, 2.3rem);
    }
    .header-subtitle {
        font-size: 0.7rem;
        letter-spacing: 3px;
    }
    .scroll-arrow {
        bottom: 0rem;
        font-size: 1.5rem;
    }

    /* --- Styles cho các section khác trên Mobile --- */
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .section-title {
        margin-bottom: 2.5rem;
        padding: 0.5rem 1rem;
    }
    .section-title span {
        font-size: clamp(0.8rem, 3.5vw, 1rem); 
        letter-spacing: 1px;
        white-space: nowrap;
    }
    .main-footer {
        padding: 2rem 0;
    }
    .footer-logo-container img {
        max-width: 250px;
    }
    .footer-info {
        flex-direction: column;
        gap: 0.8rem;
        align-items: center;
    }
    .portfolio-section {
        padding: 3rem 0;
    }
    .portfolio-section:first-of-type {
        padding-top: 2rem;
    }

   /* --- SỬA LỖI CHO MÀN HÌNH CHÀO MỪNG (WELCOME SCREEN) --- */
    .welcome-text-container {
        display: block;
        width: auto;
        max-width: 93%;
        /* THAY ĐỔI: Giảm padding để khung nhỏ lại */
        padding: 1.5rem 0.8rem; 
        margin: 0 auto 2rem auto; 
    }

    .welcome-logo {
        max-width: 250px; 
        margin: 0 auto 1.5rem auto; /* Tăng khoảng cách dưới logo */
    }

    .welcome-subtitle {
        /* Sửa cỡ chữ cho dễ đọc */
        font-size: 0.8rem; 
        white-space: nowrap;
        line-height: 1.5;
    }
    
    .welcome-invitation {
        max-width: 90%;
        padding: 10px 15px;
    }

    .welcome-invitation span {
        margin: 0 8px;
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .welcome-invitation i.fa-star {
        font-size: 0.8em;
    }
    
    .welcome-section,
    .welcome-section--reverse {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 1.5rem;
    }
    .welcome-section__connector {
        align-self: center;
        width: 2px;
        height: 30px;
        background-color: rgba(255, 255, 255, 0.4);
        
    }
    .welcome-section__title-box,
    .welcome-section__grid-box {
        min-width: 100%;
        padding: 1rem;
    }
    .welcome-section__title-box i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    .welcome-section__title-box h3 {
        font-size: 1rem;
    }
    /* --- PHẦN TINH CHỈNH MỚI BẮT ĐẦU TỪ ĐÂY --- */

    /* 1. Chuyển lưới thành 1 cột duy nhất để các nút rộng ra */
    /* CSS cho lựa chọn 2 (2 cột) */
    .welcome-grid-group {
        grid-template-columns: repeat(2, 1fr); /* Đặt lại thành 2 cột */
        gap: 0.75rem;
    }

    .welcome-grid-group a {
        flex-direction: column; /* Icon trên, chữ dưới */
        justify-content: center;
        text-align: center;
        padding: 10px 5px;
        min-height: 80px; 
        font-size: 0.75rem; 
        white-space: normal; /* Cho phép chữ xuống dòng */
    }

    .welcome-grid-group a i {
        margin-bottom: 8px; /* Đặt lại khoảng cách dưới cho icon */
        margin-right: 0; 
    }

    .welcome-grid a {
        /* Kế thừa giao diện mới, chỉ cần chỉnh lại font và padding */
        font-size: 0.7rem;
        padding: 14px 10px;
    }
    
}
/* --- Định nghĩa cho animation quay của viền sáng --- */
@keyframes spin-border {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ----- BỔ SUNG CODE CHO NỀN BẢN VẼ KỸ THUẬT ----- */

/* Đảm bảo body có position: relative để pseudo-element hoạt động đúng */
body {
    position: relative; 
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--primary-color);
    line-height: 1.7;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* Tạo lớp nền ảo nằm sau toàn bộ nội dung */
body::before {
    content: '';
    position: fixed; /* Giúp nền đứng yên khi người dùng cuộn trang */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Đặt lớp nền này nằm dưới cùng */
    
    /* --- PHẦN QUAN TRỌNG NHẤT --- */
    
    /* 1. Đường dẫn đến ảnh */
    background-image: url('images/bg.jpg'); 
    
    /* 2. Lặp lại ảnh nếu ảnh là một họa tiết nhỏ (pattern) */
    background-repeat: repeat; 
    
    /* 3. Độ mờ của ảnh nền (quan trọng!) */
    opacity: 0.30; /* Chỉ 5%, làm cho nền rất tinh tế */
}
