/**
 * SPATIAL UI DESIGN SYSTEM
 * Inspired by Apple VisionOS & Next-Gen Spatial Interfaces
 * Architected for Himanshu Rajbhar - Digital Hub
 */

:root {
    /* Spatial Palette - Deep Space (Default) */
    --bg-base: #060814;
    --bg-surface: rgba(15, 23, 42, 0.65);
    --bg-surface-elevated: rgba(30, 41, 59, 0.7);
    --bg-surface-hover: rgba(51, 65, 85, 0.5);
    --bg-glass-card: rgba(255, 255, 255, 0.05);
    --bg-glass-card-hover: rgba(255, 255, 255, 0.1);
    
    /* Spatial Specular & Chamfer Edges */
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-glass-hover: rgba(255, 255, 255, 0.3);
    --specular-highlight: rgba(255, 255, 255, 0.25);
    --shadow-depth-1: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-depth-2: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px -10px rgba(99, 102, 241, 0.2);
    --shadow-depth-3: 0 35px 80px -20px rgba(0, 0, 0, 0.8), 0 0 60px -15px rgba(34, 211, 238, 0.25);
    
    /* Accent Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-amber: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    --gradient-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-gold: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    
    /* Text Hierarchy */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.82);
    --text-muted: rgba(255, 255, 255, 0.55);
    --text-dim: rgba(255, 255, 255, 0.38);
    
    /* Spatial Orb Glows */
    --orb-1: #4f46e5;
    --orb-2: #06b6d4;
    --orb-3: #ec4899;
    --orb-4: #8b5cf6;

    /* Blur and Spring */
    --blur-glass: blur(24px) saturate(190%);
    --blur-heavy: blur(40px) saturate(200%);
    --spring-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Alternate Theme: Aurora Borealis */
[data-theme="aurora"] {
    --bg-base: #031412;
    --bg-surface: rgba(6, 44, 38, 0.65);
    --bg-surface-elevated: rgba(13, 68, 59, 0.7);
    --orb-1: #059669;
    --orb-2: #0d9488;
    --orb-3: #0284c7;
    --orb-4: #10b981;
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #3b82f6 100%);
}

/* Alternate Theme: Sunset Nebula */
[data-theme="sunset"] {
    --bg-base: #14050d;
    --bg-surface: rgba(43, 13, 30, 0.65);
    --bg-surface-elevated: rgba(70, 20, 48, 0.7);
    --orb-1: #f43f5e;
    --orb-2: #8b5cf6;
    --orb-3: #fb923c;
    --orb-4: #e11d48;
    --gradient-primary: linear-gradient(135deg, #f43f5e 0%, #fb923c 50%, #facc15 100%);
}

/* Alternate Theme: Sol Daylight Glass */
[data-theme="sol"] {
    --bg-base: #e2e8f0;
    --bg-surface: rgba(255, 255, 255, 0.75);
    --bg-surface-elevated: rgba(255, 255, 255, 0.9);
    --bg-surface-hover: rgba(241, 245, 249, 0.8);
    --bg-glass-card: rgba(255, 255, 255, 0.6);
    --bg-glass-card-hover: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(0, 0, 0, 0.08);
    --border-glass-hover: rgba(99, 102, 241, 0.3);
    --specular-highlight: rgba(255, 255, 255, 0.9);
    --shadow-depth-1: 0 10px 25px -5px rgba(0, 0, 0, 0.07);
    --shadow-depth-2: 0 20px 45px -10px rgba(99, 102, 241, 0.15);
    --shadow-depth-3: 0 30px 60px -15px rgba(0, 0, 0, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --orb-1: #a5b4fc;
    --orb-2: #bae6fd;
    --orb-3: #fbcfe8;
    --orb-4: #ddd6fe;
}

/* CSS Reset & Baseline */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-base);
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-base);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    transition: background-color 0.6s var(--spring-smooth), color 0.4s ease;
    user-select: none;
}

/* Selection */
::selection {
    background: rgba(99, 102, 241, 0.4);
    color: #ffffff;
}

/* ==========================================================================
   SPATIAL BACKGROUND & AMBIENT NEBULA
   ========================================================================== */
.spatial-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.spatial-grid {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px, 80px 80px;
    background-position: 0 0, 20px 20px;
    opacity: 0.7;
    mask-image: radial-gradient(circle at 50% 50%, black 40%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 40%, transparent 85%);
}

.spatial-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    mix-blend-mode: screen;
    will-change: transform;
    transition: transform 0.2s ease-out, background 0.8s ease;
}

[data-theme="sol"] .spatial-orb {
    mix-blend-mode: multiply;
    opacity: 0.4;
    filter: blur(100px);
}

.orb-primary {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, var(--orb-1) 0%, transparent 70%);
    top: -120px;
    left: -120px;
    animation: orbFloat1 22s ease-in-out infinite alternate;
}

.orb-secondary {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, var(--orb-2) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    animation: orbFloat2 26s ease-in-out infinite alternate;
}

.orb-accent {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, var(--orb-3) 0%, transparent 70%);
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat3 18s ease-in-out infinite alternate;
}

.orb-glow {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, var(--orb-4) 0%, transparent 70%);
    top: 75%;
    left: 10%;
    animation: orbFloat4 20s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, 120px) scale(1.15); }
    100% { transform: translate(-40px, 60px) scale(0.95); }
}

@keyframes orbFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-100px, -90px) scale(1.2); }
    100% { transform: translate(50px, -40px) scale(0.9); }
}

@keyframes orbFloat3 {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-30%, -70%) scale(1.12); }
    100% { transform: translate(-70%, -30%) scale(0.92); }
}

@keyframes orbFloat4 {
    0% { transform: translate(0, 0) scale(0.9); }
    50% { transform: translate(70px, -80px) scale(1.1); }
    100% { transform: translate(-50px, 40px) scale(1); }
}

/* ==========================================================================
   LAYOUT CONTAINER
   ========================================================================== */
.spatial-container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 30px 20px 100px;
    position: relative;
    z-index: 10;
    perspective: 1200px;
}

/* ==========================================================================
   TOP FLOATING STATUS PILL BAR
   ========================================================================== */
.spatial-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 9999px;
    background: var(--bg-surface);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-depth-1);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s var(--spring-smooth);
}

.status-pill:hover {
    border-color: var(--border-glass-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-depth-2);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    position: relative;
    box-shadow: 0 0 10px #10b981;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid #10b981;
    animation: statusPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes statusPulse {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

.status-clock {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 4px;
    padding-left: 8px;
    border-left: 1px solid var(--border-glass);
}

/* Floating Utility Controls (Audio & Theme) */
.spatial-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-surface);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s var(--spring-bounce);
    position: relative;
    outline: none;
}

.control-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-glass-hover);
    transform: translateY(-2px) scale(1.05);
    background: var(--bg-surface-elevated);
    box-shadow: var(--shadow-depth-1);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.active {
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

/* Sound wave animation inside audio button */
.sound-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.sound-bar {
    width: 2.5px;
    background: currentColor;
    border-radius: 2px;
    transition: height 0.2s ease;
}

.sound-bar:nth-child(1) { height: 6px; }
.sound-bar:nth-child(2) { height: 12px; }
.sound-bar:nth-child(3) { height: 8px; }

.control-btn.sound-playing .sound-bar:nth-child(1) {
    animation: soundAnim1 0.8s ease-in-out infinite alternate;
}
.control-btn.sound-playing .sound-bar:nth-child(2) {
    animation: soundAnim2 0.7s ease-in-out infinite alternate 0.2s;
}
.control-btn.sound-playing .sound-bar:nth-child(3) {
    animation: soundAnim3 0.9s ease-in-out infinite alternate 0.1s;
}

@keyframes soundAnim1 { from { height: 4px; } to { height: 13px; } }
@keyframes soundAnim2 { from { height: 14px; } to { height: 5px; } }
@keyframes soundAnim3 { from { height: 7px; } to { height: 14px; } }

/* ==========================================================================
   SPATIAL PROFILE CARD
   ========================================================================== */
.spatial-card {
    background: var(--bg-surface);
    backdrop-filter: var(--blur-glass);
    border-radius: 32px;
    padding: 44px 32px 36px;
    text-align: center;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-depth-2);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.25s var(--spring-smooth);
    margin-bottom: 28px;
}

/* Chamfered Optical Light Bevel */
.spatial-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 32px;
    padding: 1px;
    background: linear-gradient(135deg, var(--specular-highlight) 0%, rgba(255, 255, 255, 0.05) 40%, transparent 70%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Card Mouse Interactive Specular Glare */
.spatial-card-glare {
    position: absolute;
    inset: 0;
    border-radius: 32px;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.12), transparent 45%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    mix-blend-mode: overlay;
    z-index: 1;
}

.spatial-card:hover .spatial-card-glare {
    opacity: 1;
}

/* Avatar Orbital Stage */
.avatar-orbital-stage {
    position: relative;
    width: 154px;
    height: 154px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateZ(40px);
}

.orbital-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.ring-outer {
    width: 172px;
    height: 172px;
    border: 1.5px dashed rgba(99, 102, 241, 0.4);
    animation: ringOrbit 20s linear infinite;
}

.ring-inner {
    width: 160px;
    height: 160px;
    border: 2px solid transparent;
    border-top-color: #06b6d4;
    border-bottom-color: #a855f7;
    animation: ringOrbitReverse 12s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.ring-satellite {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 12px #ffffff, 0 0 24px #38bdf8;
}

@keyframes ringOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes ringOrbitReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.avatar-core {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: relative;
    z-index: 3;
    padding: 4px;
    background: var(--gradient-primary);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 30px rgba(99, 102, 241, 0.35);
    animation: avatarFloat 4s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: #1e293b;
    display: block;
    border: 3px solid rgba(255, 255, 255, 0.9);
    transition: filter 0.5s ease;
}

/* Verified Badge */
.verified-spatial-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    border: 3px solid var(--bg-base);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.6);
    z-index: 4;
}

/* Typography in Profile */
.profile-title-group {
    transform: translateZ(30px);
}

.profile-name {
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.15;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.profile-role {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 6px 16px;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    margin-bottom: 20px;
}

[data-theme="sol"] .profile-role {
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
}

.profile-bio {
    font-size: 0.975rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto 12px;
}

.profile-sub-bio {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 28px;
}

/* Interactive Pill Badges */
.profile-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.chip-item {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

/* ==========================================================================
   STATS GRID
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 32px;
}

.stat-spatial-card {
    background: var(--bg-surface);
    backdrop-filter: var(--blur-glass);
    border-radius: 22px;
    padding: 20px 14px;
    text-align: center;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-depth-1);
    transition: all 0.3s var(--spring-smooth);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.stat-spatial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.stat-spatial-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-depth-2);
}

.stat-spatial-card:hover::before {
    left: 100%;
}

.stat-icon {
    font-size: 1.1rem;
    color: #818cf8;
    margin-bottom: 8px;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.stat-title {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.stat-subtext {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   SECTION TITLES
   ========================================================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 4px;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.section-label i {
    color: #818cf8;
    font-size: 0.9rem;
}

.section-tagline {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ==========================================================================
   FEATURED APPS (SPATIAL 3D LINK CARDS)
   ========================================================================== */
.apps-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 36px;
}

.spatial-link-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-radius: 24px;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-surface);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-depth-1);
    transform-style: preserve-3d;
    transition: all 0.35s var(--spring-smooth);
    overflow: hidden;
    cursor: pointer;
}

/* 3D Specular glare effect on link cards */
.link-glare {
    position: absolute;
    inset: 0;
    background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.15), transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spatial-link-item:hover .link-glare {
    opacity: 1;
}

.spatial-link-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.spatial-link-item:hover {
    transform: translateY(-5px) scale(1.015);
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-depth-2);
}

.spatial-link-item:active {
    transform: translateY(-1px) scale(0.99);
}

/* Specific Accents for featured cards */
.spatial-link-item[data-app="stock-simulator"]:hover {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 20px 45px -10px rgba(245, 158, 11, 0.25);
}

.spatial-link-item[data-app="financial-calculator"]:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 20px 45px -10px rgba(168, 85, 247, 0.25);
}

.spatial-link-item[data-app="finance-chemistry"]:hover {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 20px 45px -10px rgba(236, 72, 153, 0.25);
}

.link-main {
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 2;
    flex: 1;
}

.link-icon-box {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s var(--spring-bounce);
}

.spatial-link-item:hover .link-icon-box {
    transform: scale(1.1) rotateZ(-3deg);
}

.link-details {
    flex: 1;
    min-width: 0;
}

.link-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.link-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.spatial-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000000;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.badge-violet {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.badge-cyan {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

.link-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.link-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 1rem;
    margin-left: 12px;
    flex-shrink: 0;
    transition: all 0.3s var(--spring-smooth);
}

.spatial-link-item:hover .link-action {
    background: var(--text-primary);
    color: var(--bg-base);
    transform: translateX(4px) scale(1.08);
}

/* ==========================================================================
   DROPDOWN & INTERACTIVE ACCORDION
   ========================================================================== */
.dropdown-trigger {
    cursor: pointer;
}

.dropdown-arrow {
    transition: transform 0.35s var(--spring-smooth);
}

.dropdown-trigger.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-spatial-drawer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.45s var(--spring-smooth), opacity 0.3s ease, margin 0.35s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
}

.dropdown-trigger.open + .dropdown-spatial-drawer {
    max-height: 400px;
    opacity: 1;
    margin-top: 10px;
}

.drawer-subcard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: 18px;
    background: var(--bg-surface-elevated);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s var(--spring-smooth);
}

.drawer-subcard:hover {
    background: var(--bg-surface-hover);
    transform: translateX(6px);
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-depth-1);
}

.drawer-subcard-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
}

.drawer-subcard-content {
    flex: 1;
}

.drawer-subcard-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-subcard-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.store-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 2px 8px;
    border-radius: 6px;
}

/* ==========================================================================
   SPATIAL SOCIAL SECTION
   ========================================================================== */
.social-glass-pod {
    background: var(--bg-surface);
    backdrop-filter: var(--blur-glass);
    border-radius: 28px;
    padding: 24px;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-depth-1);
    margin-bottom: 32px;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.social-spatial-btn {
    aspect-ratio: 1;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 1.45rem;
    position: relative;
    overflow: hidden;
    transition: all 0.35s var(--spring-bounce);
    cursor: pointer;
}

.social-spatial-btn span {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.85;
}

.social-spatial-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.25), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-spatial-btn:hover {
    transform: translateY(-8px) scale(1.08);
    box-shadow: var(--shadow-depth-2);
    color: #ffffff;
}

.social-spatial-btn:hover::before {
    opacity: 1;
}

.social-spatial-btn.linkedin:hover {
    background: rgba(0, 119, 182, 0.35);
    border-color: rgba(0, 119, 182, 0.8);
    box-shadow: 0 15px 35px -5px rgba(0, 119, 182, 0.4);
}

.social-spatial-btn.email:hover {
    background: rgba(220, 53, 69, 0.35);
    border-color: rgba(220, 53, 69, 0.8);
    box-shadow: 0 15px 35px -5px rgba(220, 53, 69, 0.4);
}

.social-spatial-btn.facebook:hover {
    background: rgba(24, 119, 242, 0.35);
    border-color: rgba(24, 119, 242, 0.8);
    box-shadow: 0 15px 35px -5px rgba(24, 119, 242, 0.4);
}

.social-spatial-btn.instagram:hover {
    background: rgba(225, 48, 108, 0.35);
    border-color: rgba(225, 48, 108, 0.8);
    box-shadow: 0 15px 35px -5px rgba(225, 48, 108, 0.4);
}

/* ==========================================================================
   PRIMARY CTAs & SPATIAL DOCK
   ========================================================================== */
.cta-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 40px;
}

.spatial-cta-btn {
    padding: 16px 22px;
    border-radius: 20px;
    border: none;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.35s var(--spring-smooth);
    position: relative;
    overflow: hidden;
    outline: none;
}

.spatial-cta-btn.primary {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.5);
}

.spatial-cta-btn.primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 18px 45px -8px rgba(99, 102, 241, 0.7);
}

.spatial-cta-btn.secondary {
    background: var(--bg-surface);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    box-shadow: var(--shadow-depth-1);
}

.spatial-cta-btn.secondary:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--border-glass-hover);
    background: var(--bg-surface-elevated);
    box-shadow: var(--shadow-depth-2);
}

.spatial-cta-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Ripple click effect */
.ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: rippleAnim 0.6s linear;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.spatial-footer {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.footer-copy {
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.footer-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ==========================================================================
   SPATIAL FLOATING DOCK (VISIONOS CAPSULE)
   ========================================================================== */
.spatial-floating-dock {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    backdrop-filter: var(--blur-heavy);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-depth-3);
    border-radius: 9999px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    transition: all 0.3s var(--spring-smooth);
}

.spatial-floating-dock:hover {
    border-color: var(--border-glass-hover);
    box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.3);
}

.dock-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 9999px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--spring-bounce);
    outline: none;
    text-decoration: none;
}

.dock-item i {
    font-size: 0.95rem;
}

.dock-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.dock-item.dock-cta {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.dock-item.dock-cta:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.dock-divider {
    width: 1px;
    height: 20px;
    background: var(--border-glass);
}

/* ==========================================================================
   MODAL WINDOWS (VISIONOS SPATIAL SHEETS)
   ========================================================================== */
.spatial-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 20, 0.75);
    backdrop-filter: blur(16px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.spatial-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spatial-modal-dialog {
    width: 100%;
    max-width: 480px;
    background: var(--bg-surface);
    backdrop-filter: var(--blur-heavy);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    padding: 32px;
    box-shadow: var(--shadow-depth-3);
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s var(--spring-bounce), opacity 0.3s ease;
    opacity: 0;
}

.spatial-modal-overlay.active .spatial-modal-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.modal-close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Modal Form Styles */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
}

.form-select option {
    background: #0f172a;
    color: #ffffff;
}

/* QR Code Display in Modal */
.qr-container {
    padding: 24px;
    border-radius: 20px;
    background: #ffffff;
    display: inline-block;
    margin: 10px auto 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#qrcode-canvas {
    display: block;
}

/* ==========================================================================
   TOAST NOTIFICATION (SPATIAL HUD)
   ========================================================================== */
.spatial-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-surface);
    backdrop-filter: var(--blur-heavy);
    border: 1px solid var(--border-glass);
    border-radius: 9999px;
    padding: 12px 24px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-depth-3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: all 0.4s var(--spring-bounce);
    pointer-events: none;
}

.spatial-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.spatial-toast i {
    color: #10b981;
}

/* ==========================================================================
   MOBILE & RESPONSIVE REFINEMENTS
   ========================================================================== */
@media (max-width: 640px) {
    .spatial-container {
        padding: 20px 16px 90px;
    }

    .spatial-card {
        padding: 36px 20px 28px;
        border-radius: 26px;
    }

    .profile-name {
        font-size: 1.85rem;
    }

    .stats-grid {
        gap: 8px;
    }

    .stat-spatial-card {
        padding: 14px 8px;
        border-radius: 16px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-title {
        font-size: 0.65rem;
    }

    .spatial-link-item {
        padding: 16px;
        border-radius: 18px;
    }

    .link-icon-box {
        width: 46px;
        height: 46px;
        font-size: 1.5rem;
        border-radius: 14px;
    }

    .link-title {
        font-size: 0.95rem;
    }

    .link-description {
        font-size: 0.775rem;
    }

    .social-glass-pod {
        padding: 18px;
        border-radius: 22px;
    }

    .social-grid {
        gap: 10px;
    }

    .social-spatial-btn {
        font-size: 1.25rem;
        border-radius: 16px;
    }

    .cta-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .spatial-floating-dock {
        width: calc(100% - 32px);
        justify-content: space-around;
        bottom: 16px;
        padding: 6px 10px;
    }

    .dock-item span {
        display: none;
    }

    .dock-item {
        padding: 8px 12px;
    }
}
