/* Explain: Base styles, including background gradients and scroll-triggered animations. */
[x-cloak] {
    display: none !important;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--background-color);
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--background-color);
    background-image: 
        radial-gradient(at 0% 0%, color-mix(in srgb, #3b82f6 35%, transparent) 0px, transparent 60%),
        radial-gradient(at 100% 100%, color-mix(in srgb, #0ea5e9 25%, transparent) 0px, transparent 60%);
    background-attachment: fixed;
}

section.bg-\[var\(--surface-color\)\] {
    background: color-mix(in srgb, var(--surface-color) 40%, transparent) !important;
}
section.bg-\[var\(--navy-color\)\] {
    background: color-mix(in srgb, var(--navy-color) 65%, transparent) !important;
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
}
section.bg-\[var\(--background-color\)\] {
    background: transparent !important;
}

::selection {
    background: var(--sand-color);
    color: var(--navy-color);
}

button,
a {
    cursor: pointer;
}

input,
button,
textarea,
select {
    font: inherit;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--aqua-color) 62%, transparent);
    outline-offset: 3px;
}

/* Scroll Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger grid children */
.grid > .scroll-reveal:nth-child(1) { transition-delay: 0.1s; }
.grid > .scroll-reveal:nth-child(2) { transition-delay: 0.2s; }
.grid > .scroll-reveal:nth-child(3) { transition-delay: 0.3s; }
.grid > .scroll-reveal:nth-child(4) { transition-delay: 0.4s; }
.grid > .scroll-reveal:nth-child(5) { transition-delay: 0.5s; }
.grid > .scroll-reveal:nth-child(6) { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: translateY(0);
        transition: none;
    }
    
    .grid > .scroll-reveal {
        transition-delay: 0s !important;
    }
}
