/* CODEDEPTH OVERVIEW SECTION */
.codedepth-section {
    padding: 5rem 1.5rem;
    background-color: var(--bg-white);
    max-width: 1440px;
    margin: 0 auto;
}

.codedepth-container {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 4rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 4rem;
    position: relative;
    overflow: hidden;
}

/* TOP SPLIT: LEFT CONTENT & RIGHT VISUAL */
.codedepth-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.codedepth-content {
    flex: 1;
    max-width: 500px;
}

.codedepth-title {
    font-family: var(--font-sans); /* Matching typical tech styling, or serif if preferred. Using sans for technical feel */
    font-size: var(--fs-h2);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.codedepth-title span {
    color: var(--primary-green);
    display: block;
}

.codedepth-desc {
    font-size: var(--fs-body);
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 450px;
}

.codedepth-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-green);
    color: var(--bg-white);
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.codedepth-cta:hover {
    background-color: #059669; /* slightly darker green */
    transform: translateY(-2px);
}

.codedepth-cta:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 4px;
}

/* RIGHT VISUALS */
.codedepth-visual {
    flex: 1.2;
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Subtle Dotted Pattern */
.codedepth-visual::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background-image: radial-gradient(circle, #e5e7eb 2px, transparent 2px); /* Very subtle neutral dots */
    background-size: 24px 24px;
    opacity: 0.5;
    z-index: 0;
    border-radius: 50%;
    mask-image: radial-gradient(circle, black 40%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle, black 40%, transparent 70%);
}

.codedepth-visual-inner {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Circular Profiles */
.cd-profile {
    position: absolute;
    border-radius: 50%;
    border: 4px solid var(--bg-white);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background-color: #f3f4f6;
}

.cd-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Position Profiles */
.cd-profile-1 {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 45%;
    border-color: #f0fdf4; /* Very light green tint to border */
    animation: float 6s ease-in-out infinite;
}

.cd-profile-2 {
    width: 100px;
    height: 100px;
    top: 45%;
    left: 20%;
    animation: float 7s ease-in-out infinite 1s;
}

.cd-profile-3 {
    width: 140px;
    height: 140px;
    bottom: 5%;
    right: 15%;
    border-color: #f0fdf4;
    animation: float 8s ease-in-out infinite 2s;
}

/* Floating Conversation Bubbles */
.cd-bubble {
    position: absolute;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-main);
    font-weight: 500;
    max-width: 200px;
    line-height: 1.4;
    z-index: 2;
    animation: float-subtle 9s ease-in-out infinite;
}

.cd-bubble-1 {
    top: 5%;
    left: 0;
    animation-delay: 0.5s;
}

.cd-bubble-2 {
    top: 40%;
    right: 0;
    animation-delay: 1.5s;
}

.cd-bubble-3 {
    bottom: 25%;
    left: 5%;
    animation-delay: 2.5s;
}

/* UI Micro Element */
.cd-ui-bubble {
    position: absolute;
    bottom: -5%;
    right: 40%;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1rem;
    min-width: 160px;
    z-index: 3;
    animation: float-subtle 8s ease-in-out infinite 1s;
}

.cd-ui-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
}

.cd-ui-progress {
    color: var(--primary-green);
}

.cd-ui-item {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cd-ui-item::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--border-color);
}

.cd-ui-item.active::before {
    background-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.cd-ui-item:last-child {
    margin-bottom: 0;
}


/* BOTTOM FEATURES STRIP */
.codedepth-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
}

.cd-feature {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cd-feature:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.05);
}

.cd-feature:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 4px;
}

.cd-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: #f0fdf4;
    color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

.cd-feature-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.cd-feature-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}


/* ANIMATIONS */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes float-subtle {
    0% { transform: translateY(0px) translateX(0px); }
    50% { transform: translateY(-6px) translateX(3px); }
    100% { transform: translateY(0px) translateX(0px); }
}

@media (prefers-reduced-motion: reduce) {
    .cd-profile, .cd-bubble, .cd-ui-bubble {
        animation: none !important;
        transform: none !important;
    }
}


/* RESPONSIVE DESIGN */
@media (max-width: 1280px) {
    .codedepth-container {
        padding: 3rem;
    }
    
    .cd-bubble-1 { top: 0; left: -5%; }
    .cd-bubble-2 { right: -5%; }
}

@media (max-width: 1024px) {
    .codedepth-container {
        padding: 2.5rem;
    }
    
    .codedepth-top {
        flex-direction: column;
        text-align: center;
        gap: 4rem;
    }
    
    .codedepth-content {
        max-width: 700px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .codedepth-visual {
        width: 100%;
        max-width: 600px;
        height: 350px;
    }
    
    .codedepth-features {
        grid-template-columns: repeat(2, 1fr);
        padding-top: 2rem;
    }
}

@media (max-width: 768px) {
    .codedepth-section {
        padding: 4rem 1.5rem;
    }
    
    .codedepth-container {
        padding: 2rem 1.5rem;
        gap: 3rem;
    }
    
    .codedepth-title {
        font-size: clamp(2rem, 6vw, 2.5rem);
    }
    
    /* Adjust visual scale for tablet */
    .cd-bubble {
        font-size: 0.75rem;
        padding: 0.6rem 0.8rem;
        max-width: 160px;
    }
    
    .cd-profile-1 { width: 100px; height: 100px; top: 5%; }
    .cd-profile-2 { width: 80px; height: 80px; top: 40%; left: 15%; }
    .cd-profile-3 { width: 110px; height: 110px; right: 10%; }
}

@media (max-width: 600px) {
    .codedepth-visual {
        height: auto;
        min-height: 250px;
        padding: 1rem 0;
    }
    
    .codedepth-visual-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
    }
    
    .cd-profile, .cd-bubble, .cd-ui-bubble {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        animation: none !important;
    }
    
    .cd-bubble {
        text-align: center;
        font-size: 0.8125rem;
    }
    
    .cd-bubble-3 { display: none; /* Hide one bubble on small screens to prevent clutter */ }
    
    .cd-profile-1 { width: 100px; height: 100px; }
    .cd-profile-2 { width: 80px; height: 80px; }
    .cd-profile-3 { width: 90px; height: 90px; }
}

@media (max-width: 480px) {
    .codedepth-container {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }
    
    .codedepth-features {
        grid-template-columns: 1fr; /* Stack features on very small mobile */
        padding-top: 1.5rem;
        gap: 1rem;
    }
    
    .cd-feature {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .cd-feature-icon {
        margin-bottom: 0;
    }
    
    .cd-feature-text {
        display: flex;
        flex-direction: column;
    }
    
    .cd-feature-title {
        margin-bottom: 0.25rem;
    }
    
    .cd-feature-desc {
        font-size: 0.8125rem;
    }
}
