/* ======================================== */
/* PEIKA - MODERN LAYOUT CSS                */
/* ======================================== */

:root {
    --bg-color: #F0E7D5;
    --text-dark: #465940;
    --text-muted: #555555;
    
    /* Hệ thống bo góc lẹm */
    --radius: 36px;
    
    /* Vị trí đỉnh của video (ngang với chữ Space) */
    /* Chiều cao vừa bằng 2 dòng đầu + 16px padding-bottom */
    --spacer-height: calc(16px + 2.1 * clamp(34px, 4.4vw, 68px)); 
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ======================================== */
/* PAGE WRAPPER                             */
/* ======================================== */
.page-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px; /* Khoảng cách đồng đều 4 cạnh bằng với đáy video */
    overflow: hidden; /* Cố định 1 trang, không cuộn */
}

/* ======================================== */
/* NAVBAR                                   */
/* ======================================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0; /* Bỏ padding dưới để thu hẹp khoảng cách tới chữ */
    flex-shrink: 0; /* Không bị bóp nhỏ */
    z-index: 100;
}

.logo {
    height: 72px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #465940;
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(70, 89, 64, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    transition: background-color 0.3s ease;
}

.btn-start:hover {
    background-color: rgba(70, 89, 64, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.dots {
    font-size: 10px;
    letter-spacing: 2px;
}

/* ======================================== */
/* HERO MAIN                                */
/* ======================================== */
.hero-main {
    flex: 1; /* Chiếm toàn bộ không gian còn lại */
    position: relative;
    min-height: 0;
    overflow: hidden; /* Cắt video theo border-radius */
    border-bottom-right-radius: var(--radius);
    border-bottom-left-radius: var(--radius); /* Bo góc dưới trái để đồng tâm với nút audio */
}

/* Video nền */
.hero-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Lớp phủ chấm bi (dot overlay) cho video */
.video-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-image: radial-gradient(rgba(0, 0, 0, 0.25) 0.5px, transparent 0.5px);
    background-size: 3px 3px;
}

/* ======================================== */
/* HERO TOP: Chữ U úp ngược che video       */
/* ======================================== */
.hero-top-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: flex-start;
    z-index: 10;
    pointer-events: none; /* Trống ở giữa để click/tương tác với video */
}

.hero-top-wrapper > * {
    pointer-events: auto; /* Click được vào chữ/stats */
}

/* --- TITLE AREA (Trái) --- */
.title-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Để khối chứa chữ Space chỉ rộng vừa chữ đó */
    max-width: 60%;
}

.title-part-top {
    background-color: var(--bg-color);
    padding: 0 48px 8px 0; /* padding-bottom 8px để tạo khoảng cách với video */
    height: var(--spacer-height);
}

.title-part-bottom {
    background-color: var(--bg-color);
    border-bottom-right-radius: var(--radius);
    padding: 0 8px 8px 0; /* Đồng bộ padding-bottom với phần trên */
    position: relative;
    /* Khối này tự hẹp lại bằng chữ Space + padding do align-items: flex-start của title-area */
}

.hero-title {
    font-size: clamp(34px, 4.4vw, 68px);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2; /* Đảm bảo chữ luôn nổi lên trên các góc lẹm nếu có tràn viền do font */
}

/* Lẹm góc trong (Giao giữa phần hẹp và video) */
.title-part-bottom::after {
    content: '';
    position: absolute;
    top: 0; /* Ngay sát mép dưới của title-part-top */
    right: calc(var(--radius) * -1); /* Chìa ra ngoài vùng video */
    width: var(--radius);
    height: var(--radius);
    background: radial-gradient(circle at bottom right, transparent var(--radius), var(--bg-color) calc(var(--radius) + 0.5px));
    pointer-events: none;
}

/* Lẹm góc ngoài (Nối với mép trái video bên dưới) */
.title-part-bottom::before {
    content: '';
    position: absolute;
    bottom: calc(var(--radius) * -1);
    left: 0;
    width: var(--radius);
    height: var(--radius);
    background: radial-gradient(circle at bottom right, transparent var(--radius), var(--bg-color) calc(var(--radius) + 0.5px));
    pointer-events: none;
}

/* --- TOP SPACER (Giữa) --- */
.top-spacer {
    flex: 1;
    height: var(--spacer-height);
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
}

/* Thanh tìm kiếm */
.search-container {
    width: 100%;
    max-width: 100%; /* Cho phép thanh dài ra hết cỡ */
    position: relative;
    opacity: 0;
    animation: fadeDown 0.8s ease forwards 0.4s; /* Hiện ra trễ một chút */
}

.search-input {
    width: 100%;
    height: 40px; /* Làm mỏng lại */
    border-radius: var(--radius); /* Bằng với radius của video */
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15); /* Kính mờ trong suốt */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0 24px 0 52px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    color: #fff;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.search-input:focus {
    border-color: rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.3);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input:focus + .search-icon,
.search-input:focus ~ .search-icon {
    color: #fff;
}

/* --- STATS BLOCK (Phải) --- */
.stats-block {
    background-color: var(--bg-color);
    border-bottom-left-radius: var(--radius);
    padding: 0 0 16px 16px; /* Thu hẹp mép ngang và dọc để sát video hơn */
    display: flex;
    gap: 12px;
    position: relative;
}

/* Lẹm góc trong (Stats kết nối với top-spacer) */
.stats-block::before {
    content: '';
    position: absolute;
    top: var(--spacer-height);
    left: calc(var(--radius) * -1);
    width: var(--radius);
    height: var(--radius);
    background: radial-gradient(circle at bottom left, transparent var(--radius), var(--bg-color) calc(var(--radius) + 0.5px));
    pointer-events: none;
}

/* Lẹm góc ngoài (Stats kết nối với mép phải video) */
.stats-block::after {
    content: '';
    position: absolute;
    bottom: calc(var(--radius) * -1);
    right: 0;
    width: var(--radius);
    height: var(--radius);
    background: radial-gradient(circle at bottom left, transparent var(--radius), var(--bg-color) calc(var(--radius) + 0.5px));
    pointer-events: none;
}

/* --- Thẻ Stats (Dùng chung) --- */
.stat-card {
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: clamp(160px, 14vw, 220px);
    height: clamp(210px, 30vh, 280px);
    position: relative; /* Thêm để chứa video absolute */
    overflow: hidden;   /* Thêm để cắt video theo border-radius */
}

.dark-card {
    background-color: #465940;
    color: #fff;
}

.light-card {
    background-color: #fff;
    color: var(--text-dark);
}

.video-card {
    background-color: #354430;
    color: #fff;
}

.card-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.card-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Lớp phủ làm tối video */
    z-index: 1;
    pointer-events: none;
}

.stat-top h3 {
    font-size: clamp(36px, 4vw, 56px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat-top h3 span {
    font-size: 0.6em;
    vertical-align: top;
    margin-left: 2px;
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 12px;
    opacity: 0.7;
}

.dark-card .stat-label { color: #888; }
.light-card .stat-label { color: #888; }

.stat-desc {
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.8;
}

/* ======================================== */
/* BOTTOM LEFT BLOCK                        */
/* ======================================== */
.bottom-left-block {
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: var(--bg-color);
    border-top-right-radius: var(--radius);
    padding: 16px 16px 16px 0; /* Thu nhỏ chiều cao theo yêu cầu */
    display: flex;
    align-items: center;
    gap: 40px;
    z-index: 10;
}

.bottom-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

.btn-view {
    background-color: #465940;
    color: #fff;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-view:hover {
    background-color: #354430;
}

/* Lẹm góc ngoài (Bottom Left lên mép trái video) */
.bottom-left-block::before {
    content: '';
    position: absolute;
    top: calc(var(--radius) * -1);
    left: 0;
    width: var(--radius);
    height: var(--radius);
    background: radial-gradient(circle at top right, transparent var(--radius), var(--bg-color) calc(var(--radius) + 0.5px));
    pointer-events: none;
}

/* Lẹm góc ngoài (Bottom Left kết nối với video bên dưới) */
.bottom-left-block::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: calc(var(--radius) * -1);
    width: var(--radius);
    height: var(--radius);
    background: radial-gradient(circle at top right, transparent var(--radius), var(--bg-color) calc(var(--radius) + 0.5px));
    pointer-events: none;
}

/* ======================================== */
/* FLOATING CARDS (NỔI TRÊN VIDEO)          */
/* ======================================== */

/* Thẻ 8K+ Clients */
.glass-card {
    position: absolute;
    bottom: 32px;
    right: 32px;
    background: rgba(40, 40, 40, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    width: 360px;
    color: #fff;
    z-index: 5;
    border: 1px solid rgba(255,255,255,0.05);
}

.glass-stat h4 {
    font-size: 32px;
    font-weight: 500;
    line-height: 1;
}

.glass-stat h4 span {
    font-size: 0.6em;
    vertical-align: top;
}

.glass-stat p {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 4px;
    color: rgba(255,255,255,0.7);
}

.glass-desc {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255,255,255,0.9);
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 24px;
}

/* ======================================== */
/* ANIMATIONS                               */
/* ======================================== */

/* Trạng thái ẩn ban đầu trước khi animation chạy */
.hero-title, .stat-card, .navbar, .bottom-left-block > *, .glass-card, .hero-bg-video, .video-overlay {
    opacity: 0;
    visibility: hidden;
}

/* Các class được thêm vào qua JavaScript */
.animate-fade-up {
    animation: fadeUp 0.8s ease forwards;
    visibility: visible;
}

.animate-fade-down {
    animation: fadeDown 0.8s ease forwards;
    visibility: visible;
}

.animate-fade-right {
    animation: fadeRight 0.8s ease forwards;
    visibility: visible;
}

.animate-pop-in {
    animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    visibility: visible;
}

.animate-scale-in {
    animation: scaleIn 1.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    visibility: visible;
}

/* Định nghĩa chuyển động */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(1.05); /* Hiệu ứng zoom out nhẹ */
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ======================================== */
/* AUDIO BUTTON                             */
/* ======================================== */
.audio-btn {
    position: absolute;
    top: -55px; /* (-36px tâm đường cong lõm phía trên block) - (19px bán kính nút) */
    left: 17px; /* (36px tâm đường cong) - (19px bán kính nút) */
    width: 38px; /* Khung tròn nhỏ */
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15); /* Nền mờ tinh tế */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: all 0.3s ease;
    opacity: 0.7;
    color: #fff;
}

.audio-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
    transform: scale(1.05);
}

.audio-icon {
    width: 20px;
    height: 20px;
    opacity: 0.9;
}

/* Các vòng sóng âm thanh trong SVG */
.sound-wave {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.audio-btn.playing .wave-1 {
    animation: wavePulse 1s infinite alternate;
}
.audio-btn.playing .wave-2 {
    animation: wavePulse 1s infinite alternate 0.5s;
}

@keyframes wavePulse {
    0% { opacity: 0.2; }
    100% { opacity: 1; }
}

/* Khối chứa các chữ nổi lên */
.floating-texts {
    position: absolute;
    top: 50%;
    left: 35px; /* Bắt đầu ngay sát miệng loa thay vì ngoài rìa nút */
    pointer-events: none;
}

/* Trạng thái đứng yên (khi KHÔNG phát nhạc) */
.float-text {
    position: absolute;
    left: -5px; /* Để sát vào miệng loa */
    top: -6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    opacity: 0; /* Ẩn đi khi chưa phát nhạc */
    transition: opacity 0.3s ease;
}

.audio-btn.playing {
    opacity: 1;
}

/* Chỉ chạy animation khi được JS gán class animating */
.float-text.animating {
    animation: peikaFloat 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes peikaFloat {
    0% {
        transform: translate(0, 0) scale(0.3) rotate(-5deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translate(10px, -15px) scale(1) rotate(5deg);
    }
    80% {
        opacity: 0.7;
    }
    100% {
        transform: translate(30px, -50px) scale(1.2) rotate(-5deg);
        opacity: 0;
    }
}

/* Ẩn hiện button animation (dùng chung fade-right) */

/* ===== GOOGLE-STYLE CENTER WRAPPER ===== */
.google-center-wrapper {
    position: absolute;
    top: 55%; /* Đẩy xuống một xíu */
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 50;
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
}

.center-logo {
    height: 130px;
    object-fit: contain;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeDown 0.8s ease forwards;
}

.google-center-wrapper .search-container {
    width: 100%;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeDown 0.8s ease forwards 0.2s;
}

.google-center-wrapper .search-input {
    height: 44px;
    font-size: 16px;
    padding: 0 24px 0 52px;
    border-radius: 26px; /* Fully rounded like google */
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    color: #465940;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.google-center-wrapper .search-input::placeholder {
    color: rgba(70, 89, 64, 0.7); /* Màu xanh rêu nhạt */
}

.google-center-wrapper .search-input:focus {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(70, 89, 64, 0.4);
}

.google-center-wrapper .search-icon {
    color: #465940;
}

.action-buttons-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeDown 0.8s ease forwards 0.4s;
}

.pill-btn {
    background: rgba(70, 89, 64, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px; /* Pill shape */
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.pill-btn:hover {
    background: rgba(70, 89, 64, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* =====================================================================
   PRELOADER
   ===================================================================== */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

#loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 400px;
}

.loader-logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.05em;
    text-transform: lowercase;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--text-dark);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progress-stripes 1s linear infinite;
    transition: width 0.1s ease;
}

@keyframes progress-stripes {
    from {
        background-position: 1rem 0;
    }
    to {
        background-position: 0 0;
    }
}

.progress-text {
    font-size: 24px;
    color: var(--text-dark);
    font-weight: 600;
}
