/**
 * Home index (body.home-index) - subtle depth, spacing, hovers, splash.
 * Palette unchanged (#faf7f5 base, #b85a3a accent).
 */

/* ---- Page background: noise only (gradient + motion → css/site-ambient.css on html) ---- */
body.home-index {
    position: relative;
}

body.home-index::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}

body.dark-mode.home-index::before,
html[data-theme="dark"] body.home-index::before {
    opacity: 0.04;
    filter: invert(1);
}

/* Splash: hide main page entrance while active */
body.home-index.aligali-splash-active {
    animation: none !important;
}

/* ---- Section rhythm ---- */
body.home-index main.container > section + section,
body.home-index main.container > section + .content-wrapper.home-latest-wrap {
    margin-top: clamp(1.85rem, 4.5vw, 2.75rem) !important;
}

body.home-index main.container > .home-hero-refined + .home-discover-desktop-strip {
    margin-top: clamp(1.35rem, 3.5vw, 2.15rem) !important;
}

body.home-index .section-title {
    margin-top: clamp(1.65rem, 3.85vw, 2.28rem) !important;
    margin-bottom: clamp(1.1rem, 2.75vw, 1.42rem) !important;
}

/* ---- Hero → discover soft divider ---- */
.home-hero-refined__edge {
    height: 1px;
    margin: clamp(0.45rem, 1.65vw, 0.95rem) auto clamp(0.55rem, 2.1vw, 1.12rem);
    max-width: min(580px, 92vw);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(61, 53, 46, 0.07) 12%,
        rgba(61, 53, 46, 0.11) 50%,
        rgba(61, 53, 46, 0.07) 88%,
        transparent
    );
    border: 0;
}

body.dark-mode .home-hero-refined__edge,
html[data-theme="dark"] .home-hero-refined__edge {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.06) 14%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.06) 86%,
        transparent
    );
}

/* מובייל: פס הגילוי מוסתר (מגירת הדר); הקו והריווח לפניו מבוטלים ב-home-index-mobile.css */

/* ---- Logo splash overlay ---- */
.aligali-home-splash {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #faf7f5;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.aligali-home-splash.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.aligali-home-splash.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.aligali-home-splash__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    filter: blur(6px);
    transform: scale(0.94);
    opacity: 0;
    transition:
        filter 0.85s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.65s ease;
}

.aligali-home-splash.is-visible .aligali-home-splash__inner {
    filter: blur(0);
    transform: scale(1);
    opacity: 1;
}

.aligali-home-splash__inner img {
    max-width: min(200px, 48vw);
    max-height: min(72px, 18vw);
    width: auto;
    height: auto;
    object-fit: contain;
}

body.dark-mode .aligali-home-splash,
html[data-theme="dark"] .aligali-home-splash {
    background: #161616;
}

@media (prefers-reduced-motion: reduce) {
    .aligali-home-splash,
    .aligali-home-splash__inner {
        transition: none !important;
    }

    .aligali-home-splash__inner {
        filter: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/*
 * Mobile / narrow: fixed SVG noise (feTurbulence) + optional filter:invert repaints the whole
 * scroll surface - major flicker/jank. Desktop keeps the subtle texture.
 */
@media (max-width: 1024px) {
    body.home-index::before {
        display: none !important;
        content: none !important;
    }
}

/* מובייל דף הבית: home-index-mobile.css (נטען אחרי ה-inline ב-index כדי לעקוף !important) */

body.home-index .home-discover-cats-chips {
    display: none;
}

body.home-index .home-discover-cats-desktop {
    display: block;
}
