/* =============================================
   Digital Business Card — Silicon Garage
   Light theme · Tech-inspired
   ============================================= */

:root {
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --card-elevated: #f1f5f9;
    --border: rgba(148, 163, 184, 0.25);
    --border-strong: rgba(148, 163, 184, 0.45);
    --text: #0f172a;
    --text-muted: #475569;
    --text-subtle: #94a3b8;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --accent-start: #22d3ee;
    --accent-end: #0284c7;
    --accent-gradient: linear-gradient(135deg, #22d3ee, #0ea5e9, #0284c7);
    --green: #16a34a;
    --blue: #0284c7;
    --orange: #ea580c;
    --radius: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --radius-full: 9999px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 40px rgba(0, 0, 0, 0.07);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg);
    background-image: radial-gradient(at 50% 0%, rgba(14, 165, 233, 0.06) 0%, transparent 50%);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding: max(16px, env(safe-area-inset-top, 16px))
             max(16px, env(safe-area-inset-right, 16px))
             max(16px, env(safe-area-inset-bottom, 16px))
             max(16px, env(safe-area-inset-left, 16px));
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* --- 3D Background Canvas --- */

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Background Decoration --- */

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: #22d3ee;
    top: -150px;
    right: -120px;
}

.bg-glow-2 {
    width: 400px;
    height: 400px;
    background: #0284c7;
    bottom: -120px;
    left: -120px;
}

/* --- Card --- */

.card {
    width: 100%;
    max-width: 440px;
    background-color: var(--card-bg);
    background-image: radial-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 5%, #22d3ee 25%, #0ea5e9 50%, #0284c7 75%, transparent 95%);
    background-size: 200% 100%;
    animation: shimmer 4s ease-in-out infinite;
}

/* --- Card Logo --- */

.card-logo {
    text-align: center;
    margin-bottom: 8px;
    animation: fadeUp 0.5s ease-out;
}

.card-logo img {
    height: 48px;
    width: auto;
    margin: 0 auto;
    filter: drop-shadow(0 2px 8px rgba(14, 165, 233, 0.15));
}

/* --- Hero --- */

.hero {
    text-align: center;
    margin-bottom: 28px;
    animation: fadeUp 0.6s ease-out;
}

.avatar-wrapper {
    position: relative;
    width: 132px;
    height: 132px;
    margin: 0 auto 20px;
}

.avatar-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #22d3ee, #0ea5e9, #0284c7, #0ea5e9, #22d3ee);
    animation: spin 20s linear infinite;
    will-change: transform;
}

.avatar-wrapper::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid rgba(14, 165, 233, 0.2);
    animation: pulse 3s ease-in-out infinite;
}

.avatar {
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--card-bg);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.avatar .initials {
    font-size: 42px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    user-select: none;
}

#name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 6px;
}

.role {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.tagline {
    font-size: 14px;
    color: var(--text-subtle);
    font-weight: 400;
    line-height: 1.5;
    max-width: 300px;
    margin: 0 auto;
}

/* --- Actions Grid --- */

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeUp 0.6s ease-out 0.24s both;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 12px;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    min-height: 80px;
    text-decoration: none;
}

.action-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.action-btn.call {
    background: rgba(2, 132, 199, 0.05);
    border-color: rgba(2, 132, 199, 0.15);
}
.action-btn.call svg { color: var(--blue); }

.action-btn.email {
    background: rgba(234, 88, 12, 0.05);
    border-color: rgba(234, 88, 12, 0.12);
}
.action-btn.email svg { color: var(--orange); }

.action-btn.whatsapp {
    background: rgba(22, 163, 74, 0.05);
    border-color: rgba(22, 163, 74, 0.12);
}
.action-btn.whatsapp svg { color: var(--green); }

.action-btn.website {
    background: rgba(14, 165, 233, 0.05);
    border-color: rgba(14, 165, 233, 0.12);
}
.action-btn.website svg { color: var(--accent); }

.action-btn:active {
    transform: scale(0.95);
}

/* --- Buttons --- */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition);
    min-height: 48px;
}

.btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    margin-bottom: 12px;
    animation: fadeUp 0.6s ease-out 0.2s both;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.2);
}

.btn-primary:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
    flex: 1;
}

.btn-secondary:active {
    transform: scale(0.97);
    background: var(--card-elevated);
}

.btn-icon {
    width: 48px;
    min-width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    transition: all var(--transition);
}

.btn-icon svg { width: 20px; height: 20px; }

.btn-icon:active {
    transform: scale(0.93);
    background: var(--card-elevated);
}

/* --- Share Group --- */

.share-group {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    animation: fadeUp 0.6s ease-out 0.25s both;
}

/* --- Services & Tech Stack Sections --- */

.section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 12px;
    text-align: center;
}

.services-section {
    margin-bottom: 20px;
    animation: fadeUp 0.6s ease-out 0.12s both;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.service-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: rgba(14, 165, 233, 0.07);
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: #0369a1;
    white-space: nowrap;
}

.tech-section {
    margin-bottom: 24px;
    animation: fadeUp 0.6s ease-out 0.18s both;
}

.tech-marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.marquee-track {
    display: flex;
    align-items: center;
    gap: 32px;
    width: max-content;
    animation: marquee 18s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

.marquee-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.marquee-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity var(--transition), transform var(--transition);
}

.marquee-item:hover .marquee-icon {
    opacity: 1;
    transform: scale(1.1);
}

.marquee-icon svg {
    width: 100%;
    height: 100%;
}

.marquee-label {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-subtle);
    font-weight: 500;
    white-space: nowrap;
}

/* --- Socials --- */

.socials {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    animation: fadeUp 0.6s ease-out 0.35s both;
}

.social-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    transition: all var(--transition);
}

.social-link svg { width: 20px; height: 20px; }

.social-link:active {
    transform: scale(0.9);
}

/* --- Footer --- */

footer {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    animation: fadeUp 0.6s ease-out 0.38s both;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.footer-icon {
    height: 30px;
    width: auto;
}

.footer-wordmark {
    height: 18px;
    width: auto;
    opacity: 0.85;
}

footer p {
    font-size: 12px;
    color: var(--text-subtle);
}

footer a {
    color: var(--text-muted);
    transition: color var(--transition);
}

/* --- QR Modal --- */

.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.qr-modal.active {
    opacity: 1;
    visibility: visible;
}

.qr-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.qr-content {
    position: relative;
    background: #ffffff;
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.qr-modal.active .qr-content {
    transform: scale(1);
}

.qr-label {
    font-size: 14px;
    font-weight: 600;
    color: #27272a;
    margin-bottom: 20px;
}

#qr-canvas {
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f4f4f5;
    color: #71717a;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    line-height: 1;
}

.btn-close:hover {
    background: #e4e4e7;
    color: #18181b;
}

/* --- Toast --- */

.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    opacity: 0;
    pointer-events: none;
    background: var(--card-bg);
    color: var(--text);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    z-index: 2000;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* --- Animations --- */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Hover (pointer devices only) --- */

@media (hover: hover) {
    .action-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-sm);
    }
    .action-btn.call:hover {
        background: rgba(2, 132, 199, 0.1);
        border-color: rgba(2, 132, 199, 0.25);
    }
    .action-btn.email:hover {
        background: rgba(234, 88, 12, 0.1);
        border-color: rgba(234, 88, 12, 0.2);
    }
    .action-btn.whatsapp:hover {
        background: rgba(22, 163, 74, 0.1);
        border-color: rgba(22, 163, 74, 0.2);
    }
    .action-btn.website:hover {
        background: rgba(14, 165, 233, 0.1);
        border-color: rgba(14, 165, 233, 0.2);
    }

    .btn-primary:hover {
        opacity: 0.92;
        transform: translateY(-1px);
        box-shadow: 0 6px 24px rgba(14, 165, 233, 0.25);
    }

    .btn-secondary:hover {
        background: var(--card-elevated);
        border-color: var(--accent);
    }

    .btn-icon:hover {
        background: var(--card-elevated);
        color: var(--text);
        border-color: var(--accent);
    }

    .social-link:hover {
        background: rgba(14, 165, 233, 0.08);
        color: var(--accent);
        border-color: rgba(14, 165, 233, 0.3);
        transform: translateY(-2px);
    }

    footer a:hover {
        color: var(--accent);
    }
}

/* --- Responsive --- */

@media (min-width: 480px) {
    body { padding: 24px; }
    .card { padding: 40px 32px; }
    .avatar-wrapper { width: 148px; height: 148px; }
    .avatar .initials { font-size: 50px; }
    #name { font-size: 30px; }
    .role { font-size: 16px; }
    .tagline { font-size: 15px; }
}

/* --- Reduced Motion --- */

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