/* =========================================
   HOME.CSS - Apple-Style Landing Page
   ========================================= */

/* Scoped to body.home-page only */

/* FONTS & BASE */
.home-page {
    background-color: var(--bg);
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* 1. HERO SECTION (Full Bleed) */
.home-hero {
    position: relative;
    height: 95vh;
    /* Almost full screen */
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
}

/* Hero Media Container */
.home-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    cursor: pointer;
}

.hero-video,
.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1.5s ease;
}

/* Video defaults to visible */
.hero-video {
    z-index: 1;
    opacity: 1;
}

/* Image hidden initially (behind video) or visible as fallback */
.hero-image {
    z-index: 0;
    background-size: cover;
    background-position: center;
}

/* State: Video Ended -> Hide Video */
.hero-video.video-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Overlay for text readability & Edge Blending */
.media-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    /* Subtle dimming */
    z-index: 2;
    pointer-events: none;
    transition: background 1.5s ease;
}

/* Reduce Motion / Mobile Fallback */
/* Reduce Motion Preference Only */
@media (prefers-reduced-motion: reduce) {
    .hero-video {
        display: none;
    }
}

.home-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
    margin-top: -60px;
    /* Slight visual lift */
    opacity: 0;
    animation: heroFadeIn 1.2s ease-out forwards 0.3s;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.home-hero h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2em;
    line-height: 1.1;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.home-hero p {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 400;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-cta-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-apple {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 40px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 4px 14px var(--shadow);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    /* lighter accent */
    transform: scale(1.03);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    opacity: 0.7;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* 2. STORY BLOCKS */
.story-section {
    padding: 100px 0;
    background-color: var(--bg);
}

.story-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 120px;
    gap: 80px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    opacity: 0;
    /* JS Reveal */
    transition: opacity 1s ease, transform 1s ease;
    transform: translateY(40px);
}

.story-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.story-block.reverse {
    flex-direction: row-reverse;
}

.story-text {
    flex: 1;
    max-width: 450px;
}

.story-text h2 {
    font-size: 2.5rem;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.2;
}

.story-text p {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
}

.story-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.story-link:hover {
    text-decoration: underline;
}

.story-image {
    flex: 1.2;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.story-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.story-block:hover .story-image img {
    transform: scale(1.03);
}

/* 3. CATEGORY STRIP */
.categories-section {
    padding: 80px 20px 120px;
    background-color: var(--surface-soft);
    text-align: center;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 60px;
    color: var(--text);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.category-tile {
    position: relative;
    height: 480px;
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    background: var(--surface);
    box-shadow: 0 10px 30px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.category-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: #fff;
    text-align: left;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.tile-overlay h3 {
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.tile-overlay span {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
}

.category-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px var(--shadow);
}

.category-tile:hover img {
    transform: scale(1.1);
}

/* 4. TRUST STRIP */
.trust-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    padding: 60px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1.1rem;
}

.trust-icon {
    width: 24px;
    height: 24px;
    fill: var(--accent);
}

/* 5. FINAL CTA */
.final-cta {
    padding: 100px 20px;
    text-align: center;
    background: var(--text);
    color: #fff;
}

.final-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
}

/* --- DESKTOP HERO REFINEMENT (Gentle Zoom-Out) --- */
@media (min-width: 1025px) {
    .home-hero-media {
        background-color: var(--text);
        /* Foundation for edge blending */
    }

    /* Foreground Video & Image: Reduce perceived zoom for elegance */
    .hero-video,
    .hero-image {
        transform: scale(0.97);
        /* Gentle zoom out from full-bleed */
        transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 1.5s ease;
    }

    /* Edge Blending: Layer a soft vignette to dissolve borders into the background */
    .media-overlay {
        background: radial-gradient(circle, transparent 50%, rgba(0, 0, 0, 0.4) 100%),
            rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(0px);
        /* Just in case we want to add subtle blur later */
    }

    /* Hover effect for a more interactive, "breathing" feel */
    .home-hero-media:hover .hero-video,
    .home-hero-media:hover .hero-image {
        transform: scale(0.99);
        /* Subtle reaction on hover */
    }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .home-hero {
        height: 80vh;
        /* Better framing on mobile */
    }

    .hero-video,
    .hero-image {
        object-position: center center;
        /* Prevent weird cropping */
        object-fit: cover;
        /* Strict cover */
        transform: scale(1.1);
        /* Slight zoom to kill any black bars/edges */
    }

    .story-block {
        flex-direction: column;
        gap: 40px;
        margin-bottom: 80px;
    }

    .story-block.reverse {
        flex-direction: column;
    }

    .story-image {
        width: 100%;
    }

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

    .category-tile {
        height: 400px;
    }

    .trust-strip {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
        padding: 40px;
    }
}