:root {
    --secondary: #5f87f8;
}

body {
    min-height: 100vh;
}

body::before {
    animation: drift-grid 22s linear infinite;
}

@keyframes drift-grid {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(64px, 64px, 0); }
}

main,
.site-footer {
    position: relative;
    z-index: 1;
}

.cursor-glow,
.ambient-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.cursor-glow {
    width: 320px;
    height: 320px;
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(95, 135, 248, 0.13) 0%, rgba(52, 199, 177, 0.14) 35%, transparent 72%);
    filter: blur(4px);
    opacity: 0.95;
    transition: opacity 0.3s ease, transform 0.08s linear;
    transform: translate3d(-9999px, -9999px, 0);
    will-change: transform;
}

.cursor-glow.is-hidden {
    opacity: 0;
}

.ambient-particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(95, 135, 248, 0.28) 0%, rgba(52, 199, 177, 0.2) 100%);
    box-shadow: 0 0 18px rgba(95, 135, 248, 0.08);
    animation: particle-float var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: 0.7;
}

@keyframes particle-float {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(0.95);
        opacity: 0.25;
    }
    50% {
        transform: translate3d(0, -26px, 0) scale(1.08);
        opacity: 0.85;
    }
}

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

.hero-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.hero-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(4px);
    opacity: 0.45;
    animation: orb-drift var(--orb-duration, 12s) ease-in-out infinite;
}

.hero-orb:nth-child(1) {
    top: 10%;
    left: -2%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(52, 199, 177, 0.28) 0%, rgba(52, 199, 177, 0) 72%);
    --orb-duration: 14s;
}

.hero-orb:nth-child(2) {
    top: 16%;
    right: 4%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(95, 135, 248, 0.18) 0%, rgba(95, 135, 248, 0) 72%);
    --orb-duration: 16s;
}

.hero-orb:nth-child(3) {
    bottom: -4%;
    left: 38%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(15, 141, 125, 0.18) 0%, rgba(15, 141, 125, 0) 72%);
    --orb-duration: 13s;
}

@keyframes orb-drift {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, -24px, 0) scale(1.06);
    }
}

.page-title--hero {
    max-width: 14ch;
}

.hero-title-dynamic {
    display: grid;
    gap: 0.18rem;
    max-width: 9.5ch;
}

.headline-accent,
.typing-text {
    display: block;
}

.headline-accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 55%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.typing-text {
    color: var(--ink);
    position: relative;
    min-height: 1.15em;
}

.typing-text::after {
    content: '';
    display: inline-block;
    width: 0.08em;
    height: 0.95em;
    margin-left: 0.1em;
    background: var(--primary);
    vertical-align: -0.08em;
    animation: blink-caret 1s step-end infinite;
}

@keyframes blink-caret {
    0%, 45% { opacity: 1; }
    46%, 100% { opacity: 0; }
}

.card,
.filter-toolbar,
.product-card,
.resource-card {
    position: relative;
    overflow: hidden;
    transform: perspective(1000px) rotateX(var(--card-rotate-x, 0deg)) rotateY(var(--card-rotate-y, 0deg)) translateY(var(--card-lift, 0px));
    transform-style: preserve-3d;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.card::after,
.filter-toolbar::after,
.product-card::after,
.resource-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(280px circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), rgba(95, 135, 248, 0.12), rgba(52, 199, 177, 0.08) 32%, transparent 70%);
    opacity: var(--surface-glow-opacity, 0);
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.card:hover,
.filter-toolbar:hover,
.product-card:hover,
.resource-card:hover {
    --card-lift: -6px;
    --surface-glow-opacity: 1;
    border-color: var(--line-strong);
    box-shadow: 0 22px 54px rgba(16, 34, 53, 0.12);
}

.resource-card:hover {
    transform: perspective(1000px) rotateX(var(--card-rotate-x, 0deg)) rotateY(var(--card-rotate-y, 0deg)) translateY(var(--card-lift, -6px));
}

.pillar-grid--quad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 980px) {
    .pillar-grid--quad {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .pillar-grid--quad {
        grid-template-columns: 1fr;
    }
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
    .cursor-glow,
    .ambient-particles,
    .hero-ambient,
    .typing-text::after {
        display: none !important;
    }

    .card,
    .filter-toolbar,
    .product-card,
    .resource-card,
    .card:hover,
    .filter-toolbar:hover,
    .product-card:hover,
    .resource-card:hover {
        transform: none !important;
    }
}
