/* =====================================================
   Digital MoltBot — custom styles layered on Tailwind
   ===================================================== */

/* ---------- Decorative grid backgrounds ---------- */
.hero-grid-bg,
.cta-grid-bg {
    background-image:
        linear-gradient(to right, rgba(99, 102, 241, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 40%, transparent 100%);
}

/* Dark-section variant keeps the grid visible on slate-950 */
.cta-grid-bg {
    background-image:
        linear-gradient(to right, rgba(129, 140, 248, 0.07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(129, 140, 248, 0.07) 1px, transparent 1px);
}

/* ---------- Mega menu safety (no-JS / CSS-only environments) ----------
   Visibility is primarily handled by Tailwind group-hover/focus-within
   utilities in the markup; this only guarantees stacking context. */
.mega-panel {
    will-change: opacity, transform;
}

/* ---------- FAQ accordion panels (JS slides them; base state hidden) ---------- */
.faq-panel {
    display: none;
}
.faq-panel.is-open {
    /* JS adds/removes inline styles; class kept for semantics/testing */
}

.faq-chevron {
    transition: transform 0.2s ease;
}

/* ---------- Reveal-on-scroll ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-reveal].revealed {
    opacity: 1;
    transform: none;
}

/* ---------- Focus visibility for keyboard users ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------- Native form control polish (Tailwind forms plugin covers most) ---------- */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem;
}

/* ---------- Smooth scrolling with sticky-header offset ---------- */
html {
    scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .faq-chevron {
        transition: none;
    }
}

/* ---------- Long-form legal/prose pages ---------- */
.prose-like a {
    color: #4338ca;
    text-decoration: underline;
    text-decoration-color: rgba(67, 56, 202, 0.35);
    text-underline-offset: 2px;
}
.prose-like a:hover {
    color: #312e81;
}

/* ---------- Selection colour ---------- */
::selection {
    background: rgba(99, 102, 241, 0.22);
}
