/* ═══════════════════════════════════════════════
   AZ KONNECT — Experience Layer CSS
   High-conversion AI system experience layer
   ═══════════════════════════════════════════════ */

/* ══════════════════════════════════════
   1. PERSISTENT AI ORB
   ══════════════════════════════════════ */
.az-orb {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 8500;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform .4s cubic-bezier(.16, 1, .3, 1), box-shadow .4s;
    will-change: transform;
}

.az-orb::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 158, 255, .2) 0%, transparent 70%);
    animation: orbBreathe 3s ease-in-out infinite;
    pointer-events: none;
}

.az-orb::after {
    content: '';
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    border: 1px solid rgba(74, 158, 255, .08);
    animation: orbRing 4s ease-in-out infinite;
    pointer-events: none;
}

.az-orb-core {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(74, 158, 255, .4), rgba(2, 12, 46, .9) 70%);
    border: 1.5px solid rgba(74, 158, 255, .35);
    box-shadow:
        0 0 20px rgba(74, 158, 255, .2),
        0 0 60px rgba(74, 158, 255, .08),
        inset 0 0 20px rgba(74, 158, 255, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all .4s;
}

.az-orb:hover .az-orb-core {
    border-color: rgba(74, 158, 255, .7);
    box-shadow:
        0 0 30px rgba(74, 158, 255, .4),
        0 0 80px rgba(74, 158, 255, .15),
        inset 0 0 30px rgba(74, 158, 255, .2);
    transform: scale(1.08);
}

.az-orb:hover {
    transform: translateY(-4px);
}

.az-orb-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Orb pulse notification dot */
.az-orb-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A9EFF, #7FC4FF);
    border: 2px solid rgba(2, 12, 46, .9);
    animation: orbNotify 2s ease-in-out infinite;
    z-index: 2;
}

.az-orb-label {
    position: absolute;
    right: 68px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: rgba(2, 12, 46, .85);
    border: 1px solid rgba(74, 158, 255, .2);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, .85);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all .35s cubic-bezier(.16, 1, .3, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
}

.az-orb-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: rgba(2, 12, 46, .85);
    border-right: 1px solid rgba(74, 158, 255, .2);
    border-bottom: 1px solid rgba(74, 158, 255, .2);
}

.az-orb:hover .az-orb-label,
.az-orb-label.show {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

@keyframes orbBreathe {
    0%, 100% { transform: scale(1); opacity: .6; }
    50% { transform: scale(1.15); opacity: 1; }
}

@keyframes orbRing {
    0%, 100% { transform: scale(1); opacity: .3; }
    50% { transform: scale(1.2); opacity: .6; }
}

@keyframes orbNotify {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 158, 255, .4); }
    50% { box-shadow: 0 0 0 6px rgba(74, 158, 255, 0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

@keyframes msgEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Orb Lead Capture Modal ── */
.az-orb-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 8600;
    background: rgba(2, 12, 46, .5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}

.az-orb-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.az-orb-modal {
    position: fixed;
    bottom: 96px;
    right: 28px;
    z-index: 8700;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: rgba(3, 14, 52, .95);
    border: 1px solid rgba(74, 158, 255, .18);
    border-radius: 20px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, .5),
        0 0 40px rgba(74, 158, 255, .06),
        inset 0 0 30px rgba(74, 158, 255, .03);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    transform: translateY(20px) scale(.95);
    opacity: 0;
    pointer-events: none;
    transition: all .4s cubic-bezier(.16, 1, .3, 1);
    overflow: hidden;
}

.az-orb-modal.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.az-orb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.az-orb-modal-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255, 255, 255, .95);
    display: flex;
    align-items: center;
    gap: 8px;
}

.az-orb-modal-header h4 .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 8px #2ecc71;
    animation: blink 2.5s ease-in-out infinite;
}

.az-orb-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .5);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.az-orb-modal-close:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.az-orb-modal-body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.az-orb-modal-body .msg-row {
    display: flex;
    width: 100%;
    animation: msgEnter .5s cubic-bezier(.2, .8, .2, 1) forwards;
}

.az-orb-modal-body .msg-assistant-row { justify-content: flex-start; }
.az-orb-modal-body .msg-user-row { justify-content: flex-end; }

.az-orb-modal-body .msg-bubble {
    max-width: 90%;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.az-orb-modal-body .msg-assistant {
    background: rgba(2, 12, 46, .4);
    border: 1px solid rgba(74, 158, 255, .12);
    border-radius: 14px 14px 14px 4px;
    color: rgba(255, 255, 255, .9);
}

.az-orb-modal-body .msg-user {
    background: rgba(74, 158, 255, .12);
    border: 1px solid rgba(74, 158, 255, .25);
    border-radius: 14px 14px 4px 14px;
    color: #fff;
}

/* Multi-step chips in orb modal */
.az-orb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.az-orb-chip {
    padding: 7px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(2, 12, 46, .4);
    border: 1px solid rgba(74, 158, 255, .15);
    color: rgba(255, 255, 255, .75);
    cursor: pointer;
    transition: all .25s;
    user-select: none;
}

.az-orb-chip:hover {
    background: rgba(74, 158, 255, .12);
    border-color: rgba(74, 158, 255, .45);
    color: #fff;
    transform: translateY(-1px);
}

.az-orb-chip.selected {
    background: rgba(74, 158, 255, .2);
    border-color: var(--az-accent);
    color: #fff;
}

/* Orb modal input */
.az-orb-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(2, 12, 46, .6);
    border: 1px solid rgba(74, 158, 255, .2);
    border-radius: 12px;
    padding: 4px 6px;
    transition: all .3s;
}

.az-orb-input-wrap:focus-within {
    border-color: rgba(74, 158, 255, .6);
    box-shadow: 0 0 20px rgba(74, 158, 255, .15);
}

.az-orb-input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    padding: 8px 10px;
    font-size: 13px;
    outline: 0;
    font-family: inherit;
    min-width: 0;
}

.az-orb-input::placeholder {
    color: rgba(255, 255, 255, .35);
}

.az-orb-send {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(74, 158, 255, .1);
    color: rgba(74, 158, 255, .5);
    border: 1px solid rgba(74, 158, 255, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .25s;
    flex-shrink: 0;
    font-size: 14px;
}

.az-orb-send:hover,
.az-orb-send.active {
    background: var(--az-accent);
    color: var(--az-navy-deep);
    border-color: var(--az-accent);
    box-shadow: 0 0 12px rgba(74, 158, 255, .4);
}

/* Success state */
.az-orb-modal .gp-success-state {
    text-align: center;
    animation: msgEnter .5s cubic-bezier(.2, .8, .2, 1) forwards;
}

.az-orb-modal .gp-success-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(74, 158, 255, .2), rgba(74, 158, 255, .08));
    border: 1.5px solid rgba(74, 158, 255, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 22px;
    color: var(--az-accent);
    box-shadow: 0 0 20px rgba(74, 158, 255, .2);
}

/* ══════════════════════════════════════
   2. DATA STREAM BACKGROUNDS
   ══════════════════════════════════════ */
.az-data-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.az-data-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 0;
    right: 0;
    height: 200%;
    background-image:
        linear-gradient(0deg, transparent 98%, rgba(74, 158, 255, .03) 100%),
        linear-gradient(90deg, transparent 98%, rgba(74, 158, 255, .02) 100%);
    background-size: 1px 40px, 40px 1px;
    animation: dataFlow 60s linear infinite;
}

@keyframes dataFlow {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

/* Scan line effect */
.az-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(74, 158, 255, .15), transparent);
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes scanline {
    0% { top: -2px; opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ══════════════════════════════════════
   3. SECTION CONNECTORS
   ══════════════════════════════════════ */
.az-connector {
    position: relative;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.az-connector::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(74, 158, 255, .2), rgba(74, 158, 255, .05));
}

.az-connector-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--az-accent);
    box-shadow: 0 0 12px var(--az-accent);
    animation: connectorPulse 2s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes connectorPulse {
    0%, 100% { box-shadow: 0 0 8px var(--az-accent); transform: scale(1); }
    50% { box-shadow: 0 0 20px var(--az-accent), 0 0 40px rgba(74, 158, 255, .2); transform: scale(1.3); }
}

/* ══════════════════════════════════════
   4. DEPTH NAVIGATION (before footer)
   ══════════════════════════════════════ */
.az-depth-nav {
    position: relative;
    padding: 80px 24px;
    background: linear-gradient(180deg, var(--az-navy-deep), rgba(5, 22, 91, .3));
    overflow: hidden;
}

.az-depth-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 158, 255, .15), transparent);
}

.az-depth-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.az-depth-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--az-accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.az-depth-label .line {
    width: 20px;
    height: 1px;
    background: var(--az-accent);
    opacity: .4;
}

.az-depth-title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    letter-spacing: -.02em;
    color: rgba(255, 255, 255, .9);
    margin-bottom: 40px;
}

.az-depth-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.az-depth-card {
    background: rgba(255, 255, 255, .02);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 16px;
    padding: 28px 24px;
    text-decoration: none;
    color: var(--az-text);
    transition: all .4s cubic-bezier(.16, 1, .3, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.az-depth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 0%, rgba(74, 158, 255, .06), transparent 60%);
    opacity: 0;
    transition: opacity .4s;
}

.az-depth-card:hover {
    transform: translateY(-4px);
    border-color: rgba(74, 158, 255, .2);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .3);
}

.az-depth-card:hover::before { opacity: 1; }

.az-depth-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--az-accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.az-depth-card-icon svg {
    width: 22px;
    height: 22px;
    color: var(--az-accent);
}

.az-depth-card h4 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.az-depth-card p {
    font-size: 13px;
    color: var(--az-text-mid);
    line-height: 1.6;
}

.az-depth-card .go-arrow {
    font-size: 13px;
    font-weight: 600;
    color: var(--az-accent);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap .3s;
}

.az-depth-card:hover .go-arrow { gap: 10px; }

/* ══════════════════════════════════════
   5. INTERACTIVE HOVER STATES
   ══════════════════════════════════════ */
/* Magnetic hover effect for buttons */
.az-magnetic {
    transition: transform .4s cubic-bezier(.16, 1, .3, 1);
}

/* Glow line effect on section entry */
.az-glow-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(74, 158, 255, .4) 50%, transparent 100%);
    transform: scaleX(0);
    transition: transform 1.2s cubic-bezier(.16, 1, .3, 1);
}

.az-glow-line.active {
    transform: scaleX(1);
}

/* ══════════════════════════════════════
   6. LIVE DEMO SIMULATION
   ══════════════════════════════════════ */
.az-demo-terminal {
    background: rgba(2, 12, 46, .7);
    border: 1px solid rgba(74, 158, 255, .12);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .4);
}

.az-demo-terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .03);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.az-demo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.az-demo-dot.red { background: #ff5f57; }
.az-demo-dot.yellow { background: #ffbd2e; }
.az-demo-dot.green { background: #28ca41; }

.az-demo-terminal-title {
    flex: 1;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--az-text-dim);
    letter-spacing: .04em;
}

.az-demo-terminal-body {
    padding: 16px 18px;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.8;
    color: var(--az-text-mid);
    min-height: 120px;
}

.az-demo-line {
    opacity: 0;
    transform: translateX(-10px);
    animation: termLine .4s forwards;
}

.az-demo-line .prompt { color: var(--az-accent); }
.az-demo-line .success { color: #2ecc71; }
.az-demo-line .dim { color: var(--az-text-dim); }

@keyframes termLine {
    to { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════
   7. COUNTER ANIMATIONS
   ══════════════════════════════════════ */
.az-counter {
    font-variant-numeric: tabular-nums;
    transition: all .3s;
}

/* ══════════════════════════════════════
   8. PAGE TRANSITION
   ══════════════════════════════════════ */
.az-page-enter {
    animation: pageEnter .6s cubic-bezier(.16, 1, .3, 1) forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* ══════════════════════════════════════
   9. RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    .az-orb {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }

    .az-orb-label {
        display: none;
    }

    .az-orb-modal {
        bottom: 80px;
        right: 12px;
        width: calc(100vw - 24px);
    }

    .az-depth-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .az-depth-grid {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════
   10. REDUCED MOTION
   ══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .az-orb::before,
    .az-orb::after,
    .az-orb-pulse,
    .az-scanline,
    .az-data-bg::before,
    .az-connector-dot,
    .az-demo-line {
        animation: none !important;
    }
}
