:root {
    --ios-bg: #000000;
    --ios-card: #1c1c1e;
    --ios-card-secondary: #2c2c2e;
    --ios-accent: #0a84ff;
    --ios-red: #ff3b30;
    --ios-white: #ffffff;
    --ios-gray: #8e8e93;
    --ios-separator: rgba(255, 255, 255, 0.15);

    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --container-padding: 30px;
    --max-width: 1100px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--ios-bg);
    color: var(--ios-white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.015em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:active {
    opacity: 0.7;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.fade-in {
    animation: iosFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes iosFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass {
    background: rgba(28, 28, 30, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.banner {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, var(--ios-bg) 100%);
}

.profile-header {
    max-width: 1000px;
    margin: -100px auto 40px;
    padding: 0 30px;
    position: relative;
    z-index: 10;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 30px;
    border: 4px solid var(--ios-bg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    object-fit: cover;
}

.profile-info {
    margin-top: 16px;
}

.profile-info h1 {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.username {
    font-size: 17px;
    color: var(--ios-gray);
    margin-top: 2px;
}

.bio-section {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.social-button {
    background: var(--ios-card);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--ios-separator);
}

.social-button svg {
    width: 18px;
    height: 18px;
}

.section {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 30px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title span {
    color: var(--ios-red);
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.fav-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    /* Prevents text from stretching the flex item */
}

.fav-poster-wrapper {
    width: 100%;
    aspect-ratio: 2 / 3 !important;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--ios-separator);
    background: var(--ios-card);
}

.fav-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.fav-info {
    padding: 0 4px;
    min-height: 48px;
    /* Ensure uniform height for the info section too */
}

.fav-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-meta {
    font-size: 12px;
    color: var(--ios-gray);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.fav-meta svg {
    fill: var(--ios-red);
    width: 12px;
    height: 12px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    background: var(--ios-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--ios-separator);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    transform: scale(1.02);
}

.project-image-wrapper {
    aspect-ratio: 16/9;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    padding: 20px;
}

.project-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.project-description {
    font-size: 15px;
    color: var(--ios-gray);
    line-height: 1.5;
}

.skeleton-card {
    background: var(--ios-card);
    border-radius: var(--radius-md);
    aspect-ratio: 2/3;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .favorites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .favorites-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        margin-top: -80px;
        padding: 0 20px;
    }

    .avatar {
        width: 100px;
        height: 100px;
        border-radius: 24px;
    }
}

.fade-in {
    animation: iosFade 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes iosFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-divider {
    height: 1px;
    background: var(--ios-separator);
    border: none;
    max-width: 1000px;
    margin: 0 auto;
}