/* ===============================================================
   KEY TOWER — Tower section: soft metallic light reflection
   Standalone add-on; load AFTER assets/css/style.css.
   No JavaScript; no changes to the section counter or other panels.
   =============================================================== */

/* The existing artwork has opacity on its container. Separate that
   opacity onto ::before so the specular light can stay independent. */
#section4 .tower--section {
    opacity: 1 !important;
    background-image: none !important;
    --kt-tower-base-opacity: 0.28;
    --kt-tower-glint-opacity: 0.27;
}

/* Restore the exact original tower photo placement and transparency. */
#section4 .tower--section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../images/keytower-2026/wireless-tower.png");
    background-position: right center;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: var(--kt-tower-base-opacity);
    pointer-events: none;
}

/* A very narrow silver-blue light band masked to the tower photograph.
   It stays behind all Tower text and equipment logos. */
#section4 .tower--section::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background-image: linear-gradient(
        103deg,
        transparent 44%,
        rgba(183, 224, 247, 0.00) 47.5%,
        rgba(213, 238, 253, 0.26) 49%,
        rgba(255, 255, 255, 0.76) 50%,
        rgba(181, 223, 247, 0.22) 51%,
        rgba(183, 224, 247, 0.00) 53%,
        transparent 56%
    );
    background-repeat: no-repeat;
    background-size: 250% 100%;
    background-position: 100% center;
    -webkit-mask-image: url("../images/keytower-2026/wireless-tower.png");
    mask-image: url("../images/keytower-2026/wireless-tower.png");
    -webkit-mask-position: right center;
    mask-position: right center;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* Only run while visitors are on the Tower section.
   One quick sweep after arrival, then a long quiet interval. */
#section4.active .tower--section::after {
    animation: kt-tower-metallic-reflection 18s ease-in-out infinite;
}

@keyframes kt-tower-metallic-reflection {
    0%, 5%   { opacity: 0; background-position: 100% center; }
    7%       { opacity: var(--kt-tower-glint-opacity); }
    17%      { opacity: var(--kt-tower-glint-opacity); background-position: 0% center; }
    19%, 100%{ opacity: 0; background-position: 0% center; }
}

@media (max-width: 697px) {
    #section4 .tower--section {
        --kt-tower-base-opacity: 0.12;
        --kt-tower-glint-opacity: 0.14;
    }
}

@media (prefers-reduced-motion: reduce) {
    #section4.active .tower--section::after {
        animation: none !important;
        opacity: 0 !important;
    }
}
