* {
    margin: 0 auto;
    box-sizing: border-box;
}

body {
    background-color: hsl(185, 75%, 39%);
    background-image: 
        url(./images/bg-pattern-top.svg),
        url(./images/bg-pattern-bottom.svg);
    background-repeat: no-repeat;
    background-position: 
        right 50vw bottom 50vh,
        left 50vw top 50vh;
    min-height: 100vh;
    font-family: "Kumbh Sans", serif;
    position: relative;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    height: 95dvh;
}

.card {
    width: 360px;
    background-color: white;
    border-radius: 1rem;
    overflow: hidden; /* Asegura que los bordes redondeados se apliquen */
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.main_top {
    height: 300px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible; /* Permite que el fondo de .top1 sea visible */
}



/* --- Sección crítica: Fondo y avatar --- */
.top1 {
    background-color: red; /* Temporal para debug */
    width: 100%;
    display: block;
    background-size: cover;
    background-position: center;
    height: 140px;
    position: relative;
    z-index: 2;
}


.card_bg {
    width: 100%;
}


/* --- Ajustes para .top2 --- */
.top2 {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 70px;
    background: white;
    position: relative;
    z-index: 1; /* Debajo del avatar pero encima del fondo */
}

.img_container {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    position: absolute;
    bottom: -55px;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
    border: 5px solid white;
    z-index: 3; 
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Elimina espacio fantasma debajo de la imagen */
    z-index: 4;
}

/* --- Textos y stats --- */
.textLine1 {
    text-align: center;
    margin-bottom: 0.5rem;
    
}

.textLine1 p {
    display: inline-block;
}

.title {
    color: hsl(229, 23%, 23%);
    font-weight: 700;
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.age, .from {
    color: hsl(0, 0%, 59%);
    font-weight: 400;
}

.info_area {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid hsla(0, 0%, 59%, 0.2);
}

.followers, .likes, .photos {
    text-align: center;
}

.followers .title, 
.likes .title, 
.photos .title {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
}

.info {
    color: hsl(0, 0%, 59%);
    font-size: 0.7rem;
    letter-spacing: 1px;
}

/* --- Ajustes finales --- */
.attribution { 
    font-size: 11px; 
    text-align: center; 
    position: absolute;
    bottom: 10px;
}
.attribution a { 
    color: hsl(228, 45%, 44%); 
}