/* --- SOFTWARE SECTION: Clean Architecture --- */

.sw-section {
    position: relative;
    /* Use global background for seamless transition */
    background-color: var(--bg);
    padding: clamp(6rem, 10vh, 10rem) 0;
    overflow: hidden;
    color: var(--text);
    z-index: 1;
}

/* --- AMBIENT --- */
.sw-ambient {
    position: absolute; inset: 0; pointer-events: none; z-index: 0;
}

.sw-glow-spot {
    position: absolute; top: 50%; left: 100%; transform: translate(-50%, -50%);
    width: 100%; height: 600px;
    background: radial-gradient(ellipse at center, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%);
    filter: blur(100px); opacity: 0.5;
}

.sw-grid-pattern {
    position: absolute; inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--text) 10%, transparent) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    opacity: 0.2;
}

.sw-container {
    position: relative; z-index: 2;
    max-width: 1200px; margin: 0 auto;
}

/* --- HEADER --- */
.sw-header {
    text-align: center; max-width: 680px; margin: 0 auto 5rem;
}

/* Status Pill (Apple Style) */
.sw-status-pill {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 8px;
    background: color-mix(in srgb, var(--elev-2) 80%, transparent);
    border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
    border-radius: 100px;
    backdrop-filter: blur(10px);
    margin-bottom: 2rem; cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px -5px rgba(0,0,0,0.1);
}
.sw-status-pill:hover {
    background: color-mix(in srgb, var(--elev-2) 90%, transparent);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -5px rgba(0,0,0,0.15);
}

.status-indicator {
    position: relative; width: 12px; height: 12px; display: flex; align-items: center; justify-content: center;
}
.status-indicator .dot {
    width: 6px; height: 6px; background: var(--ok); border-radius: 50%; z-index: 2;
}
.status-indicator .ping {
    position: absolute; width: 100%; height: 100%; background: var(--ok); border-radius: 50%;
    opacity: 0; animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite; z-index: 1;
}

.status-label {
    font-size: 0.75rem; font-weight: 600; color: var(--text-dim); letter-spacing: 0.02em;
}

/* Typography */
.sw-title {
    font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; line-height: 1.1; margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.sw-gradient {
    background: linear-gradient(135deg, var(--text) 30%, var(--brand) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sw-desc {
    font-size: 1.1rem; color: var(--text-muted); line-height: 1.6;
}

/* --- PIPELINE LAYOUT --- */
.sw-pipeline {
    display: grid;
    /* Card - Node - Card - Node - Card */
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    position: relative;
    margin-bottom: 5rem;
}

/* Connecting Line Background */
.sw-connector-track {
    position: absolute; top: 50%; left: 0; right: 0; height: 2px;
    transform: translateY(-50%); z-index: 0;
}
.track-line {
    position: absolute; inset: 0; background: var(--stroke); opacity: 0.5;
}
.data-stream {
    position: absolute; top: 0; left: 0; width: 20%; height: 100%;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    filter: drop-shadow(0 0 4px var(--brand));
    animation: stream 3s linear infinite;
    opacity: 0.8;
}

/* --- CARDS --- */
.sw-card {
    position: relative;
    height: 320px;
    z-index: 1;
    cursor: default;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sw-card:hover { transform: translateY(-10px); }

.card-glass-sw {
    position: absolute; inset: 0;
    background: color-mix(in srgb, var(--elev-1) 70%, transparent);
    border: 1px solid var(--stroke);
    border-radius: 24px;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05), 
        0 2px 4px -1px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.4s ease;
}
.sw-card:hover .card-glass {
    border-color: color-mix(in srgb, var(--brand) 30%, transparent);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15), 0 0 20px color-mix(in srgb, var(--brand) 10%, transparent);
}

.card-inner-sw {
    position: relative; height: 100%; padding: 2rem;
    display: flex; flex-direction: column; justify-content: space-between;
}

/* Icon Layer */
.icon-layer {
    display: flex; justify-content: space-between; align-items: flex-start;
}
.icon-box {
    width: 48px; height: 48px; border-radius: 12px;
    background: var(--elev-2); border: 1px solid var(--stroke);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim); transition: 0.3s;
}
.icon-box svg { width: 24px; height: 24px; }
.sw-card:hover .icon-box {
    background: var(--brand); border-color: var(--brand); color: var(--bg); /* Contrast */
    box-shadow: 0 4px 15px color-mix(in srgb, var(--brand) 40%, transparent);
    transform: scale(1.05) rotate(-5deg);
}

.stage-tag {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--brand); padding: 4px 10px; border-radius: 100px;
    background: color-mix(in srgb, var(--brand) 8%, transparent);
}

/* Content Layer */
.content-layer h3 {
    font-size: 1.25rem; font-weight: 700; margin: 0 0 1rem; color: var(--text);
}

/* Micro Visuals (Abstract UI representations) */
.micro-visual {
    height: 80px; background: color-mix(in srgb, var(--bg) 50%, transparent);
    border-radius: 12px; border: 1px solid color-mix(in srgb, var(--stroke) 50%, transparent);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    position: relative;
}

/* Card 1 Visual: Code */
.code-lines { display: flex; flex-direction: column; gap: 6px; width: 60%; }
.line { height: 4px; background: var(--stroke); border-radius: 2px; }
.w-80 { width: 80%; } .w-60 { width: 60%; } .w-40 { width: 40%; }
.processing-badge {
    position: absolute; bottom: 10px; right: 10px;
    font-size: 0.6rem; font-family: monospace; color: var(--text-muted);
    display: flex; align-items: center; gap: 4px;
}
.proc-dot { width: 4px; height: 4px; background: var(--ok); border-radius: 50%; animation: blink 2s infinite; }

/* Card 2 Visual: Stack */
.stack-visual { flex-direction: column; gap: 4px; align-items: center; }
.server-layer { width: 40px; height: 6px; background: var(--stroke); border-radius: 2px; transition: 0.3s; }
.sw-card:hover .l1 { background: var(--brand); width: 50px; }
.sw-card:hover .l2 { background: var(--brand); width: 40px; opacity: 0.7; transition-delay: 0.1s; }
.sw-card:hover .l3 { background: var(--brand); width: 45px; opacity: 0.4; transition-delay: 0.2s; }

/* Card 3 Visual: Chart */
.chart-visual { align-items: flex-end; gap: 6px; padding-bottom: 15px; }
.chart-bar { width: 6px; background: var(--stroke); border-radius: 2px; transition: 0.3s; }
.sw-card:hover .chart-bar { background: var(--brand); }
.chart-bar.active { background: var(--brand); opacity: 0.5; }
.sw-card:hover .chart-bar.active { opacity: 1; height: 60% !important; }

/* --- NODES (Connectors) --- */
/* --- NODES (Premium Connectors) --- */
.sw-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 2; /* Ensure above lines */
    cursor: default;
}

/* The Core Dot */
.node-circle {
    width: 14px; 
    height: 14px;
    border-radius: 50%;
    background: var(--bg); /* Deep background to mask line */
    border: 1.5px solid var(--stroke);
    box-shadow: 
        0 0 0 4px var(--bg), /* Mask behind */
        0 0 0 1px var(--glass-highlight) inset; /* Inner rim light */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

/* Active/Hover State (The Halo) */
.sw-pipeline:hover .node-circle,
.sw-node:hover .node-circle {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 
        0 0 0 4px var(--bg), 
        0 0 20px var(--brand); /* Neon Glow */
    transform: scale(1.1);
}

/* Optional: Pulse Animation for active nodes */
.node-circle::after {
    content: '';
    position: absolute; inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--brand);
    opacity: 0;
    transform: scale(0.8);
    transition: 0.4s ease;
}

.sw-pipeline:hover .node-circle::after {
    animation: nodePulse 2s infinite;
}

/* The Label (Glass Tag) */
.node-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    
    /* Glassmorphism */
    background: var(--glass-bg-light);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    
    padding: 6px 10px;
    border-radius: 8px;
    opacity: 0.7;
    transform: translateY(0);
    transition: all 0.3s ease;
    
    /* Avoid text selection */
    user-select: none;
    white-space: nowrap;
}

/* Label Hover Interaction */
.sw-node:hover .node-label {
    opacity: 1;
    color: var(--text);
    background: var(--glass-border);
    border-color: var(--glass-border-strong);
    transform: translateY(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Keyframes */
@keyframes nodePulse {
    0% { transform: scale(1); opacity: 1; border-width: 1.5px; }
    100% { transform: scale(2.2); opacity: 0; border-width: 0px; }
}

/* --- FOOTER --- */
/* --- FOOTER TELEMETRY (Deep Hydro System) --- */
.sw-footer {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5rem; /* Spacious premium feel */
    padding-top: 4rem;
    margin-top: 4rem;
    
    /* Base border */
    border-top: 1px solid var(--glass-bg-light);
}

/* Horizon Glow Line (The "Laser" Top) */
.sw-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: 0.3;
    box-shadow: 0 -2px 10px var(--brand);
}

/* The Metric Container */
.sw-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    cursor: default;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.sw-metric:hover {
    transform: translateY(-4px);
}

/* The Value (Big Number) */
.sw-metric .val {
    display: block;
    font-size: clamp(2rem, 2.5vw, 3rem); /* Responsive scaling */
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums; /* Engineering alignment */
    
    /* Gradient Text Mask */
    background: linear-gradient(180deg, #fff 20%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
    transition: all 0.4s ease;
}

/* Interaction: Value Glows on Hover */
.sw-metric:hover .val {
    background: linear-gradient(180deg, #fff 0%, var(--brand) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px var(--brand));
}

/* The Label (Technical Detail) */
.sw-metric .lbl {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.sw-metric:hover .lbl {
    color: var(--brand);
    opacity: 1;
    letter-spacing: 0.2em; /* Subtle expansion */
}

/* The Separator (Vertical Fade) */
.sw-sep {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, 
        transparent, 
        var(--glass-highlight), 
        transparent
    );
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sw-footer {
        flex-direction: column;
        gap: 2.5rem;
    }
    .sw-sep {
        width: 60px;
        height: 1px;
        background: linear-gradient(to right, transparent, var(--glass-highlight), transparent);
    }
}



/* --- ANIMATIONS --- */
@keyframes ping {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes stream { 
    0% { left: -20%; opacity: 0; } 
    50% { opacity: 1; } 
    100% { left: 120%; opacity: 0; } 
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .sw-pipeline {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 3rem;
    }
    .sw-connector-track {
        width: 2px; height: 100%; top: 0; left: 50%; transform: translateX(-50%);
    }
    .data-stream { width: 100%; height: 20%; top: 0; left: 0; animation: streamVert 3s linear infinite; }
    
    .sw-node { flex-direction: row; }
    .sw-card { height: auto; min-height: 280px; }
    
    @keyframes streamVert {
        0% { top: -20%; opacity: 0; }
        50% { opacity: 1; }
        100% { top: 120%; opacity: 0; }
    }
}

@media (max-width: 600px) {
    .sw-header { margin-bottom: 3rem; }
    .sw-title { font-size: 2.2rem; }
    .sw-footer { gap: 1.5rem; }
    .sw-metric .val { font-size: 1.25rem; }
}