/* ============================================================================
   IntuiFy — "Nova" scroll-driven WebGL layer
   Loaded AFTER the inline <style> in index.php so it can override it.
   ========================================================================== */

:root {
    --nova-warm: #ffa091;
    --nova-cool: #8da9fc;
    --nova-bg: #030305;
    --nova-muted: #a0a0a0;
    --nova-ease: cubic-bezier(0.2, 1, 0.2, 1);
    --nova-ease-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* The WebGL canvas sits at z-index:-10. A background on <body> would paint on
   top of it, so the page base colour lives on <html> and <body> stays clear. */
html { background: var(--nova-bg); }
body { background: transparent; }

/* ---------------------------------------------------------------- canvas -- */

#nova-canvas {
    position: fixed;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    z-index: -10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 900ms ease;
}
html.nova-live #nova-canvas { opacity: 1; }

/* Static gradient shown when WebGL is unavailable or motion is reduced. */
#nova-fallback {
    position: fixed;
    inset: 0;
    z-index: -9;
    pointer-events: none;
    opacity: 0;
    transition: opacity 600ms ease;
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(51, 102, 255, 0.20), transparent 62%),
        radial-gradient(ellipse 55% 45% at 88% 18%, rgba(255, 76, 51, 0.13), transparent 66%),
        radial-gradient(ellipse 70% 50% at 12% 88%, rgba(51, 102, 255, 0.12), transparent 66%);
}
html.nova-static #nova-fallback { opacity: 1; }

/* Big-bang flash: scales out of the singularity between scroll 0.90 and 0.95. */
#nova-glow {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 100px;
    height: 100px;
    border-radius: 9999px;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    z-index: 30;
    pointer-events: none;
    will-change: transform, opacity;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.92) 40%, rgba(255, 255, 255, 0) 80%);
}

/* ----------------------------------------------------------- legibility -- */

/* Sections are transparent so the particles show through; a soft radial scrim
   keeps body copy readable when the cloud passes behind the text. */
.nova-scrim { position: relative; }
.nova-scrim::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 78% 66% at 50% 50%,
        rgba(3, 3, 5, 0.86) 0%,
        rgba(3, 3, 5, 0.62) 52%,
        rgba(3, 3, 5, 0) 100%);
}
.nova-scrim > * { position: relative; z-index: 1; }

/* The hero sits inside the sphere's bright rim, so it needs a wider, denser
   pool of darkness than the in-flow sections. */
.nova-scrim-hero::before {
    inset: -12vh -16vw;
    background: radial-gradient(ellipse 62% 56% at 50% 50%,
        rgba(3, 3, 5, 0.92) 0%,
        rgba(3, 3, 5, 0.82) 42%,
        rgba(3, 3, 5, 0.5) 68%,
        rgba(3, 3, 5, 0) 100%);
}

/* Glass cards get a heavier fill + blur: they now float over a live scene. */
.glow-card {
    background: linear-gradient(135deg, rgba(14, 16, 24, 0.66), rgba(9, 11, 18, 0.52));
    border: 1px solid rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.glow-card:hover {
    border-color: rgba(141, 169, 252, 0.32);
    box-shadow: 0 0 44px -10px rgba(141, 169, 252, 0.18);
}

/* Form fields need a floor of their own over the wave. */
.form-input {
    background: rgba(6, 8, 14, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.form-input:focus {
    border-color: rgba(141, 169, 252, 0.5);
    box-shadow: 0 0 0 3px rgba(141, 169, 252, 0.12);
}

/* Re-key the accent gradient to the scene palette (warm ↔ cool). */
.gradient-text {
    background: linear-gradient(90deg, var(--nova-warm), var(--nova-cool));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ------------------------------------------------------- eyebrow + ring -- */

.top-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 20px;
    font-size: clamp(13px, 0.95vw, 14px);
    font-weight: 500;
    line-height: 1;
    color: #fff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.top-label svg { width: 14px; height: 14px; flex: 0 0 14px; }

/* 1px animated gradient ring, masked with the standard xor/exclude trick. */
.nova-ring {
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    background-size: 200% 100%;
    background-image: linear-gradient(90deg,
        rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: nova-ring-slide 3000ms linear infinite;
}
@keyframes nova-ring-slide {
    from { background-position: 0% 0%; }
    to   { background-position: 200% 0%; }
}

/* -------------------------------------------------------------- buttons -- */

.btn-primary,
.btn-secondary {
    height: 56px;
    border-radius: 9999px;
    font-family: inherit;
    font-size: clamp(15px, 1.1vw, 16px);
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px 0 32px;
    border: 0;
    color: #fff;
    background: rgba(20, 25, 35, 0.4);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    box-shadow:
        inset 0 2px 10px rgba(255, 255, 255, 0.35),
        inset 0 -6px 16px rgba(0, 0, 0, 0.75),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 8px 24px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    background: rgba(30, 35, 50, 0.5);
    box-shadow:
        inset 0 2px 12px rgba(255, 255, 255, 0.45),
        inset 0 -6px 18px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 12px 32px rgba(0, 0, 0, 0.5);
}
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-primary > .nova-ring {
    background-image: linear-gradient(90deg, var(--nova-warm), var(--nova-cool), var(--nova-warm));
    animation-duration: 4000ms;
}

/* Trailing circular arrow badge with its own static gradient ring. */
.btn-arrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.02);
}
.btn-arrow::after {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--nova-warm), var(--nova-cool));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}
.btn-arrow svg { width: 12px; height: 12px; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.btn-secondary:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

/* Full-width variant used by the contact form submit. */
.btn-block { width: 100%; justify-content: center; padding: 0 24px; }

/* --------------------------------------------------------- text cascade -- */

.cascade .nova-word {
    display: inline-block;
    white-space: nowrap;
}
.cascade .nova-char {
    display: inline-block;
    will-change: transform, opacity, filter;
    transform: translateY(40px);
    opacity: 0;
    filter: blur(16px);
    transition:
        transform 1200ms var(--nova-ease-quart),
        opacity   1200ms var(--nova-ease-quart),
        filter    1200ms var(--nova-ease-quart);
}
.cascade.is-cascading .nova-char {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0);
}

/* Trailing-edge fade, only on left-aligned display type. */
.title-fade {
    -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 60%, rgba(0,0,0,0.2) 100%);
    mask-image: linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 60%, rgba(0,0,0,0.2) 100%);
}

/* ------------------------------------------------------------- polish ---- */

/* The nav bar has to stay legible over the brightest part of the wave. */
#main-header > div { background: rgba(8, 9, 16, 0.72); }

/* Reveal transitions inherit the spec's easing so everything moves alike. */
.reveal-element {
    transition:
        opacity 1.2s var(--nova-ease),
        transform 1.2s var(--nova-ease);
}

@media (prefers-reduced-motion: reduce) {
    #nova-canvas,
    #nova-glow { display: none !important; }
    .cascade .nova-char {
        transform: none !important;
        opacity: 1 !important;
        filter: none !important;
        transition: none !important;
    }
    .nova-ring { animation: none !important; }
    .btn-primary:hover:not(:disabled),
    .btn-secondary:hover { transform: none; }
}
