:root {
    --glass-bg: rgba(255, 255, 255, 0.035);
    --glass-surface: rgba(18, 18, 22, 0.65);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-specular: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.03) 40%, rgba(255, 255, 255, 0) 100%);
    --liquid-blur: blur(35px) saturate(190%);
    --accent-glow: rgba(0, 242, 254, 0.25);
    --ios-curve: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Body Alignment */
body.editorial-mode {
    background-color: #050507;
    color: #f5f5f7;
    font-family: 'Space Grotesk', sans-serif;
    overflow-x: hidden;
}

/* Hero Section */
.video-hero {
    padding: 130px 4vw 35px;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-tag {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: #8e8e93;
    margin-bottom: 12px;
}

.hero-title {
    font-size: clamp(2.4rem, 5.5vw, 4.8rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    margin: 0 0 12px;
    line-height: 1.05;
}

.glow-text {
    background: linear-gradient(180deg, #ffffff 0%, #8e8e93 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    color: #8e8e93;
    font-size: 1rem;
    max-width: 480px;
    margin: 0 0 35px;
}

/* iPhone Dynamic Island Capsule Controls */
.liquid-controls {
    background: var(--glass-bg);
    backdrop-filter: var(--liquid-blur);
    -webkit-backdrop-filter: var(--liquid-blur);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.25);
    border-radius: 40px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 85px;
    z-index: 40;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 30px;
}

.filter-btn, .action-btn {
    background: transparent;
    border: none;
    color: #8e8e93;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s var(--ios-curve);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover, .action-btn:hover {
    color: #ffffff;
}

.filter-btn.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.action-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #f5f5f7;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

/* Portfolio Masonry Grid (Auto Flow by Aspect Ratio) */
.portfolio-container {
    max-width: 1400px;
    margin: 0 auto 120px;
    padding: 0 4vw;
}

.video-grid {
    columns: 3 320px;
    column-gap: 24px;
}

/* Liquid Video Card */
.video-card {
    position: relative;
    border-radius: 26px;
    overflow: hidden;
    background: #0d0d10;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    margin-bottom: 24px;
    break-inside: avoid;
    transform: translateZ(0);
    transition: transform 0.45s var(--ios-curve), box-shadow 0.45s ease;
}

/* Liquid Specular Glow Border */
.video-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 26px;
    padding: 1.5px;
    background: var(--glass-specular);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 4;
}

.video-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 35px var(--accent-glow);
}

/* Media Wrapper dengan Aspek Rasio Dinamis */
.card-media-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    overflow: hidden;
}

.card-media-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ios-curve);
}

.video-card:hover .card-media-wrapper video {
    transform: scale(1.05);
}

/* Frosted Glass Floating Tag & Overlay */
.card-glass-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 40%, rgba(0,0,0,0.92) 100%);
    z-index: 3;
    pointer-events: none;
}

.card-badge {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.card-info {
    transform: translateY(4px);
    transition: transform 0.3s var(--ios-curve);
}

.video-card:hover .card-info {
    transform: translateY(0);
}

.card-info h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.video-duration {
    margin: 0;
    font-size: 0.78rem;
    color: #a1a1a6;
    letter-spacing: 0.05em;
}

/* Liquid Modal Cinema */
.liquid-modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ios-curve);
}

.liquid-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(35px) saturate(180%);
    -webkit-backdrop-filter: blur(35px) saturate(180%);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 88vh;
    background: var(--glass-surface);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 28px;
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.95), inset 0 1px 2px rgba(255, 255, 255, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.94);
    transition: transform 0.4s var(--ios-curve);
}

.liquid-modal.open .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    backdrop-filter: blur(15px);
    transition: background 0.2s, transform 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Video Player Wrapper */
.player-wrapper {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.player-wrapper video {
    max-width: 100%;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Floating Center Ripple Play/Pause Button */
.center-play-trigger {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.7);
    transition: all 0.3s var(--ios-curve);
    z-index: 10;
}

.player-wrapper.paused .center-play-trigger {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    cursor: pointer;
}

/* Player Liquid Floating Bottom Island */
.player-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    padding: 14px 20px;
    background: rgba(15, 15, 20, 0.7);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    z-index: 12;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease, transform 0.35s var(--ios-curve);
}

/* State: Sembunyikan kontrol bar saat di-tap 1x */
.player-wrapper.hide-controls .player-overlay {
    opacity: 0 !important;
    transform: translateY(15px) !important;
    pointer-events: none;
}

/* Kontrol selalu muncul kembali jika video ter-pause */
.player-wrapper.paused .player-overlay {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto;
}

/* Interactive Scrubber Bar */
.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    margin-bottom: 12px;
    transition: height 0.2s;
}

.progress-bar-container:hover {
    height: 8px;
}

.progress-filled {
    height: 100%;
    background: #ffffff;
    border-radius: 3px;
    width: 0%;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
    position: relative;
}

.progress-filled::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar-container:hover .progress-filled::after {
    opacity: 1;
}

/* Control Hub & Buttons */
.player-subcontrols {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.left-ctrl, .right-ctrl {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.06);
}

.speed-btn {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    width: auto !important;
    padding: 0 10px;
    border-radius: 14px !important;
}

.time-display {
    font-size: 0.78rem;
    color: #a1a1a6;
    letter-spacing: 0.05em;
    min-width: 90px;
}

.modal-meta {
    text-align: center;
}

.modal-meta .badge {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-block;
    margin-bottom: 2px;
}

.modal-meta h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
}

/* Volume Slider Capsule */
.volume-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 65px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* Double-Tap Feedback Zones */
.tap-ripple-zone {
    position: absolute;
    top: 0;
    bottom: 80px;
    width: 35%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    z-index: 15;
    transition: opacity 0.2s ease;
}

.tap-ripple-zone.left {
    left: 0;
    border-radius: 0 50% 50% 0;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
}

.tap-ripple-zone.right {
    right: 0;
    border-radius: 50% 0 0 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
}

.tap-ripple-zone span {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.tap-ripple-zone.active {
    opacity: 1;
}

/* Toast Notifikasi */
.toast-notice {
    position: fixed;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: #fff;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 0.85rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s var(--ios-curve);
    z-index: 1000;
}

.toast-notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Canvas Thumbnail Pengganti Blank Hitam */
.card-thumb-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card-thumb-canvas.ready {
    opacity: 1;
}

/* Pastikan video berada tepat di bawah canvas saat preview diam */
.card-media-wrapper video {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.card-media-wrapper {
    position: relative;
    overflow: hidden;
    background: #0d0d11;
}

.thumb-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.thumb-canvas.ready {
    opacity: 1;
}

/* Sembunyikan canvas saat card di-hover agar preview video berputar mulus */
.video-card:hover .thumb-canvas {
    opacity: 0;
}

/* ==========================================
   MOBILE & RESPONSIVE FIX (iOS / Android)
   ========================================== */
@media (max-width: 768px) {
    .video-hero {
        padding: 95px 16px 20px;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.15;
    }

    .hero-desc {
        font-size: 0.88rem;
        margin-bottom: 20px;
    }

    .liquid-controls {
        top: 70px;
        width: calc(100% - 32px);
        box-sizing: border-box;
        padding: 6px;
        justify-content: space-between;
        gap: 6px;
    }

    .filter-tabs {
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        max-width: calc(100% - 70px);
    }

    .filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        padding: 6px 14px;
        font-size: 0.78rem;
        flex-shrink: 0;
    }

    .action-btn {
        padding: 6px 12px;
        font-size: 0.78rem;
        flex-shrink: 0;
    }

    .action-btn span {
        display: none;
    }

    .portfolio-container {
        padding: 0 16px;
        margin-bottom: 80px;
    }

    .video-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        columns: unset;
    }

    .video-card {
        width: 100%;
        margin-bottom: 0;
        border-radius: 20px;
    }

    .card-info h3 {
        font-size: 1rem;
    }

    .modal-content {
        width: 95vw;
        max-height: 90vh;
        border-radius: 20px;
    }

    .player-wrapper video {
        max-height: 65vh;
    }

    .player-overlay {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 12px 14px;
        border-radius: 16px;
    }

    .volume-wrapper,
    .modal-meta {
        display: none;
    }

    .left-ctrl {
        gap: 8px;
    }

    .time-display {
        font-size: 0.72rem;
        min-width: auto;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 34px;
        height: 34px;
    }
}