html {
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    /* Exactly viewport height to prevent scrollbar */
    background: url('background.jpg') center/cover no-repeat fixed;
    /* fixed prevents background scrolling seam */
    font-family: 'Montserrat', sans-serif;
    color: #fff;
    overflow: hidden;
    /* Prevent all scrollbars completely */

    /* Center the anchor vertically and horizontally */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The anchor only takes the exact size of main-title */
.center-anchor {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.logo-container {
    position: absolute;
    bottom: calc(100% + 120px);
    /* Exactly 200px above the top of main-title */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 100%;
    animation: fadeInDown 1.5s ease-out;
}

.logo-container img {
    max-width: 200px;
    height: auto;
}

.main-title {
    position: relative;
    font-weight: 700;
    font-size: 43px;
    margin: 0;
    text-align: center;
    letter-spacing: 1px;
    background: linear-gradient(to right, #da8326, #ffb450, #f48120, #da8326);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Hiệu ứng đổ bóng đậm (dark shadow) để làm nổi bật chữ */
    filter: drop-shadow(6px 6px 4px rgba(0, 0, 0, 0.85));
    animation: fadeInUp 1.5s ease-out 0.3s both;
}

.bottom-content {
    position: absolute;
    top: calc(100% + 120px);
    /* Exactly 120px below the bottom of main-title */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.subtitle {
    font-weight: 400;
    font-size: 35px;
    margin: 0;
    letter-spacing: 12px;

    text-transform: uppercase;
    animation: fadeInUp 1.5s ease-out 0.6s both;

    filter: drop-shadow(6px 6px 4px rgba(0, 0, 0, 0.85));
    animation: fadeInUp 1.5s ease-out 0.3s both;
    margin-right: -12px;

    background: linear-gradient(13deg, #752f0b, #fd912b, #752f0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

}

.footer-link {
    position: absolute;
    top: calc(100% + 120px);
    right: 220px;
    /* Vị trí bên phải như thiết kế ban đầu */
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 1.5px;
    transition: color 0.3s ease;
    animation: fadeIn 1s ease-out 0.2s both, blinkColor 1s ease-in-out infinite alternate 2s;
}

/* Hiệu ứng nhấp nháy chuyển màu cho footer link */
@keyframes blinkColor {
    0% {
        color: #fff;
    }

    100% {
        color: #ffb450;
    }
}

.footer-link:hover {
    color: #ffb450;
}

.footer-link span {
    font-size: 12px;
    margin-left: 5px;
}

/* Basic Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -30px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive adjustments to prevent overlap on extremely small screens */
@media (max-width: 900px) {
    .main-title {
        font-size: 36px;
    }

    /* Giảm khoảng cách cho màn hình nhỏ */
    .logo-container {
        bottom: calc(100% + 100px);
    }

    .bottom-content {
        top: calc(100% + 80px);
    }

    .subtitle {
        font-size: 28px;
        letter-spacing: 8px;
        margin-right: -8px;
    }

    .footer-link {
        top: calc(100% + 100px);
        left: 0;
        right: 0;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .main-title {
        font-size: 28px;
    }

    .subtitle {
        font-size: 20px;
        letter-spacing: 5px;
        margin-right: -5px;
    }

    /* Giảm khoảng cách cho điện thoại */
    .logo-container {
        bottom: calc(100% + 60px);
    }

    .logo-container img {
        max-width: 150px;
    }

    .bottom-content {
        top: calc(100% + 60px);
    }

    .footer-link {
        top: calc(100% + 60px);
    }
}

/* Giao diện xoay ngang cho mobile (VD: iPhone 12 landscape 844x390) */
@media (max-height: 450px) and (orientation: landscape) {
    .main-title {
        font-size: 26px;
    }

    .subtitle {
        font-size: 16px;
        letter-spacing: 4px;
        margin-right: -4px;
    }

    .logo-container {
        bottom: calc(100% + 20px);
    }

    .logo-container img {
        max-width: 80px;
    }

    .bottom-content {
        top: calc(100% + 20px);
    }

    .footer-link {
        top: calc(100% + 15px);
    }
}