@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

        /* ── Avatar Glow Ring ─────────────────────────────── */
        #avatar-ring-wrap {
            position: relative;
            width: 44px; height: 44px;
            cursor: pointer;
            flex-shrink: 0;
        }

        /* blurred colour bloom behind the ring */
        #avatar-ring-wrap::before {
            content: '';
            position: absolute;
            inset: -6px;
            border-radius: 50%;
            background: conic-gradient(from 0deg, var(--avatar-c1, #3b82f6), var(--avatar-c2, #06b6d4), var(--avatar-c1, #3b82f6));
            filter: blur(10px);
            opacity: 0.65;
            animation: avatar-ring-spin 2.8s linear infinite;
            z-index: 0;
        }

        /* sharp spinning ring */
        #avatar-ring-spin {
            position: absolute;
            inset: -3px;
            border-radius: 50%;
            background: conic-gradient(from 0deg, var(--avatar-c1, #3b82f6) 0%, var(--avatar-c2, #06b6d4) 40%, transparent 65%, var(--avatar-c1, #3b82f6) 100%);
            animation: avatar-ring-spin 2.8s linear infinite;
            z-index: 1;
        }

        @keyframes avatar-ring-spin {
            to { transform: rotate(360deg); }
        }

        /* inner circle — solid dark bg + emoji */
        #avatar-inner-circle {
            position: absolute;
            inset: 3px;
            border-radius: 50%;
            background: rgba(0, 10, 26, 0.95);
            display: flex; align-items: center; justify-content: center;
            font-size: 1.35rem;
            z-index: 2;
            border: 1px solid rgba(255,255,255,0.06);
        }

        #avatar-ring-wrap:hover #avatar-ring-spin,
        #avatar-ring-wrap:hover::before {
            animation-duration: 1.2s;
        }
        
        body {
            font-family: 'Inter', sans-serif;
            background: linear-gradient(135deg, #000a1a 0%, #0a0f1f 50%, #001a33 100%) fixed;
            color: #e5e5e5;
            scroll-behavior: smooth;
            position: relative;
            overflow-x: hidden;
        }

        /* Content Z-index Management */
        #app-content {
            position: relative;
            z-index: 10;
        }

        main {
            position: relative;
            z-index: 10;
        }

        footer {
            position: relative;
            z-index: 10;
        }

        /* Glassmorphism Navigation */
        .glass-nav { 
            background: rgba(0, 10, 26, 0.85); 
            backdrop-filter: blur(16px);
            border-bottom: 1px solid rgba(59, 130, 246, 0.15); 
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        }

        .page-transition { animation: fadeIn 0.4s ease-out; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        
        /* Glass Bubble Navigation Links */
        .nav-link-glass {
            position: relative;
            padding: 0.5rem 1.25rem;
            border-radius: 9999px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: #cbd5e1;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            cursor: pointer;
            font-weight: 600;
            font-size: 0.9rem;
            overflow: hidden;
        }

        .nav-link-glass::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.6s ease;
            pointer-events: none;
        }

        .nav-link-glass:hover::before {
            left: 100%;
        }

        .nav-link-glass:hover {
            background: rgba(59, 130, 246, 0.3);
            border-color: rgba(59, 130, 246, 0.5);
            color: #e2e8f0;
            box-shadow: 0 8px 32px rgba(59, 130, 246, 0.25), inset 0 0 20px rgba(59, 130, 246, 0.1);
            transform: translateY(-3px);
            backdrop-filter: blur(20px);
        }

        .nav-link-glass.active {
            background: rgba(59, 130, 246, 0.4);
            border-color: rgba(59, 130, 246, 0.8);
            color: #3b82f6;
            box-shadow: 0 12px 40px rgba(59, 130, 246, 0.4), inset 0 0 30px rgba(59, 130, 246, 0.2);
        }

        .nav-link-active { color: #3b82f6; border-bottom: 2px solid #3b82f6; }
        
        .hidden-access { display: none !important; }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-8px); }
            50% { transform: translateX(8px); }
            75% { transform: translateX(-8px); }
        }
        .shake-error {
            animation: shake 0.4s ease-in-out;
            border-color: #ef4444 !important;
        }

        .free-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            background: #222;
            color: white;
            font-size: 10px;
            font-weight: 800;
            padding: 3px 8px;
            border-radius: 9999px;
            z-index: 10;
        }

        .dna-stage {
            width: 100%;
            position: relative;
            height: 220px;
            overflow: hidden;
            border-radius: 1.75rem;
            background:
                radial-gradient(circle at 18% 30%, rgba(34, 211, 238, 0.22), transparent 28%),
                radial-gradient(circle at 82% 70%, rgba(168, 85, 247, 0.2), transparent 30%),
                linear-gradient(135deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.88));
            border: 1px solid rgba(125, 211, 252, 0.22);
            box-shadow: inset 0 0 50px rgba(34, 211, 238, 0.08), 0 18px 50px rgba(0, 0, 0, 0.3);
        }

        .dna-stage::before,
        .dna-stage::after {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 2;
        }

        .dna-stage::before {
            background:
                linear-gradient(90deg, rgba(2, 6, 23, 0.95), transparent 12%, transparent 88%, rgba(2, 6, 23, 0.95)),
                linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 16%, transparent 84%, rgba(255, 255, 255, 0.05));
        }

        .dna-stage::after {
            background-image:
                linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
                linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
            background-size: 32px 32px;
            opacity: 0.45;
        }

        #latestDnaCanvas {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            display: block;
            z-index: 1;
        }

        @media (max-width: 640px) {
            .dna-stage {
                height: 170px;
                border-radius: 1.25rem;
            }
        }

        #mobile-menu-dropdown {
            display: none;
            background: #111;
            border: 1px solid #222;
            transform-origin: top right;
            animation: scaleIn 0.2s ease-out;
        }
        @keyframes scaleIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        /* Physics Concepts Section */
        .physics-concepts {
            margin-top: 4rem;
            margin-bottom: 3rem;
        }

        .concepts-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 2rem;
            margin-top: 2rem;
        }

        .concept-card {
            position: relative;
            overflow: hidden;
            border-radius: 1.5rem;
            border: 1px solid rgba(148, 163, 184, 0.2);
            background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
            transition: all 0.4s ease;
            cursor: pointer;
            transform: translateY(100px);
            opacity: 0;
        }

        .concept-card.scroll-visible {
            animation: slideInUp 0.6s ease forwards;
        }

        @keyframes slideInUp {
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .concept-card:hover {
            border-color: #3b82f6;
            box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
            transform: translateY(-8px);
        }

        .concept-image {
            width: 100%;
            height: 200px;
            background: linear-gradient(135deg, #1e40af 0%, #06b6d4 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 4rem;
            position: relative;
            overflow: hidden;
        }

        .concept-image::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
            animation: shimmer 2s infinite;
        }

        @keyframes shimmer {
            100% { left: 100%; }
        }

        .concept-image.gravity { background: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%); }
        .concept-image.motion { background: linear-gradient(135deg, #dc2626 0%, #f97316 100%); }
        .concept-image.energy { background: linear-gradient(135deg, #16a34a 0%, #84cc16 100%); }
        .concept-image.waves { background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%); }
        .concept-image.optics { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
        .concept-image.electricity { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); }

        .concept-content {
            padding: 1.5rem;
        }

        .concept-title {
            font-size: 1.25rem;
            font-weight: bold;
            color: #e2e8f0;
            margin-bottom: 0.75rem;
        }

        .concept-description {
            font-size: 0.875rem;
            color: #cbd5e1;
            line-height: 1.6;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.4s ease;
        }

        .concept-card.expanded .concept-description {
            max-height: 200px;
        }

        .concept-tag {
            display: inline-block;
            background: rgba(59, 130, 246, 0.2);
            color: #60a5fa;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: bold;
            margin-top: 1rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .concept-icon {
            animation: float 3s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
        }

        .pulse-animation {
            animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
        }

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

        .physics-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1rem;
            padding-left: 0.5rem;
        }

        .physics-header i {
            font-size: 1.5rem;
            color: #06b6d4;
        }

        .physics-header h2 {
            font-size: 1.5rem;
            font-weight: bold;
            margin-bottom: 0;
            color: white;
        }

        /* Famous Physicists Section */
        .physicists-section {
            margin-top: 4rem;
            margin-bottom: 3rem;
        }

        .physicists-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 2rem;
            margin-top: 2rem;
        }

        .physicist-card {
            position: relative;
            overflow: hidden;
            border-radius: 1.5rem;
            border: 1px solid rgba(148, 163, 184, 0.2);
            background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
            transition: all 0.5s ease;
            transform: translateY(100px);
            opacity: 0;
            text-align: center;
        }

        .physicist-card.scroll-visible {
            animation: slideInUp 0.6s ease forwards;
        }

        .physicist-card:hover {
            border-color: #f59e0b;
            box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
            transform: translateY(-12px);
        }

        .physicist-image {
            width: 100%;
            height: 280px;
            background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 8rem;
            position: relative;
            overflow: hidden;
        }

        .physicist-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .physicist-card:hover .physicist-image img {
            transform: scale(1.1);
        }

        .physicist-image::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, transparent 0%, rgba(0,0,0,0.2) 100%);
        }

        .physicist-content {
            padding: 1.5rem;
        }

        .physicist-name {
            font-size: 1.25rem;
            font-weight: bold;
            color: #fbbf24;
            margin-bottom: 0.5rem;
        }

        .physicist-era {
            font-size: 0.875rem;
            color: #94a3b8;
            margin-bottom: 1rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 600;
        }

        .physicist-bio {
            font-size: 0.85rem;
            color: #cbd5e1;
            line-height: 1.5;
            margin-bottom: 1rem;
            min-height: 60px;
        }

        .physicist-contribution {
            display: inline-block;
            background: rgba(245, 158, 11, 0.1);
            color: #fbbf24;
            padding: 0.5rem 1rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border: 1px solid rgba(245, 158, 11, 0.3);
        }

        /* Story Pop-up Modal */
        .story-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 200;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(4px);
        }

        .story-modal.active {
            display: flex;
            animation: fadeInModal 0.4s ease-out;
        }

        @keyframes fadeInModal {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        .story-modal-content {
            background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
            border: 2px solid rgba(220, 38, 38, 0.3);
            border-radius: 2rem;
            padding: 3rem;
            max-width: 500px;
            width: 90%;
            text-align: center;
            animation: slideUp 0.5s ease-out;
            box-shadow: 0 25px 50px rgba(220, 38, 38, 0.3);
            position: relative;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .story-modal-close {
            position: absolute;
            top: 1rem;
            right: 1rem;
            background: rgba(220, 38, 38, 0.2);
            border: none;
            color: #fca5a5;
            font-size: 1.5rem;
            cursor: pointer;
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .story-modal-close:hover {
            background: rgba(220, 38, 38, 0.5);
            transform: rotate(90deg);
        }

        .story-modal-icon {
            font-size: 3.5rem;
            margin-bottom: 1rem;
            animation: float 3s ease-in-out infinite;
        }

        .story-modal-title {
            font-size: 1.75rem;
            font-weight: 900;
            color: #fca5a5;
            margin-bottom: 1rem;
            text-shadow: 0 2px 10px rgba(220, 38, 38, 0.3);
        }

        .story-modal-description {
            color: #cbd5e1;
            line-height: 1.7;
            margin-bottom: 2rem;
            font-size: 0.95rem;
        }

        .story-modal-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        .story-btn {
            padding: 0.75rem 1.5rem;
            border-radius: 9999px;
            font-weight: 600;
            border: none;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-block;
            font-size: 0.95rem;
        }

        .story-btn-primary {
            background: linear-gradient(135deg, #7c3aed 0%, #dc2626 100%);
            color: white;
            box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
        }

        .story-btn-primary:hover {
            box-shadow: 0 15px 40px rgba(220, 38, 38, 0.5);
            transform: translateY(-2px);
        }

        .story-btn-secondary {
            background: rgba(220, 38, 38, 0.2);
            color: #fca5a5;
            border: 1px solid rgba(220, 38, 38, 0.5);
        }

        .story-btn-secondary:hover {
            background: rgba(220, 38, 38, 0.3);
            border-color: #dc2626;
        }
