:root {
    --primary-bg: #0f172a;
    --accent-glow: #3b82f6;
    --accent-gold: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --card-radius: 28px;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #020617;
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px; /* Reduced from 24px to make card larger on mobile */
}

/* 3D Scene */
.card-wrapper {
    width: 100%;
    perspective: 2000px;
}

.card {
    position: relative;
    width: 100%;
    aspect-ratio: 0.60; /* Balanced vertical proportion for modern phones */
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

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

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--card-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5), 
                0 18px 36px -18px rgba(0, 0, 0, 0.5),
                inset 0 0 0 1px var(--glass-border);
}

/* --- Front Side: Unique Editorial Look --- */
.card-face.front {
    background: linear-gradient(165deg, #1e293b 0%, #0f172a 100%);
}

/* Background elements */
.front::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 80%;
    height: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    z-index: 1;
}

/* Front Logo */
.front-logo {
    position: absolute;
    /* top: 24px; */
    right: 10px;
    width: 180px;
    height: auto;
    object-fit: contain;
    z-index: 5;
    opacity: 1;
    /* filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.25)); */
}



.front-content {
    position: relative;
    height: 100%;
    padding: 40px;
    z-index: 3;
    display: flex;
    flex-direction: column;
}

.intro-text {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.main-name {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -2px;
}

.main-name span {
    display: block;
    color: var(--accent-gold);
}

.role-badge {
    align-self: flex-start;
    margin-top: 20px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Deep's Image with Cut-out Effect */
.personal-image-container {
    position: absolute;
    bottom: 0;
    right: -20px;
    width: 100%;
    height: 70%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    pointer-events: none;
    z-index: 4;
}

.personal-image {
    height: 100%;
    width: auto;
    max-width: 130%; /* Allow slight overflow for artistic effect */
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
    transition: transform 0.5s ease;
}

.footer-hint {
    position: absolute;
    bottom: 30px;
    left: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.footer-hint::after {
    content: '';
    width: 40px;
    height: 1px;
    background: white;
    opacity: 0.3;
}

/* --- Back Side: Premium Dark Redesign --- */
.card-face.back {
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 60%, #0f1f35 100%);
    transform: rotateY(180deg);
    color: #f8fafc;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Subtle glow orbs on back */
.card-face.back::before {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -20%;
    width: 70%;
    height: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.card-face.back::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

/* Header: Logo + Name Stacked */
.back-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.back-logo-img {
    width: 240px;
    height: auto;
    object-fit: contain;
    margin-top: -50px;
    margin-bottom: -45px;
    /* filter: drop-shadow(0 2px 10px rgba(245, 158, 11, 0.3)); */
}

.back-header-text {
    flex: 1;
}

.back-name {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #f8fafc;
    line-height: 1.1;
}

.back-title {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
    margin-top: 4px;
    text-transform: uppercase;
}

/* Gold Divider */
.back-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.5), transparent);
    margin: 4px 0;
    position: relative;
    z-index: 2;
}

/* Contact List */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.contact-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #cbd5e1;
    font-weight: 400;
    font-size: 0.82rem;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.contact-btn:active {
    transform: scale(0.97);
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
}

.contact-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
}

.contact-icon svg {
    width: 15px;
    height: 15px;
}

/* Footer: Centered Social */
.back-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    padding-top: 10px;
}

.social-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    color: var(--accent-gold);
    opacity: 0.85;
}

.social-handles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.social-handles span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.3px;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.footer-hint {
    animation: pulse 2s infinite;
}

/* --- PREMIUM ADDITIONS --- */

/* 1. Cinematic Preloader */
.preloader {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #020617;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.2s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-logo {
    width: 200px; /* Increased from 120px */
    height: auto;
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0));
    animation: preloaderPulse 2.5s infinite ease-in-out;
}

@keyframes preloaderPulse {
    0%, 100% { opacity: 0.5; filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.4)); transform: scale(1); }
    50% { opacity: 1; filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.8)); transform: scale(1.05); }
}

/* 2. App Container Entrance Animation */
.app-container {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 0.3s;
    /* Ensure existing flex properties are kept */
    width: 100%;
    max-width: 480px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px; /* Reduced from 24px to make card larger on mobile */
    position: relative;
    z-index: 10;
}

.app-container.ready {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 3. Ambient Dynamic Background */
.ambient-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.6;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: floatOrb 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 70vw; height: 70vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
    top: -20%; left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
    bottom: -10%; right: -20%;
    animation-delay: -10s;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, 10%) scale(1.1); }
    100% { transform: translate(-5%, -5%) scale(0.95); }
}

/* 4. Holographic Glare Effect */
.glare {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.front-glare {
    mix-blend-mode: soft-light;
    background: linear-gradient(105deg, 
        transparent 20%, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 255, 255, 0.1) 75%, 
        transparent 80%);
}

.back-glare {
    mix-blend-mode: overlay;
    background: linear-gradient(105deg, 
        transparent 20%, 
        rgba(245, 158, 11, 0.1) 25%, 
        rgba(245, 158, 11, 0.4) 50%, 
        rgba(245, 158, 11, 0.1) 75%, 
        transparent 80%);
}

.card:hover .glare,
.card-wrapper.active .glare {
    opacity: 0.8;
}
