.home {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-content: center;
    align-items: start;
    gap: clamp(2rem, 4vw, 7rem);
}

.home-content {
    flex: 1 1 50%;
    min-width: 0;
}

.cloud-architecture {
    flex: 0 1 600px;
    width: 100%;
    min-width: 0;
    position: relative;
    align-self: flex-start;
    isolation: isolate;
    container-type: inline-size;
    padding: 0 0 2.4rem;
    overflow: hidden;
}

.architecture-scene {
    position: relative;
    width: 100%;
    aspect-ratio: 600 / 380;
    background: radial-gradient(ellipse at 50% 50%, rgba(0, 120, 212, .12), transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 238, 255, .035), transparent 68%);
}

.architecture-connections {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.architecture-links {
    stroke: var(--main-color);
    stroke-width: 1.2;
    stroke-dasharray: 4 7;
    opacity: .35;
}

.architecture-routes-mobile { display: none; }

/* Preserve the original routes; switch the figure attribute to "classic" to restore them. */
.architecture-links-orthogonal { display: none; }
.cloud-architecture[data-connection-style="orthogonal"] .architecture-links-classic { display: none; }
.cloud-architecture[data-connection-style="orthogonal"] .architecture-links-orthogonal { display: inline; }

.flow-dot {
    fill: #9af6ff;
    filter: drop-shadow(0 0 4px var(--main-color));
    offset-distance: 0%;
    animation: architecture-data-flow 5s linear infinite;
}

.flow-infrastructure { offset-path: path("M198 145 Q255 145 255 210"); }
.flow-ai { offset-path: path("M402 169 Q345 169 345 210"); animation-delay: -2.5s; }
.flow-containers { offset-path: path("M180 395 Q255 395 255 350"); animation-delay: -1.25s; }
.flow-devops { offset-path: path("M402 415 Q345 415 345 350"); animation-delay: -3.75s; }

.cloud-architecture[data-connection-style="orthogonal"] .flow-infrastructure {
    offset-path: path("M198 145 H243 Q255 145 255 157 V210");
}
.cloud-architecture[data-connection-style="orthogonal"] .flow-ai {
    offset-path: path("M402 169 H357 Q345 169 345 181 V210");
}
.cloud-architecture[data-connection-style="orthogonal"] .flow-containers {
    offset-path: path("M180 395 H243 Q255 395 255 383 V350");
}
.cloud-architecture[data-connection-style="orthogonal"] .flow-devops {
    offset-path: path("M402 415 H357 Q345 415 345 403 V350");
}

@keyframes architecture-data-flow {
    0% { offset-distance: 0%; opacity: 0; }
    20% { offset-distance: 20%; opacity: 1; }
    80% { offset-distance: 80%; opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

.architecture-node {
    position: absolute;
    width: 30%;
    height: 26.316%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 2rem;
    background: rgba(31, 36, 45, .65);
}

.architecture-node strong {
    color: var(--text-color);
    font-size: clamp(11px, 2.7cqw, 16px);
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.architecture-icon {
    width: clamp(18px, 4.7cqw, 28px);
    height: clamp(18px, 4.7cqw, 28px);
    fill: none;
    stroke: var(--main-color);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.architecture-node-caption {
    color: rgba(255, 255, 255, .65);
    font-size: clamp(9px, 2cqw, 12px);
    line-height: 1.4;
    text-align: center;
}

.architecture-infrastructure { left: 3%; top: 1.316%; }
.architecture-ai { right: 3%; top: 7.632%; }
.architecture-containers { left: 0; top: 67.105%; }
.architecture-devops { right: 3%; top: 72.368%; }

.architecture-center {
    left: 34.167%;
    top: 31.579%;
    width: 31.667%;
    height: 36.842%;
    gap: 8px;
    border-color: var(--main-color);
    background: var(--bg-color);
    box-shadow: 0 0 18px rgba(0, 238, 255, .09);
}

.architecture-center strong {
    font-size: clamp(18px, 4.5cqw, 27px);
    font-weight: 700;
}

.architecture-azure-logo {
    width: clamp(32px, 9cqw, 54px);
    height: clamp(32px, 9cqw, 54px);
}

/* Keep compact landscape screens in the mobile layout. */
@media (max-width: 768px), (max-width: 1100px) and (max-height: 500px) and (orientation: landscape) {
    .architecture-routes-desktop { display: none; }
    .architecture-routes-mobile { display: inline; }
    .architecture-infrastructure { left: 5%; top: 1.316%; }
    .architecture-ai { right: 5%; top: 1.316%; }
    .architecture-containers {
        left: 5%;
        top: 67.105%;
    }
    .architecture-devops { right: 5%; top: 67.105%; }
    .architecture-containers,
    .architecture-devops {
        /* Reserve space for the icon, heading and two caption lines. */
        min-height: max(80px, calc(14cqw + 20px));
        padding: 6px 4px;
    }
    .architecture-containers > *,
    .architecture-devops > * { flex-shrink: 0; }
    .flow-infrastructure { offset-path: path("M210 145 Q255 145 255 210"); }
    .flow-ai { offset-path: path("M390 145 Q345 145 345 210"); }
    .flow-containers { offset-path: path("M210 395 Q255 395 255 350"); }
    .flow-devops { offset-path: path("M390 395 Q345 395 345 350"); }
    .cloud-architecture[data-connection-style="orthogonal"] .flow-infrastructure { offset-path: path("M210 145 H243 Q255 145 255 157 V210"); }
    .cloud-architecture[data-connection-style="orthogonal"] .flow-ai { offset-path: path("M390 145 H357 Q345 145 345 157 V210"); }
    .cloud-architecture[data-connection-style="orthogonal"] .flow-containers { offset-path: path("M210 395 H243 Q255 395 255 383 V350"); }
    .cloud-architecture[data-connection-style="orthogonal"] .flow-devops { offset-path: path("M390 395 H357 Q345 395 345 383 V350"); }


    .home { grid-template-columns: minmax(0, 1fr); gap: 4rem; padding-bottom: 5rem; }
    .home-content { flex: auto; width: 100%; }
    .cloud-architecture { flex: auto; width: 100%; max-width: 540px; justify-self: center; padding-bottom: 3rem; }
}

@media (max-width: 480px) {
    .architecture-node { gap: 2px; }
    .architecture-center { gap: 4px; }
}

@media (max-width: 380px) {
    .architecture-node { gap: 2px; border-radius: 1.5rem; }
    .architecture-center strong { max-width: 75px; }
}

@media (prefers-reduced-motion: reduce) {
    html, * { scroll-behavior: auto; }
    .flow-dot { animation: none; offset-distance: 50%; }
}
