:root {
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --bg-primary: #000000;
    --grid-bg: #ffffff;
    --border-color: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 20px;
}

.container {
    max-width: 935px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .profile-header {
        flex-direction: row;
        align-items: flex-start;
    }
}

.profile-pic {
    width: 77px;
    height: 77px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    margin-right: 0;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .profile-pic {
        width: 100px;
        height: 100px;
    }
}

@media (min-width: 768px) {
    .profile-pic {
        width: 150px;
        height: 150px;
        margin-right: 30px;
        margin-bottom: 0;
    }
}

.profile-info {
    text-align: center;
    width: 100%;
}

@media (min-width: 768px) {
    .profile-info {
        text-align: left;
    }
}

.profile-info h1 {
    font-size: 22px;
    font-weight: 300;
    margin-bottom: 15px;
}

@media (min-width: 480px) {
    .profile-info h1 {
        font-size: 26px;
    }
}

@media (min-width: 768px) {
    .profile-info h1 {
        font-size: 28px;
        margin-bottom: 20px;
    }
}

.bio {
    margin-bottom: 20px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* iOS needs minmax */
    gap: 2px;
    background-color: #000;
    width: 100%;
    -webkit-overflow-scrolling: touch; /* Safari momentum scroll */
}

/* Nuclear option for stubborn iOS versions */
@supports (-webkit-touch-callout: none) {
    .grid {
        grid-template-columns: repeat(3, 33.33%);
    }
}

.grid-item {
    aspect-ratio: 1;
    background: white;
    overflow: hidden;
    -webkit-transform: translateZ(0); /* Safari render hint */
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-touch-callout: none; /* Disable iOS long-press menu */
}



.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    cursor: pointer;
    /* Add these: */
    overflow-y: auto;
    overscroll-behavior: contain; /* Prevents page scroll when modal is open */
}

.modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%; /* Full viewport height */
    padding: 20px;
    cursor: auto;
    /* Add this: */
    pointer-events: none; /* Lets clicks pass through to modal */
}

.modal-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    /* Add this: */
    pointer-events: auto; /* Re-enables clicks on image */
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto; /* Ensures close button remains clickable */
}

