:root {
    /* Colors (Dark Mode Default) */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #10b981;
    --bg-dark: #0a0b10;
    --bg-card: #161a23;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-dark: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.09);
}

/* Background Stars */
.stars-container {
    position: fixed;
    inset: -20px; /* Bám lấy toàn bộ và tỏa dư ra ngoài 20px để chắc ăn không thấy viền */
    z-index: -1;
    overflow: hidden;
    background-color: var(--bg-dark);
    transition: background-color 0.4s ease;
}

/* Hide stars in light mode */
[data-theme="light"] .stars-container::before,
[data-theme="light"] .stars-container::after,
[data-theme="light"] .star {
    display: none;
}

/* Light mode: subtle dot grid */
[data-theme="light"] .stars-container {
    background: radial-gradient(circle at top right, #e2e8f0, #f8fafc 50%);
}

[data-theme="light"] .stars-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#94a3b8 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.15;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

/* Background Blobs Styles */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    display: none; /* Hide by default */
}

[data-theme="light"] .bg-blobs {
    display: block;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px); /* Tăng độ mờ ảo (mesh effect) */
    opacity: 0.8; /* Tăng độ đậm để nổi bật hơn trên nền trắng */
    animation: blob-float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

[data-theme="light"] .blob {
    mix-blend-mode: multiply; /* Hiệu ứng trộn màu rất đẹp cho Light Mode */
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: rgba(99, 102, 241, 0.25); /* Primary Indigo tươi hơn */
    top: -150px;
    right: -100px;
    animation-duration: 25s;
}

.blob-2 {
    width: 550px;
    height: 550px;
    background: rgba(16, 185, 129, 0.2); /* Secondary Green */
    bottom: -150px;
    left: -100px;
    animation-delay: -5s;
    animation-duration: 22s;
}

.blob-3 {
    width: 450px;
    height: 450px;
    background: rgba(236, 72, 153, 0.2); /* Thêm màu Hồng Pink mộng mơ */
    top: 30%;
    left: 20%;
    animation-delay: -10s;
    animation-duration: 28s;
}

.blob-4 {
    width: 500px;
    height: 500px;
    background: rgba(14, 165, 233, 0.25); /* Xanh Sky Blue rực rỡ */
    top: 50%;
    right: 15%;
    animation-delay: -15s;
    animation-duration: 24s;
}

.blob-5 {
    width: 400px;
    height: 400px;
    background: rgba(245, 158, 11, 0.15); /* Cam vàng lấp lánh (Amber) */
    bottom: 10%;
    left: 40%;
    animation-delay: -2s;
    animation-duration: 26s;
}

@keyframes blob-float {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(50px, -30px) rotate(90deg) scale(1.05); }
    50% { transform: translate(20px, 60px) rotate(180deg) scale(0.95); }
    75% { transform: translate(-40px, 20px) rotate(270deg) scale(1.02); }
    100% { transform: translate(0, 0) rotate(360deg) scale(1); }
}

/* Twinkling Static Stars */
.stars-container::before {
    content: "";
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    box-shadow: 
        10vw 10vh 1px #fff, 20vw 30vh 1px #fff, 30vw 15vh 1px #fff, 40vw 40vh 1px #fff, 
        50vw 10vh 1px #fff, 65vw 25vh 1px #fff, 75vw 50vh 1px #fff, 85vw 15vh 1px #fff,
        15vw 60vh 1px #fff, 25vw 80vh 1px #fff, 45vw 70vh 1px #fff, 60vw 90vh 1px #fff,
        80vw 75vh 1px #fff, 90vw 95vh 1px #fff, 5vw 45vh 1px #fff, 95vw 35vh 1px #fff;
    border-radius: 50%;
    opacity: 0.3;
    animation: twinkle 5s infinite alternate;
}

@keyframes twinkle {
    from { opacity: 0.1; }
    to { opacity: 0.5; }
}

.star {
    position: absolute;
    top: -50px;
    left: -100px;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.5);
    animation: shooting-star linear infinite;
    opacity: 0;
}

.star::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 150px;
    height: 1px;
    background: linear-gradient(-90deg, #fff, transparent);
}

@keyframes shooting-star {
    0% {
        transform: rotate(20deg) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: rotate(20deg) translateX(120vw);
        opacity: 0;
    }
}

.star:nth-child(1) { top: 10%; left: -10%; animation-delay: 0s; animation-duration: 3s; }
.star:nth-child(2) { top: 25%; left: -20%; animation-delay: 4s; animation-duration: 4s; }
.star:nth-child(3) { top: 40%; left: -5%; animation-delay: 7s; animation-duration: 3.5s; }
.star:nth-child(4) { top: 5%; left: -15%; animation-delay: 2s; animation-duration: 5s; }
.star:nth-child(5) { top: 60%; left: -25%; animation-delay: 5s; animation-duration: 4.5s; }
.star:nth-child(6) { top: 15%; left: -10%; animation-delay: 9s; animation-duration: 4s; }
.star:nth-child(7) { top: 80%; left: -5%; animation-delay: 1s; animation-duration: 3.2s; }
.star:nth-child(8) { top: 35%; left: -30%; animation-delay: 3s; animation-duration: 4.8s; }

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

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: transparent;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo {
    font-family: 'Outfit', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 100px 0;
    scroll-margin-top: 80px; /* Bù trừ cho chiều cao của thanh Navbar cố định */
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 0 auto;
    border-radius: 2px;
}

.btn {
    padding: 0.8rem 2.2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    cursor: pointer;
    border: none;
    white-space: nowrap; /* Chống xuống hàng */
}

@media (max-width: 576px) {
    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    background: var(--glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.17, 0.55, 0.55, 1);
    will-change: transform, opacity;
}

.fade-up {
    transform: translateY(50px);
}

.fade-left {
    transform: translateX(-50px);
}

.fade-right {
    transform: translateX(50px);
}

.zoom-in {
    transform: scale(0.9);
}

.reveal.active {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* Delay classes for staggered animations */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

footer {
    padding: 3rem 0;
    background: var(--bg-card);
    text-align: center;
    border-top: 1px solid var(--glass-border);
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    display: none; /* Ẩn mặc định */
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
}

/* Chỉ hiển thị và ẩn con trỏ mặc định trên thiết bị có chuột (Desktop) */
@media (pointer: fine) {
    .cursor-dot,
    .cursor-outline {
        display: block;
    }

    body, a, button, .btn, .menu-toggle {
        cursor: none !important;
    }
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
}

/* Hover effect for cursor */
.cursor-hover .cursor-dot {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: var(--secondary-color);
}

.cursor-hover .cursor-outline {
    transform: translate(-50%, -50%) scale(1.5);
    border-color: var(--secondary-color);
    background-color: rgba(16, 185, 129, 0.1);
}

/* ===== Scroll to Top Button ===== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 500; /* Thấp hơn cursor (9999) để không chặn sự kiện chuột */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px) scale(0.85);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.35s ease;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.scroll-top:hover {
    background: var(--primary-hover);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.45);
}

.scroll-top:active {
    transform: translateY(0) scale(0.95);
    transition-duration: 0.1s;
}

@media (max-width: 768px) {
    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}
