:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #14141e;
    --text-primary: #e8e8ed;
    --text-secondary: #8888a0;
    --text-muted: #5a5a70;
    --accent: #ff2d6a;
    --accent-secondary: #ff6b9d;
    --accent-glow: rgba(255, 45, 106, 0.25);
    --accent-glow-strong: rgba(255, 45, 106, 0.4);
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --gradient-accent: linear-gradient(135deg, #ff2d6a 0%, #ff6b9d 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-accent: 0 4px 20px var(--accent-glow);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: transparent;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Progress Bar - Fixed at top */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-secondary);
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-accent);
    width: 0%;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 10px var(--accent-glow-strong);
}

.progress-time {
    position: fixed;
    top: 8px;
    right: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    z-index: 1001;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
}

.progress-time.visible {
    opacity: 1;
    transform: translateY(0);
}

.progress-time span {
    color: var(--accent);
    font-weight: 600;
}

/* Main Content */
.main-content {
    background: transparent !important;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem 6rem;
}

/* Sections */
.section {
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 4rem 0;
}

/* Typography */
h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.0625rem;
}

p:last-child {
    margin-bottom: 0;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-primary);
    line-height: 1.7;
}

/* Text Content Card */
.text-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.text-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

/* Media Cards */
.media-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
}

.media-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
    transform: translateY(-2px);
}

/* Video Player */
.video-container {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--transition-fast);
    cursor: pointer;
}

.video-container:hover .video-overlay,
.video-container.paused .video-overlay {
    opacity: 1;
}

.play-button {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-accent);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px var(--accent-glow-strong);
}

.play-button svg {
    width: 28px;
    height: 28px;
    fill: white;
    margin-left: 4px;
}

/* Custom Media Controls */
.media-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: var(--accent);
    background: var(--accent-glow);
}

.control-btn svg {
    width: 20px;
    height: 20px;
}

.progress-slider {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-slider-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-slider:hover .progress-slider-fill {
    background: var(--accent-secondary);
}

.time-display {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'SF Mono', Monaco, monospace;
    min-width: 80px;
    text-align: center;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-slider-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 100%;
}

/* Audio Player */
.audio-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.audio-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-accent);
}

.audio-icon svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.audio-info {
    flex: 1;
    min-width: 0;
}

.audio-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.audio-controls .progress-slider {
    flex: 1;
}

.audio-controls .control-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 50%;
}

.audio-controls .control-btn:hover {
    background: var(--accent);
    color: white;
}

/* Image Gallery */
.image-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.image-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-normal);
}

.image-card:hover img {
    transform: scale(1.02);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.image-caption {
    color: white;
    font-size: 0.9rem;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.image-grid .media-card {
    margin-bottom: 0;
}

/* Loading State */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s ease;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.offline-indicator.visible {
    transform: translateX(-50%) translateY(0);
}

.offline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.offline-indicator span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Invalid User */
.invalid-user {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.invalid-user h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.invalid-user p {
    max-width: 400px;
}

/* Focus States */
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent-glow-strong);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
    background: transparent !important;
        padding: 2rem 1rem 4rem;
    }

    .text-card,
    .media-card {
        border-radius: var(--radius-md);
    }

    .audio-card {
        flex-direction: column;
        text-align: center;
    }

    .audio-controls {
        width: 100%;
    }

    .volume-control {
        display: none;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .progress-time {
        display: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Floating Media Load Indicator */
#media-load-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    transition: opacity 0.3s, transform 0.3s;
}

#media-load-indicator.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#media-load-indicator.complete {
    border-color: var(--accent);
}

.load-indicator-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.load-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

#media-load-indicator.complete .load-spinner {
    border-color: var(--accent);
    animation: none;
}

.load-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex: 1;
}

#media-load-indicator.complete .load-text {
    color: var(--accent);
}

.load-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.load-bar {
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.load-bar-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

@media (max-width: 480px) {
    #media-load-indicator {
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* Media Card Header & Description */
.media-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.media-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.media-description {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.media-description p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Text cards - top corners only rounded */
.text-card {
    border-radius: 5px 5px 0 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.text-card.viewing {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--accent-glow);
}

/* Image cards - lift effect */
.image-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.image-card.viewing {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
    border-color: var(--accent);
}

/* Media cards lift effect */
.media-card.viewing {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
    border-color: var(--accent);
}

/* Text cards - top corners 5px, bottom 0 */
.text-card {
    border-radius: 5px 5px 0 0 !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.text-card.viewing {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
}

/* Image cards lift effect */
.image-card.viewing {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
    border-color: var(--accent);
}

/* Hero Header with Image */
.hero-header {
    margin-top: 0;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    width: calc(100% + 3rem);
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 4px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.hero-content .lead {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .hero-header {
    margin-top: 0;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    width: calc(100% + 3rem);
        min-height: 50vh;
    }
}

/* Hero header - full width, 0 margin top */
.hero-header {
    margin: 0 !important;
    width: 100% !important;
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Card header and body */
.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
    border-radius: 5px 5px 0 0;
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    background: var(--bg-primary) !important;
    padding: 1.5rem;
}

.card-body p:last-child {
    margin-bottom: 0;
}

/* Fixed hero header with image swapping */
.hero-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    height: 60vh;
    z-index: -1;
}

.hero-header .hero-image {
    transition: opacity 0.5s ease;
}

.hero-spacer {
    height: 60vh;
}

/* Main content needs background to cover fixed header */
.main-content {
    background: transparent !important;
    position: relative;
    background: transparent;
    z-index: 1;
}

/* Envelope/Postbox effect */
.hero-header {
    z-index: 1 !important;
}

.hero-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    width: 100%;
    padding: 0 2rem;
    pointer-events: none;
}

.hero-content h1 {
    position: relative;
    z-index: 100;
    padding: 1rem 2rem 1.5rem;
    margin-bottom: 0;
    background: linear-gradient(to bottom, var(--bg-primary) 0%, var(--bg-primary) 80%, transparent 100%);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.8), 0 25px 50px -15px rgba(0, 0, 0, 0.5);
}

.hero-content .lead {
    position: relative;
    z-index: 1;
    margin-top: -10px;
    padding-top: 20px;
}

.hero-spacer {
    height: 45vh;
}

.main-content {
    position: relative;
    z-index: 50 !important;
    margin-top: -15vh;
}

/* First section slides under the h1 */
.main-content .section:first-child {
    padding-top: 2rem;
}

/* Fix envelope effect - h1 matches hero background */
.hero-content {
    top: 30% !important;
    transform: translate(-50%, -50%) !important;
}

.hero-content h1 {
    background: transparent !important;
    position: relative;
    padding: 1rem 2rem;
    margin: 0;
}

.hero-content h1::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 25px;
    background: inherit;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.9), 0 15px 40px rgba(0, 0, 0, 0.6);
    z-index: 99;
}

/* The h1 container needs the hero image */
.hero-title-wrapper {
    position: relative;
    display: inline-block;
}

.hero-title-bg {
    position: absolute;
    top: -50px;
    left: -100px;
    right: -100px;
    bottom: -30px;
    background-size: cover;
    background-position: center;
    z-index: -1;
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

/* Envelope effect - separate elements */
.hero-title-fixed {
    position: fixed;
    top: 15%;
    left: 0;
    right: 0;
    z-index: 100;
    text-align: center;
    pointer-events: none;
}

.hero-title-fixed h1 {
    position: relative;
    z-index: 2;
    display: inline-block;
    padding: 0.5rem 2rem;
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    background: none !important;
    -webkit-text-fill-color: white !important;
}

.hero-title-bg {
    position: absolute;
    top: -30px;
    left: 0;
    right: 0;
    height: 150px;
    background-size: cover;
    background-position: center top;
    z-index: 1;
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 60%, transparent 100%);
}

.hero-title-fixed::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 10%;
    right: 10%;
    height: 20px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.9), 0 10px 50px rgba(0, 0, 0, 0.7);
    z-index: 3;
}

.hero-lead-fixed {
    position: fixed;
    top: 35%;
    left: 0;
    right: 0;
    z-index: 10;
    text-align: center;
    pointer-events: none;
}

.hero-lead-fixed .lead {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    font-size: 1.1rem;
    margin: 0;
    padding: 0 2rem;
}

.hero-spacer {
    height: 50vh !important;
}

.main-content {
    z-index: 50 !important;
}

/* Extend h1 background to top of screen */
.hero-title-bg {
    top: -200px !important;
    height: 350px !important;
}

.hero-title-fixed {
    top: 20% !important;
}

.hero-title-fixed h1 {
    padding-top: 150px !important;
    margin-top: -150px !important;
}

/* Cover entire top with h1 background */
.hero-title-fixed {
    top: 0 !important;
    padding-top: 15vh;
}

.hero-title-bg {
    top: 0 !important;
    height: calc(15vh + 120px) !important;
    mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%) !important;
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%) !important;
}

/* Crossfade hero images */
.hero-header .hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.hero-header .hero-image.active {
    opacity: 1;
}

/* Crossfade title backgrounds */
.hero-title-bg {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.hero-title-bg.active {
    opacity: 1;
}

/* 3D perspective for cards going through slot */
.main-content {
    perspective: 1000px;
    perspective-origin: center top;
}

.main-content .section {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.main-content .media-card,
.main-content .text-card,
.main-content .image-card {
    transform-style: preserve-3d;
    transform-origin: center bottom;
}

/* Darker shadow and narrower slot */
.hero-title-fixed::after {
    left: 5% !important;
    right: 5% !important;
    height: 30px !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 1), 
                0 15px 60px rgba(0, 0, 0, 0.9),
                0 25px 80px rgba(0, 0, 0, 0.7) !important;
}

/* Make h1 area narrower than cards */
.hero-title-fixed {
    max-width: 850px !important;
    margin: 0 auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
}

.hero-title-bg {
    left: -50px !important;
    right: -50px !important;
}

/* Undo h1 width changes */
.hero-title-fixed {
    max-width: none !important;
    margin: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
}

.hero-title-bg {
    left: 0 !important;
    right: 0 !important;
}

/* Fix white gap - extend coverage and remove mask at top */
.hero-title-bg {
    top: -100px !important;
    height: calc(15vh + 250px) !important;
    mask-image: linear-gradient(to bottom, black 0%, black 80%, transparent 100%) !important;
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 80%, transparent 100%) !important;
}

.hero-title-fixed {
    background: transparent !important;
}

.hero-title-fixed h1 {
    background: transparent !important;
}

/* Fix the light gap below h1 */
.hero-title-fixed::after {
    content: '' !important;
    position: absolute !important;
    bottom: -30px !important;
    left: 0 !important;
    right: 0 !important;
    height: 40px !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%) !important;
    box-shadow: none !important;
    z-index: 3 !important;
}

/* Add shadow to the title bg instead */
.hero-title-bg {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 1), 
                0 30px 80px rgba(0, 0, 0, 0.9) !important;
}

/* Make shadow gap same width as cards (900px) */
.hero-title-fixed::after {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: 900px !important;
    padding: 0 1.5rem !important;
    box-sizing: border-box !important;
}

.hero-title-bg {
    box-shadow: none !important;
}

/* Create centered shadow element */
.hero-title-fixed::before {
    content: '' !important;
    position: absolute !important;
    bottom: -20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 3rem) !important;
    max-width: 868px !important;
    height: 30px !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 1), 
                0 25px 80px rgba(0, 0, 0, 0.9) !important;
    z-index: 4 !important;
}

/* Full width dark gradient, shadow only at card width */
.hero-title-fixed::after {
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 50%, transparent 100%) !important;
    height: 50px !important;
}

.hero-title-fixed::before {
    bottom: -25px !important;
}

/* RESET - Clean fix for shadow slot */
.hero-title-fixed::before {
    display: none !important;
}

.hero-title-fixed::after {
    display: none !important;
}

/* Single clean shadow on the title bg bottom edge */
.hero-title-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 870px;
    height: 8px;
    background: transparent;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 1), 
                0 20px 60px rgba(0, 0, 0, 0.8);
}

/* Remove previous shadow attempts */
.hero-title-bg::after {
    display: none !important;
}

/* Simple h1 shadow with large radius - only visible in middle */
.hero-title-fixed h1 {
    box-shadow: 0 50px 100px 50px rgba(0, 0, 0, 1) !important;
}

/* Undo h1 shadow, make h1 100% wide always */
.hero-title-fixed h1 {
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

.hero-title-fixed {
    width: 100% !important;
    max-width: 100% !important;
}

/* Slot shadow - centered dark shadow at card width */
.slot-shadow {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 870px;
    height: 20px;
    background: radial-gradient(ellipse 50% 100% at center, rgba(0,0,0,1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 200;
}

/* Slot shadow - wider, darker, softer edges */
.slot-shadow {
    bottom: -30px !important;
    max-width: 1000px !important;
    height: 60px !important;
    background: radial-gradient(ellipse 70% 100% at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0.9) 30%, rgba(0,0,0,0.5) 60%, transparent 100%) !important;
    filter: blur(8px) !important;
}

/* Move progress bar to bottom */
.progress-container {
    top: auto !important;
    bottom: 0 !important;
}

.progress-time {
    top: auto !important;
    bottom: 12px !important;
    right: 16px !important;
}

/* Lead closer to h1 with top shadow */
.hero-lead-fixed {
    top: 28% !important;
    margin-top: 0 !important;
}

.hero-lead-fixed .lead {
    margin-top: 0 !important;
    padding-top: 0 !important;
    box-shadow: 0 -30px 40px rgba(0, 0, 0, 0.9) !important;
}

/* Undo lead shadow */
.hero-lead-fixed .lead {
    box-shadow: none !important;
}

/* Move slot shadow down 30px, make 150px wider */
.slot-shadow {
    bottom: -60px !important;
    max-width: 1150px !important;
}

/* Slot shadow - 15px more down, less fade, darker */
.slot-shadow {
    bottom: -75px !important;
    background: radial-gradient(ellipse 80% 100% at center, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 50%, rgba(0,0,0,0.7) 80%, transparent 100%) !important;
    filter: blur(5px) !important;
}

/* Slot shadow - moderate fade on sides */
.slot-shadow {
    background: radial-gradient(ellipse 60% 100% at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0.9) 40%, rgba(0,0,0,0.5) 70%, transparent 95%) !important;
    filter: blur(6px) !important;
}

/* Cards go behind at middle of shadow, not bottom */
.hero-title-fixed {
    z-index: 100 !important;
}

.slot-shadow {
    z-index: 101 !important;
}

.main-content {
    z-index: 50 !important;
}

/* Move slot shadow up so cards go behind at middle */
.slot-shadow {
    bottom: -40px !important;
    height: 80px !important;
}

/* Preload Overlay */
.preload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a0f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.preload-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.preload-content {
    text-align: center;
    color: #fff;
}

.preload-content .loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 3px solid rgba(255, 45, 106, 0.2);
    border-top-color: #ff2d6a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.preload-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.preload-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 0 auto 15px;
    overflow: hidden;
}

.preload-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #ff2d6a, #ff6b9d);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.preload-count {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Hide content while loading */
body.loading .hero-header,
body.loading .hero-title-fixed,
body.loading .hero-lead-fixed,
body.loading .main-content,
body.loading .progress-container,
body.loading .progress-time {
    opacity: 0;
}

/* Slot shadow - moved down, lighter bottom, darker div background */
.slot-shadow {
    bottom: -55px !important;
    height: 100px !important;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.95) 0%, 
        rgba(0,0,0,0.7) 40%, 
        rgba(0,0,0,0.3) 70%, 
        transparent 100%
    ) !important;
    filter: blur(8px) !important;
}

/* Make the title div background darker than shadows */
.hero-title-fixed {
    background-color: #000 !important;
}

.hero-title-bg {
    opacity: 0.85 !important;
}

.hero-title-bg.active {
    opacity: 0.85 !important;
}

/* Slot shadow - refined with horizontal fade + vertical gradient */
.slot-shadow {
    bottom: -55px !important;
    height: 90px !important;
    background: radial-gradient(ellipse 55% 80% at center top, 
        rgba(0,0,0,0.95) 0%, 
        rgba(0,0,0,0.6) 50%,
        rgba(0,0,0,0.2) 80%,
        transparent 100%
    ) !important;
    filter: blur(6px) !important;
}

/* Move slot shadow down 55px more */
.slot-shadow {
    bottom: -110px !important;
}

/* Lead text - up 35px, dark with inner shadow */
.hero-lead-fixed {
    top: calc(28% - 35px) !important;
}

.hero-lead-fixed .lead {
    background: rgba(0, 0, 0, 0.85) !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.9) !important;
}

/* Sync h1 background transition with hero images */
.hero-title-bg {
    transition: opacity 0.8s ease-in-out !important;
}

.hero-image {
    transition: opacity 0.8s ease-in-out !important;
}

/* Lead - dark gray background, almost black inner shadow */
.hero-lead-fixed .lead {
    background: #1a1a1a !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.95) !important;
}

/* Lead text color - black */
.hero-lead-fixed .lead {
    color: #000 !important;
}

/* Lead text - bring to front, visible */
.hero-lead-fixed {
    z-index: 150 !important;
}

.hero-lead-fixed .lead {
    color: #fff !important;
    position: relative;
    z-index: 151 !important;
}

/* Align both images to top */
.hero-image {
    object-position: center top !important;
    object-fit: cover !important;
}

.hero-title-bg {
    background-position: center top !important;
    background-size: cover !important;
}

/* Force both images to align from absolute top */
.hero-image {
    top: 0 !important;
    object-position: top center !important;
}

.hero-title-bg {
    top: 0 !important;
    background-position: top center !important;
}

.hero-header {
    top: 0 !important;
}

.hero-title-fixed {
    top: 0 !important;
}

/* Stop all flashing - smooth everything */
.hero-image,
.hero-title-bg {
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Prevent any flicker on scroll */
.hero-header,
.hero-title-fixed,
.hero-lead-fixed,
.main-content {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Disable 3D tilt effect - causes flashing */
.main-content .section {
    transform: none !important;
    transition: none !important;
}

.media-card,
.text-card,
.image-card {
    transform: none !important;
    transition: box-shadow 0.3s ease !important;
}

/* Smooth opacity only */
.hero-image {
    opacity: 0;
    transition: opacity 1s ease !important;
}

.hero-image.active {
    opacity: 1;
}

.hero-title-bg {
    opacity: 0;
    transition: opacity 1s ease !important;
}

.hero-title-bg.active {
    opacity: 0.85;
}

/* No flashing on any element */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Fix slot shadow - soft edges on all sides */
.slot-shadow {
    bottom: -110px !important;
    height: 120px !important;
    max-width: 900px !important;
    background: radial-gradient(ellipse 100% 100% at center top, 
        rgba(0,0,0,0.9) 0%, 
        rgba(0,0,0,0.6) 30%,
        rgba(0,0,0,0.3) 60%,
        transparent 100%
    ) !important;
    filter: blur(15px) !important;
}

/* Undo lead changes - back to original position, no background */
.hero-lead-fixed {
    top: 28% !important;
}

.hero-lead-fixed .lead {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: #333 !important;
}

/* Dedicated shadow div below h1 */
.title-shadow-div {
    position: fixed;
    top: 15vh;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    max-width: 90%;
    height: 150px;
    background: radial-gradient(ellipse 100% 80% at center top,
        rgba(0,0,0,0.95) 0%,
        rgba(0,0,0,0.7) 25%,
        rgba(0,0,0,0.4) 50%,
        rgba(0,0,0,0.1) 75%,
        transparent 100%
    );
    filter: blur(12px);
    pointer-events: none;
    z-index: 99;
}

/* Hide the old slot shadow */
.slot-shadow {
    display: none !important;
}

/* Fix dedicated shadow - only below h1, not over content */
.title-shadow-div {
    position: fixed;
    top: calc(15vh + 60px);
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    max-width: 85%;
    height: 80px;
    background: radial-gradient(ellipse 100% 100% at center top,
        rgba(0,0,0,0.8) 0%,
        rgba(0,0,0,0.4) 40%,
        transparent 100%
    );
    filter: blur(10px);
    pointer-events: none;
    z-index: 90;
}

/* DEBUG - bright red shadow */
.title-shadow-div {
    background: radial-gradient(ellipse 100% 100% at center top,
        rgba(255,0,0,0.9) 0%,
        rgba(255,0,0,0.5) 40%,
        transparent 100%
    ) !important;
    filter: none !important;
}

/* CLEAN OVERRIDE - Remove all old shadows */
.hero-title-fixed::before,
.hero-title-fixed::after {
    display: none !important;
    content: none !important;
}

.slot-shadow {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* ONLY shadow - bright red to see it */
.title-shadow-div {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    top: calc(15vh + 80px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 800px !important;
    max-width: 85% !important;
    height: 100px !important;
    background: red !important;
    filter: none !important;
    pointer-events: none !important;
    z-index: 95 !important;
}

/* FIX - hero-title-fixed only covers header area */
.hero-title-fixed {
    height: 15vh !important;
    max-height: 15vh !important;
    overflow: visible !important;
    background-color: transparent !important;
}

.hero-title-bg {
    height: 100% !important;
}

/* Main content in front */
.main-content {
    position: relative !important;
    z-index: 50 !important;
    background: #0a0a0f !important;
}

/* Hide the CSS shadow div class */
.title-shadow-div {
    display: none !important;
}

/* FINAL FIX - h1 area solid, no bleed through */
.hero-title-fixed {
    height: 15vh !important;
    background: #0a0a0f !important;
    overflow: hidden !important;
}

.hero-title-bg {
    opacity: 1 !important;
}

/* Lead text below h1, not on shadow */
.hero-lead-fixed {
    top: 16vh !important;
    z-index: 88 !important;
}

.hero-lead-fixed .lead {
    background: transparent !important;
    color: rgba(255,255,255,0.7) !important;
}

/* FIX - Show h1 */
.hero-title-fixed {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hero-title-fixed h1 {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #fff !important;
}

/* FIX - Show content */
.main-content {
    background: transparent !important;
}

.main-content .section {
    background: transparent !important;
}

.media-card, .text-card {
    background: #1a1a2e !important;
}

/* ============================================
   FINAL DEFINITIVE RULES - DO NOT ADD MORE
   ============================================ */

.hero-title-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 15vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100 !important;
    overflow: visible !important;
    background: transparent !important;
}

.hero-title-fixed h1 {
    position: relative !important;
    z-index: 102 !important;
    color: #fff !important;
    font-size: 2.5rem !important;
    text-shadow: 0 2px 20px rgba(0,0,0,0.8) !important;
}

.hero-title-bg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-size: cover !important;
    background-position: top center !important;
    z-index: 1 !important;
}

.hero-title-bg.active {
    opacity: 1 !important;
}

.hero-title-bg:not(.active) {
    opacity: 0 !important;
}

.hero-lead-fixed {
    position: fixed !important;
    top: 15vh !important;
    left: 0 !important;
    right: 0 !important;
    text-align: center !important;
    z-index: 90 !important;
    padding: 10px !important;
    background: linear-gradient(to bottom, rgba(10,10,15,0.9), transparent) !important;
}

.hero-lead-fixed .lead {
    color: rgba(255,255,255,0.7) !important;
    background: transparent !important;
    margin: 0 !important;
}

/* Shadow below header */
#main-shadow {
    position: fixed !important;
    top: 15vh !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 800px !important;
    height: 80px !important;
    background: radial-gradient(ellipse 100% 100% at center top, rgba(0,0,0,0.8) 0%, transparent 100%) !important;
    pointer-events: none !important;
    z-index: 89 !important;
    filter: blur(10px) !important;
}

.main-content {
    position: relative !important;
    z-index: 50 !important;
    background: transparent !important;
    padding-top: 25vh !important;
}

.slot-shadow {
    display: none !important;
}

/* H1 area with background image - content goes behind */
.hero-title-fixed {
    background: #0a0a0f !important;
}

.hero-title-bg {
    opacity: 0 !important;
    transition: opacity 0.8s ease !important;
}

.hero-title-bg.active {
    opacity: 1 !important;
}

/* Content slides BEHIND h1 area */
.hero-title-fixed {
    z-index: 100 !important;
}

.main-content {
    z-index: 50 !important;
    margin-top: -5vh !important;
}

/* ENVELOPE EFFECT - Content goes BEHIND h1 area */
.hero-title-fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 20vh !important;
    z-index: 100 !important;
    overflow: hidden !important;
}

/* Lead text is part of the fixed header */
.hero-lead-fixed {
    position: fixed !important;
    top: 12vh !important;
    z-index: 101 !important;
    background: transparent !important;
}

/* Main content scrolls BEHIND fixed header */
.main-content {
    position: relative !important;
    z-index: 50 !important;
    padding-top: 22vh !important;
    margin-top: 0 !important;
}

/* Shadow at bottom of h1 area */
#main-shadow {
    position: fixed !important;
    top: 20vh !important;
    z-index: 99 !important;
}

/* NO shadow on h1 text */
.hero-title-fixed h1 {
    text-shadow: none !important;
    box-shadow: none !important;
}

/* Shadow div - same width as content cards */
#main-shadow {
    position: fixed !important;
    top: 20vh !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: 800px !important;
    height: 60px !important;
    background: radial-gradient(ellipse 100% 100% at center top, rgba(0,0,0,0.7) 0%, transparent 100%) !important;
    pointer-events: none !important;
    z-index: 99 !important;
    filter: blur(8px) !important;
}

/* NO SHADOW ON H1 - NEVER */
.hero-title-fixed h1 {
    text-shadow: none !important;
    box-shadow: none !important;
    filter: none !important;
}

/* NO SHADOW ON LEAD */
.hero-lead-fixed,
.hero-lead-fixed .lead {
    text-shadow: none !important;
    box-shadow: none !important;
    filter: none !important;
}

/* Shadow BELOW h1 */
#main-shadow {
    top: 15vh !important;
}

/* Remove line through h1 */
.hero-title-fixed {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    text-decoration: none !important;
}

.hero-title-fixed::before,
.hero-title-fixed::after {
    display: none !important;
    content: none !important;
    border: none !important;
}

.hero-title-fixed h1 {
    text-decoration: none !important;
    border: none !important;
}

/* Move shadow further down - below h1 and lead */
#main-shadow {
    top: 18vh !important;
}

/* Remove mask causing line */
.hero-title-bg {
    mask-image: none !important;
    -webkit-mask-image: none !important;
}
