/* Global Theme Variables */
:root {
    /* Light Mode Colors */
    --bg-body: #ffffff;
    --text-body: #111827;
    /* gray-900 */
    --text-muted: #4b5563;
    /* gray-600 */

    --bg-glass: rgba(255, 255, 255, 0.6);
    --border-glass: rgba(229, 231, 235, 1);
    /* gray-200 */

    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-strength: 0.1;
}

.dark {
    /* Dark Mode Colors (Neutral Palette) */
    --bg-body: #0a0a0a;
    /* neutral-950 */
    --text-body: #f5f5f5;
    /* neutral-100 */
    --text-muted: #a3a3a3;
    /* neutral-400 */

    --bg-glass: rgba(23, 23, 23, 0.6);
    /* neutral-900/60 */
    --border-glass: rgba(255, 255, 255, 0.1);

    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-strength: 0.5;
}

/* Base Styles */
body {
    background-color: var(--bg-body);
    color: var(--text-body);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Glass Panel Component */
.glass-panel {
    background-color: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;

    /* Shadow XL */
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .glass-panel {
    /* Shadow 2XL */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Typography Utilities */
.text-body {
    color: var(--text-body);
}

.text-muted {
    color: var(--text-muted);
}

/* Transitions */
.transition-theme {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* --- Hero Section Styles --- */
.mesh-gradient {
    background-color: #0f172a;
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(192, 100%, 35%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(16, 100%, 50%, 1) 0, transparent 50%),
        radial-gradient(at 50% 50%, hsla(210, 100%, 45%, 1) 0, transparent 50%);
}

.hero-container {
    position: relative;
    overflow: hidden;
    background-color: #1a3c5e;
    /* Base Blue */
    transition: background-color 1s ease;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    /* Fade in when loaded */
    transition: opacity 1s ease;
}

.hero-canvas-loaded #hero-canvas {
    opacity: 1;
}

.gradient-text {
    background-image: linear-gradient(120deg, #6366f1, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.card-gradient-1 {
    background-image: linear-gradient(135deg, #4f46e5, #7c3aed, #ec4899);
}

.card-gradient-2 {
    background-image: linear-gradient(135deg, #0f766e, #22c55e, #eab308);
}

.bento-shadow {
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.4);
}

@keyframes float-soft {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float-soft 6s ease-in-out infinite;
}

.number-glow {
    text-shadow: 0 0 40px rgba(129, 140, 248, 0.7);
}

.paper-content {
    font-family: Inter, sans-serif;
    line-height: 1.75;
}

.paper-content h2 {
    font-weight: 600;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-body);
}

.paper-content h3 {
    font-weight: 600;
    font-size: 1.125rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-body);
}

.paper-content p {
    margin-top: 1rem;
    margin-bottom: 1rem;
    color: var(--text-body);
}

.paper-content blockquote {
    margin: 1.25rem 0;
    padding: 0.75rem 1rem;
    border-left: 3px solid #6366f1;
    background-color: rgba(99, 102, 241, 0.06);
    border-radius: 0.5rem;
}

.dark .paper-content blockquote {
    background-color: rgba(129, 140, 248, 0.08);
    border-left-color: #818cf8;
}

.paper-content ol,
.paper-content ul {
    margin: 1rem 0 1rem 1.25rem;
}

.paper-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    border: 1px solid rgba(229, 231, 235, 1);
}

.dark .paper-content table {
    border-color: rgba(255, 255, 255, 0.1);
}

.paper-content th,
.paper-content td {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid rgba(229, 231, 235, 1);
    text-align: left;
    vertical-align: top;
}

.dark .paper-content th,
.dark .paper-content td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.paper-content thead th {
    background-color: rgba(249, 250, 251, 1);
    font-weight: 600;
}

.dark .paper-content thead th {
    background-color: rgba(255, 255, 255, 0.04);
}

.paper-content pre {
    background-color: rgba(249, 250, 251, 1);
    border: 1px solid rgba(229, 231, 235, 1);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.dark .paper-content pre {
    background-color: rgba(23, 23, 23, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
}

.paper-content code {
    font-family: 'JetBrains Mono', monospace;
    background-color: rgba(249, 250, 251, 1);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
}

.dark .paper-content code {
    background-color: rgba(255, 255, 255, 0.06);
}

.paper-content a {
    color: #6366f1;
    text-decoration: none;
}

.paper-content a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.toc-link {
    display: block;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    color: #6b7280;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.dark .toc-link {
    color: #a3a3a3;
}

.toc-link:hover {
    color: #111827;
    background-color: rgba(0, 0, 0, 0.03);
    border-left-color: #6366f1;
}

.dark .toc-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
    border-left-color: #818cf8;
}