/* ============================================
   EFFECTS.CSS — Visual enhancements for v2
   Requires: style.css (base styles)
   ============================================ */

/* === 1. Animated Gradient Shimmer on Hero Text === */
.gradient-shimmer {
    background: linear-gradient(
        135deg,
        #2997ff 0%,
        #a855f7 25%,
        #ec4899 50%,
        #a855f7 75%,
        #2997ff 100%
    );
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shimmer 6s ease infinite;
}

@keyframes gradient-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* === 2. Glow Effect Behind Gradient Titles === */
.glow-text {
    position: relative;
}

.glow-text::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 80%;
    background: var(--glow-color, rgba(168, 85, 247, 0.15));
    filter: blur(60px);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.glow-text.visible::after,
.glow-text:not(.reveal)::after {
    opacity: 1;
}

/* === 3. Sequential Pulsing Rings on Steps === */

.step-num-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
}

.step-num-wrap .step-num {
    position: relative;
    z-index: 2;
    margin: 0;
}

.pulse-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    pointer-events: none;
    /* 8s total cycle: each step gets a 2s window to pulse, idle for 6s */
    animation: pulse-ring 8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Sequential delays: Step 1 at 0s, Step 2 at 2s, Step 3 at 4s, Step 4 at 6s */
.step:nth-child(1) .pulse-ring       { color: #a855f7; animation-delay: 0s; }
.step:nth-child(1) .pulse-ring-delay  { color: #a855f7; animation-delay: 0.6s; }
.step:nth-child(2) .pulse-ring        { color: #ec4899; animation-delay: 2s; }
.step:nth-child(2) .pulse-ring-delay  { color: #ec4899; animation-delay: 2.6s; }
.step:nth-child(3) .pulse-ring        { color: #f97316; animation-delay: 4s; }
.step:nth-child(3) .pulse-ring-delay  { color: #f97316; animation-delay: 4.6s; }
.step:nth-child(4) .pulse-ring        { color: #06b6d4; animation-delay: 6s; }
.step:nth-child(4) .pulse-ring-delay  { color: #06b6d4; animation-delay: 6.6s; }

/* Pulse happens in first 25% of cycle (2s), then idle for 75% (6s) */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    12.5% {
        transform: scale(1.8);
        opacity: 0;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* === 4. Glassmorphism Cards === */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* === 5. Hover Glow on Cards (simple colored shadow) === */
.hover-glow {
    position: relative;
    transition: border-color 0.4s, transform 0.3s, box-shadow 0.4s;
}

.hover-glow:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 0 30px var(--hover-glow, rgba(168, 85, 247, 0.12)),
                0 0 60px var(--hover-glow, rgba(168, 85, 247, 0.06)),
                0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Different glow colors per scenario */
.scenario-item:nth-child(1).hover-glow { --hover-glow: rgba(41, 151, 255, 0.18); }
.scenario-item:nth-child(2).hover-glow { --hover-glow: rgba(168, 85, 247, 0.18); }
.scenario-item:nth-child(3).hover-glow { --hover-glow: rgba(236, 72, 153, 0.18); }
.scenario-item:nth-child(4).hover-glow { --hover-glow: rgba(249, 115, 22, 0.18); }
.scenario-item:nth-child(5).hover-glow { --hover-glow: rgba(16, 185, 129, 0.18); }
.scenario-item:nth-child(6).hover-glow { --hover-glow: rgba(6, 182, 212, 0.18); }
.scenario-item:nth-child(7).hover-glow { --hover-glow: rgba(59, 130, 246, 0.18); }

/* === Button Glow === */
.btn-glow {
    position: relative;
    overflow: visible;
}

.btn-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    filter: blur(14px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn-glow:hover::after {
    opacity: 0.5;
}

/* Nav CTA glow */
.nav-cta-glow {
    position: relative;
}

.nav-cta-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--accent);
    filter: blur(10px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.nav-cta-glow:hover::after {
    opacity: 0.4;
}

/* === Glass Input Fields === */
.glass-input {
    background: rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: border-color 0.3s, box-shadow 0.3s !important;
}

.glass-input:focus {
    border-color: rgba(168, 85, 247, 0.5) !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}

/* ============================================
   FEATURE VISUALS — Nexus, Stats, Security, Mission
   ============================================ */

/* === Feature: Nexus Diagram === */
.feature-nexus-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f1628 0%, #1a1040 50%, #0f1628 100%);
}

.nexus-svg {
    width: 100%;
    max-width: 360px;
    height: auto;
}

.nexus-label {
    font-size: 10px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.03em;
}

/* === Feature: Stats Counters === */
.feature-stats-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1a1f 0%, #1a2d3a 50%, #0d1a1f 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 48px;
    text-align: center;
}

.stat-number {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    background: linear-gradient(135deg, #2997ff, #a855f7);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-item:nth-child(2) .stat-number { background-image: linear-gradient(135deg, #a855f7, #ec4899); }
.stat-item:nth-child(3) .stat-number { background-image: linear-gradient(135deg, #06b6d4, #3b82f6); }
.stat-item:nth-child(4) .stat-number { background-image: linear-gradient(135deg, #10b981, #06b6d4); }

.stat-plus {
    font-size: 1.6rem;
    font-weight: 600;
}

.stat-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    margin-top: 4px;
}

/* === Feature: Security Icons === */
.feature-security-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1f12 0%, #1a3a22 50%, #0d1f12 100%);
}

.security-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 300px;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.security-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.security-item span {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

/* === Feature: Mission Visual (Growth Animation) === */
.feature-mission-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0d1f 0%, #2d1a3a 50%, #1a0d1f 100%);
}

.mission-svg {
    width: 100%;
    max-width: 380px;
    height: auto;
}

.mission-person {
    animation: mission-grow 6s ease-in-out infinite;
}

@keyframes mission-grow {
    0%, 5% { transform: scale(0.5); opacity: 0.35; }
    45%, 65% { transform: scale(1.35); opacity: 1; }
    90%, 100% { transform: scale(0.5); opacity: 0.35; }
}

.growth-ring {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.growth-ring-1 {
    animation: ring-pulse 6s ease-out infinite;
}

.growth-ring-2 {
    animation: ring-pulse 6s ease-out infinite 0.5s;
}

@keyframes ring-pulse {
    0%, 30% { transform: scale(0.6); opacity: 0; }
    50% { transform: scale(1); opacity: 0.5; }
    70%, 100% { transform: scale(1.5); opacity: 0; }
}

/* === Feature Responsive === */
@media (max-width: 600px) {
    .stats-grid { gap: 16px 24px; }
    .stat-number { font-size: 2rem; }
    .stat-label { font-size: 0.7rem; }
    .nexus-svg { max-width: 280px; }
    .security-items { max-width: 240px; }
    .security-item { padding: 8px 12px; gap: 10px; }
    .security-icon { width: 28px; height: 28px; }
    .security-item span { font-size: 0.8rem; }
    .mission-svg { max-width: 180px; }
}

/* ============================================
   LAYER VISUALS — Animated content for layers 2-6
   ============================================ */

/* === Layer 2: Radar Chart === */
.layer-roles {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1028 0%, #2d1b4e 50%, #1a1028 100%);
}

.radar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 340px;
}

.radar-svg {
    width: 100%;
    height: auto;
}

.radar-grid-line {
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 1;
    fill: none;
}

.radar-axis {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.radar-label {
    font-size: 9.5px;
    font-weight: 500;
    fill: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    letter-spacing: 0.02em;
}

.radar-label.radar-label-lit {
    fill: rgba(168, 85, 247, 0.95);
    font-weight: 700;
}

.radar-shape {
    fill: rgba(168, 85, 247, 0.12);
    stroke: rgba(168, 85, 247, 0.6);
    stroke-width: 2;
}

.radar-dot {
    fill: #a855f7;
}

.radar-role-info {
    text-align: center;
}

.radar-role-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    transition: opacity 0.3s;
}

/* === Layer 3: Floating Domain Terms === */
.layer-terms {
    background: linear-gradient(135deg, #0d1f1f 0%, #1a3a3a 50%, #0d1f1f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.float-term {
    position: absolute;
    left: var(--x);
    top: var(--y);
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    pointer-events: none;
    animation: float-drift var(--d, 20s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

.float-term:nth-child(odd) {
    color: rgba(6, 182, 212, 0.7);
    font-size: 0.9rem;
}

.float-term:nth-child(3n) {
    color: rgba(16, 185, 129, 0.65);
    font-size: 1rem;
    font-weight: 600;
}

.float-term:nth-child(4n) {
    color: rgba(168, 85, 247, 0.6);
}

@keyframes float-drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    25% {
        transform: translate(12px, -18px) scale(1.05);
        opacity: 0.9;
    }
    50% {
        transform: translate(-8px, 10px) scale(0.98);
        opacity: 0.6;
    }
    75% {
        transform: translate(15px, 8px) scale(1.03);
        opacity: 0.85;
    }
}

/* === Layer 4: Live Typing Effect === */
.layer-typing {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0d0d 0%, #2d1a1a 50%, #1a0d0d 100%);
    padding: 24px;
}

.typing-conversation {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 380px;
}

.typing-bubble {
    padding: 14px 18px;
    border-radius: 16px;
    max-width: 90%;
}

.typing-user {
    background: rgba(41, 151, 255, 0.12);
    border: 1px solid rgba(41, 151, 255, 0.2);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.typing-ai {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    min-height: 70px;
}

.typing-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    opacity: 0.5;
}

.typing-user .typing-label { color: #2997ff; }
.typing-ai .typing-label { color: #a855f7; }

.typing-text {
    font-size: 0.88rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.typing-cursor {
    display: inline;
    color: #a855f7;
    font-weight: 300;
    animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-dots {
    display: none;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots.visible {
    display: flex;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(41, 151, 255, 0.6);
    animation: dot-bounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* === Layer 5: Pipeline Diagram (SVG) === */
.layer-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d0d1f 0%, #1a1a3a 50%, #0d0d1f 100%);
    padding: 24px;
}

.pipeline-svg {
    width: 100%;
    max-width: 460px;
    height: auto;
}

.pipe-label {
    font-size: 9px;
    font-weight: 600;
    fill: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: inherit;
}

.pipe-node circle {
    transition: stroke 0.4s, fill 0.4s;
}

.pipe-node.pipe-lit circle {
    stroke: rgba(41, 151, 255, 0.6);
    fill: rgba(41, 151, 255, 0.08);
}

.pipe-node.pipe-lit path {
    stroke: rgba(41, 151, 255, 0.9);
}

.pipe-node.pipe-lit .pipe-label {
    fill: rgba(41, 151, 255, 0.9);
}

/* === Layer 6: Animated Checklist === */
.layer-checklist {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0f24 0%, #1e1e42 50%, #0f0f24 100%);
    padding: 24px;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 320px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    opacity: 0.55;
    transform: translateX(-6px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.checklist-item.checked {
    opacity: 1;
    transform: translateX(0);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
}

.checklist-item span {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    transition: color 0.4s;
}

.checklist-item.checked span {
    color: #fff;
}

.check-box {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.4s, background 0.4s;
}

.checklist-item.checked .check-box {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.3);
}

.check-path {
    fill: none;
    stroke: #10b981;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    transition: stroke-dashoffset 0.4s ease 0.1s;
}

.checklist-item.checked .check-path {
    stroke-dashoffset: 0;
}

/* === Responsive: reduce effects on mobile for performance === */
@media (max-width: 900px) {
    .pipeline-svg { max-width: 360px; }
    .radar-wrap { max-width: 280px; }
    .typing-conversation { max-width: 300px; }
    .checklist-items { max-width: 260px; }
}

@media (max-width: 600px) {
    .pulse-ring {
        animation-duration: 3s;
    }

    .gradient-shimmer {
        animation-duration: 8s;
    }

    .glow-text::after {
        filter: blur(40px);
        width: 80%;
    }

    .float-term { font-size: 0.72rem !important; }
    .pipeline-svg { max-width: 300px; }
    .radar-wrap { max-width: 240px; }
    .radar-label { font-size: 7px; }
    .radar-role-name { font-size: 0.9rem; }
    .typing-bubble { padding: 10px 14px; }
    .typing-text { font-size: 0.8rem; }
    .checklist-item { padding: 8px 12px; }
    .checklist-item span { font-size: 0.8rem; }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .gradient-shimmer { animation: none; }
    .hero-flip-word { transition: none; }
    .fade-in { animation: none; opacity: 1; transform: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .float-term { animation: none; }
}
