/* Landing page backdrop (index.html): a lattice of small CTforex symbols that turn gold under the pointer. */

.home-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.home-hero::before,
.home-shell,
.home-foot {
    position: relative;
    z-index: 1;
}

.home-bg {
    --bg-pattern: rgba(197, 168, 125, 0.085);
    --bg-gold: #e0c08a;
    --mx: 50%;
    --my: 50%;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

html[data-theme="ivory"] .home-bg {
    --bg-pattern: rgba(116, 90, 52, 0.11);
    --bg-gold: #a37b3f;
}

/* The wrappers carry the fade masks; the inner layer carries the tile mask, so the two masks
   multiply in every browser without mask-composite. */
.home-bg__field,
.home-bg__spot {
    position: absolute;
    inset: 0;
}

.home-bg__field {
    -webkit-mask-image: radial-gradient(ellipse 52% 50% at 30% 52%, rgba(0, 0, 0, 0.12), #000 80%);
    mask-image: radial-gradient(ellipse 52% 50% at 30% 52%, rgba(0, 0, 0, 0.12), #000 80%);
}

.home-bg__tiles {
    position: absolute;
    inset: 0;
    background: var(--bg-pattern);
    -webkit-mask: url("../brand/ctforex-pattern.svg") 0 0 / 160px 160px repeat;
    mask: url("../brand/ctforex-pattern.svg") 0 0 / 160px 160px repeat;
}

.home-bg__tiles.is-gold {
    background: var(--bg-gold);
}

.home-bg__spot {
    opacity: 0;
    transition: opacity 0.5s ease;
    -webkit-mask-image: radial-gradient(circle 210px at var(--mx) var(--my), #000, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
    mask-image: radial-gradient(circle 210px at var(--mx) var(--my), #000, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
}

.home-bg.is-lit .home-bg__spot {
    opacity: 0.95;
}

@media (max-width: 860px) {
    .home-bg__field {
        -webkit-mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.3) 45%, #000);
        mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, 0.3) 45%, #000);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-bg__spot {
        transition: none;
    }
}
