* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    /* Safari and Chrome fixes */
    -webkit-overflow-scrolling: touch;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    /* Prevent text size adjustment on iOS */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: relative;
    background-color: #f5f5f0;
    overflow-y: auto;
    /* Mobile safe area support */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100%;
    min-height: 100%;
    z-index: -1;
    overflow: hidden;
    /* Safari and Chrome fixes */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Mobile safe area support */
    top: env(safe-area-inset-top, 0);
    left: env(safe-area-inset-left, 0);
    right: env(safe-area-inset-right, 0);
    bottom: env(safe-area-inset-bottom, 0);
    width: calc(100vw - env(safe-area-inset-left, 0) - env(safe-area-inset-right, 0));
    height: calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    /* Safari and Chrome fixes */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Prevent image dragging on mobile */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    /* Better rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: optimizeQuality;
}

/* Desktop image - show on desktop, hide on mobile */
.background-desktop {
    display: block;
}

/* Mobile image - hide on desktop, show on mobile */
.background-mobile {
    display: none;
}

.content {
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Safari mobile fix */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 40px 20px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0));
    position: relative;
    z-index: 1;
    /* Safari and Chrome fixes */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.social-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(107, 78, 61, 0.9);
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    /* Touch-friendly */
    -webkit-tap-highlight-color: rgba(107, 78, 61, 0.3);
    cursor: pointer;
    /* Prevent text selection on mobile */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Better touch target */
    touch-action: manipulation;
}

.social-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.social-icon svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
    transition: fill 0.3s ease;
}

.social-icon:hover svg {
    fill: #ffffff;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    html, body {
        height: 100%;
        height: -webkit-fill-available; /* Safari mobile fix */
    }

    body {
        padding: 0;
    }

    .background-container {
        position: fixed;
        width: 100vw;
        height: 100vh;
        height: -webkit-fill-available; /* Safari mobile fix */
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f5f5f0;
    }

    /* Hide desktop image on mobile */
    .background-desktop {
        display: none;
    }

    /* Show mobile image on mobile */
    .background-mobile {
        display: block;
        position: relative;
        width: 100%;
        height: 100%;
        max-width: 100vw;
        max-height: 100vh;
        max-height: -webkit-fill-available; /* Safari mobile fix */
        object-fit: contain;
        object-position: center center;
        min-width: auto;
        min-height: auto;
    }

    .content {
        min-height: 100vh;
        min-height: -webkit-fill-available; /* Safari mobile fix */
        padding: 30px 20px;
        padding-bottom: calc(30px + env(safe-area-inset-bottom, 0));
    }

    .social-icons {
        gap: 25px;
    }
    
    .social-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }
    
    .social-icon svg {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 25px 15px;
        padding-bottom: calc(25px + env(safe-area-inset-bottom, 0));
    }

    .social-icons {
        gap: 20px;
    }
    
    .social-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .social-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* Small mobile devices */
@media (max-width: 360px) {
    .content {
        padding: 20px 12px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    }

    .social-icons {
        gap: 18px;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .social-icon svg {
        width: 22px;
        height: 22px;
    }
}

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
    .background-container {
        position: fixed;
        height: -webkit-fill-available;
    }

    .background-image {
        height: -webkit-fill-available;
    }

    .content {
        min-height: -webkit-fill-available;
    }
}

/* Chrome-specific fixes */
@supports (-webkit-appearance: none) and (not (-webkit-touch-callout: none)) {
    .background-image {
        will-change: transform;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .content {
        padding: 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    }

    .social-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
    }
    
    .social-icon svg {
        width: 23px;
        height: 23px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .background-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}
