/* feature_iot.css - styles for /features/iot landing page */

/* ============ Reveal animations ============ */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-50px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal-left.active { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(50px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal-right.active { opacity: 1; transform: translateX(0); }

/* ============ Float / pulse ============ */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.animate-float { animation: float 5s ease-in-out infinite; }
.animate-float-delayed { animation: float 5s ease-in-out 2s infinite; }

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45); }
    50% { box-shadow: 0 0 0 14px rgba(99, 102, 241, 0); }
}
.glow-pulse { animation: glow-pulse 2.4s ease-in-out infinite; }

@keyframes scan-x { 0% { transform: translateX(-110%); } 100% { transform: translateX(220%); } }
.scan-x { animation: scan-x 2.6s ease-in-out infinite; }

/* ============ Workflow path ============ */
@keyframes dash-flow { from { stroke-dashoffset: 240; } to { stroke-dashoffset: 0; } }
.dash-flow { stroke-dasharray: 8 10; animation: dash-flow 6s linear infinite; }

/* ============ Bg art lattice ============ */
.bg-lattice {
    background-image: radial-gradient(circle at 1px 1px, rgba(165, 180, 252, 0.08) 1px, transparent 0);
    background-size: 24px 24px;
}

/* ============ Sensor pings ============ */
@keyframes ping-out {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.6); opacity: 0; }
}
.ping-dot {
    position: relative;
    width: 10px; height: 10px;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.9);
}
.ping-dot::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.6);
    animation: ping-out 1.6s ease-out infinite;
}
.ping-dot.amber { background: #f59e0b; }
.ping-dot.amber::before { background: rgba(245, 158, 11, 0.6); }
.ping-dot.rose { background: #f43f5e; }
.ping-dot.rose::before { background: rgba(244, 63, 94, 0.6); }
.ping-dot.indigo { background: #6366f1; }
.ping-dot.indigo::before { background: rgba(99, 102, 241, 0.6); }

/* ============ Device card hover ============ */
.device-card {
    transition: transform 0.4s cubic-bezier(0.5, 0, 0, 1), box-shadow 0.4s ease, border-color 0.3s ease;
}
.device-card:hover {
    transform: translateY(-8px);
    border-color: #6366f1;
    box-shadow: 0 30px 60px -20px rgba(99, 102, 241, 0.4);
}

/* ============ Live feed rows ============ */
.iot-row { opacity: 0; transform: translateY(8px); transition: opacity 0.5s ease, transform 0.5s ease; }
.iot-row.is-live { opacity: 1; transform: translateY(0); }
.iot-row.fade-out { opacity: 0; transform: translateY(-8px); }

/* ============ Incident card states ============ */
.ai-stage { display: none; }
.ai-stage.is-on { display: block; animation: ai-fade-in 0.45s ease both; }
@keyframes ai-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.ai-action-row { opacity: 0; transform: translateX(-6px); transition: opacity 0.4s ease, transform 0.4s ease; }
.ai-action-row.is-shown { opacity: 1; transform: translateX(0); }

@keyframes type-dots {
    0%, 20% { opacity: 0.2; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
    60%, 100% { opacity: 0.2; transform: translateY(0); }
}
.type-dot { display: inline-block; width: 4px; height: 4px; border-radius: 999px; background: #a5b4fc; margin: 0 1px; animation: type-dots 1.2s ease-in-out infinite; }
.type-dot:nth-child(2) { animation-delay: 0.18s; }
.type-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes leak-flash {
    0%, 100% { background-color: rgba(244, 63, 94, 0.18); }
    50% { background-color: rgba(244, 63, 94, 0.32); }
}
.leak-flash { animation: leak-flash 1.4s ease-in-out 2; }

.ai-btn { transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease; }
.ai-btn:hover { transform: translateY(-1px); }
.ai-btn:active { transform: translateY(0); }
.ai-btn:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }

.check-tick { transform: scale(0); transition: transform 0.4s cubic-bezier(0.5, 1.6, 0.4, 1); }
.check-tick.is-on { transform: scale(1); }

.ai-status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 9px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}

/* ============ Gauges ============ */
.gauge-arc { stroke-dasharray: 220; stroke-dashoffset: 220; transition: stroke-dashoffset 1.6s cubic-bezier(0.5, 0, 0, 1); }

/* ============ Sparkline draw ============ */
.iot-spark { stroke-dasharray: 600; stroke-dashoffset: 600; transition: stroke-dashoffset 1.8s cubic-bezier(0.5, 0, 0, 1); }
.iot-spark.is-drawn { stroke-dashoffset: 0; }

/* ============ Anomaly timeline ============ */
.timeline-row {
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.timeline-row.is-shown { opacity: 1; transform: translateX(0); }

/* ============ Energy chart ============ */
.bar-rise { transform: scaleY(0); transform-origin: bottom; transition: transform 1.2s cubic-bezier(0.5, 0, 0, 1); }
.bar-rise.is-rise { transform: scaleY(1); }

/* ============ Lock card flip animation ============ */
.code-card {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.code-card.is-shown { opacity: 1; transform: translateY(0); }

/* ============ Tab unit selector ============ */
.unit-tab {
    transition: all 0.25s ease;
    border-bottom: 2px solid transparent;
}
.unit-tab.is-on {
    color: #4338ca;
    border-bottom-color: #6366f1;
}
.unit-tab:focus { outline: none; }
.unit-tab:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: -2px;
    border-radius: 6px;
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-left, .reveal-right { opacity: 1 !important; transform: none !important; transition: none !important; }
    .animate-float, .animate-float-delayed,
    .glow-pulse, .ping-dot::before,
    .scan-x, .dash-flow,
    .type-dot, .leak-flash,
    .ai-stage.is-on,
    .iot-row, .timeline-row, .code-card, .ai-action-row,
    .bar-rise, .gauge-arc, .iot-spark, .check-tick {
        animation: none !important;
        transition: none !important;
    }
    .iot-row, .timeline-row, .code-card, .ai-action-row { opacity: 1 !important; transform: none !important; }
    .bar-rise { transform: scaleY(1) !important; }
    .check-tick { transform: scale(1) !important; }
    .gauge-arc { stroke-dashoffset: 0 !important; }
    .iot-spark { stroke-dashoffset: 0 !important; }
}
