:root {
    --primary: #6366f1;
    --primary-dim: rgba(99, 102, 241, 0.15);
    --primary-glow: rgba(99, 102, 241, 0.25);
    --bg: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-row: rgba(255, 255, 255, 0.04);
    --bg-row-hover: rgba(255, 255, 255, 0.08);
    --text: #e5e5e5;
    --text-dim: #888;
    --text-bright: #fff;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --radius: 16px;
    --radius-sm: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* === LIGHT THEME === */
[data-theme="light"] {
    --bg: #f5f5f7; --bg-card: #ffffff; --bg-card-hover: #f0f0f2;
    --bg-row: rgba(0, 0, 0, 0.03); --bg-row-hover: rgba(0, 0, 0, 0.06);
    --text: #374151; --text-dim: #6b7280; --text-bright: #111827;
    --border: rgba(0, 0, 0, 0.1); --border-hover: rgba(0, 0, 0, 0.2);
    --primary-dim: rgba(99, 102, 241, 0.1); --primary-glow: rgba(99, 102, 241, 0.15);
}
.theme-toggle-float {
    position: fixed; bottom: 1.25rem; right: 1.25rem; width: 40px; height: 40px;
    border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-dim); cursor: pointer; display: flex; align-items: center;
    justify-content: center; z-index: 1000; transition: all 0.2s;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.theme-toggle-float:hover { color: var(--text-bright); transform: scale(1.1); }
@media print { .theme-toggle-float { display: none !important; } }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* === PAGE LAYOUT === */
.vcard-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* === CARD === */
.vcard-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

/* Header gradient bar */
.card-header-bar {
    height: 100px;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #ec4899));
    position: relative;
}
.card-header-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, var(--bg-card), transparent);
}

/* === AVATAR === */
.card-avatar-wrapper {
    display: flex;
    justify-content: center;
    margin-top: -52px;
    position: relative;
    z-index: 2;
}
.card-avatar {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--bg-card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #ec4899));
}
.card-avatar-placeholder span {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

/* === IDENTITY === */
.card-identity {
    text-align: center;
    padding: 1rem 1.5rem 0;
}
.card-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}
.card-title {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 500;
}
.card-company {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.125rem;
}

/* === BIO === */
.card-bio {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-dim);
    line-height: 1.6;
    padding: 0.75rem 1.75rem 0;
    max-width: 360px;
    margin: 0 auto;
}

/* === CONTACT FIELDS === */
.card-contacts {
    padding: 1.25rem 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.contact-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--bg-row);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s, transform 0.15s;
    cursor: pointer;
}
.contact-row:hover {
    background: var(--bg-row-hover);
    transform: translateX(2px);
}
.contact-row--no-link {
    cursor: default;
}
.contact-row--no-link:hover {
    transform: none;
}
.contact-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary-dim);
    color: var(--primary);
    flex-shrink: 0;
}
.contact-info {
    flex: 1;
    min-width: 0;
}
.contact-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.0625rem;
}
.contact-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.contact-arrow {
    color: var(--text-dim);
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}
.contact-row:hover .contact-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* === SOCIAL LINKS === */
.card-socials {
    display: flex;
    justify-content: center;
    gap: 0.625rem;
    padding: 1.25rem 1.25rem 0;
    flex-wrap: wrap;
}
.social-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
}
.social-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-dim);
    transform: scale(1.1);
}

/* === EXPERTISE === */
.card-expertise {
    padding: 1.5rem 1.25rem 0;
    border-top: 1px solid var(--border);
    margin-top: 1.25rem;
}
.expertise-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-bright);
    text-align: center;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
}
.expertise-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.expertise-item {
    padding: 0.875rem 1rem;
    background: var(--bg-row);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.expertise-item:hover {
    background: var(--bg-row-hover);
}
.expertise-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.375rem;
}
.expertise-item p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin: 0;
}

/* === ACTION BUTTONS === */
.card-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    cursor: pointer;
    border: none;
    font-family: var(--font);
    flex: 1;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover { box-shadow: 0 6px 25px var(--primary-glow); }
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--text-dim);
    background: var(--bg-row);
}

/* === QR MODAL === */
.qr-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.qr-modal.active {
    display: flex;
}
.qr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.qr-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    max-width: 340px;
    width: calc(100% - 2rem);
    animation: modalIn 0.3s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.qr-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}
.qr-modal-close:hover { color: var(--text-bright); }
.qr-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 1.25rem;
}
.qr-image {
    display: inline-flex;
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}
.qr-image img {
    display: block;
    width: 200px;
    height: 200px;
}
.qr-subtitle {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}
.btn-copy {
    width: auto;
    flex: none;
    padding: 0.625rem 1.25rem;
    font-size: 0.8rem;
}
.btn-copy.copied {
    border-color: #22c55e;
    color: #22c55e;
}

/* === BADGE === */
.badge-wrapper {
    margin-top: 1.5rem;
    text-align: center;
}
.powered-badge {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--text-dim);
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.powered-badge:hover { opacity: 0.8; }
.powered-badge strong { font-weight: 600; }

/* === ANIMATIONS === */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .vcard-page {
        padding: 1rem 0.75rem;
    }
    .vcard-card {
        border-radius: var(--radius-sm);
    }
    .card-header-bar {
        height: 80px;
    }
    .card-avatar-wrapper {
        margin-top: -44px;
    }
    .card-avatar {
        width: 88px;
        height: 88px;
    }
    .card-avatar-placeholder span {
        font-size: 2rem;
    }
    .card-name {
        font-size: 1.3rem;
    }
    .card-bio {
        padding: 0.75rem 1.25rem 0;
    }
    .card-contacts {
        padding: 1rem 1rem 0;
    }
    .card-socials {
        padding: 1rem 1rem 0;
    }
    .card-expertise {
        padding: 1rem 1rem 0;
        margin-top: 1rem;
    }
    .card-actions {
        padding: 1.25rem 1rem;
        flex-direction: column;
    }
}

/* === PRINT === */
@media print {
    * { background: #fff !important; color: #111 !important; box-shadow: none !important; }
    .vcard-page { padding: 0; }
    .vcard-card { border: 1px solid #ddd !important; max-width: 100%; }
    .card-header-bar { background: #f0f0f0 !important; }
    .card-header-bar::after { display: none; }
    .card-avatar { border-color: #ddd !important; }
    .card-avatar-placeholder { background: #ddd !important; }
    .card-avatar-placeholder span { color: #333 !important; }
    .card-title { color: #555 !important; }
    .contact-icon { background: #f0f0f0 !important; color: #555 !important; }
    .contact-row { background: #fafafa !important; border: 1px solid #eee !important; }
    .social-btn { border-color: #ddd !important; color: #555 !important; }
    .card-expertise { border-color: #eee !important; }
    .expertise-item { background: #fafafa !important; }
    .expertise-title { color: #555 !important; }
    .expertise-item h4 { color: #111 !important; }
    .expertise-item p { color: #666 !important; }
    .card-actions, .qr-modal, .badge-wrapper, #shareBtn { display: none !important; }
    .fade-in { opacity: 1 !important; transform: none !important; }
}
