/* ==========================================================================
   ENVELOPE COMPONENT - PIXEL PERFECT BEM CSS (CHUẨN 100% FRAMER 4 FLAPS)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ENVELOPE SCREEN (Toàn màn hình)
   -------------------------------------------------------------------------- */
.envelope {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #dfdcce;
    background-image:
        radial-gradient(ellipse at 50% 45%, #ede9de 0%, #ded9cc 65%, #cdc7b9 100%);
    cursor: pointer;
    perspective: 1600px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 9999;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s,
        visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s,
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
}

/* Subtle paper texture grain */
.envelope::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 0);
    background-size: 6px 6px;
    pointer-events: none;
    opacity: 0.85;
}

/* Vignette shadow */
.envelope::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 130px rgba(50, 45, 35, 0.12);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   2. BOTANICAL ILLUSTRATIONS (CÀNH HOA SÁT ĐÁY DƯỚI & NHỎ LẠI 20%)
   -------------------------------------------------------------------------- */
.envelope__botanical {
    position: absolute;
    bottom: -16px;
    top: auto;
    width: clamp(65px, 7vw, 100px);
    height: clamp(340px, 66vh, 580px);
    pointer-events: none;
    z-index: 15;
    opacity: 0.95;
    transition: opacity 0.6s ease;
}

.envelope__botanical--left {
    left: clamp(10px, 1.8vw, 36px);
    transform-origin: bottom center;
    transform: rotate(4deg) scale(0.8);
}

.envelope__botanical--right {
    right: clamp(10px, 1.8vw, 36px);
    transform-origin: bottom center;
    transform: scaleX(-1) rotate(4deg) scale(0.8);
}

.envelope__botanical-svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    overflow: visible;
}

/* Animation nét vẽ thân cành cây (Draw Stem Line) */
.envelope__stem {
    stroke-dasharray: 1000;
    stroke-dashoffset: 0;
}

/* Animation nở hoa và lá (Bloom & Fade-in) */
.envelope__bloom,
.envelope__leaf {
    opacity: 0;
    animation: bloomFade 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

/* Staggered delay cho từng bông hoa và lá */
.envelope__bloom--1 {
    animation-delay: 0.25s;
}

.envelope__leaf--1 {
    animation-delay: 0.35s;
}

.envelope__leaf--2 {
    animation-delay: 0.4s;
}

.envelope__leaf--3 {
    animation-delay: 0.5s;
}

.envelope__leaf--4 {
    animation-delay: 0.55s;
}

.envelope__leaf--5 {
    animation-delay: 0.65s;
}

.envelope__leaf--6 {
    animation-delay: 0.7s;
}

.envelope__bloom--2 {
    animation-delay: 0.75s;
}

.envelope__leaf--7 {
    animation-delay: 0.85s;
}

.envelope__leaf--8 {
    animation-delay: 0.9s;
}

.envelope__bloom--3 {
    animation-delay: 0.95s;
}

.envelope__leaf--9 {
    animation-delay: 1.05s;
}

.envelope__leaf--10 {
    animation-delay: 1.1s;
}

.envelope__leaf--11 {
    animation-delay: 1.15s;
}

.envelope__leaf--12 {
    animation-delay: 1.2s;
}

.envelope__leaf--13 {
    animation-delay: 1.25s;
}

@keyframes bloomFade {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   3. ENVELOPE 4-FLAP DIAMONDS (CHUẨN 100% FRAMER ARCHITECTURE)
   -------------------------------------------------------------------------- */
.envelope__container {
    --diamond-size: 2400px;
    --diamond-radius: 1697px;
    /* 2400 * sqrt(2) / 2 */
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

.envelope__flap {
    position: absolute;
    width: var(--diamond-size);
    height: var(--diamond-size);
    box-sizing: border-box;
    pointer-events: none;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.8s ease;
}

/* Left Flap (Framer exact: 45deg, linear-gradient) */
.envelope__flap--left {
    z-index: 1;
    left: calc(50% - var(--diamond-radius));
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    background: linear-gradient(135deg, rgb(232, 229, 213) 0%, rgb(223, 220, 202) 100%);
}

/* Right Flap (Framer exact: 45deg, linear-gradient) */
.envelope__flap--right {
    z-index: 1;
    left: calc(50% + var(--diamond-radius));
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    background: linear-gradient(135deg, rgb(232, 229, 213) 0%, rgb(223, 220, 202) 100%);
}

/* Bottom Flap (Framer exact: 45deg, 1px border) */
.envelope__flap--bottom {
    z-index: 2;
    left: 50%;
    top: calc(50% + var(--diamond-radius));
    transform: translate(-50%, -50%) rotate(45deg);
    background: linear-gradient(135deg, rgb(236, 233, 218) 0%, rgb(226, 223, 206) 100%);
    border: 1px solid rgba(110, 112, 95, 0.3);
}

/* Top Flap (Framer exact: 45deg, 1px border, 0 5px 12px shadow) */
.envelope__flap--top {
    z-index: 3;
    left: 50%;
    top: calc(50% - var(--diamond-radius));
    transform: translate(-50%, -50%) rotate(45deg);
    background: linear-gradient(135deg, rgb(240, 238, 224) 0%, rgb(227, 224, 207) 100%);
    border: 1px solid rgba(110, 112, 95, 0.4);
    box-shadow: rgba(70, 70, 50, 0.2) 0px 5px 12px 0px;
}

/* Content overlays (TEXT VỪA GỌN TRONG NẮP TRÊN) */
.envelope__top-content {
    position: absolute;
    top: clamp(28px, 6.5vh, 60px);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 85%;
    max-width: 520px;
    z-index: 12;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.envelope__title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(0.95rem, 1.35vw, 1.35rem);
    font-weight: 500;
    letter-spacing: 0.28em;
    color: #6f6b5f;
    text-transform: uppercase;
    line-height: 1.4;
}

.envelope__bottom-content {
    position: absolute;
    bottom: clamp(35px, 8.5vh, 75px);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 12;
    pointer-events: auto;
    width: 90%;
    max-width: 500px;
    transition: opacity 0.4s ease;
}

.envelope__subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.3rem, 2.1vw, 1.75rem);
    color: #7e7a6f;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.envelope__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(0.78rem, 1.05vw, 0.9rem);
    font-weight: 600;
    letter-spacing: 0.28em;
    color: #8a8579;
    text-transform: uppercase;
    transition: color 0.3s ease, transform 0.3s ease;
    animation: tapSubtleGlow 2.5s ease-in-out infinite;
}

.envelope__action-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.9em;
}

.envelope:hover .envelope__action {
    color: #5c564a;
}

.envelope:hover .envelope__action-arrow {
    transform: translateX(4px);
}

/* Wax Seal (NÚT TAG TO LÊN NỔI BẬT) */
.envelope__seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    width: 220px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    outline: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.35s ease;
}

.envelope__seal-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 14px 28px rgba(50, 38, 22, 0.50)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.24));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.35s ease;
}

.envelope:hover .envelope__seal {
    transform: translate(-50%, -50%) scale(1.07);
}

.envelope:hover .envelope__seal-img {
    filter: drop-shadow(0 18px 36px rgba(50, 38, 22, 0.60)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.30));
}

/* --------------------------------------------------------------------------
   4. OPENING ANIMATION SEQUENCE
   -------------------------------------------------------------------------- */

/* Khi click mở thiệp */
.envelope.is-opening .envelope__seal {
    animation: sealBreak 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.envelope.is-opening .envelope__top-content,
.envelope.is-opening .envelope__bottom-content {
    opacity: 0;
}

.envelope.is-opening .envelope__flap--top {
    transform: translate(-50%, -85%) rotate(45deg);
    opacity: 0;
}

.envelope.is-opening {
    opacity: 0;
    transform: scale(1.03);
    visibility: hidden;
    pointer-events: none;
}

/* Trạng thái đã mở hoàn tất */
.envelope.is-opened {
    display: none !important;
}

/* Keyframe animations */
@keyframes tapSubtleGlow {

    0%,
    100% {
        opacity: 0.85;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

@keyframes sealBreak {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }

    40% {
        transform: translate(-50%, -50%) scale(1.2) rotate(-8deg);
        opacity: 0.95;
    }

    100% {
        transform: translate(-50%, -65%) scale(1.3) rotate(15deg);
        opacity: 0;
        filter: blur(3px);
    }
}

/* ==========================================================================
   5. HOMEPAGE - HERO BANNER (PLAY VIDEO NỀN TRONG img/video.mp4)
   ========================================================================== */
.home-main {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: #f7f2ea;
}

.hero-banner {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 620px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-banner__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.hero-banner__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
}

.hero-banner__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 15, 12, 0.35) 0%, rgba(15, 15, 12, 0.15) 45%, rgba(15, 15, 12, 0.45) 100%);
    pointer-events: none;
}

.hero-banner__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 24px;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.hero-banner__title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2.8rem, 6.2vw, 5.2rem);
    font-weight: 300;
    font-style: italic;
    line-height: 1.12;
    color: #ffffff;
    letter-spacing: 0.01em;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.4);
    margin: 0;
}

.hero-banner__title em {
    font-style: italic;
    font-weight: 400;
}

.hero-banner__subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.15rem, 1.85vw, 1.55rem);
    font-style: italic;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.92);
    margin-top: 18px;
    margin-bottom: 36px;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.hero-banner__cta {
    display: inline-block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.05rem, 1.4vw, 1.3rem);
    font-style: italic;
    font-weight: 400;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.04em;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.75);
    transition: color 0.3s ease, border-bottom-color 0.3s ease, transform 0.3s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-banner__cta:hover {
    color: #ffffff;
    border-bottom-color: #ffffff;
    transform: translateY(-2px);
}

/* ==========================================================================
   6. ABOUT SECTION (CÂU CHUYỆN THƯƠNG HIỆU AUREUS)
   ========================================================================== */
.about {
    position: relative;
    background-color: #f7f2ea;
    padding: clamp(90px, 13vh, 160px) 24px clamp(80px, 11vh, 140px) 24px;
    overflow: hidden;
}

.about__container {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.about__header {
    margin-bottom: 40px;
}

.about__title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2.4rem, 4.6vw, 3.8rem);
    font-weight: 400;
    color: #643d34;
    line-height: 1.22;
    letter-spacing: 0.01em;
    margin: 0;
}

.about__title em {
    font-style: italic;
    font-weight: 400;
}

.about__content {
    max-width: 660px;
    margin: 0 auto;
}

.about__text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.08rem, 1.35vw, 1.26rem);
    line-height: 1.85;
    color: #554840;
    margin-bottom: 30px;
    letter-spacing: 0.015em;
}

.about__quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.3rem, 1.85vw, 1.65rem);
    font-style: italic;
    color: #7b4a3d;
    margin: 36px auto;
    line-height: 1.4;
    border: none;
    padding: 0;
}

.about__quote em {
    font-style: italic;
}

.about__media {
    margin: 60px auto 72px auto;
    max-width: 680px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 48px rgba(60, 40, 25, 0.12), 0 4px 14px rgba(0, 0, 0, 0.04);
}

.about__image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.about__media:hover .about__image {
    transform: scale(1.025);
}

.about__footer {
    margin-top: 20px;
}

.about__signoff {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.85rem, 2.8vw, 2.35rem);
    font-weight: 400;
    color: #643d34;
    line-height: 1.25;
    margin-bottom: 32px;
}

.about__signoff em {
    font-style: italic;
}

.about__socials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.about__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #9c8478;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

.about__social-link:hover {
    color: #643d34;
    transform: translateY(-3px);
    background-color: rgba(100, 61, 52, 0.06);
}

.about__social-svg {
    display: block;
}

/* --------------------------------------------------------------------------
   7. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .envelope__botanical {
        width: 48px;
        opacity: 0.7;
    }

    .envelope__botanical--left {
        left: 2px;
    }

    .envelope__botanical--right {
        right: 2px;
    }

    .envelope__top-content {
        top: 5vh;
        max-width: 320px;
    }

    .envelope__bottom-content {
        bottom: 6vh;
    }

    .envelope__seal {
        width: 180px;
    }

    .hero-banner__title {
        font-size: 2.5rem;
    }

    .hero-banner__subtitle {
        font-size: 1.1rem;
        margin-top: 14px;
        margin-bottom: 28px;
    }

    .about {
        padding: 70px 20px 60px 20px;
    }

    .about__title {
        font-size: 2.1rem;
    }

    .about__text {
        font-size: 1.05rem;
    }

    .about__media {
        margin: 40px auto 50px auto;
        border-radius: 16px;
    }
}