/* Decorative motion stays inside the hero and below its interactive content. */
.hero[data-flag-hero] {
    position: relative;
    isolation: isolate;
}

[data-flag-hero] .hero-grid {
    position: relative;
    z-index: 2;
}

.hero-flag-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    contain: strict;
}

.hero-flag-bubble {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    padding: 5px;
    border: 1px solid rgb(255 255 255 / 95%);
    border-radius: 50%;
    background: linear-gradient(145deg, rgb(255 255 255 / 96%), rgb(234 244 233 / 60%));
    box-shadow: 0 5px 18px rgb(25 80 49 / 9%), inset 0 0 0 1px rgb(102 143 108 / 12%);
    will-change: transform, opacity;
}

.hero-flag-bubble::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgb(255 255 255 / 52%), transparent 48%);
    box-shadow: inset 1px 1px 2px rgb(255 255 255 / 75%);
}

.hero-flag-bubble img {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 50%;
    object-fit: cover;
    opacity: .9;
}

.hero-motion-toggle {
    position: absolute;
    right: max(24px, calc((100% - 1200px) / 2));
    bottom: 15px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgb(117 142 106 / 17%);
    border-radius: 20px;
    background: rgb(246 248 244 / 92%);
    color: #627456;
    font-size: 10px;
    line-height: 1.5;
}

.hero-motion-toggle:hover {
    color: var(--green);
    background: #fff;
    border-color: #bdcfb3;
}

@media (max-width: 680px) {
    .hero-motion-toggle {
        right: 20px;
        bottom: 6px;
        min-height: 36px;
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-flag-bubble { will-change: auto; }
}
