html, body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle ambient glow on the page body so glass surfaces have something to refract.
   Two soft radial gradients (coral top-right, blue bottom-left), fixed so they don't scroll. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: #000;
}

.mud-layout, .mud-main-content {
    position: relative;
    z-index: 1;
}

/* === Glass utilities ===
   Apply via Class="glass" on a MudPaper / MudCard / MudButton, etc.
   Needs a colorful or textured backdrop to actually look glassy — see body::before above. */
.glass {
    background: rgba(20, 20, 23, 0.55) !important;
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 8px 32px -12px rgba(0, 0, 0, 0.6) !important;
}

.glass-strong {
    background: rgba(20, 20, 23, 0.35) !important;
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 16px 48px -16px rgba(0, 0, 0, 0.65) !important;
}

/* Glass tint variants: pick the accent that fits the surface */
.glass-coral {
    background: linear-gradient(135deg, rgba(255, 99, 99, 0.12), rgba(20, 20, 23, 0.55) 60%) !important;
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border: 1px solid rgba(255, 99, 99, 0.18) !important;
}

.glass-blue {
    background: linear-gradient(135deg, rgba(84, 113, 255, 0.12), rgba(20, 20, 23, 0.55) 60%) !important;
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border: 1px solid rgba(84, 113, 255, 0.18) !important;
}

/* Glass for buttons — use Variant="Variant.Outlined" + Class="glass-button" for best result */
.glass-button.mud-button-root {
    background: rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.glass-button.mud-button-root:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.18);
}

.glass-button.mud-button-root:active {
    transform: translateY(1px);
}

/* Hover lift for glass cards */
.glass.cursor-pointer:hover,
.glass-strong.cursor-pointer:hover,
.glass-coral.cursor-pointer:hover,
.glass-blue.cursor-pointer:hover {
    background-color: rgba(28, 28, 33, 0.65) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    transition: background-color 160ms ease, border-color 160ms ease;
}

/* === Ethereal background ===
   Adapted from 21st.dev/community/components/jatin-yadav05/etheral-shadow.
   Renders a fixed, viewport-filling layer behind page content. Pages opt in by dropping
   <EtherealBackground /> at the top of their template. */
.ethereal-bg-root {
    position: fixed;
    inset: 0;
    /* .mud-main-content sets z-index:1 (a new stacking context); -1 keeps the bg behind in-flow page cards
       inside that context while still rendering above body::before. */
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    contain: strict;
}

.ethereal-bg-defs {
    position: absolute;
    width: 0;
    height: 0;
}

/* The colored shape that the SVG turbulence/displacement filter warps.
   Three offset radial gradients give it organic, multi-lobed shape;
   hue-rotate keyframes cycle the palette over time (matches the framer-motion hue cycle in the original).
   Inset is negative so the warped edges never reveal the viewport border. */
.ethereal-bg-shape {
    position: absolute;
    inset: calc(var(--ethereal-spread, 60px) * -1);
    background:
        radial-gradient(ellipse 55% 45% at 28% 32%, var(--ethereal-color, rgba(168, 85, 247, 0.55)) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 78% 28%, rgba(84, 113, 255, 0.45) 0%, transparent 62%),
        radial-gradient(ellipse 60% 50% at 65% 78%, rgba(255, 99, 99, 0.40) 0%, transparent 60%),
        radial-gradient(ellipse 45% 38% at 18% 82%, rgba(34, 197, 94, 0.32) 0%, transparent 60%);
    opacity: 0.85;
    filter: var(--ethereal-warp, none) blur(4px) hue-rotate(0deg);
    animation: ethereal-hue var(--ethereal-speed, 24s) linear infinite;
    will-change: filter;
}

/* Keyframes reuse --ethereal-warp so the per-instance SVG filter id is preserved while the
   CSS hue-rotate cycles. (Earlier draft hardcoded url(#dummy) here and broke the displacement.) */
@keyframes ethereal-hue {
    from { filter: var(--ethereal-warp, none) blur(4px) hue-rotate(0deg); }
    to   { filter: var(--ethereal-warp, none) blur(4px) hue-rotate(360deg); }
}

/* Inline data-URI noise (no extra HTTP). Mix-blend overlay keeps colors honest while breaking up gradient banding. */
.ethereal-bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Respect reduced-motion: freeze the hue cycle. */
@media (prefers-reduced-motion: reduce) {
    .ethereal-bg-shape { animation: none; }
}

code, pre, .mono {
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', monospace;
}

/* Raycast-style surface treatment: subtle 1px borders, no heavy shadows */
.mud-paper {
    background-color: #000 !important;
}

.mud-paper.mud-paper-outlined {
    border-color: rgba(255, 255, 255, 0.08);
    background-color: #000;
}

.mud-appbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background-color: #000 !important;
}

.mud-drawer {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* Card hover: brighter border, subtle background lift */
.mud-paper-outlined.cursor-pointer:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background-color: #1A1A1E;
    transition: border-color 120ms ease, background-color 120ms ease;
}

/* Buttons / chips: tighter radius for Raycast feel */
.mud-button-root {
    border-radius: 6px;
    font-weight: 500;
}

.mud-chip {
    border-radius: 6px;
    font-weight: 500;
}

/* Inputs: softer borders */
.mud-input-outlined .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.10);
}

.mud-input-outlined:hover:not(.mud-disabled) .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.22);
}

/* Top app menu bar (Ruixen-style) */
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: #FAFAFA;
    margin-right: 1.5rem;
    padding: 0.25rem 0.25rem 0.25rem 0;
}

.app-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow: 0 4px 12px -4px rgba(255, 99, 99, 0.35);
}

/* MudImage inside MudAvatar — fill the circle and crop, don't stretch.
   MudBlazor's default doesn't set object-fit, so portraits sometimes render off-center. */
.mud-avatar .mud-image,
.mud-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.app-brand-text {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.375rem;
    line-height: 1;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.25rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.app-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #A1A1AA;
    text-decoration: none;
    transition: color 120ms ease, background-color 120ms ease;
    white-space: nowrap;
}

.app-nav-link:hover {
    color: #FAFAFA;
    background-color: rgba(255, 255, 255, 0.04);
}

.app-nav-link-active {
    color: #FAFAFA;
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.app-nav-icon {
    display: inline-flex;
    align-items: center;
    color: inherit;
}

.app-nav-icon .mud-icon-root {
    color: inherit;
    width: 16px;
    height: 16px;
}

.app-user {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding-left: 0.5rem;
}

.app-user-name {
    font-size: 0.8125rem;
    color: #E5E5E7;
    font-weight: 500;
}

@media (max-width: 720px) {
    .app-user-name { display: none; }
    .app-brand-text { display: none; }
}

/* Bell overlay anchored to the top-right of a project card */
.card-bell-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

/* Project alerts popover (OriginUI-style notifications dropdown) */
.alerts-popover {
    width: 380px;
    max-width: calc(100vw - 24px);
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.7), 0 8px 16px -8px rgba(0, 0, 0, 0.4) !important;
    background: rgba(20, 20, 23, 0.96) !important;
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    padding: 0 !important;
    overflow: hidden;
}

.alerts-popover-content {
    display: flex;
    flex-direction: column;
    max-height: 440px;
}

.alerts-popover-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem 0.625rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.alerts-popover-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #FAFAFA;
    letter-spacing: -0.01em;
}

.alerts-popover-subtitle {
    font-size: 0.75rem;
    color: #A1A1AA;
    margin-top: 0.125rem;
}

.alerts-popover-link {
    background: none;
    border: none;
    cursor: pointer;
    color: #FF6363;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0;
    text-decoration: none;
    white-space: nowrap;
}

.alerts-popover-link:hover {
    color: #FF8A8A;
    text-decoration: underline;
}

.alerts-popover-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.alerts-popover-row {
    display: grid;
    grid-template-columns: 6px auto 1fr;
    align-items: start;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background-color 100ms ease;
}

.alerts-popover-row:last-child {
    border-bottom: none;
}

.alerts-popover-row:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.alerts-popover-dot {
    width: 6px;
    height: 6px;
    margin-top: 0.5rem;
    border-radius: 50%;
    background: #FF6363;
    box-shadow: 0 0 0 2px rgba(255, 99, 99, 0.18);
}

.alerts-popover-dot.muted {
    background: transparent;
    box-shadow: none;
}

.alerts-popover-avatar {
    flex-shrink: 0;
}

.alerts-popover-text {
    min-width: 0;
}

.alerts-popover-line {
    font-size: 0.8125rem;
    color: #E5E5E7;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.alerts-popover-line strong {
    color: #FAFAFA;
    font-weight: 600;
}

.alerts-popover-time {
    font-size: 0.6875rem;
    color: #71717A;
    margin-top: 0.125rem;
}

.alerts-popover-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    color: #A1A1AA;
}

.alerts-popover-empty-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #E5E5E7;
}

.alerts-popover-empty-sub {
    font-size: 0.75rem;
    color: #71717A;
    text-align: center;
}

.alerts-popover-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.625rem 1rem;
    text-align: center;
}

/* Member avatar preview strip (Home cards / Dashboard) */
.member-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: #A1A1AA;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    border-radius: 6px;
    transition: background-color 120ms ease, color 120ms ease;
}

.member-preview:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #FAFAFA;
}

.member-preview-text {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Markdown rendered content */
.markdown-body code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.markdown-body pre {
    background: #0F0F11;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* === Animated Gradient Background ===
   Four blurred color blobs drifting on independent loops. Mounted once per page
   via <AnimatedGradientBackground />. Sits fixed behind content (z-index: 0).
   Page content sits at z-index: 1 thanks to .mud-layout/.mud-main-content above. */
.animated-gradient-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
    background: #000;
}

.animated-gradient-bg .agb-blob,
.animated-gradient-bg .agb-grain {
    display: none;
}

/* Swirl shader background canvas — fullscreen, behind all page content. */
.swirl-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    display: block;
    background: #000;
}

/* Celestial Ink gradient background — fixed, behind page content.
   Per-instance gradient is set inline via the component's style attribute.
   A soft radial vignette darkens the edges to keep content centers readable. */
.celestial-ink-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    display: block;
}

body:has(.celestial-ink-bg)::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.35) 100%);
}

/* === Grain gradient background ===
   CSS approximation of paper-design GrainGradient (corners shape).
   Three corner-anchored radial blobs + grain noise overlay. Per-page palette
   is set by --gg-c1/2/3 inline on the .grain-gradient-bg div. */
.grain-gradient-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background: #000;
}

.grain-gradient-bg::before {
    content: '';
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse 60% 60% at 5% 10%, var(--gg-c1, hsl(14,100%,57%)) 0%, transparent 65%),
        radial-gradient(ellipse 60% 60% at 95% 15%, var(--gg-c2, hsl(45,100%,51%)) 0%, transparent 65%),
        radial-gradient(ellipse 70% 70% at 50% 110%, var(--gg-c3, hsl(340,82%,52%)) 0%, transparent 65%);
    filter: blur(60px);
    opacity: 0.55;
    animation: grain-gradient-drift 22s ease-in-out infinite;
    will-change: transform;
}

.grain-gradient-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.20;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    pointer-events: none;
}

@keyframes grain-gradient-drift {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(3%, -2%) scale(1.06); }
    66%  { transform: translate(-2%, 3%) scale(0.97); }
    100% { transform: translate(0, 0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .grain-gradient-bg::before { animation: none; }
}

.agb-blob {
    position: absolute;
    width: 50rem;
    height: 50rem;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.55;
    will-change: transform;
    mix-blend-mode: screen;
}

.agb-blob-1 {
    background: radial-gradient(circle at 30% 30%, #ff6363, transparent 70%);
    top: -15rem;
    left: -10rem;
    animation: agb-drift-1 26s ease-in-out infinite;
}

.agb-blob-2 {
    background: radial-gradient(circle at 30% 30%, #5471ff, transparent 70%);
    top: -10rem;
    right: -15rem;
    animation: agb-drift-2 32s ease-in-out infinite;
}

.agb-blob-3 {
    background: radial-gradient(circle at 30% 30%, #b14aed, transparent 70%);
    bottom: -20rem;
    left: 10%;
    animation: agb-drift-3 28s ease-in-out infinite;
}

.agb-blob-4 {
    background: radial-gradient(circle at 30% 30%, #19c3a4, transparent 70%);
    bottom: -15rem;
    right: 5%;
    width: 40rem;
    height: 40rem;
    opacity: 0.45;
    animation: agb-drift-4 34s ease-in-out infinite;
}

@keyframes agb-drift-1 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(20vw, 15vh) scale(1.1); }
    66%  { transform: translate(8vw, 35vh) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes agb-drift-2 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-18vw, 20vh) scale(1.15); }
    66%  { transform: translate(-30vw, 5vh) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes agb-drift-3 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(15vw, -15vh) scale(1.1); }
    66%  { transform: translate(-10vw, -25vh) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes agb-drift-4 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-12vw, -20vh) scale(1.05); }
    66%  { transform: translate(8vw, -10vh) scale(1.2); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Faint film grain over the gradient — breaks up the blur banding on flat areas. */
.agb-grain {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.2 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* When the animated background is on, suppress the body::before ambient glow
   so the two effects don't fight. */
body:has(.animated-gradient-bg)::before {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .agb-blob { animation: none; }
}