/* 
   Ileria Cinematic Homepage
   Premium Dark-to-Light Architecture
*/

/* Remove TwentyTwentyfour page wrappers */
body.ileria-homepage-full .wp-site-blocks,
body.ileria-homepage-full .wp-block-post,
body.ileria-homepage-full .wp-block-post-content,
body.ileria-homepage-full .entry-content,
body.ileria-homepage-full main,
body.ileria-homepage-full .is-layout-constrained,
body.ileria-homepage-full .is-layout-flow {
    max-width: none !important; width: 100% !important;
    padding: 0 !important; margin: 0 !important;
}

body.ileria-homepage-full #ileria-home-v1 {
    width: 100% !important; max-width: 100% !important;
    margin: 0 !important;
    /* Removed overflow-x: hidden because it breaks position: sticky down the DOM tree! */
}

/* =========================================
   CORE THEME TOKENS
   ========================================= */
#ileria-home-v1 {
    /* Base Variables */
    --font-heading: 'Poppins', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    font-family: var(--font-body);
    width: 100%;
    margin-top: -32px;
    transition: background-color 1s ease, color 1s ease;
}

/* Dark Theme Variables */
.h-theme-dark {
    --bg-main: #020611;
    --bg-secondary: #050d1e;
    --text-primary: #ffffff;
    --text-secondary: #8b98a5;
    --accent-glow: rgba(0, 210, 255, 0.15);
    --border-color: rgba(255,255,255,0.08);
    background-color: var(--bg-main);
    color: var(--text-primary);
}

/* Light Theme Variables */
.h-theme-light {
    --bg-main: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #001a3d;
    --text-secondary: #64748b;
    --accent-glow: rgba(0, 64, 148, 0.05);
    --border-color: rgba(0,0,0,0.06);
    background-color: var(--bg-main);
    color: var(--text-primary);
}

#ileria-home-v1 * { box-sizing: border-box; }
#ileria-home-v1 h1, #ileria-home-v1 h2, #ileria-home-v1 h3, #ileria-home-v1 p { margin: 0; padding: 0; }
a { text-decoration: none; }

.home-wrap {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* =========================================
   1. MEGA-SCROLLYTELLING (HERO + CORE)
========================================= */
.h-mega-scrolly {
    position: relative;
    /* 4 Slides = 400vh of scrollable space */
    height: 400vh;
}

.h-mega-sticky-container {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh; /* Locks to viewport */
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* The Fixed Visual Side */
.h-mega-visual {
    position: absolute;
    right: 22vw; /* Massively pushed left to counteract the scale(2.5) expansion */
    top: 0;
    width: 35vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.h-dark-glow {
    position: absolute;
    width: 200%; height: 200%;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 210, 255, 0.15) 0%, transparent 60%);
    z-index: 0;
    animation: h-pulse 8s infinite alternate ease-in-out;
    pointer-events: none;
}

#mega-spin-device {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    object-fit: contain;
    filter: drop-shadow(0 30px 80px rgba(0,0,0,0.4));
    will-change: transform;
    display: block;
    transform: scale(2.5); /* Massive base scale to trim transparency */
}

/* The Left Text Slides */
.h-mega-text-container {
    position: relative;
    width: 100%;
    height: 100vh;
    z-index: 20;
    pointer-events: none; /* Passes clicks through to device if needed */
}

.mega-slide {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%) translateY(40px); /* Base state: lower */
    width: 45%;
    opacity: 0;
    visibility: hidden;
    pointer-events: auto; /* Allow buttons to be clicked */
    transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mega-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateY(0); /* Centers perfectly */
}

.mega-slide.passed {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateY(-40px); /* Exits upwards */
}

/* Slide 0 Specifics */
.mega-slide h1 { font-family: var(--font-heading); font-size: clamp(48px, 6vw, 72px); font-weight: 900; line-height: 1.05; letter-spacing: -2px; color: #fff; margin: 16px 0; }
.mega-slide h2 { font-family: var(--font-heading); font-size: clamp(38px, 4.5vw, 54px); font-weight: 900; line-height: 1.05; letter-spacing: -1.5px; color: #fff; margin-bottom: 20px; }
.mega-slide p { font-size: 20px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 30px; font-weight: 400; max-width: 90%; }
.mega-slide .h-lead-dark { font-size: 22px; }

/* Actions */
.h-hero-actions-dark { display: flex; gap: 16px; margin-top: 30px; }
.h-btn-cinematic { background: #fff; color: #020813; padding: 16px 32px; border-radius: 30px; font-weight: 700; text-decoration: none; transition: 0.3s; }
.h-btn-cinematic:hover { transform: scale(1.05); box-shadow: 0 10px 30px rgba(255,255,255,0.2); }
.h-btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.2); padding: 15px 32px; border-radius: 30px; font-weight: 600; text-decoration: none; transition: 0.3s; }
.h-btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* Glitch Badge */
.h-glitch-badge {
    display: inline-block; padding: 6px 14px; border-radius: 20px;
    background: rgba(0, 210, 255, 0.1); border: 1px solid rgba(0, 210, 255, 0.3);
    color: #00d2ff; font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
}

/* Scroll Down Indicator */
.h-scroll-down-cinematic {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 30; opacity: 0; transition: opacity 0.3s;
}
.h-scroll-down-cinematic.active { opacity: 1; }
.h-scroll-down-cinematic span { color: rgba(255,255,255,0.4); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.h-line-indicator { width: 1px; height: 40px; background: linear-gradient(to bottom, #00d2ff, transparent); }

/* Mini Bento Stats */
.mega-mini-bento {
    display: inline-block;
    padding: 16px 24px;
    border-radius: 16px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.mega-mini-bento.bg-pulse { background: rgba(0, 210, 255, 0.05); }
.mega-mini-bento.bg-glass { background: rgba(255, 255, 255, 0.03); }
.mega-mini-bento.bg-accent { background: rgba(0, 85, 255, 0.1); }

.mega-mini-bento .mb-top { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.mega-mini-bento .mb-mid { font-size: 38px; font-weight: 900; color: #fff; line-height: 1.1; margin: 6px 0 2px; }
.mega-mini-bento .mb-mid span.small { font-size: 16px; margin-left: 6px; font-weight: 600; color: rgba(255,255,255,0.7); }
.mega-mini-bento .mb-bot { font-size: 13px; color: rgba(255,255,255,0.6); }

@keyframes h-pulse { 
    0% { opacity: 0.4; transform: translate(-50%,-50%) scale(0.9); } 
    100% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); } 
}

/* Mobile Adjustments for Mega-Scrolly */
@media (max-width: 900px) {
    .h-mega-visual { width: 100%; height: 60vh; top: 0; align-items: flex-end; }
    #mega-spin-device { max-height: 50vh; transform: scale(1.8); }
    .h-mega-text-container { padding-top: 50vh; } /* Push text below device */
    .mega-slide { width: 90%; left: 5%; top: 60%; transform: translateY(-50%) translateY(30px); }
    .mega-slide h1 { font-size: 42px; }
    .mega-slide h2 { font-size: 32px; }
    .mega-slide p { font-size: 16px; margin-bottom: 20px; }
}

/* =========================================
   5. DUAL PATHWAY (LIGHT ZEN)
   ========================================= */
.h-split-vision-sec { padding: 120px 0; }
.h-vision-head { text-align: center; margin-bottom: 100px; }
.h-vision-head h2 { font-size: clamp(42px, 5vw, 64px); font-weight: 900; letter-spacing: -2.5px; font-family:var(--font-heading); margin-bottom: 20px; }
.h-vision-head p { font-size: 20px; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

.h-vision-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.h-vision-card {
    background: var(--bg-secondary);
    border-radius: 40px;
    padding: 60px 40px 0;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    transition: 0.6s ease;
}
.h-vision-card:hover { transform: translateY(-15px); box-shadow: 0 40px 80px rgba(0,0,0,0.06); }
.h-vc-content { margin-bottom: 60px; }
.h-vc-badge { display: inline-block; padding: 6px 14px; border: 1px solid #004094; color: #004094; border-radius: 30px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 20px;}
.h-vc-badge.highlight { background: #004094; color: #fff; }
.h-vision-card h3 { font-size: 32px; font-weight: 800; margin-bottom: 15px; letter-spacing: -1px; }
.h-vision-card p { font-size: 16px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 30px; }
.h-vc-link { font-size: 15px; font-weight: 700; color: #001a3d; }
.h-vision-card img { width: 100%; height: 350px; object-fit: cover; border-radius: 20px 20px 0 0; display: block; filter: contrast(1.05); }

/* =========================================
   6. VIDEO (CINEMATIC)
   ========================================= */
.h-cinema-sec { padding: 80px 0 160px; }
.h-cinema-full {
    width: 100%; height: 75vh;
    border-radius: 40px; overflow: hidden; position: relative;
    cursor: pointer;
}
.h-cinema-full img { width: 100%; height: 100%; object-fit: cover; transition: 0.8s; }
.h-cinema-full:hover img { transform: scale(1.05); filter: brightness(0.7); }
.h-cinema-play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,0.9);
    display: flex; align-items: center; justify-content: center;
    transition: 0.4s; box-shadow: 0 0 0 0 rgba(255,255,255,0.4);
}
.h-cinema-full:hover .h-cinema-play { box-shadow: 0 0 0 30px rgba(255,255,255,0); }
.h-cinema-play svg { width: 36px; height: 36px; margin-left: 6px; }
.h-cinema-caption { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-secondary); letter-spacing: 2px; text-transform: uppercase; }

/* =========================================
   7. TECHNICAL OVERVIEW
   ========================================= */
.h-tech-specs { padding: 120px 0; border-top: 1px solid var(--border-color); }
.h-tech-title { font-size: clamp(38px, 4vw, 54px); font-weight: 900; letter-spacing: -2px; margin-bottom: 80px; text-align: center; }
.h-spec-board { max-width: 800px; margin: 0 auto; }
.h-spec-row { display: flex; justify-content: space-between; padding: 30px 0; border-bottom: 1px solid var(--border-color); }
.h-sr-label { font-size: 18px; font-weight: 600; color: var(--text-secondary); }
.h-sr-val { font-size: 18px; font-weight: 800; text-align: right; }

/* =========================================
   8. TRUST MARQUEE
   ========================================= */
.h-trust-marquee-sec { padding: 60px 0 120px; overflow: hidden; }
.h-marquee-wrapper { position: relative; width: 100vw; margin-left: calc(-50vw + 50%); }
.h-marquee-track { display: flex; gap: 100px; width: max-content; animation: h-scroll-inf 60s linear infinite; align-items: center; padding: 0 50px; }
.h-marquee-track img { height: 50px; width: auto; filter: grayscale(100%) opacity(0.4); transition: 0.4s; }
.h-marquee-track img:hover { filter: grayscale(0%) opacity(1); }
@keyframes h-scroll-inf { 0% { transform: translateX(0); } 100% { transform: translateX(calc(-50% - 50px)); } }

/* =========================================
   9. FINAL CTA (DARK)
   ========================================= */
/* Even in light mode, the CTA is dark */
.h-final-cta-dark { background: #020611; color: #fff; padding: 160px 0; }
.h-cta-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 80px; }
.h-final-cta-dark h2 { font-size: clamp(48px, 5vw, 72px); font-weight: 900; letter-spacing: -3px; line-height: 1; }
.h-cta-r p { font-size: 20px; color: #8b98a5; margin-bottom: 40px; line-height: 1.6; }
.block-btn { display: inline-block; }

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 900px) {
    .h-hero-split-dark, .h-bento-grid-dark, .h-scrolly-grid, .h-vision-cards, .h-cta-grid { grid-template-columns: 1fr; }
    .h-hero-cinematic { padding: 120px 0; text-align: center; }
    .h-hero-content { margin: 0 auto; text-align: center; }
    .h-hero-actions-dark { justify-content: center; flex-direction: column; width: 100%; }
    .h-hero-actions-dark a { width: 100%; text-align: center; }
    .h-scrolly-sticky { top: 10vh; height: 40vh; z-index: 10; background: var(--bg-main); }
    .h-scrolly-spacer { display: none; }
    .h-final-cta-dark h2 { text-align: center; margin-bottom: 40px; }
    .h-cta-r { text-align: center; }
    .h-spec-row { flex-direction: column; gap: 10px; }
    .h-sr-val { text-align: left; }
}
