:root {
    --bg-deep-blue: #224466;
    --bg-light-blue: #336699;
    --accent-vibrant: #4facfe;
    --accent-secondary: #00f2fe;
    --text-color: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-border: rgba(255, 255, 255, 0.2);
    --link-bg: rgba(255, 255, 255, 0.15);
    --link-hover-bg: rgba(255, 255, 255, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-deep-blue);
    color: var(--text-color);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 1.5rem 1rem;
}

/* Dynamic Gradient Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* Fallback */
    background: linear-gradient(
        -45deg, 
        #224466, 
        #336699, 
        #1e3c72, 
        #2a5298
    );
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

/* Floating overlay blobs for vibrancy */
.background-animation::before,
.background-animation::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out alternate;
}

.background-animation::before {
    background: radial-gradient(circle, var(--accent-secondary), transparent 70%);
    top: -10%;
    left: -10%;
}

.background-animation::after {
    background: radial-gradient(circle, var(--accent-vibrant), transparent 70%);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 50px); }
}

/* Profile Card (Glassmorphism & 3D Flip) */
.profile-card {
    perspective: 1200px;
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.card-inner {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-front {
    padding: 3rem 2rem;
    text-align: center;
    transform: rotateY(0deg);
}

.card-back {
    position: absolute;
    inset: 0;
    padding: 2.25rem 2rem 2rem;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.card-back::-webkit-scrollbar {
    width: 6px;
}

.card-back::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* Close button on card back */
.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

/* About content */
.about-content {
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
}

.about-content h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

.about-content p {
    font-size: 0.925rem;
    line-height: 1.55;
    opacity: 0.9;
    font-weight: 400;
    margin-bottom: 0.85rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.back-btn {
    margin-top: auto;
    justify-content: center;
    text-align: center;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-header {
    margin-bottom: 2.5rem;
}

.profile-picture {
    display: inline-block;
    margin-bottom: 1rem;
}

.profile-image,
.profile-picture img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    display: block;
}

.profile-picture:hover img,
.profile-image:hover {
    transform: scale(1.05) rotate(2deg);
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.headline {
    font-size: 1.1rem;
    opacity: 0.85;
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.strapline {
    font-size: 0.9rem;
    opacity: 0.7;
    font-weight: 300;
}

/* Links */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--text-color);
    background: var(--link-bg);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
}

button.link-item {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    width: 100%;
}

.link-item:hover {
    background: var(--link-hover-bg);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    border-color: rgba(255,255,255,0.3);
}

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

/* Icons */
.link-item svg {
    opacity: 0.7;
    transition: opacity 0.3s ease; /* Only animate opacity, not transform */
}

.link-item:hover svg {
    opacity: 1;
}

/* Icon Text Wrapper */
.link-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .card-front,
    .card-back {
        padding: 2rem 1.25rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }

    .about-content h2 {
        font-size: 1.4rem;
    }

    .about-content p {
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }
}
