:root {
    --bg-primary: #0f111a;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --card-bg: rgba(26, 32, 44, 0.4);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(45, 55, 72, 0.6);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    
    --blob-1: #4338ca;
    --blob-2: #2563eb;
    --blob-3: #7e22ce;
}

@property --avatar-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

/* Shader background canvas */
#shader-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3; /* Fades the background animation to improve readability site-wide */
}

/* Container Frame */
.container {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
}

.glass-panel {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.corner-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 28px;
    height: 28px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.corner-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.corner-badge:hover {
    opacity: 1;
}

/* Header */
.profile-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
}

.avatar-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    padding: 4px;
    background: conic-gradient(
        from var(--avatar-angle),
        #4338ca 0%,
        #6366f1 25%,
        #a78bfa 45%,
        #c4b5fd 50%,
        #a78bfa 55%,
        #7e22ce 75%,
        #4338ca 100%
    );
    animation: spin-avatar 3s linear infinite;
    margin-bottom: 1.25rem;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5), 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

@keyframes spin-avatar {
    to { --avatar-angle: 360deg; }
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-primary);
}

.name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.025em;
}

.nickname {
    color: var(--text-secondary);
    font-weight: 400;
}

.tagline {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.75rem;
    max-width: 90%;
}

/* CTA Section */
.cta-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.875rem 1.25rem;
    border-radius: 100px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

/* Micro-animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 4px 25px rgba(99, 102, 241, 0.6);
    }
}

.animate-pulse {
    animation: pulse 2s infinite ease-in-out;
}

.animate-pulse:hover {
    animation-play-state: paused;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 17, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 1.5rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(26, 32, 44, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem 2rem 2rem 2rem;
    max-width: 440px;
    width: 100%;
    position: relative;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 0 0 50px rgba(99, 102, 241, 0.15);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-top: 0.5rem;
}

.modal-desc {
    font-size: 0.87rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.qr-code-wrapper {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    height: auto;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

.qr-code-wrapper:hover {
    transform: scale(1.03);
}

.qr-code-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-download-btn {
    width: auto;
    min-width: 200px;
    padding: 0.8rem 1.5rem;
}


/* Links Section */
.links-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.group-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.links-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.link-card {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    width: 100%;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.link-card:hover {
    background: var(--card-hover);
    transform: translateX(4px);
    border-color: rgba(255,255,255,0.15);
}

.link-card-featured {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
}

.link-card-featured:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.6);
}

.link-card-compact {
    padding: 0.6rem 1rem;
}

.link-card-compact .link-icon {
    width: 32px;
    height: 32px;
    margin-right: 0.75rem;
    font-size: 0.95rem;
}

.link-card-compact .d3-icon {
    width: 18px;
    height: 18px;
}

.link-card-compact .link-title {
    font-size: 0.9rem;
}

.link-card-compact .link-desc {
    font-size: 0.7rem;
    margin-top: 0.1rem;
}

.chip-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.link-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.6rem 0.5rem;
    border-radius: 100px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.link-chip i {
    color: var(--accent);
}

.link-chip:hover {
    background: var(--card-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    margin-right: 1rem;
    font-size: 1.1rem;
}

.d3-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.link-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.link-title {
    font-weight: 600;
    font-size: 1rem;
}

.link-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.link-arrow {
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.link-card:hover .link-arrow {
    transform: translateX(4px);
    color: var(--text-primary);
}

/* Brand Footer */
.brand-footer {
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    padding-top: 1.5rem;
}

.brand-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--card-border), transparent);
}

.brand-footer-logo {
    height: 22px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.brand-footer-logo:hover {
    opacity: 1;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .glass-panel {
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
    }

    .corner-badge {
        top: 1.1rem;
        right: 1.1rem;
        width: 22px;
        height: 22px;
    }

    .avatar-container {
        width: 100px;
        height: 100px;
    }
    
    .name {
        font-size: 1.5rem;
    }

    .modal-content {
        padding: 2.25rem 1.25rem 1.5rem 1.25rem;
        border-radius: 20px;
    }

    .qr-code-wrapper {
        padding: 0.75rem;
        border-radius: 16px;
        max-width: 260px;
    }

    .cta-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .link-chip {
        font-size: 0.7rem;
        padding: 0.55rem 0.35rem;
        gap: 0.3rem;
    }
}

