/*
 * @file styles.css
 * @description Main stylesheet for the portfolio website.
 */

/* ==========================================================================
   1. GLOBAL SETTINGS & VARIABLES
   ========================================================================== */
:root {
    --open-duration: 0.8s;
    --close-duration: 0.6s;
    --easing-curve: cubic-bezier(0.42, 0, 0.58, 1);
    --scroll-transition-duration: 0.05s; /* Adjusted for smoother transitions */
    --menu-item-width: 10.4vw; /* 11.56vw * 0.9 */
    --tab-width: 3.1vw; /* 3.44vw * 0.9 */
    --menu-gap: 1.04vw; /* 1.15vw * 0.9 */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
    font-size: 1vw; /* Base font size for em conversion */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    filter: url(#film-grain);
    pointer-events: none;
    z-index: 999;
}

/* ==========================================================================
   2. MAIN LAYOUT SECTIONS
   ========================================================================== */

#body1 {
    height: 100vh;
    background-color: #000;
    position: relative;
    overflow: hidden;
}

#introduce {
    position: relative;
    height: 100vh;
    background-color: #fff;
}

#Dashboard {
    position: relative;
    height: 100vh;
    background-color: #000;
}

#Manifest {
    position: relative;
    height: 100vh;
    background-color: #000;
}

#Project {
    position: relative;
    height: 100vh;
    background-color: #fff;
    display: flex; /* Sử dụng Flexbox để căn chỉnh */
    flex-direction: column; /* Sắp xếp các mục theo chiều dọc */
    justify-content: center;
    align-items: center;
    gap: 5vh; /* Khoảng cách giữa tiêu đề và nội dung */
    overflow: hidden; /* Ngăn ảnh lớn tràn ra ngoài */
}

/* --- 4.3. Project Section --- */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 3em;
    color: #3D3C42;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.1);
}

#project-content-wrapper {
    display: flex;
    flex-direction: column; /* Xếp các mục theo chiều dọc */
    align-items: center;
    justify-content: center;
    gap: 2vh; /* Giảm khoảng cách một chút cho phù hợp với layout dọc */
    text-align: center; /* Căn giữa chữ */
}

#Blog {
    height: 100vh;
    background-color: #fff;
}

#contact {
    position: relative;
    height: 70vh;
    background-color: #111;
    color: #F6F6F6;
    display: flex;
    align-items: flex-start; /* Căn các mục con lên trên cùng */
    justify-content: space-evenly; /* Phân bố không gian đều cho các mục con */
    padding: 1.15vw 2vw 0; /* Thêm padding trên, giữ padding ngang */
    box-sizing: border-box;
}

/* --- 4.4. Contact Separator --- */
#contact-separator {
    position: absolute;
    left: 50%;
    top: 20%; /* Điều chỉnh vị trí bắt đầu */
    width: 2px;
    height: 60%; /* Chiều cao bằng 60% khu vực contact */
    background-color: #444;
    border-radius: 1px;
}

/* --- 4.4. Contact Form --- */
#contact-form {
    width: 35vw; /* Đặt chiều rộng cho form */
    flex-shrink: 0; /* Ngăn form bị co lại */
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
}

.form-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    color: #F6F6F6;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 1vh 0;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.1);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-family: "Times New Roman", Times, serif;
    font-size: 1.1em;
    margin-bottom: 0.5vh;
    color: #a0a0a0;
}

#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form textarea {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 0.3vw;
    padding: 1vh 1vw;
    color: #F6F6F6;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
    resize: none; /* Ngăn người dùng thay đổi kích thước textarea */
}

#contact-form input[type="text"]:focus,
#contact-form input[type="email"]:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: #F6F6F6;
    box-shadow: 0 0 5px rgba(246, 246, 246, 0.3);
}

.form-submit-btn {
    margin-top: 1vh;
    align-self: flex-start; /* Căn nút sang trái */
}

/* --- 4.5. Contact Info --- */
#contact-info {
    width: 35vw;
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
    align-items: flex-start; /* Căn các mục sang trái */
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

.info-list li {
    display: flex;
    align-items: center;
    gap: 1vw;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1.1em;
    color: #a0a0a0;
}

.info-list li svg {
    width: 1.5em;
    height: 1.5em;
    stroke: #F6F6F6;
    stroke-width: 1.5;
    fill: none;
    flex-shrink: 0;
}

#social-links {
    display: flex;
    gap: 1.15vw;
    margin-top: 4vh; /* Khoảng cách với danh sách thông tin */
}

.social-btn {
    color: #a0a0a0;
    transition: color 0.3s, transform 0.3s;
}

.social-btn:hover {
    color: #F6F6F6;
    transform: scale(1.1);
}

.social-btn svg {
    width: 2.5em;
    height: 2.5em;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
}

#project-fox-image {
    max-width: 20vw; /* Điều chỉnh lại kích thước ảnh cho cân đối hơn */
    height: auto;
    filter: drop-shadow(0 1vw 1.5vw rgba(0,0,0,0.15));
}

#project-update-text {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.5em;
    color: #3D3C42;
    line-height: 1.6;
    /* Thay đổi border từ bên trái sang bên trên */
    border-top: 3px solid rgba(0,0,0,0.1);
    padding-top: 2vh;
    margin-top: 2vh;
}

/* ==========================================================================
   3. MAJOR COMPONENTS
   ========================================================================== */
/* --- 3.1. Intro Screen --- */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    z-index: 1000;
    opacity: 1;
    transition: opacity 1.5s ease-out, visibility 1.5s;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: opacity, visibility;
    transform: translateZ(0);
}

#intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#intro-content {
    text-align: center;
    color: white;
}

#typewriter-text {
    font-size: 2.5em;
    font-weight: 300;
    white-space: pre-wrap;
}

#typewriter-text::after {
    content: "";
    display: inline-block;
    width: 0.15em;
    height: 1em;
    background-color: white;
    margin-left: 0.2em;
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

#wait-text {
    font-size: 1.5em;
    font-weight: 300;
    color: yellow;
    margin-top: 1.85vh; /* 20px -> 1.85vh */
}

/* --- 3.2. Main Box (Hero Section Content) --- */
#main_box {
    position: absolute;
    top: 2.04vh; /* 22px -> 2.04vh */
    right: calc(22 / 1920 * 100vw);
    bottom: 2.04vh; /* 22px -> 2.04vh */
    left: calc(22 / 1920 * 100vw);
    border-radius: calc(22 / 1920 * 100vw);
    background-color: #F6F6F6;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ink {
    width: 35.26vw;
    height: 62.69vh; /* 35.26vw -> 62.69vh */
    min-width: 15.625vw;
    min-height: 27.78vh; /* 15.625vw -> 27.78vh */
    border-radius: 50%;
    box-sizing: border-box;
    position: absolute;
    z-index: 1;
    overflow: hidden;
    will-change: transform, opacity; /* Tối ưu hóa cho hiệu ứng cuộn */
    transform: translateZ(0);
}

.ink .gooey-area {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    filter: url('#goo');
}

.ink .ball {
    position: absolute;
    background: black;
    border-radius: 50%;
    animation-name: move;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
    will-change: transform;
    transform: translateZ(0);
}

@keyframes move {
    from {
        transform: translate(var(--x-from), var(--y-from)) scale(1);
    }
    to {
        transform: translate(var(--x-to), var(--y-to)) scale(1.1);
    }
}

#canvas-container {
    position: fixed; /* Changed from absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    will-change: transform, left;
    transform: translateZ(0);
}

#canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#text-block-container {
    position: absolute;
    bottom: 2.04vh; /* 22px -> 2.04vh */
    left: 1.15vw; /* 22px / 1920px */
    padding: 1.04vw 1.56vw 1.04vw 8.2vw; /* Adjusted padding */
    display: inline-block; 
    box-sizing: border-box;
    z-index: 3;
    will-change: opacity, transform;
    transform: translateZ(0);
}

.first-line {
    line-height: 1;
}

.large-p {
    font-family: 'Times New Roman', Times, serif; 
    font-size: 11.1em; /* Changed from 12vw */
    font-weight: 700;
    color: #000000;
    position: absolute;
    left: 0.52vw; 
    top: -5.16vh; /* -2.9vw -> -5.16vh */
    line-height: 1;
}

.name-text {
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    font-weight: 700;
    color: #000000;
    letter-spacing: 0.078vw;
}

.second-line {
    font-size: 2.0em;
    color: #3D3C42;
    font-weight: 300; 
    letter-spacing: 0.052vw;
    margin-top: 1.78vh; /* 1vw -> 1.78vh */
}

#role-text::after {
    content: "|";
    animation: blink 1s infinite;
    font-weight: 100;
}

/* --- 3.3. New Rectangle (Right side of Hero) --- */
#new-rectangle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%); 
    height: 45vh;
    background-color: rgba(255, 0, 0, 0.0);
    right: 1.15vw;
    width: 28vw;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 2.04vh; /* 1.15vw -> 2.04vh */
    padding-bottom: 2.04vh; /* 1.15vw -> 2.04vh */
    box-sizing: border-box;
    will-change: opacity, transform;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}
/* --- 3.4. Gooey Menu --- */
#menu_box {
    position: fixed;
    top: 0;
    right: 0;
    width: 50.92vw; /* 56.58vw * 0.9 */
    height: 9.17vh; /* 5.16vw -> 9.17vh */
    background-color: black;
    border-radius: 0 0 0 1.04vw; /* 1.15vw * 0.9 */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 1.04vw 0 0; /* 1.15vw * 0.9 */
    box-sizing: border-box;
    z-index: 10;
    transition: width var(--open-duration) var(--easing-curve);
    will-change: width;
    transform: translateZ(0);
}

#menu_box::before, #menu_box::after {
    content: '';
    position: absolute;
    width: 1.04vw; /* 1.15vw * 0.9 */
    height: 1.04vw; /* 1.15vw * 0.9 */
}

#menu_box::before {
    top: 1.83vh; /* 1.03vw -> 1.83vh */
    left: 0;
    transform: translateX(-100%);
    background: radial-gradient(circle at bottom left, transparent 1.04vw, black 1.04vw);
    transition: top var(--scroll-transition-duration) var(--easing-curve);
}

#menu_box::after {
    bottom: 0;
    right: 1.03vw; /* 1.142vw * 0.9 */
    transform: translateY(100%);
    background: radial-gradient(circle at bottom left, transparent 1.04vw, black 1.04vw);
    transition: right var(--scroll-transition-duration) var(--easing-curve);
}

#menu_box.menu-closed {
    width: 5.17vw;
    /* Delay the width transition until after the items have started retracting */
    transition: width var(--close-duration) var(--easing-curve) 0.4s;
}

/* Immediate scroll effect for the top corner */
#menu_box.is-scrolling::before {
    top: 0;
}

/* Observer-based effect for the bottom corner */
#menu_box.scrolled-down::after {
    right: 0;
}

.gooey-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.inner-box {
    background-color: white;
    border-radius: 1.04vw; /* 1.15vw * 0.9 */
    height: 5.51vh; /* 3.1vw -> 5.51vh */
    position: absolute;
    right: 0;
    will-change: transform, opacity;
}

.menu-item {
    width: var(--menu-item-width);
    display: flex;
    justify-content: center;
    align-items: center;    
    pointer-events: none;
    transition: transform var(--open-duration) var(--easing-curve), opacity 0.2s var(--easing-curve);
    will-change: transform, opacity;
    transform: translateZ(0);
    background-color: transparent; /* Override inner-box */
}

#tab {
    width: var(--tab-width);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
}
#tab svg { width: 50%; height: 50%; fill: black; } /* Using % is fine here */

.gooey-container.open .menu-item {
    opacity: 1;
    pointer-events: auto;
}

.gooey-container.closed .menu-item {
    transform: translateX(0);
    opacity: 0;
    transition-property: transform, opacity;
    transition-timing-function: var(--easing-curve);
    transition-duration: var(--close-duration);
}

.gooey-container.open .menu-item:nth-child(4) {
    transform: translateX(calc(-1 * (var(--tab-width) + var(--menu-gap))));
    transition-delay: 0.0s;
}

.gooey-container.open .menu-item:nth-child(3) {
    transform: translateX(calc(-1 * (var(--tab-width) + var(--menu-item-width) + (2 * var(--menu-gap)))));
    transition-delay: 0.1s;
}

.gooey-container.open .menu-item:nth-child(2) {
    transform: translateX(calc(-1 * (var(--tab-width) + (2 * var(--menu-item-width)) + (3 * var(--menu-gap)))));
    transition-delay: 0.2s;
}

.gooey-container.open .menu-item:nth-child(1) {
    transform: translateX(calc(-1 * (var(--tab-width) + (3 * var(--menu-item-width)) + (4 * var(--menu-gap)))));
    transition-delay: 0.3s;
}

/* Reverse the delay order for a more logical closing animation */
.gooey-container.closed .menu-item:nth-child(1) { transition-delay: 0.3s; } /* Farthest item retracts first */
.gooey-container.closed .menu-item:nth-child(2) { transition-delay: 0.2s; }
.gooey-container.closed .menu-item:nth-child(3) { transition-delay: 0.1s; }
/* The 4th item has a 0s delay by default, which is correct */

/* --- 3.5. Custom 3D Buttons --- */
/* General 3D Button */
.btn-3d-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    outline: none;
    border: none;
    background: transparent;
    padding: 0;
    transform-style: preserve-3d;
    transition: transform 0.1s cubic-bezier(0, 0, 0.58, 1);
    border-radius: 1vw; /* 16px -> 1vw */
}

.btn-3d-container::before {
    position: absolute;
    content: '';
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #111;
    border-radius: 1vw; /* 16px -> 1vw */
    box-shadow: 0 0 0 0.1vw #111; /* 2px -> 0.1vw */
    transform: translate3d(0, 0.25vh, -1em); /* 0.15em -> 0.25vh */
    transition: transform 0.1s cubic-bezier(0, 0, 0.58, 1);
}

.btn-face {
    position: relative;
    box-sizing: border-box;
    width: 17vw;
    height: 5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5vw;
    text-decoration: none;
    font-size: 1em; /* Changed from 1.8vh */
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    border-radius: 1vw; /* 16px -> 1vw */
    border: 0.15vw solid #111; /* 3px -> 0.15vw */
    background: #ffffff;
    font-family: "Times New Roman", Times, serif;
    letter-spacing: 0.05em;
    background-image: radial-gradient(circle at 0% 0%, rgba(0,0,0,0.1) 0%, transparent 40%),
                      url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CcolorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.2'/%3E%3C/svg%3E");
    background-size: auto, 5.2vw 5.2vw;
    filter: url(#shaky-border);
}

.btn-3d-container:hover {
    transform: translate(0, 0.08vh); /* 0.05em -> 0.08vh */
}

.btn-3d-container:hover::before {
    transform: translate3d(0, 0.17vh, -1em); /* 0.1em -> 0.17vh */
}

.btn-3d-container:hover .btn-face {
    background-color: #f0f0f0;
}

.btn-3d-container:active {
    transform: translate(0, 0.25vh); /* 0.15em -> 0.25vh */
}

.btn-3d-container:active::before {
    transform: translate3d(0, 0, -1em); /* Kept as is */
}

/* Menu-specific 3D Button */
.btn-3d-container-menu {
    position: relative;
    display: inline-block;
    cursor: pointer;
    outline: none;
    border: none;
    background: transparent;
    padding: 0;
    transform-style: preserve-3d;
    transition: transform 0.1s cubic-bezier(0, 0, 0.58, 1);
    border-radius: 1.04vw;
}

.btn-3d-container-menu::before {
    position: absolute;
    content: '';
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #111;
    border-radius: 1.04vw;
    box-shadow: 0 0 0 0.08vw #111; /* 1.5px -> 0.08vw */
    transform: translate3d(0, 0.25vh, -1em); /* 0.15em -> 0.25vh */
    transition: transform 0.1s cubic-bezier(0, 0, 0.58, 1);
}

.btn-face-menu {
    position: relative;
    box-sizing: border-box;
    width: 10.4vw; /* 11.56vw * 0.9 */
    height: 5.51vh; /* 3.1vw -> 5.51vh */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 1.04vw;
}

.btn-bg-shaky-menu {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 1.04vw;
    border: 0.08vw solid #111; /* 1.5px -> 0.08vw */
    background: #ffffff;
    background-image: radial-gradient(circle at 0% 0%, rgba(0,0,0,0.1) 0%, transparent 40%),
                      url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CcolorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.2'/%3E%3C/svg%3E");
    background-size: auto, 5.2vw 5.2vw;
    filter: url(#shaky-border);
    z-index: 0;
}

.btn-text-clean-menu {
    position: relative;
    z-index: 10;
    text-decoration: none;
    font-size: 0.9em; /* 1.0vw * 0.9 */ 
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    font-family: "Times New Roman", Times, serif;
    letter-spacing: 0.05em;
}

.btn-3d-container-menu:hover {
    transform: translate(0, 0.08vh); /* 0.05em -> 0.08vh */
}

.btn-3d-container-menu:hover::before {
    transform: translate3d(0, 0.17vh, -1em); /* 0.1em -> 0.17vh */
}

.btn-3d-container-menu:hover .btn-bg-shaky-menu {
    background-color: #f0f0f0;
}

.btn-3d-container-menu:active {
    transform: translate(0, 0.25vh); /* 0.15em -> 0.25vh */
}

.btn-3d-container-menu:active::before {
    transform: translate3d(0, 0, -1em); /* Kept as is */
}

/* ==========================================================================
   4. SECTION-SPECIFIC COMPONENTS
   ========================================================================== */
/* --- 4.1. Introduce Section --- */
#avatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 11.5625vw;
    height: 20.56vh; /* 222px -> 20.56vh */
    background-color: black;
    border-radius: 0 0 1.15vw 0; /* 22px */
    padding-left: 1.15vw; /* Đẩy ảnh sang phải */
    box-sizing: border-box; /* Đảm bảo padding không làm tăng chiều rộng */
}

#avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Đảm bảo ảnh lấp đầy div, có thể bị cắt xén nhẹ */
    border-radius: inherit; /* Kế thừa bo góc từ thẻ cha */
    object-position: 60% 70%; /* Dịch ảnh xuống một chút (tăng giá trị y) */
}

#avatar::before, #avatar::after {
    content: '';
    position: absolute;
    width: 1.15vw;
    height: 1.15vw;
}

#avatar::before {
    top: 0;
    left: 100%;
    background: radial-gradient(circle at bottom right, transparent 1.15vw, black 1.15vw);
}

#avatar::after {
    top: 100%;
    left: 0;
    background: radial-gradient(circle at bottom right, transparent 1.15vw, black 1.15vw);
}

#paper-overlay-container {
    position: absolute;
    top: calc(20.56vh + 2.04vh - 0.18vh); /* Converted from vw */
    left: calc(1.15vw - 0.104vw); /* Its left edge right next to the right side of guideline 4 (#guideline-avatar-after-right) */
    width: 55vw; /* To address 'too big' issue */
    height: 67.56vh; /* 38vw -> 67.56vh */
    z-index: 1;
}

#paper-overlay-container img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or 'cover' depending on the desired outcome */
    display: block;
}

#name-tag-container {
    position: absolute;
    top: 2.04vh; /* 1.15vw -> 2.04vh */
    left: calc(11.5625vw + 1.15vw);
    display: inline-block; /* Or 'block' depending on layout needs */
}

#name-tag-image {
    width: 25vw;
    height: 7.11vh; /* 4vw -> 7.11vh */
    object-fit: fill;
    display: block; /* To remove any extra space below the image */
}

#name-tag-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #111;
    font-size: 2em;
    font-weight: lighter;
    text-align: center;
    pointer-events: none;
    width: 100%;
    font-family: "Times New Roman", Times, serif;
    margin: 0;
    text-shadow: 0 0 3px rgba(17, 17, 17, 0.4); /* Thêm hiệu ứng nhòe nhẹ */
}

#info-boxes-group {
    position: absolute;
    top: calc(2.04vh + 7.11vh + 2.04vh - 0.18vh + 0.27vh); /* Converted from vw */
    left: calc(11.5625vw + 1.15vw);
    display: flex;
    align-items: center;
    gap: 1.15vw;
}

#info-box {
    position: relative; /* Change to relative for internal absolute positioning */
    display: block;
    /* Remove top and left as they are managed by the parent flex container */
    transform-origin: top center; /* Đặt tâm xoay ở trên cùng, chính giữa */ 
}

#info-box-2 {
    position: relative; /* Change to relative for internal absolute positioning */
    display: block;
    transform-origin: top center;
    /* Remove top and left as they are managed by the parent flex container */
}

#info-box-4 {
    position: relative; /* Change to relative for internal absolute positioning */
    display: block;
    transform-origin: top center;
    margin-right: calc(20vw + 1.15vw); /* Reserve space for #info-box-3 */
    /* Remove top and left as they are managed by the parent flex container */
}

#info-box-3 {
    position: absolute;
    transform-origin: top center;
    left: calc(8vw + 1.15vw); /* Align left with #info-box-2 relative to #info-boxes-group */
    top: calc(3.56vh + 2.04vh); /* 2vw -> 3.56vh, 1.15vw -> 2.04vh */
    display: block;
    /* Other internal styles like width and height from its children will still apply. */
}

#tape-image-4 {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.4vw;
    z-index: 1;
}

#info-box-image-4 {
    width: 18vw;
    height: 3.56vh; /* 2vw -> 3.56vh */
    object-fit: fill;
    display: block;
}

#info-box-text-4 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #111;
    font-size: 1.5em;
    font-weight: lighter;
    text-align: center;
    pointer-events: none;
    width: 100%;
    font-family: "Times New Roman", Times, serif;
    margin: 0;
    text-shadow: 0 0 3px rgba(17, 17, 17, 0.4);
}

#tape-image-2 {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.4vw;
    z-index: 1;
}

#info-box-image-2 {
    width: 15vw;
    height: 3.56vh; /* 2vw -> 3.56vh */
    object-fit: fill;
    display: block;
}

#info-box-text-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #111;
    font-size: 1.5em;
    font-weight: lighter;
    text-align: center;
    pointer-events: none;
    width: 100%;
    font-family: "Times New Roman", Times, serif;
    margin: 0;
    text-shadow: 0 0 3px rgba(17, 17, 17, 0.4);
}

#tape-image-3 {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.4vw;
    z-index: 1;
}

#info-box-image-3 {
    width: 23vw;
    height: 3.56vh; /* 2vw -> 3.56vh */
    object-fit: fill;
    display: block;
}

#info-box-text-3 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #111;
    font-size: 1.5em;
    font-weight: lighter;
    text-align: center;
    pointer-events: none;
    width: 100%;
    font-family: "Times New Roman", Times, serif;
    margin: 0;
    text-shadow: 0 0 3px rgba(17, 17, 17, 0.4);
}

#tape-image {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.4vw;
    z-index: 1;
}

#info-box-image {
    width: 8vw;
    height: 3.56vh; /* 2vw -> 3.56vh */
    object-fit: fill;
    display: block;
}

#info-box-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #111;
    font-size: 1.5em;
    font-weight: lighter;
    text-align: center;
    pointer-events: none;
    width: 100%;
    font-family: "Times New Roman", Times, serif;
    margin: 0;
    text-shadow: 0 0 3px rgba(17, 17, 17, 0.4); /* Thêm hiệu ứng nhòe nhẹ */
}

#hello-text {
    position: absolute;
    top: 5%;
    left: 10%;
    width: 80%;
    height: 80%;
    transform: none;
    color: #000000;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.5em;
    text-align: left;
    pointer-events: none; /* Allows clicks to go "through" the text */
    text-shadow: 0 0 1px rgba(17, 17, 17, 0.4); 
    box-sizing: border-box;
    padding: 1.78vh 1vw; /* 1vw -> 1.78vh for vertical padding */
}

#hello-text p {
    margin: 0 0 1em 0;
}

#hello-text p:last-child {
    margin-bottom: 0;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Custom Button --- */
.btn-3d-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    outline: none;
    border: none;
    background: transparent;
    padding: 0;
    transform-style: preserve-3d;
    transition: transform 0.1s cubic-bezier(0, 0, 0.58, 1);
    border-radius: 1vw; /* 16px -> 1vw */
}

.btn-3d-container::before {
    position: absolute;
    content: '';
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #111;
    border-radius: 1vw; /* 16px -> 1vw */
    box-shadow: 0 0 0 0.1vw #111; /* 2px -> 0.1vw */
    transform: translate3d(0, 0.25vh, -1em); /* 0.15em -> 0.25vh */
    transition: transform 0.1s cubic-bezier(0, 0, 0.58, 1);
    border-radius: inherit; /* Kế thừa bo góc từ container */
}

.btn-3d-container:hover {
    transform: translate(0, 0.08vh); /* 0.05em -> 0.08vh */
}

.btn-3d-container:hover::before {
    transform: translate3d(0, 0.17vh, -1em); /* 0.1em -> 0.17vh */
}

/* Áp dụng hover cho lớp nền thay vì cả mặt nút */
.btn-3d-container:hover .btn-face {
    background-color: #f0f0f0;
}

.btn-3d-container {
}

#introduce-button {
    position: absolute;
    top: 76vh; /* 5vw -> 8.89vh */
    left: 10.4vw;
    /* Ghi đè kích thước chung nếu cần */
    width: 17vw;
    height: 5vh;
    z-index: 2;
}

#paper-text {
    position: absolute;
    top: 5%;
    left: 10%;
    width: 80%;
    height: 80%;
    transform: none;
    color: #000000;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.2em;
    text-align: left;
    pointer-events: none; /* Allows clicks to go "through" the text */
    text-shadow: 0 0 1px rgba(17, 17, 17, 0.4); 
    box-sizing: border-box;
    padding: 1.78vh 1vw; /* 1vw -> 1.78vh for vertical padding */
}

#workhorse-image {
    position: absolute;
    left: 39.8vw; /* 792px / 1920px */
    top: 79vh; /* 258px / 1920px */
    transform: translate(-50%, -50%); /* Centers the image */
    width: 7vw; /* Default width to prevent it from being too big */
    height: auto;
    z-index: 2;
    opacity: 0.35; /* Makes the image slightly transparent */
}

#introduce-elements-container {
    position: relative; /* Hoặc absolute nếu cần */
    width: 100%;
    height: 100%;
    /* Bỏ qua các sự kiện chuột để không che các phần tử khác */
    pointer-events: none; 
}

#doc-clip-1 {
    position: absolute;
    top: 2.41vh; /* 26px -> 2.41vh */
    left: 36.76vw; /* ~533px trên màn hình 1920px */
    transform: translate(-50%, -50%) rotate(70deg); /* Thêm xoay -15 độ */
    width: 3.2vw; /* Điều chỉnh kích thước của ảnh */
    height: auto; /* Giữ đúng tỷ lệ khung hình */
    pointer-events: auto; /* Cho phép tương tác với ảnh nếu cần */
    z-index: 5; /* Đảm bảo nó hiển thị trên các nền khác */
    contain: layout style; /* Tối ưu hóa render */
}

#doc-clip-2 {
    position: absolute;
    top: 5.93vh; /* 64px -> 5.93vh */
    left: 11.52vw; /* ~202px trên màn hình 1920px */
    transform: rotate(50deg); 
    width: 3vw; /* Giữ cùng kích thước với clip 1 */
    height: auto;
    pointer-events: auto;
    z-index: 5;
    contain: layout style;
}

#doc-clip-3 {
    position: absolute;
    top: 22.5vh; /* ~241px trên màn hình 1920px */
    left: 55svw; /* ~940px trên màn hình 1920px */
    transform: translate(-50%, -50%) rotate(15deg); /* Căn giữa và xoay nhẹ */
    width: 10vw;
    height: auto;
    pointer-events: auto;
    z-index: 5;
    contain: layout style;
}

#doc-clip-4 {
    position: absolute;
    top: 85.4vh;
    left: 2.16vw;
    transform: translate(-50%, -50%) rotate(5deg); /* Căn giữa và xoay nhẹ */
    width: 9vw; /* Có thể điều chỉnh kích thước */
    height: auto;
    pointer-events: auto;
    z-index: 5;
    contain: layout style;
}

#doc-clip-5 {
    position: absolute;
    top: 24.91vh;
    left: 2.77vw;
    transform: translate(-50%, -50%) rotate(-10deg); /* Căn giữa và xoay nhẹ */
    width: 8vw; /* Có thể điều chỉnh kích thước */
    height: auto;
    pointer-events: auto;
    z-index: 5;
    contain: layout style;
}

#gem-eye {
    position: absolute;
    top: 53.56vh;
    left: 58.97vw;
    transform: translate(-50%, -50%); /* Căn giữa ảnh tại vị trí đã cho */
    width: 10vw; /* Kích thước mặc định, bạn có thể điều chỉnh */
    height: auto;
    pointer-events: auto;
    z-index: 5;
    contain: layout style;
}

#small-pencil {
    position: absolute;
    top: 88.18vh;
    left: 25.7vw;
    transform: translate(-50%, -50%); /* Căn giữa ảnh tại vị trí đã cho */
    width: 15vw; /* Điều chỉnh kích thước nếu cần */
    height: auto;
    pointer-events: auto;
    z-index: 5;
    contain: layout style;
}

/* --- 4.2. Dashboard Section --- */
#Dashboard {
    /* Flex properties removed to allow absolute positioning of children */
    box-sizing: border-box;
}

/* Container cho panel bên trái của Dashboard */
#left-dashboard-panel {
    position: absolute;
    top: 11.02vh;
    right: calc(2.07vw + 79.5vw + 1.15vw);
    width: 15vw;
    display: flex;
    flex-direction: column;
    gap: 1.15vw; /* Khoảng cách chính xác giữa 2 khối */
}

#skills-nav-wrapper {
    position: relative; /* Bỏ absolute để nó nằm trong flow của flex container */
    width: 100%; /* Thêm dòng này để chiều rộng bằng với container cha */
}

.skills-nav-content {
    position: relative;
    padding: 3vh 1.5vw;
    color: #111;
    font-family: "Times New Roman", Times, serif;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
}

.skill-category-btn {
    /* Reset styles from btn-3d-container if needed, or just rely on its base styles */
    width: 100%; /* Make button take full width of its container */
}

.skill-category-btn .btn-face {
    width: 100%; /* Override fixed width from .btn-face */
    height: auto; /* Let height be determined by content and padding */
    padding: 1vh 1vw;
    font-size: 1.1em;
    font-weight: 600;
    border-color: #3D3C42;
    color: #3D3C42;
    background-color: #ffffff; /* Thay đổi màu nền thành trắng */
    transition: background-color 0.3s, color 0.3s; /* Add transitions */
    /* Thêm hiệu ứng nhiễu và viền run rẩy giống introduce-button */
    background-image: radial-gradient(circle at 0% 0%, rgba(0,0,0,0.1) 0%, transparent 40%),
                      url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CcolorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.2'/%3E%3C/svg%3E");
    background-size: auto, 5.2vw 5.2vw;
    filter: url(#shaky-border);
}

.skill-category-btn:hover {
    /* Hover effects are handled by .btn-3d-container:hover */
}

.skill-category-btn.active .btn-face {
    background-color: #3D3C42 !important; /* Use !important to override hover effects */
    color: #F6F6F6;
}

.skills-wrapper {
    position: absolute;
    top: 11.02vh; /* Aligns top edge with guideline #3 */
    right: 2.07vw; /* Aligns right edge with guideline #4 */
    max-width: 79.5vw;
    width: 79.5vw;
}

.skills-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(246, 246, 246, 0.9);
    border-radius: 1vw;
    border: 2px solid #111;
    box-shadow: 1vw 1vw 0px rgba(0,0,0,0.7);
    filter: url(#shaky-border);
    z-index: 1;
}

.skills-content {
    position: relative;
    padding: 3vh 4vw;
    color: #111;
    font-family: "Times New Roman", Times, serif;
    z-index: 2;
}

#skills-list {
    /* Container for dynamically loaded skill items */
}

.skills-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    text-align: center;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 4vh;
    letter-spacing: 0.1em;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.2);
}

.skill-item {
    display: grid;
    grid-template-columns: 35fr 55fr 10fr;
    align-items: center;
    gap: 1.5vw;
    margin-bottom: 1.15vw;
    font-size: 1.2em;
}

.skill-name {
    font-weight: 700;
    text-align: right;
    font-family: "Times New Roman", Times, serif;
    letter-spacing: 0.02em;
}

.skill-bar-container {
    width: 100%;
    height: 2vh;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid #111;
    padding: 0.3vh;
    box-sizing: border-box;
    position: relative; /* Cần thiết để định vị phần trăm */
}

/* Số phần trăm đã được ẩn đi theo yêu cầu */

.skill-bar {
    height: 100%;
    background-color: #3D3C42;
    filter: url(#shaky-border);
}

.skill-level {
    font-style: italic;
    font-size: 0.9em;
    color: #3D3C42;
    font-weight: 600;
}

/* --- Nút mới dẫn đến Project --- */
#view-projects-btn {
    position: relative; /* Bỏ absolute */
    width: 100%; /* Chiều rộng bằng với container cha */
    z-index: 3;
}

#view-projects-btn .btn-face {
    width: 100%; /* Ghi đè chiều rộng cố định để nó vừa với container */
}

#view-projects-btn .btn-face span {
    font-size: 1.1em; /* Tăng kích thước chữ một chút */
    font-weight: 700; /* Đảm bảo chữ đủ đậm */
}


/* ==========================================================================
   5. UTILITIES & DEBUG TOOLS
   ========================================================================== */
/* --- 5.1. Utility Classes --- */
.effects-paused .ink .ball,
.effects-paused #role-text::after {
    animation-play-state: paused;
}

.floating-gem {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    will-change: transform;
    z-index: 0; /* Behind everything else in main_box */
}

/* --- 5.2. Mouse Tracker --- */
#mouse-tracker {
    position: fixed;
    top: 0.52vw; /* 10px / 1920px */
    left: 0.52vw; /* 10px / 1920px */
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.26vw 0.52vw; /* 5px 10px / 1920px */
    border-radius: 0.26vw; /* 5px / 1920px */
    display: flex;
    align-items: center;
    z-index: 10000;
}

#mouse-coords {
    transition: all 0.3s ease;
}

#mouse-coords.hidden {
    display: none;
}

#toggle-arrow {
    cursor: pointer;
    margin-left: 0.52vw; /* 10px / 1920px */
}

/* --- 5.3. Guidelines --- */
#guideline-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: none; /* Ẩn tất cả các đường guideline */
}

#guideline-menu-bottom {
    position: absolute;
    top: 9.17vh; /* 5.16vw -> 9.17vh */
    left: 0;
    width: 100%;
    height: 1px;
    background-color: red; /* A visible color for the guideline */
}

#guideline-before-bottom,
#guideline-after-bottom,
#guideline-after-left {
    position: absolute;
    background-color: red;
}

#guideline-before-bottom { top: 3.68vh; left: 0; width: 100%; height: 1px; }
#guideline-after-bottom { top: 11.02vh; left: 0; width: 100%; height: 1px; }
#guideline-after-left { top: 0; right: 2.07vw; width: 1px; height: 100%; }

/* --- Dashboard Guidelines --- */
#guideline-dashboard-left {
    position: absolute;
    top: 0;
    left: 1.15vw;
    width: 1px;
    height: 100%;
    background-color: blue; /* Màu xanh để dễ nhận biết */
}

/* ==========================================================================
   6. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 40vw) { /* 768px -> 40vw */
    #menu_box, #menu_box.menu-closed {
        width: 16.2vw;
        height: 24vh; /* 13.5vw -> 24vh */
        border-radius: 0 0 0 2.7vw; /* 3vw * 0.9 */
        padding: 0;
        justify-content: center;
        transition: none;
        top: 0;
        right: 0;
    }

    .gooey-container { filter: none; }
    .menu-item { display: none; }

    #tab {
        position: static;
        display: flex;
        width: 10.8vw;
        height: 19.2vh; /* 10.8vw -> 19.2vh */
        margin-left: 0;
        border-radius: 2.7vw; /* 3vw * 0.9 */
    }

    .gooey-container > div { transition: none !important; }
}
