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

:root {
    /* Light mode colors */
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --about-bg: #f8f9fa;
    --border-color: #667eea;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-color-light: rgba(0, 0, 0, 0.2);
    --social-hover-shadow: rgba(102, 126, 234, 0.4);
}

body.dark-mode {
    /* Dark mode colors */
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --card-bg: #0f3460;
    --text-primary: #e4e4e4;
    --text-secondary: #b0b0b0;
    --about-bg: #162447;
    --border-color: #667eea;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-color-light: rgba(0, 0, 0, 0.3);
    --social-hover-shadow: rgba(102, 126, 234, 0.6);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    width: 100%;
    max-width: 600px;
}

/* Card flip structure */
.profile-card {
    perspective: 1000px;
}

.card-inner {
    position: relative;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.card-front,
.card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    transition: background 0.3s ease;
}

.card-front {
    box-shadow: 0 20px 60px var(--shadow-color);
}

.card-back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px var(--shadow-color);
}

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

.qr-code {
    width: 200px;
    height: 200px;
    color: var(--text-primary);
}

.qr-label {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-top: 20px;
}

.qr-url {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 8px;
}

.qr-hint {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 20px;
    opacity: 0.6;
}

.profile-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--border-color);
    box-shadow: 0 10px 30px var(--shadow-color-light);
}

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

.name {
    font-size: 2.5em;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 700;
    transition: color 0.3s ease;
}

.tagline {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 30px;
    transition: color 0.3s ease;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: nowrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
}

.social-link svg,
.social-link i {
    width: 24px;
    height: 24px;
    color: white;
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--social-hover-shadow);
}

.about {
    text-align: left;
    padding: 20px;
    background: var(--about-bg);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.about h2 {
    font-size: 1.5em;
    color: var(--text-primary);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.about p {
    font-size: 1em;
    color: var(--text-secondary);
    line-height: 1.6;
    transition: color 0.3s ease;
}

/* Desktop: hide flip hint */
.qr-hint {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: stretch;
        background: var(--card-bg);
    }

    .container {
        max-width: none;
    }

    .profile-card {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .card-front,
    .card-back {
        border-radius: 0;
        padding: 30px 20px;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-shadow: none;
    }

    .card-front > * {
        width: 100%;
    }

    .card-front > .profile-image {
        width: 150px;
    }

    .name {
        font-size: 2em;
    }

    .tagline {
        font-size: 1em;
    }

    .social-links {
        gap: 12px;
    }

    .social-link {
        width: 44px;
        height: 44px;
    }

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

    .qr-hint {
        display: block;
    }

    .qr-code {
        width: 180px;
        height: 180px;
    }
}
