* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Защищает от вылавливания размеров наружу */
}

/* Избавляемся от ореолов на iOS */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh; /* Динамическая высота для Safari */
    background-color: #0a0a0a;
    overflow-x: hidden; /* Защита от бокового скролла */
}

body {
    font-family: "Source Sans Pro", 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    text-transform: uppercase;
    font-weight: 300;
    letter-spacing: 4px;
    text-align: center;
    color: #414f57;
}

/* Отрезанные ореолы и включенный Flexbox для идеального центрирования */
div.bg {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: 20px; /* Безопасный отступ на мобилках */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Центрирует карточку по вертикали */
    align-items: center;     /* Центрирует карточку по горизонтали */
    
    transition: background-image 3s ease-in-out;
    -webkit-transition: background-image 3s ease-in-out;
    
    background-image: linear-gradient(rgba(0,0,0,0.1),rgba(0,0,0,0.1)), url(../img/bg.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    position: relative;
}

div.img_bg_preload {
    display: none;
}

/* Карточка */
div.main {
    width: 400px;
    background-color: white;
    border-radius: 5px;
    text-align: center;
    padding: 60px 25px;
    display: block;
    /* Убрал фиксированную высоту height: 490px и безумный margin-top */
    margin: auto 0; /* Авто-отступы удерживают элемент строго по центру */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); /* Добавит объема на фоне картинок */
}

div.main section.photo {
    height: 125px;
    margin-bottom: 20px;
}

div.main section.photo img {
    height: 125px;
    /*width: 125px;*/
    object-fit: cover;
    border-radius: 50%;
}

div.main section.info {
    min-height: 115px;
}

div.main section.info h1 {
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    padding-top: 10px;
    padding-bottom: 10px;
    /* white-space: nowrap; убрано, чтобы длинные имена на мобилках не резались */
}

div.main section.info h2 {
    font-size: 14px; /* Чуть уменьшил для баланса */
    font-weight: 300;
    line-height: 1.4;
    color: #71808a; /* Сделал текст профессии чуть читаемее */
    margin-bottom: 20px;
}

div.main section.info a.download-link {
    font-weight: bold;
    color: #28c915;
    text-decoration: none;
    display: inline-block;
    padding: 5px 10px;
    transition: opacity 0.2s ease;
}

div.main section.info a.download-link:hover {
    opacity: 0.8;
}

div.main section.links {
    height: auto;
    padding-top: 30px;
}

div.main section.links a {
    height: 50px;
    text-decoration: none;
    display: inline-block;
    margin: 0 7.5px;
}

div.main section.links a svg {
    height: 40px; /* Оптимально для пальца на мобильном */
    width: auto;
}

div.main section.links a svg path {
    fill: #c8cccf;
    transition: fill 0.25s ease;
}

div.main section.links a:hover svg path {
    fill: #414f57;
}

/* Футер */
footer {
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    padding: 20px 0;
    position: absolute;
    bottom: 0;
    left: 0;
}

footer a {
    color: rgba(255, 255, 255, 0.7);
}

footer a:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Адаптив под мобильные */
@media only screen and (max-width: 444.44px) {
    div.main {
        width: 100%;
        max-width: 340px;
        padding: 40px 20px;
    }
    div.main section.info h1 {
        font-size: 18px;
    }
    div.main section.info h2 {
        font-size: 12px;
    }
    footer {
        font-size: 12px;
    }
}

/* Если телефон повернули горизонтально или экран совсем крошечный */
@media only screen and (max-height: 580px) {
    div.bg {
        padding-bottom: 80px; /* Место под абсолютный футер */
    }
    div.main {
        margin: 20px 0;
    }
}
