/* ============================================================
   TGLT Media Server - Landing Page Styles
   ============================================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --lander-primary: #6366f1;
    --lander-accent: #8b5cf6;
    --lander-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --lander-radius: 12px;
    --lander-radius-sm: 8px;
    --lander-radius-lg: 20px;
    --lander-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --lander-transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark {
    --lander-bg: #0a0a0f;
    --lander-bg-subtle: #111118;
    --lander-surface: #16161f;
    --lander-surface-hover: #1e1e2a;
    --lander-border: rgba(255, 255, 255, 0.08);
    --lander-border-hover: rgba(255, 255, 255, 0.15);
    --lander-text: #f0f0f5;
    --lander-text-secondary: #9999aa;
    --lander-text-muted: #666677;
    --lander-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --lander-shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
    --lander-glass: rgba(22, 22, 31, 0.7);
    --lander-glass-border: rgba(255, 255, 255, 0.06);
}

body.light {
    --lander-bg: #f8f9fc;
    --lander-bg-subtle: #eef0f5;
    --lander-surface: #ffffff;
    --lander-surface-hover: #f5f5fa;
    --lander-border: rgba(0, 0, 0, 0.08);
    --lander-border-hover: rgba(0, 0, 0, 0.15);
    --lander-text: #111118;
    --lander-text-secondary: #555566;
    --lander-text-muted: #888899;
    --lander-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --lander-shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.12);
    --lander-glass: rgba(255, 255, 255, 0.8);
    --lander-glass-border: rgba(0, 0, 0, 0.06);
}

body {
    font-family: var(--lander-font);
    background: var(--lander-bg);
    color: var(--lander-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Hero Section --- */
.lander-hero {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 24px 80px;
    overflow: hidden;
}

.lander-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, var(--lander-primary), transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 20%, var(--lander-accent), transparent 70%);
    opacity: 0.12;
    pointer-events: none;
}

.lander-hero__content {
    position: relative;
    max-width: 800px;
    z-index: 1;
}

.lander-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 100px;
    background: var(--lander-surface);
    border: 1px solid var(--lander-border);
    color: var(--lander-accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 24px;
}

.lander-hero__title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--lander-text) 0%, var(--lander-text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lander-hero__subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--lander-text-secondary);
    max-width: 600px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

/* --- Hero Link Buttons --- */
.lander-hero__links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.lander-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--lander-radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--lander-transition);
    cursor: pointer;
    border: none;
}

.lander-link-btn--primary {
    background: var(--lander-primary);
    color: #fff;
}

.lander-link-btn--primary:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--lander-primary) 40%, transparent);
}

.lander-link-btn--secondary {
    background: var(--lander-surface);
    color: var(--lander-text);
    border: 1px solid var(--lander-border);
}

.lander-link-btn--secondary:hover {
    border-color: var(--lander-border-hover);
    background: var(--lander-surface-hover);
    transform: translateY(-1px);
}

.lander-link-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* --- Section Container --- */
.lander-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.lander-section__header {
    text-align: center;
    margin-bottom: 48px;
}

.lander-section__title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.lander-section__desc {
    color: var(--lander-text-secondary);
    font-size: 1rem;
}

/* --- Video Card Grid --- */
.lander-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* --- Video Card --- */
.video-card {
    position: relative;
    background: var(--lander-surface);
    border: 1px solid var(--lander-border);
    border-radius: var(--lander-radius);
    overflow: hidden;
    transition: var(--lander-transition);
    cursor: pointer;
}

.video-card:hover {
    border-color: var(--lander-border-hover);
    transform: translateY(-4px);
    box-shadow: var(--lander-shadow-lg);
}

.video-card__thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--lander-bg-subtle);
    overflow: hidden;
}

.video-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card:hover .video-card__thumbnail img {
    transform: scale(1.05);
}

.video-card__thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--lander-bg-subtle), var(--lander-surface));
}

.video-card__thumbnail-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--lander-text-muted);
    opacity: 0.4;
}

.video-card__play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: var(--lander-transition);
}

.video-card:hover .video-card__play-overlay {
    opacity: 1;
}

.video-card__play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--lander-transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.video-card:hover .video-card__play-btn {
    transform: scale(1.1);
}

.video-card__play-btn svg {
    width: 24px;
    height: 24px;
    color: #111;
    margin-left: 3px;
}

.video-card__duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.video-card__body {
    padding: 20px;
}

.video-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--lander-primary) 15%, transparent);
    color: var(--lander-primary);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}

.video-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.video-card__desc {
    color: var(--lander-text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Video Modal (Lightbox) --- */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.video-modal[hidden] {
    display: none;
}

.video-modal.is-opening {
    display: flex;
}

.video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.video-modal.is-open .video-modal__backdrop {
    opacity: 1;
}

.video-modal__container {
    position: relative;
    width: 100%;
    max-width: 960px;
    z-index: 1;
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-modal.is-open .video-modal__container {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.video-modal__close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: var(--lander-transition);
}

.video-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-modal__title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    opacity: 0.9;
}

.video-modal__player-wrap {
    border-radius: var(--lander-radius);
    overflow: hidden;
    background: #000;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.video-modal__player-wrap video {
    width: 100%;
    display: block;
}

/* --- Scroll Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Staggered card entrance */
.video-card.reveal {
    transition-delay: calc(var(--card-index, 0) * 0.08s);
}

/* --- Footer --- */
.lander-footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--lander-text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--lander-border);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .lander-hero {
        padding: 80px 20px 60px;
        min-height: auto;
    }

    .lander-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .lander-section {
        padding: 0 16px 60px;
    }

    .video-modal {
        padding: 12px;
    }

    .video-modal__close {
        top: -44px;
    }

    .video-card__play-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.15);
    }

    .video-card__play-btn {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 480px) {
    .lander-hero__links {
        flex-direction: column;
        align-items: stretch;
    }

    .lander-link-btn {
        justify-content: center;
    }
}

/* --- Utility: body scroll lock when modal open --- */
body.modal-open {
    overflow: hidden;
}
