/* =========================================
   Design System & Variables
   ========================================= */
:root {
    /* Base Colors - System Default will be handled by JS/Media queries */
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Nepali Flag Inspired Palette for Accents */
    --nepal-red: #dc143c;
    --nepal-blue: #003893;
    
    /* Light Theme (Default fallback) */
    --bg-color: #f5f7fa;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.4);
    --image-bg: #e2ddf0;
    --text-main: #1a1a24;
    --text-muted: #555566;
    --accent: var(--nepal-blue);
    --accent-glow: rgba(0, 56, 147, 0.3);
    --canvas-opacity: 0.15;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-color: #0b0c10;
    --card-bg: rgba(20, 22, 30, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --image-bg: #17141d;
    --text-main: #f0f2f5;
    --text-muted: #a0a4b8;
    --accent: #4facfe; /* Lighter blue for dark mode */
    --accent-glow: rgba(79, 172, 254, 0.2);
    --canvas-opacity: 0.3;
}

/* =========================================
   Reset & Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* =========================================
   Background Canvas
   ========================================= */
#mandala-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: var(--canvas-opacity);
    transition: opacity 0.4s ease;
    pointer-events: none; /* Let clicks pass through */
}

/* =========================================
   Layout & Container
   ========================================= */
.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    z-index: 1;
}

/* =========================================
   Glassmorphism Card
   ========================================= */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.4s ease;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.15);
}

/* =========================================
   Profile Image
   ========================================= */
.image-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
}

#profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--bg-color);
    position: relative;
    z-index: 2;
    background-color: var(--image-bg); /* Fallback color if image is missing */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent), var(--nepal-red), var(--accent));
    filter: blur(15px);
    opacity: 0.6;
    z-index: 1;
    animation: rotateGlow 10s linear infinite;
}

.image-wrapper:hover #profile-img {
    transform: scale(1.05);
}

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

/* =========================================
   Typography & Content
   ========================================= */
.content-wrapper {
    width: 100%;
}

.name {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-main), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.designation {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.description {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   Buttons & Links
   ========================================= */
.links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(150, 150, 150, 0.1);
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.social-btn:hover {
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--accent-glow);
}

.social-btn:hover::before {
    opacity: 1;
}

.social-btn svg {
    transition: transform 0.3s ease;
}

.social-btn:hover svg {
    transform: scale(1.1);
}

/* =========================================
   Theme Toggle
   ========================================= */
#theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(8px);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 480px) {
    .glass-panel {
        padding: 2.5rem 1.5rem;
    }
    
    .name {
        font-size: 1.8rem;
    }
    
    .links {
        flex-direction: column;
        width: 100%;
    }
    
    .social-btn {
        justify-content: center;
        width: 100%;
    }
    
    #theme-toggle {
        top: 1rem;
        right: 1rem;
    }
}
