/* ==========================================================================
   Home Page Styles - Clayworks Website
   Hero, Magic Section, Specs, CTA sections
   ========================================================================== */

/* =========================================================================
   BACKGROUND VIDEO (Fixed)
   ========================================================================= */

.background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: var(--z-background-video);
    pointer-events: none;
    /* Mobile Safari fixes */
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.background-fallback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: var(--z-background);
    pointer-events: none;
}

/* =========================================================================
   HERO SECTION
   ========================================================================= */

.hero {
    background: transparent;
    padding-top: calc(var(--space-6xl) + 20px);
    padding-left: calc(var(--page-padding) + 20px);
    padding-right: calc(var(--page-padding) + 20px);
    padding-bottom: 0;
    /* Viewport height - use lvh for stable full-screen height */
    height: 100vh;                        /* Fallback for older browsers */
    height: calc(var(--vh, 1vh) * 100);   /* JS-calculated fallback */
    height: 100lvh;                       /* Large viewport height (stable) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: visible;
    z-index: var(--z-content);
}

/* Fixed background pseudo-element */
.hero::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background-video);
    pointer-events: none;
}

.hero-content {
    max-width: var(--max-width);
    text-align: center;
    position: relative;
    z-index: var(--z-content);
    margin-top: auto;
    margin-bottom: auto;
}

/* Soft shadow behind hero content for readability */
.hero-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 500px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.35) 0%, transparent 65%);
    filter: blur(80px);
    z-index: var(--z-background-video);
    pointer-events: none;
}

.hero-label {
    margin-bottom: var(--space-md);
    display: flex;
    justify-content: center;
}

.harmonimo-logo {
    height: auto;
    width: clamp(81px, 9.7vw, 121px);
    display: block;
    margin-top: -10px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: var(--text-display-lg);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: var(--space-md);
    color: var(--color-cream);
    letter-spacing: 0.2px;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: 400;
    line-height: 1.4;
    color: var(--color-cream);
    margin-bottom: var(--space-2xl);
    letter-spacing: 0.2px;
    max-width: 520px;
    padding: 0 var(--space-sm);
}

/* =========================================================================
   APP PREVIEW
   ========================================================================= */

.app-preview {
    display: flex;
    justify-content: center;
    margin-top: var(--space-hero-image);
    margin-bottom: var(--space-2xl);
    z-index: var(--z-elevated);
    width: 100%;
    padding: 0 var(--space-sm);
}

.app-preview-inner {
    position: relative;
    display: flex;
    justify-content: center;
}

.app-image {
    width: 420px;
    height: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    will-change: transform;
    transition: transform var(--transition-fast);
    position: relative;
    z-index: 2;
}

/* =========================================================================
   HERO STAR BADGES
   ========================================================================= */

.hero-star {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.star-image {
    width: 100%;
    height: auto;
    display: block;
}

.star-text {
    position: absolute;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    padding: 1.5rem;
    color: #fff;
}

/* Star 1: Right side, top half */
.hero-star-1 {
    width: 180px;
    right: -135px;
    top: 12%;
    transform: rotate(15deg);
}

/* Star 2: Left side, bottom half */
.hero-star-2 {
    width: 160px;
    left: -120px;
    bottom: 18%;
    transform: rotate(-15deg);
}

/* =========================================================================
   MAGIC SECTION
   ========================================================================= */

.magic-section {
    background: var(--color-purple-mid);
    color: var(--color-text-light);
    padding: var(--space-5xl) var(--page-padding);
    /* Padding accounts for app-image overlap + 6rem gap below image */
    padding-top: 36rem;                    /* Fallback for older browsers */
    padding-top: calc(84rem - 100lvh);     /* Adjusts based on viewport height */
    position: relative;
    z-index: var(--z-base);
}

/* Features Title (hidden for now) */
.features-title {
    text-align: center;
    font-size: var(--text-xs);
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted-dark);
    margin-bottom: var(--space-2xl);
}

/* =========================================================================
   VIDEO SHOWCASE (Hidden - keeping for later)
   ========================================================================= */

.video-showcase {
    max-width: var(--max-width);
    margin: 0 auto var(--space-3xl);
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: transparent;
}

.showcase-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================================================
   FEATURES SHOWCASE
   ========================================================================= */

.features-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto var(--space-3xl);
}

.feature-visual {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: transparent;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================================
   SPECS SECTION
   ========================================================================= */

.specs-section {
    background: var(--color-cream-dark);
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.specs-visual {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-top: calc(var(--space-3xl) + 40px);
}

.specs-image {
    width: 100%;
    max-width: min(561px, 45vw);
    height: auto;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transition: transform var(--transition-base);
}

.specs-image:hover {
    transform: translateY(-5px) scale(1.02);
}

.specs-text {
    color: var(--color-text-dark);
    padding: var(--space-2xl) var(--space-4xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.specs-title {
    font-family: var(--font-display);
    font-size: var(--text-display-xl);
    font-weight: 400;
    margin-bottom: var(--space-md);
    line-height: 1.2;
    color: var(--color-text-dark);
    letter-spacing: 0.2px;
    text-align: left;
}

.specs-list {
    list-style: none;
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.2px;
}

.specs-list li {
    padding-left: var(--space-md);
    position: relative;
    margin-bottom: var(--space-xs);
}

.specs-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-accent);
}

/* =========================================================================
   ANIMATIONS
   ========================================================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================================
   RESPONSIVE - TABLET (max-width: 1024px)
   ========================================================================= */

@media (max-width: 1024px) {
    .specs-section {
        grid-template-columns: 1fr;
    }
    
    .specs-visual {
        order: 2;
        padding-top: var(--space-lg);
    }
    
    .specs-text {
        order: 1;
        padding: var(--space-3xl) var(--page-padding) var(--space-lg);
        text-align: center;
    }
    
    .specs-title {
        text-align: center;
    }
    
    .specs-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .specs-list li {
        width: fit-content;
        padding-left: 0;
    }
    
    .specs-list li::before {
        position: static;
        margin-right: 0.5rem;
    }
    
    .specs-image {
        max-width: 450px;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    }
}

/* =========================================================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ========================================================================= */

@media (max-width: 768px) {
    /* Hide video on mobile - prevents play button issue and scroll jank */
    .background-video {
        display: none;
    }
    
    /* Change fixed elements to absolute on mobile - fixes scroll jank */
    .background-fallback {
        position: absolute;
    }
    
    .hero::before {
        position: absolute;
    }
    
    /* Hide expensive blur filter on mobile - causes scroll jank */
    .hero-content::after {
        display: none;
    }
    
    /* Remove will-change since parallax is removed */
    .app-image {
        will-change: auto;
    }
    
    .hero {
        padding: var(--space-5xl) var(--page-padding-mobile) var(--space-2xl);
    }
    
    .magic-section {
        padding: var(--space-3xl) var(--page-padding-mobile);
        padding-top: 32rem;
        padding-top: calc(81rem - 100lvh);  /* Adjusted for mobile hero padding + 6rem gap */
    }
    
    .specs-text {
        padding: var(--space-2xl) var(--page-padding-mobile) var(--space-lg);
    }
    
    .specs-image {
        max-width: 350px;
    }
}

/* =========================================================================
   RESPONSIVE - SMALL MOBILE
   ========================================================================= */

@media (max-width: 600px) {
    .app-image {
        width: 320px;
    }
    
    .magic-section {
        padding-top: 28rem;
        padding-top: calc(69rem - 100lvh);  /* + 6rem gap */
    }
    
    .hero-star-1 {
        width: 140px;
        right: -105px;
        top: 10%;
    }
    
    .hero-star-2 {
        width: 125px;
        left: -95px;
        bottom: 16%;
    }
    
    .star-text {
        font-size: 0.8rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .app-image {
        width: 280px;
    }
    
    .magic-section {
        padding-top: 24rem;
        padding-top: calc(65rem - 100lvh);  /* + 6rem gap */
    }
    
    .hero-star-1 {
        width: 120px;
        right: -90px;
        top: 8%;
    }
    
    .hero-star-2 {
        width: 110px;
        left: -85px;
        bottom: 14%;
    }
    
    .star-text {
        font-size: 0.7rem;
        padding: 0.75rem;
    }
}

@media (max-width: 400px) {
    .app-image {
        width: 250px;
    }
    
    .magic-section {
        padding-top: 22rem;
        padding-top: calc(61rem - 100lvh);  /* + 6rem gap */
    }
    
    .hero-star-1 {
        width: 100px;
        right: -78px;
        top: 10%;
    }
    
    .hero-star-2 {
        width: 90px;
        left: -70px;
        bottom: 15%;
    }
    
    .star-text {
        font-size: 0.55rem;
        padding: 0.4rem;
    }
}
