/* ===== Videos Page ===== */

/* Scroll animations */
.vd-page [data-anim] {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(80ms + var(--delay, 0ms));
    will-change: opacity, transform;
}
.vd-page [data-anim="fade-up"]    { transform: translateY(40px); }
.vd-page [data-anim="fade-left"]  { transform: translateX(48px); }
.vd-page [data-anim="fade-right"] { transform: translateX(-48px); }
.vd-page [data-anim="zoom-in"]    { transform: scale(0.94); }
.vd-page [data-anim].in-view { opacity: 1; transform: translate(0,0) scale(1); }
@media (prefers-reduced-motion: reduce) {
    .vd-page [data-anim] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

.vd-page {
    min-height: 100vh;
    background: #f8fafc;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6rem 2rem 0;
    overflow-x: clip;
    font-family: 'Inter', system-ui, sans-serif;
}

.vd-glow {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    z-index: 0;
    filter: blur(60px);
}
.vd-glow--tl { top: -100px; left: -120px; width: 580px; height: 580px;
    background: radial-gradient(circle, rgba(0,168,150,0.08) 0%, transparent 65%); }
.vd-glow--br { bottom: -80px; right: -100px; width: 460px; height: 460px;
    background: radial-gradient(circle, rgba(0,168,150,0.06) 0%, transparent 65%); }

/* ── Hero ── */
.vd-hero {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 0 2.5rem;
}

.vd-watermark {
    position: absolute;
    top: 4%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(70px, 13vw, 170px);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: rgba(0,0,0,0.06);
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

@media (max-width: 600px) {
    .vd-watermark {
        top: 0;
        font-size: clamp(52px, 15vw, 64px);
    }
}

.vd-header {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 820px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.vd-tag {
    display: inline-block;
    border: 1px solid rgba(0,168,150,0.4);
    color: #00A896;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 999px;
    background: rgba(0,168,150,0.06);
}

.vd-title {
    font-size: clamp(2.2rem, 4.2vw, 3.6rem);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.12;
}

.vd-title-accent {
    color: #00A896;
}

.vd-sub {
    font-size: 1.02rem;
    color: #64748b;
    line-height: 1.65;
    max-width: 640px;
}

/* ═══ Immersive gallery player ═══ */

.vd-page--player {
    padding: 0;
    background: #0b1020;
    min-height: 100vh;
    display: block;
}

.vg-stage {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.vg-bg,
.vg-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vg-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5,10,20,0.72) 0%, rgba(5,10,20,0.28) 45%, rgba(5,10,20,0.05) 70%),
        linear-gradient(0deg, rgba(5,10,20,0.82) 0%, rgba(5,10,20,0.25) 30%, rgba(5,10,20,0) 55%);
    pointer-events: none;
}

/* Title overlay */
.vg-info {
    position: absolute;
    left: clamp(1.5rem, 5vw, 5rem);
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    max-width: 520px;
    color: #ffffff;
}

.vg-label {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.85);
    border-left: 3px solid #00A896;
    padding-left: 10px;
    margin-bottom: 14px;
}

.vg-title {
    font-size: clamp(2.2rem, 4.6vw, 4rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1.04;
    margin-bottom: 14px;
    text-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.vg-desc {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    max-width: 420px;
}

.vg-watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 13px 26px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(180deg, #00bfac 0%, #00A896 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,168,150,0.45);
    transition: transform 0.15s, box-shadow 0.2s;
}
.vg-watch-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,168,150,0.6); }
.vg-watch-btn svg { width: 14px; height: 14px; }

/* Card rail */
.vg-rail-wrap {
    position: absolute;
    right: clamp(1rem, 4vw, 4rem);
    bottom: 18vh;
    z-index: 2;
    max-width: min(56vw, 720px);
}

.vg-rail {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 6px 2px 14px;
}
.vg-rail::-webkit-scrollbar { display: none; }

.vg-card {
    position: relative;
    flex: 0 0 auto;
    width: 150px;
    height: 210px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.25);
    background: #0b1020;
    cursor: pointer;
    padding: 0;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.vg-card:hover { transform: translateY(-6px); }

/* the active video plays fullscreen behind, so its card leaves the rail */
.vg-card--active { display: none; }

.vg-card video,
.vg-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vg-card-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(5,10,20,0.85) 0%, rgba(5,10,20,0.1) 55%);
}

.vg-card-text {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    text-align: left;
    color: #ffffff;
}

.vg-card-text small {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.7);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vg-card-text strong {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
}

.vg-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.vg-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.3);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.vg-arrow:hover { background: rgba(0,168,150,0.4); border-color: #2dd4bf; }
.vg-arrow svg { width: 16px; height: 16px; }

.vg-counter {
    margin-left: auto;
    font-size: 2rem;
    font-weight: 900;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.02em;
}

/* ── Mode switching ──
   preview: rotating teasers, overlay text + cards visible, no controls
   watch:   full video with sound, clean frame, controls + close only */
.vg-controls, .vg-close { display: none; }

/* watch mode = fullscreen overlay above the header and the voice widget */
.vg-stage--watch {
    position: fixed;
    inset: 0;
    z-index: 2147483600;
    background: #000;
}

body.vg-watching { overflow: hidden; }

.vg-stage--watch .vg-controls { display: flex; }
.vg-stage--watch .vg-close { display: flex; }
.vg-stage--watch .vg-info,
.vg-stage--watch .vg-rail-wrap { display: none; }
.vg-stage--watch .vg-shade {
    background: linear-gradient(0deg, rgba(5,10,20,0.6) 0%, rgba(5,10,20,0) 22%);
}

.vg-close {
    position: absolute;
    top: 24px;
    right: clamp(1.5rem, 4vw, 3rem);
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.35);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.vg-close:hover { background: rgba(239,68,68,0.5); border-color: #f87171; }
.vg-close svg { width: 18px; height: 18px; }

/* Ghost element that morphs a card into fullscreen (and back) */
.vg-ghost {
    position: fixed;
    z-index: 2147483610;
    overflow: hidden;
    background: #000;
    transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
}

/* preview-rotation morphs stay under the header and widget */
.vg-ghost--under {
    z-index: 40;
}

.vg-ghost img,
.vg-ghost video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
    .vg-ghost { transition: none; }
}

/* Player controls (hidden in preview; .vg-stage--watch turns them on) */
.vg-controls {
    position: absolute;
    left: clamp(1.5rem, 5vw, 5rem);
    right: clamp(1.5rem, 5vw, 5rem);
    bottom: 4vh;
    z-index: 2;
    display: none;
    align-items: center;
    gap: 16px;
    color: #ffffff;
}

.vg-play, .vg-mute {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.vg-play:hover, .vg-mute:hover { background: rgba(0,168,150,0.4); border-color: #2dd4bf; }
.vg-play svg, .vg-mute svg { width: 16px; height: 16px; }

.vg-time {
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.vg-progress {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.2);
    overflow: hidden;
}

.vg-progress-fill {
    height: 100%;
    width: 0%;
    background: #00A896;
    border-radius: 2px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .vg-info {
        top: auto;
        bottom: 40vh;
        transform: none;
        left: 1.25rem;
        right: 1.25rem;
        max-width: none;
    }
    .vg-title { font-size: clamp(1.8rem, 8vw, 2.6rem); }
    .vg-desc { display: none; }
    .vg-rail-wrap {
        left: 1.25rem;
        right: 1.25rem;
        bottom: 13vh;
        max-width: none;
    }
    .vg-card { width: 118px; height: 160px; }
    .vg-counter { font-size: 1.5rem; }
    .vg-controls { bottom: 2.5vh; left: 1.25rem; right: 1.25rem; }
}

