:root {
    --bg: #f4f6f8;
    --fg: #0f172a;
    --muted: #64748b;
    --accent: #6366f1;
    --border: #e2e8f0;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    overflow-x: hidden;
    width: 100%;
}

.font-display {
    font-family: 'Space Grotesk', sans-serif;
}

/* ============ Hero Section (redesigned) ============ */
.jumbo-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 34em;
    padding: 9rem 1.5rem 4.5rem 1.5rem;
    text-align: center;
    overflow: hidden;
    background: #0b0f19;
    isolation: isolate;
}

/* Layer 0: background (video / custom image / poster marquee) */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg img.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

/* Background video (YouTube iframe) filling the hero, cropped like object-fit:cover */
.hero-bg-video-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-bg-video-wrap iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 177.78vh;
    height: 56.25vw;
    min-height: 100%;
    min-width: 100%;
    transform: translate(-50%, -50%);
}

/* Fallback: living poster marquee built from real catalogue posters */
.hero-poster-marquee {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    transform: rotate(-6deg) scale(1.2);
    opacity: 0.55;
    filter: saturate(0.6);
}

.hero-marquee-row {
    display: flex;
    gap: 0.75rem;
    width: max-content;
    animation: marqueeScroll 70s linear infinite;
}

.hero-marquee-row.reverse {
    animation-direction: reverse;
    animation-duration: 85s;
}

.hero-marquee-row img {
    width: 130px;
    height: 195px;
    object-fit: cover;
    border-radius: 0.75rem;
    flex-shrink: 0;
}

@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Layer 1: gradient overlays for legibility, strength driven by --hero-overlay */
.hero-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 50% 15%, rgba(11, 15, 25, 0) 0%, rgba(11, 15, 25, calc(0.35 + var(--hero-overlay, 0.5) * 0.35)) 55%, rgba(11, 15, 25, 0.96) 100%),
        linear-gradient(to top, #0b0f19 0%, rgba(11, 15, 25, 0.75) 28%, rgba(11, 15, 25, 0.2) 60%, rgba(11, 15, 25, calc(0.15 + var(--hero-overlay, 0.5) * 0.35)) 100%);
    pointer-events: none;
}

/* Ensure content stays on top */
.jumbo-hero > * {
    position: relative;
    z-index: 2;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(251, 162, 0, 0.12);
    border: 1px solid rgba(251, 162, 0, 0.35);
    color: #fdba4a;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.75rem;
}

.hero-stats .stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    line-height: 1.1;
}

.hero-stats .stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-scroll-cue {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255, 255, 255, 0.5);
    animation: heroBounce 2.2s ease-in-out infinite;
}

@keyframes heroBounce {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.4; }
    50% { transform: translate(-50%, 6px); opacity: 0.9; }
}

@media (max-width: 768px) {
    .jumbo-hero {
        min-height: 30em;
        padding: 7rem 1.25rem 3.5rem 1.25rem;
    }

    .hero-stats {
        gap: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-marquee-row,
    .hero-scroll-cue {
        animation: none;
    }
}

/* Modern Carousel */
.carousel-wrapper {
    position: relative;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.carousel-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0 1.5rem 0;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    flex-shrink: 0;
    scroll-snap-align: start;
    width: 130px;
}

@media (min-width: 480px) {
    .carousel-item {
        width: 150px;
    }
}

@media (min-width: 768px) {
    .carousel-item {
        width: 170px;
    }
}

@media (min-width: 1024px) {
    .carousel-item {
        width: 185px;
    }
}

/* Carousel Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.carousel-wrapper:hover .carousel-btn,
.carousel-wrapper:focus-within .carousel-btn {
    opacity: 1;
    pointer-events: auto;
}

.carousel-btn:hover {
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn.prev {
    left: 0.5rem;
}

.carousel-btn.next {
    right: 0.5rem;
}

@media (max-width: 768px) {
    .carousel-btn {
        display: none;
    }
}

/* Card Styles */
.media-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
}

.media-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.2);
}

.media-card:hover .card-overlay,
.media-card:focus-within .card-overlay {
    opacity: 1;
}

.card-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-card .card-play-btn {
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.media-card:hover .card-play-btn,
.media-card:focus-within .card-play-btn {
    transform: scale(1);
}

@media (hover: none) {
    /* Touch devices: keep the affordance visible without requiring hover */
    .card-overlay {
        opacity: 0.85;
    }
}

.score-badge {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(4px);
}

/* Focus Ring */
.focus-ring:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

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

.animate-in {
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .animate-in {
        animation: none;
        opacity: 1;
    }

    .media-card:hover {
        transform: none;
    }
}

/* Modal */
.modal-overlay {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
}

/* login  */


/* --- Mobile Menu Button --- */
.mobile-menu-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #64748b; /* Slate 500 */
    transition: all 0.2s;
}
.mobile-menu-btn:hover { color: #0f172a; background: rgba(0,0,0,0.05); }

/* --- Mobile Menu Drawer (Light) --- */
.mobile-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    z-index: 40;
    padding: 1.5rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: 5px 0 15px rgba(0,0,0,0.05);
}
.mobile-nav.is-open { transform: translateX(0); }

/* --- Modal Overlay --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4); /* Softer dark overlay for light mode */
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }

/* --- Modal Panel (Light Mode) --- */
.account-modal {
    width: 100%;
    max-height: 90vh;
    background: #ffffff;
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    z-index: 101;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}

/* Open State Animation */
.account-modal.is-open { transform: translateY(0); opacity: 1; }

/* WEB SPECIFIC: Centered Box */
@media (min-width: 640px) {
    .account-modal {
        max-width: 480px;
        width: 100%;
        border-radius: 1.5rem; /* Rounded all corners */
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
        transform: translateY(20px) scale(0.95);
    }
    .account-modal.is-open {
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.jw-modal-new__header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9; /* Slate 100 */
}
.jw-modal-new-toolbar { display: flex; align-items: center; justify-content: space-between; }
.jw-modal-new-title { font-size: 1.125rem; font-weight: 700; color: #0f172a; /* Slate 900 */ }
.new-design-modal__close {
    padding: 0.5rem;
    color: #94a3b8;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    transition: background 0.2s;
}
.new-design-modal__close:hover { background: #f1f5f9; color: #0f172a; }

/* Modal Body */
.jw-modal-new__body { padding: 1.5rem; overflow-y: auto; }

/* --- Modal Buttons (Light Mode) --- */
.account-modal-button {
    width: 100%;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0; /* Slate 200 */
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    text-align: left;
    transition: all 0.2s;
    color: #1e293b;
}
.account-modal-button:hover { 
    background: #f8fafc; 
    border-color: #cbd5e1; 
}

.account-modal-button .button-left {
    width: 40px;
    display: flex;
    justify-content: center;
    color: #fba200; /* Brand Color Icon */
}
.account-modal-button .text-wrapper { flex: 1; padding: 0 0.75rem; }
.account-modal-button .text-light { color: #64748b; font-size: 0.875rem; }
.account-modal-button .button-right { color: #94a3b8; }

/* CTA Button (Create Account) - Brand Color #fba200 */
.account-modal-button.cta-button {
    background: #fba200;
    border: none;
    color: #ffffff;
}
/* Fix text colors inside CTA for readability */
.cta-button .button-left, 
.cta-button .button-right { color: #ffffff; }
.cta-button .text-light { color: rgba(255,255,255,0.9); }
.cta-button .list li svg { color: #ffffff; }

.cta-button:hover {
    background: #e59100; /* Slightly darker on hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 162, 0, 0.25);
}

/* Secondary Buttons */
.account-modal-button.secondary { 
    background: #f8fafc; /* Slate 50 */
    border: 1px solid #e2e8f0; 
}
.account-modal-button.secondary:hover { background: #f1f5f9; }
div#account-modal {
    border-radius: 12px;
}