/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #09090B;
    --bg-card: #141414;
    --bg-card-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background-color: transparent;
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Page Background ===== */
.page-background {
    position: fixed;
    top: -5%;
    left: -5%;
    width: 110vw;
    height: 110vh;
    z-index: -1;
    background-image: url('images/selfie.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(40px) brightness(0.6);
    transform: translate3d(0, 0, 0); /* Force GPU acceleration */
    will-change: transform, filter;
    pointer-events: none;
}

.page-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Removed heavy backdrop-filter causing lag */
    background: rgba(0, 0, 0, 0.75); /* Darken the blurred image so text is readable */
}

/* ===== Page Container =====
   Mobile: full viewport width (like link.me)
   Desktop (768px+): centered card with max-width
*/
.page-container {
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    background: transparent;
}

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    width: 100%;
    /* Square-ish aspect ratio like link.me profile image */
    aspect-ratio: 1 / 1.1;
    max-height: 85vh;
    overflow: hidden;
}

.hero-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transform: scale(1.05);
    will-change: transform;
}

.hero-gradient-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        transparent 100%
    );
    pointer-events: none;
}

.hero-content {
    position: absolute;
    bottom: 28px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 2;
    padding: 0 24px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.profile-name {
    font-size: 32px;
    font-weight: 750;
    letter-spacing: 0.25px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.verified-badge {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    filter: brightness(1.2) drop-shadow(0 0 6px rgba(59, 130, 246, 0.5));
}

.profile-handle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ===== Social Icons Row ===== */
.social-icons-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffffff;
    overflow: hidden;
    transition: transform var(--transition-fast);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.social-icon:hover {
    transform: scale(1.1);
}

.social-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Specific styling for the Fanvue logo so it fits nicely inside the white circle */
.social-icon[aria-label="Fanvue"] img {
    width: 55%;
    height: 55%;
    object-fit: contain;
}

/* ===== Links Section ===== */
.links-section {
    padding: 8px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Link Cards ===== */
.link-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.link-card:nth-child(1) { animation-delay: 0.5s; }
.link-card:nth-child(2) { animation-delay: 0.65s; }

.link-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.link-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.link-card:active {
    transform: translateY(-1px) scale(0.99);
}

.link-card-large {
    height: 420px;
}

#link-telegram .link-card-image {
    object-position: center 25%;
}

.link-card-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.link-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform var(--transition-smooth);
}

.link-card:hover .link-card-image {
    transform: scale(1.06);
}

.link-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        rgba(0, 0, 0, 0.15) 70%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
    transition: background var(--transition-smooth);
}

.link-card:hover .link-card-overlay {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0.05) 70%,
        transparent 100%
    );
}

/* Logo Badge (top-left) */
.link-card-logo-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    transition: transform var(--transition-spring), background var(--transition-fast);
}

.link-card:hover .link-card-logo-badge {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.6);
}

.platform-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 4px;
}

.fanvue-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.snapchat-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
}

.platform-icon {
    width: 18px;
    height: 18px;
}

.instagram-icon {
    width: 20px;
    height: 20px;
}

/* Card Content (bottom) */
.link-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px 18px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-card-label {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* ===== Link Cards Row ===== */
.link-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    animation: fadeInUp 0.6s ease-out 0.7s both;
}

.link-card-small {
    height: 220px;
}

.link-card-small .link-card-image {
    object-position: center top;
}

#link-instagram .link-card-image {
    object-position: center 65%; /* Shifts image up to show more of the body */
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 20px 24px 40px;
    animation: fadeInUp 0.6s ease-out 0.9s both;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color var(--transition-fast);
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text-secondary);
    transition: width var(--transition-smooth);
}

.footer-link:hover {
    color: var(--text-secondary);
}

.footer-link:hover::after {
    width: 100%;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive: Desktop (768px+) =====
   Like link.me: constrain to a card on larger screens */
@media (min-width: 768px) {
    body {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        background: #050505;
    }

    .page-container {
        max-width: 450px;
        border-radius: 30px;
        overflow: hidden;
        margin-top: 16px;
        margin-bottom: 16px;
        box-shadow:
            0 0 0 1px var(--border-subtle),
            0 25px 80px rgba(0, 0, 0, 0.5);
    }

    .hero-section {
        max-height: 550px;
    }
}

/* ===== Small phones ===== */
@media (max-width: 360px) {
    .hero-section {
        aspect-ratio: 1 / 1;
    }

    .link-card-large {
        height: 240px;
    }

    .link-card-small {
        height: 170px;
    }

    .links-section {
        padding: 8px 10px 20px;
    }

    .profile-name {
        font-size: 26px;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.link-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.footer-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
