* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;

}

html {
    background-color: rgb(10, 10, 10);
    color: rgb(10, 10, 10);
}

body {
    /* Fixed Safari/iPhone issue with 100svh */
    background-color: rgb(10, 10, 10);
    background-image: url('assets/images/IsaacsWood.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: -webkit-fill-available;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
    color: canvastext;
    padding: clamp(1rem, 5vw, 2rem);
    /* Added to prevent horizontal scrolling on mobile */
    overflow-x: hidden;
}

.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 500px;
    width: 100%;
    border-radius: 50px;
    transition: all 0.2s ease;
    background: rgba(51, 51, 51, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-bottom: 60px;
    padding-top: 50px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.profile-image {
    width: 240px;
    height: 240px;
    object-fit: cover;
    margin-bottom: 35px;

}
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.profile-image:hover, .profile-image:focus {
    animation: spin 0.5s ease-in-out;
}

.profile-name {
    margin: 0 !important;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgb(241, 241, 241);
    font-family: "Special Gothic Expanded One", sans-serif;
    font-weight: 400;
    font-style: normal;
        margin: 0;
    padding: 0;
}

.profile-description {
    margin: 0;
    padding: 0;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: rgb(200, 200, 200);
    font-weight: 400;
    font-style: normal;
    padding-bottom: 25px;
}

.profile-handle {
    margin: 0;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    opacity: 0.8;
}

.social-links {
    display: grid;
    /* Added -webkit prefixes for better Safari support */
    display: -webkit-grid;
    gap: 0.75rem;
    width: 95%;
    margin-top: 1rem;
    /* Added to prevent overflow on Safari */
    max-width: 100%;
    /* Additional fix for Safari grid alignment */
    -webkit-align-items: center;
    align-items: center;
    justify-items: center;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 400;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: rgba(128, 128, 128, 0.2);
    border: 1px solid rgba(128, 128, 128, 0.3);
    /* Fixed aspect-ratio for Safari compatibility */
    aspect-ratio: 5;
    -webkit-aspect-ratio: 5;
    /* Fallback for older browsers */
    width: 80%;
}

.social-link:hover, .social-link:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    background: rgba(128, 128, 128, 0.15);
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon img {
    width: 100%;
    height: 100%;
    filter: invert(1);
}

.link-text {
    text-align: center;
    margin-top: 0.5rem;
}

@media (max-width: 480px) {
    .profile-image {
    width: 240px;
    height: 240px;
    }

    .social-link {
    font-size: 1rem;
    }
}

@media (prefers-color-scheme: dark) {
    body {
    color: rgb(19, 19, 19);
    }
    .social-link {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .social-link:hover, .social-link:focus {
    background: rgba(255, 255, 255, 0.1);
    }
}
