/* =========================================
   VARIABLES & DESIGN SYSTEM
   ========================================= */
:root {
    --color-bg-base: #050505;
    --color-primary: #950714;
    --color-text-main: #e2dfd8;
    --color-text-muted: #a3a099;

    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;

    --transition-smooth: 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* =========================================
   RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100vw;
    height: 100vh;
    background-color: var(--color-bg-base);
    color: var(--color-text-main);
    font-family: var(--font-body);
    overflow: hidden;
    /* Strict no scroll */
    user-select: none;
}

/* =========================================
   HEADER
   ========================================= */
.site-header {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    display: flex;
    justify-content: center;
    width: 100%;
}

.header-logo-img {
    height: 60px;
    width: auto;
    max-width: 90vw;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
    transition: height 0.3s ease;
}

@media (min-width: 768px) {
    .header-logo-img {
        height: 80px;
    }
}

/* =========================================
   CAROUSEL LAYOUT
   ========================================= */
.carousel-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    background: radial-gradient(circle at center, #111 0%, #000 100%);
}

.carousel-card {
    position: absolute;
    width: 85vw;
    height: 60vh;
    aspect-ratio: 9 / 16;
    /* Fix punch-in by matching vertical video resolution */
    max-height: 650px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);

    /* Very smooth transitions for everything, NO delay on z-index so active card jumps to top instantly */
    transition: transform var(--transition-smooth),
        opacity var(--transition-smooth),
        border-color var(--transition-smooth);
}

/* Desktop sizing tweaks */
@media (min-width: 900px) {
    .carousel-card {
        height: 75vh;
        max-height: 800px;
        aspect-ratio: 9 / 16;
        width: auto;
        max-width: none;
    }
}

/* =========================================
   CAROUSEL STATES
   ========================================= */

/* The focused center card */
.card-active {
    transform: translateX(0) scale(1.1);
    z-index: 5;
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(149, 7, 20, 0.2);
}

/* The card to the left */
.card-prev {
    transform: translateX(-65%) scale(0.85);
    /* Overlaps behind center */
    z-index: 2;
    opacity: 1;
    /* Keep solid 1 to prevent ghosting during slide! */
}

/* The card to the right */
.card-next {
    transform: translateX(65%) scale(0.85);
    z-index: 2;
    opacity: 1;
    /* Keep solid 1 to prevent ghosting during slide! */
}

/* Mobile overlapping */
@media (max-width: 768px) {
    .card-active {
        transform: translateX(0) scale(1.05);
    }

    .card-prev {
        transform: translateX(-50%) scale(0.85);
        opacity: 1;
    }

    .card-next {
        transform: translateX(50%) scale(0.85);
        opacity: 1;
    }
}

/* Hovering side cards gives a cue */
.card-prev:hover,
.card-next:hover {
    opacity: 0.8;
    transform: translateX(calc(var(--offset) * 1.05)) scale(0.88);
    /* Requires CSS variable if we did it inline, but let's just use strict classes */
}

.card-prev:hover {
    transform: translateX(-62%) scale(0.88);
}

.card-next:hover {
    transform: translateX(62%) scale(0.88);
}

/* =========================================
   VIDEO BACKGROUNDS & EFFECTS
   ========================================= */
.card-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Perfectly fits the entire video within the card boundaries */
    /* Default strictly dimmed if not active */
    opacity: 0.35;
    transition: opacity var(--transition-smooth), filter var(--transition-smooth);
    filter: grayscale(80%) contrast(1.2) blur(6px);
    /* Added blur for side cards */
}

.card-active .card-video {
    opacity: 0.75;
    /* Brighter when center */
    filter: grayscale(10%) contrast(1.1) blur(0px);
    /* Sharp in center */
}

/* Hovering the ACTIVE card gives it full focus */
.card-active:hover .card-video {
    opacity: 1;
    filter: grayscale(0%) contrast(1.1) blur(0px);
    /* Removed scale to ensure full video is always visible */
}

/* =========================================
   CARD OVERLAY CONTROLS
   ========================================= */
.card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 10;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.5) 100%);
    transition: background var(--transition-smooth);
}

.card-active:hover .card-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0) 100%);
}

/* Typographic Title Image */
.card-title-img {
    width: 80%;
    max-width: 300px;
    height: auto;
    object-fit: contain;
    transition: transform var(--transition-smooth), opacity var(--transition-smooth);
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.9));
}

/* Sub-cards dim it slightly */
.card-prev .card-title-img,
.card-next .card-title-img {
    opacity: 0.7;
}

/* Hidden elements to reveal ONLY on the active card */
.card-reveal-content {
    position: absolute;
    bottom: 2rem;
    left: 1.5rem;
    right: 1.5rem;
    text-align: center;
    /* Hide initially */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
    /* Let clicks pass through to the anchor tag */
}

.card-desc {
    color: var(--color-text-main);
    font-size: 0.9rem;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    max-width: 250px;
}

.btn-card {
    font-family: var(--font-heading);
    color: var(--color-primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

/* =========================================
   HOVER / ACTIVE INTERACTIONS
   ========================================= */

/* On mobile, we might not have hover, so we just show the reveal right away on the active one if we want,
   but hovering is super nice for uncovering the video. */
@media (hover: hover) {
    .card-active:hover .card-title-img {
        /* Move the huge text up to see the cool video! */
        transform: translateY(-12vh) scale(0.65);
    }

    .card-active:hover .card-reveal-content {
        opacity: 1;
        transform: translateY(0);
    }

    .card-active:hover .btn-card {
        border-color: var(--color-primary);
    }
}

/* Mobile fallback for reveal - always show it slightly or require a tap */
@media (hover: none) {
    .card-active .card-video {
        opacity: 0.8;
        /* Keep bright */
    }

    .card-active .card-title-img {
        transform: translateY(-10vh) scale(0.65);
        /* Permanently shifted up */
    }

    .card-active .card-reveal-content {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   NAVIGATION HINTS
   ========================================= */
.nav-hints {
    position: absolute;
    bottom: 2rem;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    pointer-events: none;
    opacity: 0.3;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-main);
    font-weight: 300;
}

@media (min-width: 768px) {
    .nav-hints {
        opacity: 0.5;
        bottom: 3rem;
        padding: 0 15%;
        /* Push inwards */
    }
}