/* =============================================
   AGENTIC AI MARKETING — "Command Center" Theme
   ============================================= */

/* ---------- Scanline Animation ---------- */
@keyframes scanline {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* ---------- Typing Cursor Blink ---------- */
@keyframes blink-caret {
    0%, 100% { border-color: var(--color-accent); }
    50%      { border-color: transparent; }
}

/* ---------- Typing Reveal (width) ---------- */
@keyframes typing {
    from { width: 0; }
    to   { width: 100%; }
}

/* ---------- Dash Flow (pipeline connectors) ---------- */
@keyframes dash-flow {
    to { stroke-dashoffset: -20; }
}

/* ---------- Pulse Glow (pipeline nodes) ---------- */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(218, 237, 26, 0.4); }
    50%      { box-shadow: 0 0 24px rgba(218, 237, 26, 0.8); }
}

/* ---------- Flicker (CRT ambience) ---------- */
@keyframes flicker {
    0%   { opacity: 0.97; }
    5%   { opacity: 1; }
    10%  { opacity: 0.98; }
    15%  { opacity: 1; }
    100% { opacity: 1; }
}

/* ===================== HERO ===================== */
.terminal-hero {
    position: relative;
    overflow: hidden;
    padding-top: 10rem;
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    animation: flicker 4s infinite;
}

.terminal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(218, 237, 26, 0.04) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(218, 237, 26, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ---------- Scanline Overlay ---------- */
.scanline-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(218, 237, 26, 0.015) 2px,
        rgba(218, 237, 26, 0.015) 4px
    );
}

.scanline-overlay::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 6px;
    background: linear-gradient(to bottom, transparent, rgba(218, 237, 26, 0.08), transparent);
    animation: scanline 6s linear infinite;
    z-index: 2;
}

/* ---------- Typing Text ---------- */
.typing-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--color-accent);
    font-family: 'Courier New', 'Fira Code', monospace;
    color: var(--color-accent);
    animation: typing 3.5s steps(48, end) 0.5s 1 normal both,
               blink-caret 0.75s step-end infinite;
    max-width: 100%;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ---------- Code Accent ---------- */
.code-accent {
    font-family: 'Courier New', 'Fira Code', monospace;
    color: var(--color-accent);
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* ---------- Glow Text ---------- */
.glow-text {
    color: var(--color-accent);
    text-shadow: 0 0 8px rgba(218, 237, 26, 0.4),
                 0 0 20px rgba(218, 237, 26, 0.2),
                 0 0 40px rgba(218, 237, 26, 0.1);
}

/* =================== PIPELINE DIAGRAM =================== */
.pipeline-node {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(218, 237, 26, 0.06);
    color: var(--color-accent);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: pulse-glow 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    transition: var(--transition-normal);
    text-align: center;
    line-height: 1.2;
}

.pipeline-node:hover {
    background: rgba(218, 237, 26, 0.15);
    transform: scale(1.1);
}

.pipeline-connector {
    stroke: var(--color-accent);
    stroke-width: 2;
    stroke-dasharray: 8 6;
    fill: none;
    animation: dash-flow 1s linear infinite;
}

/* =================== USE CASE CARDS =================== */
.ai-usecase-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--space-md);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.ai-usecase-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    opacity: 0;
    background: radial-gradient(ellipse at center, rgba(218, 237, 26, 0.04) 0%, transparent 70%);
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.ai-usecase-card:hover {
    border-color: rgba(218, 237, 26, 0.6);
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 0 30px rgba(218, 237, 26, 0.12),
                0 0 60px rgba(218, 237, 26, 0.04);
}

.ai-usecase-card:hover::before {
    opacity: 1;
}

.ai-usecase-card h3 {
    color: var(--color-text);
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 1;
}

.ai-usecase-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.ai-usecase-card .card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-sm);
    color: var(--color-accent);
    flex-shrink: 0;
}

/* =================== TECH STACK LAYERS =================== */
.tech-stack-layer {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg-card);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.tech-stack-layer::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-accent);
    border-radius: 8px 0 0 8px;
    opacity: 0.6;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.tech-stack-layer:hover {
    border-color: rgba(218, 237, 26, 0.4);
    transform: translateX(8px);
    background: rgba(218, 237, 26, 0.02);
}

.tech-stack-layer:hover::before {
    opacity: 1;
    width: 6px;
}

.tech-stack-layer .layer-num {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--color-accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    flex-shrink: 0;
    min-width: 80px;
}

.tech-stack-layer h4 {
    color: var(--color-text);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.tech-stack-layer p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* =================== ROI CALCULATOR =================== */
.roi-calculator {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: var(--space-lg);
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.roi-calculator::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(218, 237, 26, 0.008) 3px,
        rgba(218, 237, 26, 0.008) 6px
    );
    pointer-events: none;
}

.roi-calculator h3 {
    text-align: center;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

.roi-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.roi-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.roi-field .input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.roi-field .input-prefix {
    position: absolute;
    left: 1rem;
    font-family: 'Courier New', monospace;
    color: var(--color-accent);
    font-weight: 600;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
}

.roi-field input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.roi-field input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 20px rgba(218, 237, 26, 0.1);
}

.roi-field input.no-prefix {
    padding-left: 1rem;
}

.roi-outputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.roi-output-card {
    text-align: center;
    padding: var(--space-md);
    background: rgba(218, 237, 26, 0.03);
    border: 1px solid rgba(218, 237, 26, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.roi-output-card:hover {
    border-color: rgba(218, 237, 26, 0.4);
}

.roi-output-card .output-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    font-family: 'Courier New', monospace;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 12px rgba(218, 237, 26, 0.3);
}

.roi-output-card .output-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* =================== FAQ =================== */
.ai-faq-item {
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) 0;
    cursor: pointer;
    transition: var(--transition-fast);
}

.ai-faq-item:hover {
    border-color: rgba(218, 237, 26, 0.3);
}

.ai-faq-item h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text);
    margin-bottom: 0;
    font-weight: 600;
    transition: color 0.3s ease;
}

.ai-faq-item h4::after {
    content: '+';
    font-family: 'Courier New', monospace;
    color: var(--color-accent);
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.ai-faq-item.open h4::after {
    content: '−';
    transform: rotate(0deg);
}

.ai-faq-item.open h4 {
    color: var(--color-accent);
}

.ai-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s ease;
    padding-top: 0;
}

.ai-faq-item.open .ai-faq-answer {
    max-height: 400px;
    padding-top: var(--space-sm);
}

.ai-faq-answer p {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin: 0;
    line-height: 1.7;
}

/* =================== CTA SECTION =================== */
.ai-cta-section {
    text-align: center;
    position: relative;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    overflow: hidden;
}

.ai-cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center bottom, rgba(218, 237, 26, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

/* =================== SECTION LABELS =================== */
.section-label {
    color: var(--color-accent);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
    display: inline-block;
}

/* =================== SPLIT LAYOUT =================== */
.agentic-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

/* =================== USE-CASE GRID =================== */
.usecase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

/* =================== RESPONSIVE =================== */
@media (max-width: 992px) {
    .agentic-split {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .usecase-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .roi-outputs {
        grid-template-columns: 1fr;
    }

    .pipeline-node {
        width: 60px;
        height: 60px;
        font-size: 0.6rem;
    }

    .terminal-hero {
        padding-top: 8rem;
    }
}

@media (max-width: 768px) {
    .usecase-grid {
        grid-template-columns: 1fr;
    }

    .roi-inputs {
        grid-template-columns: 1fr;
    }

    .typing-text {
        white-space: normal;
        animation: none;
        border-right: none;
        width: auto;
        font-size: 1rem;
    }

    .terminal-hero {
        padding-top: 7rem;
        padding-bottom: var(--space-lg);
    }

    .tech-stack-layer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .tech-stack-layer .layer-num {
        min-width: auto;
    }

    .pipeline-svg-wrap {
        display: none;
    }

    .pipeline-mobile {
        display: flex !important;
    }
}
