/* ===== ROOT ===== */
/* (Font already loaded via <link> in <head> — duplicate @import removed) */
#myworks-wp-root {
    --bg: #000000;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(140, 180, 255, 0.25);
    --glow-primary: rgba(120, 160, 255, 0.15);
    --glow-hover: rgba(140, 180, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);
    --accent: rgba(160, 195, 255, 1);

    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--primary-font);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#myworks-wp-root *,
#myworks-wp-root *::before,
#myworks-wp-root *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== STAR CANVAS ===== */
#myworks-wp-root #mw-star-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease-out;
}

/* ===== HERO SECTION ===== */
#myworks-wp-root .mw-hero {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 60px 24px;
    text-align: center;
}

#myworks-wp-root .mw-hero-inner {
    max-width: 700px;
}

#myworks-wp-root .mw-label {
    font-family: var(--primary-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.35em;
    color: var(--accent);
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
        transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

#myworks-wp-root .mw-title {
    font-family: var(--primary-font);
    font-size: clamp(42px, 10vw, 88px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary) !important;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
        transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    background: linear-gradient(180deg, #ffffff 30%, rgba(160, 195, 255, 0.7) 100%);
    -webkit-background-clip: text;
    /* Dấu tiếng Việt: nền gradient (background-clip:text) chỉ tô trong hộp nội dung,
       dấu chồng (Ố, Ệ, Ậ…) vượt lên trên hộp nên bị mất màu → trông như bị cắt.
       Nới hộp bằng padding rồi bù margin âm: chữ đủ chỗ, bố cục không đổi. */
    padding-block: 0.22em 0.14em;
    margin-block-start: -0.22em;

    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#myworks-wp-root .mw-subtitle {
    font-size: clamp(15px, 3vw, 19px);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary) !important;
    max-width: 500px;
    margin: 0 auto 48px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
        transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

#myworks-wp-root .mw-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
        transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

#myworks-wp-root .mw-scroll-hint.mw-revealed svg {
    animation: mwBounce 2s ease-in-out infinite;
}

/* Revealed state for hero elements */
#myworks-wp-root .mw-revealed {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ===== GRID SECTION ===== */
#myworks-wp-root .mw-grid-section {
    position: relative;
    z-index: 2;
    padding: 40px 24px 100px;
    max-width: 1200px;
    margin: 0 auto;
}

#myworks-wp-root .mw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    perspective: 1200px;
    perspective-origin: center center;
}

/* ===== CARDS ===== */
#myworks-wp-root .mw-card {
    position: relative;
    border-radius: 20px;
    overflow: visible;
    /* Smooth interpolation — the key to buttery parallax */
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Initial state — hidden, JS will animate */
    opacity: 0;
    transform: translateY(60px) scale(0.96);
}

#myworks-wp-root .mw-card-glow {
    position: absolute;
    inset: -1px;
    border-radius: 20px;
    background: linear-gradient(135deg,
            rgba(120, 160, 255, 0.12) 0%,
            transparent 40%,
            transparent 60%,
            rgba(160, 120, 255, 0.08) 100%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#myworks-wp-root .mw-card:hover .mw-card-glow {
    opacity: 1;
}

#myworks-wp-root .mw-card-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 28px 36px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    transition: border-color 0.4s ease,
        background 0.4s ease,
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s ease;
}

#myworks-wp-root .mw-card:hover .mw-card-inner {
    border-color: var(--card-hover-border);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-6px);
    box-shadow: 0 20px 60px -15px rgba(100, 150, 255, 0.12),
        0 0 40px -10px rgba(140, 180, 255, 0.08);
}

/* Logo */
#myworks-wp-root .mw-logo-wrap {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s ease;
}

#myworks-wp-root .mw-card:hover .mw-logo-wrap {
    transform: scale(1.06);
    box-shadow: 0 8px 30px -8px rgba(100, 150, 255, 0.15);
}

#myworks-wp-root .mw-logo {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: brightness(0.9) contrast(1.05);
    transition: filter 0.4s ease;
}

#myworks-wp-root .mw-card:hover .mw-logo {
    filter: brightness(1) contrast(1.1);
}

/* Card text */
#myworks-wp-root .mw-company {
    font-family: var(--primary-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary) !important;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

#myworks-wp-root .mw-role {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(120, 160, 255, 0.08);
    border: 1px solid rgba(120, 160, 255, 0.15);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 16px;
}

#myworks-wp-root .mw-desc {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary) !important;
}

/* Nút link domain dưới mỗi card — tối giản, cùng ngôn ngữ với .mw-video-cta:
   chỉ domain (không https), gạch chân mảnh, mũi tên ↗ trượt nhẹ khi hover */
#myworks-wp-root .mw-card-inner { min-height: 100%; }   /* card cùng hàng cao bằng nhau → link nằm cùng đường đáy */
#myworks-wp-root .mw-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    padding-top: 16px;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--primary-font);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: color .25s ease, border-color .25s ease;
}
#myworks-wp-root .mw-link svg { flex: none; opacity: 0.7; transition: transform .25s ease, opacity .25s ease; }
#myworks-wp-root .mw-link:hover,
#myworks-wp-root .mw-link:focus-visible { color: #00f2ff; border-color: rgba(0, 242, 255, 0.55); outline: none; }
#myworks-wp-root .mw-link:hover svg { transform: translate(2px, -2px); opacity: 1; }

/* ===== FOOTER SECTION ===== */
#myworks-wp-root .mw-footer-section {
    position: relative;
    z-index: 2;
    padding: 80px 24px 120px;
    text-align: center;
}

#myworks-wp-root .mw-footer-inner {
    opacity: 0;
    transform: translateY(40px);
}

#myworks-wp-root .mw-footer-inner.mw-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
        transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

#myworks-wp-root .mw-footer-text {
    font-family: var(--primary-font);
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted) !important;
    margin-bottom: 16px;
}

#myworks-wp-root .mw-footer-tagline {
    font-size: clamp(20px, 5vw, 32px);
    font-weight: 300;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    color: rgba(255, 255, 255, 0.7) !important;
    letter-spacing: 0.01em;
}

/* Stagger delays removed — JS handles scroll-driven animations */

/* ===== ANIMATIONS ===== */
@keyframes mwStarsFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 0.7;
    }
}

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

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

@keyframes mwBounce {

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

    50% {
        transform: translateY(8px);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
    #myworks-wp-root .mw-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

@media (max-width: 600px) {
    #myworks-wp-root .mw-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    #myworks-wp-root .mw-card-inner {
        padding: 32px 20px 28px;
    }

    #myworks-wp-root .mw-logo-wrap {
        width: 80px;
        height: 80px;
        border-radius: 18px;
    }

    #myworks-wp-root .mw-hero {
        min-height: 80vh;
        padding: 40px 20px;
    }
}
    


/* ===== VIDEO GIỚI THIỆU SAHA (trong .mw-footer-section, phía trên dòng "More ventures") ===== */
#myworks-wp-root .mw-video {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 0 auto 72px;
    text-align: center;
    opacity: 0;
    transform: translateY(32px);
}
#myworks-wp-root .mw-video.mw-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .9s cubic-bezier(0.22, 1, 0.36, 1), transform .9s cubic-bezier(0.22, 1, 0.36, 1);
}
#myworks-wp-root .mw-video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 24px;
    overflow: hidden;
    background: #0a0f18;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 80px -30px rgba(120, 160, 255, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.4);
    /* bo góc + overflow hidden trên Safari cần isolate để video không tràn góc */
    isolation: isolate;
    transform: translateZ(0);
}
#myworks-wp-root .mw-video-el {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#myworks-wp-root .mw-video-sound {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px 9px 13px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(7, 12, 20, 0.72);
    color: #fff;
    font-family: var(--primary-font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}
#myworks-wp-root .mw-video-sound:hover { border-color: rgba(0, 242, 255, 0.5); background: rgba(7, 12, 20, 0.9); }
#myworks-wp-root .mw-video-sound:active { transform: scale(0.97); }
#myworks-wp-root .mw-video-sound .ico-on,
#myworks-wp-root .mw-video-sound .txt-on { display: none; }
#myworks-wp-root .mw-video-sound[aria-pressed="true"] { border-color: rgba(0, 242, 255, 0.6); color: #00f2ff; }
#myworks-wp-root .mw-video-sound[aria-pressed="true"] .ico-on { display: block; }
#myworks-wp-root .mw-video-sound[aria-pressed="true"] .txt-on { display: inline; }
#myworks-wp-root .mw-video-sound[aria-pressed="true"] .ico-off,
#myworks-wp-root .mw-video-sound[aria-pressed="true"] .txt-off { display: none; }
#myworks-wp-root .mw-video-caption {
    margin-top: 18px;
    font-family: var(--primary-font);
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Link tối giản dẫn sang trang cuộc thi Thực Chiến AI */
#myworks-wp-root .mw-video-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--primary-font);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: color .25s ease, border-color .25s ease;
}
#myworks-wp-root .mw-video-cta svg { transition: transform .25s ease; }
#myworks-wp-root .mw-video-cta:hover { color: #00f2ff; border-color: rgba(0, 242, 255, 0.55); }
#myworks-wp-root .mw-video-cta:hover svg { transform: translate(2px, -2px); }
@media (max-width: 600px) {
    #myworks-wp-root .mw-video { margin-bottom: 48px; }
    #myworks-wp-root .mw-video-frame { border-radius: 16px; }
    #myworks-wp-root .mw-video-sound { right: 10px; bottom: 10px; padding: 10px; }
    #myworks-wp-root .mw-video-sound-txt { display: none !important; }   /* mobile: chỉ icon */
    #myworks-wp-root .mw-video-caption { font-size: 13px; text-align: center; }
    #myworks-wp-root .mw-video-cta { margin-top: 12px; font-size: 13.5px; }
}

/* backdrop-filter (hiệu ứng kính mờ) chỉ bật trên thiết bị có chuột/GPU mạnh;
   mobile/touch dùng nền bán trong suốt thường — nhìn gần như nhau, nhẹ hơn nhiều */
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
    #myworks-wp-root .mw-card-inner {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}
