:root {
    --bg-color: #01000f;
    --text-color: #ffffff;
    --accent-purple: #8a2be2;
    --accent-rose: #ff007f;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    /* Typography: 'Outfit' chosen for its modern glyph set and legibility at small sizes. */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}


.spline-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    z-index: 1;
    pointer-events: auto;
    /* Interaction layer must pass through events to the WebGL canvas. */
}

/* Iframe reset: Absolute positioning prevents layout shifts from default inline-block baseline alignment. */
.spline-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}


/* Stacking context management: Container must float above the 3D scene. */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
}

.container_pic {
    position: relative;
    /* Minimized state configuration. Initial position locked to viewport bottom. */
    width: 140px;
    height: 140px;
    transform: translateY(38vh);
    /* 38vh offset calculated to position the bubble comfortably within thumb reach on mobile. */

    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    /* Glassmorphism accent: subtle border highlight to separate from deep background. */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    cursor: pointer;
    outline: none;
    /* Focus management handled via custom active states; native outline suppressed. */

    /* Interaction Policing */
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    /* CSS touch-action: none is critical here. It prevents the browser from hijacking our custom swipe gestures for scrolling. */

    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 20;
    /* Z-Index hierarchy peak. */
}

/* Micro-interaction: Subtle lift on hover encourages engagement when minimized. */
.container_pic:not(.active):hover {
    transform: translateY(38vh) scale(1.1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.5);
}

/* State: Active (Expanded) */
.container_pic.active {
    width: 600px;
    height: 600px;
    transform: translateY(0);
    /* Resetting transform to origin (center) for the active state. */
    border-color: rgba(255, 255, 255, 0.1);
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(0.95);
    transition: transform 0.6s ease;
}

.container_pic::after {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: grayscale(100%);
    -webkit-backdrop-filter: grayscale(100%);
    mask-image: linear-gradient(to bottom, transparent 60%, black 68%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 60%, black 80%);
    z-index: 5;
    pointer-events: none;

    /* Vignette effect: Adds depth. */
}

/* Drag Hint */
.drag-hint {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 25;
    color: rgb(255, 255, 255);
    background-color: rgba(10, 10, 10, 0.5);
    border-radius: 50%;
    padding: 4px;
    animation: floatHint 2s ease-in-out infinite;
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 1;
}

.drag-hint.hidden {
    opacity: 0;
    transform: translate(-50%, -60%);
}

@keyframes floatHint {

    0%,
    100% {
        transform: translate(-50%, -50%);
    }

    50% {
        transform: translate(-50%, -65%);
    }
}

.container_pic.active .profile-pic {
    transform: scale(1.05);
}

.container_info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55%;
    padding: 20px 40px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;

    background: linear-gradient(to top, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 0.8) 50%, transparent 100%);

    z-index: 10;
    /* Hidden by default (when small bubbles) */
    opacity: 0;
    pointer-events: none;

    /* Minimized state: Scaled down and slightly lower to feel integrated in the circle */
    transform: translateY(20px) scale(0.9);

    /* Rapid exit transition to clear the stage before the container shrinks */
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Progressive disclosure: Information reveals only when the user commits to the interaction. */
.container_pic.active .container_info {
    opacity: 1;
    pointer-events: auto;

    /* Normal state */
    transform: translateY(0) scale(1);

    /* Slower entry with delay to wait for container expansion */
    transition: opacity 0.4s ease 0.2s, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

/* Logo */
.logo {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: -1px;
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
    overflow: hidden;
    vertical-align: middle;
}

.logo-swap-container {
    display: inline-grid;
    grid-template-areas: "stack";
    overflow: hidden;
    vertical-align: bottom;
    margin-left: 2px;
}

.logo-word {
    grid-area: stack;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

/* Initial States */
.logo-word.primary {
    transform: translateY(0);
}

.logo-word.secondary {
    transform: translateY(-100%);
}

/* Hover States - Move both down */
.logo:hover .logo-word.primary {
    transform: translateY(100%);
}

.logo:hover .logo-word.secondary {
    transform: translateY(0);
}

/* Dot Styles */
.dot {
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-rose));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Bio */
.bio {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    /* Muted white for elegance */
    font-weight: 300;
    max-width: 400px;
    margin: 5px;
}

/* Social Icons */
.social-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    /* margin-top: 1rem; */
}

.social-icon {
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    /* Subtle backdrop */
}

.social-icon:hover {
    opacity: 1;
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
}

.social-icon svg {
    width: 28px;
    height: 28px;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    opacity: 1;
    visibility: visible;
}

#loading-screen.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -1px;
}

.bouncing {
    display: inline-block;
    color: var(--accent-rose);
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-rose));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: bounce 0.3s infinite alternate cubic-bezier(0.5, 0.05, 0.1, 0.3);
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-4px);
    }
}