/* =================================================================
   WEB DEVELOPMENT PAGE STYLES (The Architect's Blueprint)
   ================================================================= */

/* --- 1. Hero: The Matrix --- */
.wd-hero {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000; /* Deep black for matrix contrast */
}

#matrixCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4; /* Subtle background */
}

/* Gradient overlay for text readability */
.wd-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, #000 90%);
    z-index: 1;
}

.wd-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.wd-hero__badge {
    display: inline-block;
    font-family: monospace;
    color: var(--lab-accent-green);
    border: 1px solid rgba(10, 255, 96, 0.3);
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    background: rgba(10, 255, 96, 0.05);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
}

.wd-hero__title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 24px;
}

.wd-hero__subtitle {
    max-width: 600px;
    margin: 0 auto;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

.wd-hero__scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 2;
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* --- 2. Architecture: Comparison Slider --- */
.wd-arch {
    padding: 120px 0;
    background: var(--lab-bg);
}

.wd-section-header {
    text-align: center;
    margin-bottom: 60px;
}

.wd-section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.wd-section-header p {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.arch-comparison {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 500px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--lab-border);
    background: #0a0f2e;
    cursor: col-resize;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.view-microservices, .view-monolith {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-microservices img, .view-monolith img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.view-monolith {
    width: 50%; /* Initial state */
    background: #050816;
    border-right: 1px solid var(--color-primary);
    z-index: 2;
}

.arch-label {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.6);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}

.view-microservices .arch-label { left: auto; right: 20px; }

.arch-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 40px;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.handle-line {
    position: absolute;
    width: 2px;
    height: 100%;
    background: var(--color-primary);
}

.handle-circle {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 20px rgba(138, 66, 255, 0.8);
    font-size: 1.2rem;
}

.arch-comparison:hover .handle-circle {
    transform: scale(1.1);
    background: #fff;
    color: var(--color-primary);
}

/* --- 3. Tech Stack: Periodic Table --- */
.wd-stack {
    padding: 120px 0;
    background: var(--lab-bg);
}

.periodic-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
}

.element {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--lab-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.element span {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.element small {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.element:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.1);
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.element[data-type="frontend"]:hover { border-color: var(--lab-accent-cyan); color: var(--lab-accent-cyan); box-shadow: 0 0 20px rgba(0, 240, 255, 0.2); }
.element[data-type="backend"]:hover { border-color: var(--lab-accent-purple); color: var(--lab-accent-purple); box-shadow: 0 0 20px rgba(188, 19, 254, 0.2); }
.element[data-type="cloud"]:hover { border-color: var(--lab-accent-green); color: var(--lab-accent-green); box-shadow: 0 0 20px rgba(10, 255, 96, 0.2); }

.stack-filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.legend-item {
    background: transparent;
    border: 1px solid var(--lab-border);
    color: var(--color-text-muted);
    padding: 8px 20px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.legend-item:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

.legend-item[data-filter="frontend"]:hover { border-color: var(--lab-accent-cyan); color: var(--lab-accent-cyan); }
.legend-item[data-filter="backend"]:hover { border-color: var(--lab-accent-purple); color: var(--lab-accent-purple); }
.legend-item[data-filter="cloud"]:hover { border-color: var(--lab-accent-green); color: var(--lab-accent-green); }

/* --- 5. Performance Metrics --- */
.wd-metrics {
    padding: 120px 0;
    background: radial-gradient(circle at center, #0a0f2e 0%, #000 100%);
    position: relative;
}

.wd-metrics::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-top: 60px;
    position: relative;
    z-index: 2;
}

.metric-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.circle-chart {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
}

.circle-chart svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 10px rgba(10, 255, 96, 0.3));
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke: var(--lab-accent-green);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 0, 100; /* Start empty */
    transition: stroke-dasharray 1.5s ease-out;
}

.percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.metric-card h4 {
    color: var(--color-text-muted);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- 6. DevOps Pipeline --- */
.wd-devops {
    padding: 160px 0;
    background: #050816;
    position: relative;
    overflow: hidden;
}

/* Background Grid for DevOps */
.wd-devops::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    pointer-events: none;
}

.pipeline-container {
    position: relative;
    margin-top: 80px;
}

.pipeline-track {
    position: absolute;
    top: 25px; /* Aligns with center of 50px marker */
    left: 0;
    width: 100%;
    height: 2px; /* Container for line */
    z-index: 0;
}

.track-line {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
}

.track-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--lab-accent-cyan), transparent);
    filter: blur(2px);
    animation: pulseFlow 3s linear infinite;
}

@keyframes pulseFlow {
    0% { left: -200px; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    position: relative;
    z-index: 1;
}

.pipeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    position: relative;
}

.node-marker {
    width: 50px;
    height: 50px;
    background: #050816;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    color: var(--color-text-muted);
    font-weight: 700;
    transition: all 0.4s ease;
    z-index: 2;
    box-shadow: 0 0 0 5px #050816; /* Fake spacing from line */
}

.pipeline-node:hover .node-marker {
    border-color: var(--lab-accent-cyan);
    color: #fff;
    box-shadow: 0 0 0 5px #050816, 0 0 20px rgba(0, 240, 255, 0.4);
    transform: scale(1.1);
}

.node-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.node-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.05), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pipeline-node:hover .node-card {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.pipeline-node:hover .node-card::before {
    opacity: 1;
}

.node-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--lab-accent-purple);
    transition: transform 0.4s ease;
}

.pipeline-node:nth-child(2) .node-icon { color: var(--lab-accent-cyan); }
.pipeline-node:nth-child(3) .node-icon { color: var(--lab-accent-green); }

.pipeline-node:hover .node-icon {
    transform: scale(1.1) rotate(-5deg);
}

.node-info h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #fff;
}

.node-info p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* --- 7. FAQ Section --- */
.wd-faq {
    padding: 160px 0;
    background: #02040a;
    position: relative;
}

.faq-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 80px;
    align-items: start;
}

.faq-intro {
    position: sticky;
    top: 120px;
}

.faq-intro h2 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 24px;
}

.faq-intro p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 40px;
    max-width: 400px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

.faq-item.active {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--lab-accent-cyan);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.faq-trigger {
    width: 100%;
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: color 0.3s ease;
}

.faq-trigger i {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
}

.faq-item.active .faq-trigger {
    color: var(--lab-accent-cyan);
}

.faq-item.active .faq-trigger i {
    transform: rotate(45deg);
    color: var(--lab-accent-cyan);
}

.faq-content {
    height: 0;
    overflow: hidden;
    transition: height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.faq-body {
    padding: 0 30px 30px;
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.7;
}


/* Responsive */
@media (max-width: 1024px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
    .faq-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .faq-intro { position: relative; top: 0; text-align: center; }
    .faq-intro p { margin: 0 auto 30px; }
    
    .pipeline-grid { grid-template-columns: 1fr; gap: 40px; }
    
    .pipeline-track {
        left: 25px; /* Center of 50px marker */
        top: 0;
        width: 2px;
        height: 100%;
    }
    
    .track-line { width: 100%; height: 100%; }
    
    .track-pulse {
        width: 100%;
        height: 200px;
        background: linear-gradient(to bottom, transparent, var(--lab-accent-cyan), transparent);
        animation: pulseFlowVertical 3s linear infinite;
    }
    
    @keyframes pulseFlowVertical {
        0% { top: -200px; opacity: 0; }
        20% { opacity: 1; }
        80% { opacity: 1; }
        100% { top: 100%; opacity: 0; }
    }
    
    .pipeline-node { flex-direction: row; align-items: flex-start; gap: 20px; }
    .node-marker { flex-shrink: 0; }
}

@media (max-width: 768px) {
    .wd-hero {
        min-height: auto;
        padding: 100px 0 60px;
    }
    .wd-hero__title { font-size: 2.5rem; }
    .arch-comparison { height: 300px; }
    .periodic-table { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; }
    .element span { font-size: 1.5rem; }
    .stack-filters { flex-wrap: wrap; gap: 10px; }
    .metrics-grid { grid-template-columns: 1fr; }

    .wd-arch, .wd-stack, .wd-metrics, .wd-devops, .wd-faq {
        padding: 60px 0;
    }
    .wd-section-header h2 { font-size: 2rem; }
}

/* Responsive */
@media (max-width: 768px) {
    .arch-comparison { height: 300px; }
    .periodic-table { grid-template-columns: repeat(3, 1fr); }
}