/* =====================================================================
   Background Ripple Effect
   Native Razor Pages / CSS / JavaScript port of the Aceternity UI
   background-ripple-effect component.

   v4 changes:
   - Global load from _Layout so the footer can use it on every page.
   - Homepage hero ripple stays behind the first opening background only.
   - Footer ripple is a controlled top/background band, not a full-footer grid.
   - Footer hover/click ripple works through footer content.
   - Dark and light mode visual palettes included.
   ===================================================================== */

/* ------------------------------------------------------
   Shared ripple grid engine
------------------------------------------------------ */

.background-ripple-effect__grid {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 1;
    display: grid;
    transform: translateX(-50%);
    transform-origin: top center;
    will-change: transform;
    mask-image: radial-gradient(ellipse at top, #000 0 24%, rgba(0, 0, 0, 0.92) 42%, rgba(0, 0, 0, 0.42) 70%, transparent 96%);
    -webkit-mask-image: radial-gradient(ellipse at top, #000 0 24%, rgba(0, 0, 0, 0.92) 42%, rgba(0, 0, 0, 0.42) 70%, transparent 96%);
}

.background-ripple-effect__cell {
    position: relative;
    min-width: 0;
    min-height: 0;
    border: 0.5px solid var(--ripple-cell-border);
    background-color: var(--ripple-cell-fill);
    opacity: 0.4;
    box-shadow: inset 0 0 40px 1px var(--ripple-cell-shadow);
    cursor: crosshair;
    transition: opacity 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
    will-change: opacity;
}

.background-ripple-effect__cell:hover,
.background-ripple-effect__cell.is-hovered {
    opacity: 0.8;
    background-color: var(--ripple-cell-hover-fill);
    border-color: var(--ripple-cell-hover-border);
    box-shadow: inset 0 0 44px 1px var(--ripple-cell-hover-shadow);
}

.background-ripple-effect__cell.is-rippling {
    animation: backgroundCellRipple var(--duration, 200ms) ease-out var(--delay, 0ms) none 1;
}

@keyframes backgroundCellRipple {
    0% {
        opacity: 0.4;
        background-color: var(--ripple-cell-fill);
    }

    50% {
        opacity: 0.82;
        background-color: var(--ripple-cell-active-fill);
    }

    100% {
        opacity: 0.4;
        background-color: var(--ripple-cell-fill);
    }
}

/* ------------------------------------------------------
   Homepage scroll-expand hero ripple
   Important: this targets the opening background layer only.
------------------------------------------------------ */

.scroll-expand-hero--ripple {
    --ripple-cell-border: rgba(212, 212, 216, 0.23);
    --ripple-cell-fill: rgba(245, 245, 245, 0.035);
    --ripple-cell-shadow: rgba(255, 255, 255, 0.08);
    --ripple-cell-hover-fill: rgba(255, 255, 255, 0.06);
    --ripple-cell-hover-border: rgba(255, 255, 255, 0.34);
    --ripple-cell-hover-shadow: rgba(255, 255, 255, 0.13);
    --ripple-cell-active-fill: rgba(255, 255, 255, 0.09);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.075), transparent 36rem),
        #000;
}

.scroll-expand-hero--ripple .scroll-expand-hero__sticky {
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.09), transparent 34rem),
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.045), transparent 24rem),
        radial-gradient(circle at 86% 26%, rgba(255, 255, 255, 0.035), transparent 26rem),
        #000;
}

.scroll-expand-hero__stage-ripple {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: auto;
    opacity: 0.7;
    transition: opacity 220ms ease;
}

.scroll-expand-hero.is-expanded .scroll-expand-hero__stage-ripple {
    opacity: 0.18;
    pointer-events: none;
}

.scroll-expand-hero__stage-ripple::before,
.scroll-expand-hero__stage-ripple::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.scroll-expand-hero__stage-ripple::before {
    z-index: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 28rem),
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.055), transparent 34rem);
}

.scroll-expand-hero__stage-ripple::after {
    z-index: 4;
    background:
        radial-gradient(circle at 50% 26%, transparent 0 22%, rgba(0, 0, 0, 0.34) 58%, rgba(0, 0, 0, 0.92) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.92), transparent 32%, transparent 68%, rgba(0, 0, 0, 0.92)),
        linear-gradient(180deg, rgba(0, 0, 0, 0.1), transparent 22%, rgba(0, 0, 0, 0.72));
}

.scroll-expand-hero__stage-ripple .background-ripple-effect__grid {
    opacity: 0.95;
}

/* ------------------------------------------------------
   Footer ripple
------------------------------------------------------ */

.footer-panel--ripple,
.site-footer.footer-panel--ripple,
.site-footer.footer-panel--ripple.site-footer--inverse {
    --footer-bg: #030303;
    --footer-fg: #ffffff;
    --footer-muted: rgba(255, 255, 255, 0.68);
    --footer-border: rgba(255, 255, 255, 0.13);
    --footer-border-strong: rgba(255, 255, 255, 0.2);
    --ripple-cell-border: rgba(212, 212, 216, 0.2);
    --ripple-cell-fill: rgba(245, 245, 245, 0.028);
    --ripple-cell-shadow: rgba(255, 255, 255, 0.065);
    --ripple-cell-hover-fill: rgba(255, 255, 255, 0.055);
    --ripple-cell-hover-border: rgba(255, 255, 255, 0.31);
    --ripple-cell-hover-shadow: rgba(255, 255, 255, 0.12);
    --ripple-cell-active-fill: rgba(255, 255, 255, 0.085);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: var(--footer-fg);
    background:
        radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.11), transparent 26rem),
        radial-gradient(circle at 88% 16%, rgba(255, 255, 255, 0.065), transparent 24rem),
        linear-gradient(180deg, #050505 0%, var(--footer-bg) 56%, #000000 100%);
    border-top-color: var(--footer-border-strong) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 -24px 70px -54px rgba(255, 255, 255, 0.18);
}

.footer-panel--ripple::before {
    opacity: 0;
}

.footer-panel__ripple {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 0;
    height: clamp(18rem, 42vw, 31rem);
    overflow: hidden;
    pointer-events: none;
    opacity: 0.62;
}

.footer-panel__ripple::before,
.footer-panel__ripple::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.footer-panel__ripple::before {
    z-index: 0;
    background:
        radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.12), transparent 23rem),
        radial-gradient(circle at 82% 8%, rgba(255, 255, 255, 0.075), transparent 25rem),
        radial-gradient(circle at 50% 86%, rgba(255, 255, 255, 0.045), transparent 26rem);
}

.footer-panel__ripple::after {
    z-index: 4;
    background:
        radial-gradient(ellipse at 50% 18%, transparent 0 30%, rgba(0, 0, 0, 0.2) 62%, rgba(0, 0, 0, 0.72) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.82), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.82)),
        linear-gradient(180deg, rgba(0, 0, 0, 0.02), transparent 52%, rgba(0, 0, 0, 0.86));
}

.footer-panel__ripple .background-ripple-effect__grid {
    top: 0;
    opacity: 0.95;
    mask-image: radial-gradient(ellipse at top, #000 0 22%, rgba(0, 0, 0, 0.92) 42%, rgba(0, 0, 0, 0.42) 72%, transparent 96%);
    -webkit-mask-image: radial-gradient(ellipse at top, #000 0 22%, rgba(0, 0, 0, 0.92) 42%, rgba(0, 0, 0, 0.42) 72%, transparent 96%);
}

.footer-panel--ripple .footer-panel__inner {
    position: relative;
    z-index: 2;
}

.footer-panel--ripple::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    z-index: 1;
    height: 46%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, var(--footer-bg) 48%, var(--footer-bg));
}

/* ------------------------------------------------------
   Light mode palette
------------------------------------------------------ */

html[data-theme="light"] .scroll-expand-hero--ripple {
    --ripple-cell-border: rgba(24, 24, 27, 0.16);
    --ripple-cell-fill: rgba(24, 24, 27, 0.025);
    --ripple-cell-shadow: rgba(24, 24, 27, 0.05);
    --ripple-cell-hover-fill: rgba(24, 24, 27, 0.06);
    --ripple-cell-hover-border: rgba(24, 24, 27, 0.28);
    --ripple-cell-hover-shadow: rgba(24, 24, 27, 0.095);
    --ripple-cell-active-fill: rgba(24, 24, 27, 0.09);
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.07), transparent 36rem),
        #fafafa;
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__sticky {
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.06), transparent 34rem),
        radial-gradient(circle at 12% 18%, rgba(0, 0, 0, 0.035), transparent 24rem),
        radial-gradient(circle at 86% 26%, rgba(0, 0, 0, 0.03), transparent 26rem),
        #fafafa;
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__stage-ripple::before {
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.08), transparent 28rem),
        radial-gradient(circle at 50% 42%, rgba(0, 0, 0, 0.04), transparent 34rem);
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__stage-ripple::after {
    background:
        radial-gradient(circle at 50% 26%, transparent 0 22%, rgba(250, 250, 250, 0.34) 58%, rgba(250, 250, 250, 0.92) 100%),
        linear-gradient(90deg, rgba(250, 250, 250, 0.94), transparent 32%, transparent 68%, rgba(250, 250, 250, 0.94)),
        linear-gradient(180deg, rgba(250, 250, 250, 0.06), transparent 22%, rgba(250, 250, 250, 0.72));
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__eyebrow {
    border-color: rgba(0, 0, 0, 0.13);
    background: rgba(0, 0, 0, 0.045);
    color: rgba(0, 0, 0, 0.66);
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__title {
    color: #0f0f10 !important;
    text-shadow: 0 12px 42px rgba(255, 255, 255, 1), 0 3px 0 rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__subtitle--below-card {
    color: rgba(15, 15, 16, 0.68) !important;
    text-shadow: 0 8px 28px rgba(255, 255, 255, 1);
}

/* The expanded card uses a photo/artwork layer. Keep its overlay text white in light mode. */
html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__media,
html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__media .text-foreground,
html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__media .headline-accent {
    color: #ffffff !important;
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__media .text-muted-foreground {
    color: rgba(255, 255, 255, 0.72) !important;
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__media .border-border {
    border-color: rgba(255, 255, 255, 0.22) !important;
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__media .bg-card {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__media .bg-foreground {
    background-color: #ffffff !important;
}

html[data-theme="light"] .scroll-expand-hero--ripple .scroll-expand-hero__media .text-background {
    color: #050505 !important;
}

html[data-theme="light"] .footer-panel--ripple,
html[data-theme="light"] .site-footer.footer-panel--ripple,
html[data-theme="light"] .site-footer.footer-panel--ripple.site-footer--inverse {
    --footer-bg: #f7f7f7;
    --footer-fg: #0f0f10;
    --footer-muted: rgba(15, 15, 16, 0.64);
    --footer-border: rgba(15, 15, 16, 0.13);
    --footer-border-strong: rgba(15, 15, 16, 0.18);
    --ripple-cell-border: rgba(24, 24, 27, 0.15);
    --ripple-cell-fill: rgba(24, 24, 27, 0.024);
    --ripple-cell-shadow: rgba(24, 24, 27, 0.045);
    --ripple-cell-hover-fill: rgba(24, 24, 27, 0.058);
    --ripple-cell-hover-border: rgba(24, 24, 27, 0.27);
    --ripple-cell-hover-shadow: rgba(24, 24, 27, 0.09);
    --ripple-cell-active-fill: rgba(24, 24, 27, 0.085);
    color: var(--footer-fg) !important;
    background:
        radial-gradient(circle at 14% 0%, rgba(0, 0, 0, 0.07), transparent 26rem),
        radial-gradient(circle at 88% 16%, rgba(0, 0, 0, 0.045), transparent 24rem),
        linear-gradient(180deg, #ffffff 0%, var(--footer-bg) 56%, #f3f3f3 100%);
    border-top-color: var(--footer-border-strong) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 -24px 70px -54px rgba(0, 0, 0, 0.16);
}

html[data-theme="light"] .footer-panel--ripple .footer-panel__ripple::before {
    background:
        radial-gradient(circle at 24% 0%, rgba(0, 0, 0, 0.07), transparent 23rem),
        radial-gradient(circle at 82% 8%, rgba(0, 0, 0, 0.05), transparent 25rem),
        radial-gradient(circle at 50% 86%, rgba(0, 0, 0, 0.032), transparent 26rem);
}

html[data-theme="light"] .footer-panel--ripple .footer-panel__ripple::after {
    background:
        radial-gradient(ellipse at 50% 18%, transparent 0 30%, rgba(250, 250, 250, 0.22) 62%, rgba(250, 250, 250, 0.82) 100%),
        linear-gradient(90deg, rgba(250, 250, 250, 0.9), transparent 28%, transparent 72%, rgba(250, 250, 250, 0.9)),
        linear-gradient(180deg, rgba(250, 250, 250, 0.02), transparent 52%, rgba(250, 250, 250, 0.88));
}

html[data-theme="light"] .footer-panel--ripple .footer-panel__cta {
    background: var(--footer-fg);
    color: #ffffff;
    box-shadow: 0 24px 58px -34px rgba(0, 0, 0, 0.32);
}

html[data-theme="light"] .footer-panel--ripple .footer-panel__tags span {
    border-color: var(--footer-border);
    background: rgba(0, 0, 0, 0.035);
    color: var(--footer-muted);
}

html[data-theme="light"] .footer-panel--ripple .footer-panel__tags span:hover {
    border-color: rgba(15, 15, 16, 0.28);
    background: rgba(0, 0, 0, 0.055);
    color: var(--footer-fg);
}

html[data-theme="light"] .footer-panel--ripple .footer-panel__contact-link i {
    color: rgba(15, 15, 16, 0.58);
}

@media (max-width: 767px) {
    .scroll-expand-hero__stage-ripple {
        opacity: 0.48;
    }

    .background-ripple-effect__grid {
        transform: translateX(-50%) scale(0.86);
    }

    .footer-panel__ripple {
        height: 22rem;
        opacity: 0.46;
    }
}

@media (prefers-reduced-motion: reduce) {
    .background-ripple-effect__cell,
    .background-ripple-effect__cell.is-hovered,
    .background-ripple-effect__cell.is-rippling {
        animation: none !important;
        transition: opacity 120ms ease;
    }
}
