/* ========================================
   SuboVision — Digital Business Card
   /card/card.css
   ======================================== */

/* ---- Variables (mirrors main site tokens) ---- */
:root {
    --primary-start: #3B82F6;
    --primary-end: #7C3AED;
    --primary-gradient: linear-gradient(135deg, #3B82F6 0%, #7C3AED 100%);
    --primary-gradient-subtle: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(124,58,237,0.12) 100%);
    --primary-gradient-hover: linear-gradient(135deg, #60A5FA 0%, #8B5CF6 100%);
    --shadow-primary: 0 4px 14px 0 rgba(124,58,237,0.4);
    --shadow-primary-lg: 0 8px 28px 0 rgba(124,58,237,0.55);
    --focus-ring: 0 0 0 3px rgba(59,130,246,0.35);

    /* Neutral */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Typography */
    --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--gray-50);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* ---- Skip Link ---- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10000;
    background: var(--primary-gradient);
    color: var(--white);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    font-weight: 600;
}

.skip-link:focus {
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    width: auto;
    height: auto;
    overflow: visible;
}


/* ========================================
   Top Bar
   ======================================== */
.card-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--space-4) var(--space-6);
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
}

.card-back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.card-back-link:hover {
    color: var(--primary-start);
}

.card-back-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    flex-shrink: 0;
}

.topbar-logo {
    height: 28px;
    width: auto;
}

/* ========================================
   Main layout
   ======================================== */
.card-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
}

/* ========================================
   vCard
   ======================================== */
.vcard {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    padding: var(--space-8);
    /* Entry animation */
    animation: cardEnter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- Top accent bar ---- */
.vcard::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    z-index: 2;
}

/* ========================================
   Card Header
   ======================================== */
.vcard-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

/* Avatar */
.vcard-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.vcard-avatar {
    position: relative;
    z-index: 1;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(59,130,246,0.25);
    display: block;
}

/* Identity */
.vcard-identity {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-1);
    min-width: 0;
    padding-top: var(--space-1);
}

.vcard-logo-wrap {
    margin-bottom: var(--space-2);
}

.vcard-logo {
    height: 24px;
    width: auto;
}

.vcard-name {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vcard-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-500);
    line-height: 1.3;
}

.vcard-company {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-start);
    margin-top: var(--space-1);
}

/* ========================================
   Divider
   ======================================== */
.vcard-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gray-200), transparent);
    margin-bottom: var(--space-6);
}

/* ========================================
   Contact Items
   ======================================== */
.vcard-contacts {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.vcard-contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
    background: var(--gray-50);
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

a.vcard-contact-item:hover {
    background: var(--white);
    border-color: var(--primary-start);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

a.vcard-contact-item:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.vcard-contact-static {
    cursor: default;
}

.vcard-contact-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

a.vcard-contact-item:hover .vcard-contact-icon {
    transform: scale(1.08);
    box-shadow: var(--shadow-primary);
}

.vcard-contact-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--white);
}

.vcard-contact-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.vcard-contact-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    line-height: 1.2;
}

.vcard-contact-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vcard-contact-arrow {
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.vcard-contact-arrow svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary-start);
}

a.vcard-contact-item:hover .vcard-contact-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================
   About Section
   ======================================== */
.vcard-about {
    margin-bottom: var(--space-6);
}

.vcard-about-text {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: var(--space-4);
}

.vcard-current {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--primary-gradient-subtle);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(59,130,246,0.15);
}

.vcard-current-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-end);
    flex-shrink: 0;
}

.vcard-current-value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
}

/* ========================================
   Action Buttons
   ======================================== */
.vcard-actions {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.vcard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition:
        transform var(--transition-base),
        box-shadow var(--transition-base),
        background var(--transition-base),
        border-color var(--transition-base),
        color var(--transition-base);
    flex: 1;
    text-decoration: none;
}

.vcard-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

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

.vcard-btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    box-shadow: var(--shadow-primary);
}

.vcard-btn-primary:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-lg);
}

.vcard-btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-primary);
}

.vcard-btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.vcard-btn-outline:hover {
    border-color: var(--primary-start);
    color: var(--primary-start);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.vcard-btn-outline:active {
    transform: translateY(0);
}

/* ========================================
   Card Footer
   ======================================== */
.vcard-footer {
    border-top: 1px solid var(--gray-100);
    padding-top: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.vcard-vat {
    font-size: 0.6875rem;
    color: var(--gray-400);
    font-weight: 500;
}

.vcard-tagline {
    font-size: 0.6875rem;
    color: var(--gray-400);
    text-align: right;
    font-style: italic;
}

/* ========================================
   Download success flash
   ======================================== */
.vcard-btn-primary.downloaded {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 4px 14px 0 rgba(16,185,129,0.4);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 500px) {
    .card-main {
        padding: var(--space-4) var(--space-3);
        align-items: flex-start;
    }

    .vcard {
        max-width: 100%;
        padding: var(--space-6) var(--space-5);
        border-radius: var(--radius-xl);
    }

    .vcard-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--space-4);
    }

    .vcard-identity {
        align-items: center;
    }

    .vcard-name {
        white-space: normal;
        text-align: center;
    }

    .vcard-actions {
        flex-direction: column;
    }
}

@media (max-width: 360px) {
    .vcard {
        padding: var(--space-5) var(--space-4);
    }

    .vcard-avatar {
        width: 84px;
        height: 84px;
    }

    .vcard-contact-value {
        font-size: 0.8125rem;
    }
}

/* ========================================
   Dark Mode
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f0f1a;
        --bg-secondary: #1a1a2e;
        --bg-card: #1e1e35;
        --text-primary: #f0f0f5;
        --text-secondary: #a0a0b5;
        --text-muted: #6b6b85;
        --border-color: #2a2a45;
        --border-light: #3a3a55;
    }

    body {
        background-color: var(--bg-primary);
        color: var(--text-secondary);
    }

    /* Top bar */
    .card-topbar {
        background: rgba(15,15,26,0.92);
        border-bottom-color: var(--border-color);
    }

    .card-back-link {
        color: var(--text-secondary);
    }

    .card-back-link:hover {
        color: var(--primary-start);
    }

    /* Card */
    .vcard {
        background: var(--bg-card);
        box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 1px var(--border-color);
    }

    /* Header */
    .vcard-name {
        color: var(--text-primary);
    }

    .vcard-avatar {
        border-color: var(--bg-card);
        box-shadow: var(--shadow-lg), 0 0 0 3px rgba(59,130,246,0.35);
    }

    /* Divider */
    .vcard-divider {
        background: linear-gradient(to right, transparent, var(--border-color), transparent);
    }

    /* Contact items */
    .vcard-contact-item {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    a.vcard-contact-item:hover {
        background: var(--bg-primary);
        border-color: var(--primary-start);
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    }

    .vcard-contact-value {
        color: var(--text-primary);
    }

    /* About */
    .vcard-about-text {
        color: var(--text-secondary);
    }

    .vcard-current {
        background: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(124,58,237,0.15) 100%);
        border-color: rgba(59,130,246,0.25);
    }

    .vcard-current-value {
        color: var(--text-secondary);
    }

    /* Buttons */
    .vcard-btn-outline {
        color: var(--text-secondary);
        border-color: var(--border-light);
    }

    .vcard-btn-outline:hover {
        color: var(--primary-start);
        border-color: var(--primary-start);
    }

    /* Footer */
    .vcard-footer {
        border-top-color: var(--border-color);
    }

}

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

    .vcard {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
