/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT RESEARCH MANIFESTO — CSS
   Philosophy: Professionalism, Futurism, Minimalism, Dynamism
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --void: #020208;
    --void-deep: #000000;
    --surface: rgba(10, 10, 25, 0.6);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-glow: rgba(108, 99, 255, 0.15);
    
    --accent: #6c63ff;
    --accent-hot: #a78bfa;
    --text-primary: #e2e2f0;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── RESET & BASE ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--void-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── BACKGROUND ─── */
.research-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
}

.void-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, transparent 20%, var(--void-deep) 100%);
    z-index: 1;
}

#research-canvas {
    width: 100%;
    height: 100%;
}

/* ─── NAV & HUD ─── */
.research-nav {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 32px 48px;
    display: flex;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, var(--void-deep) 0%, transparent 100%);
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.3s var(--ease-expo);
}

.nav-back:hover {
    color: var(--accent);
    transform: translateX(-4px);
}

.nav-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-tag {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.4em;
    color: var(--text-muted);
    margin-top: 4px;
}

.nav-metrics {
    display: flex;
    gap: 24px;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.metric .label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.metric .value {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
}

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

/* ─── READING PROGRESS ─── */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 2px;
    z-index: 101;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* ─── MAIN CONTAINER ─── */
.research-container {
    max-width: 900px;
    margin: 160px auto 120px;
    padding: 0 40px;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

/* ─── GLASS PANELS (CORE AESTHETIC) ─── */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 60px;
    position: relative;
    overflow: hidden;
    
    /* Physics-based lighting: bright top-left, dark bottom-right */
    box-shadow: 
        inset 1px 1px 0 rgba(255,255,255,0.05),
        inset -1px -1px 0 rgba(0,0,0,0.2),
        0 20px 50px rgba(0,0,0,0.3);
    
    transition: box-shadow 0.6s var(--ease-expo);
}

.glass-panel:hover {
    transform: translateY(-4px);
    transition: transform 0.6s var(--ease-expo), box-shadow 0.6s var(--ease-expo);
    box-shadow: 
        inset 1px 1px 0 rgba(255,255,255,0.08),
        inset -1px -1px 0 rgba(0,0,0,0.3),
        0 30px 60px rgba(0,0,0,0.4),
        0 0 40px var(--glass-glow);
}

.glass-inset {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.02);
    box-shadow: inset 2px 2px 8px rgba(0,0,0,0.4), inset -1px -1px 4px rgba(255,255,255,0.01);
}

/* ─── PAPER HEADER ─── */
.paper-header {
    text-align: center;
    padding: 80px 60px;
}

.header-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.meta-item {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    padding: 4px 12px;
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 4px;
}

.paper-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.paper-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 40px;
}

.author-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.author-avatar {
    width: 48px; height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-avatar img {
    width: 100%; height: 100%;
    object-fit: contain;
}

.author-info {
    text-align: left;
}

.author-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.author-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ─── SECTIONS ─── */
.section-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent);
    letter-spacing: 0.25em;
    margin-bottom: 24px;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(108, 99, 255, 0.3), transparent);
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 30px;
}

.section-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ─── THEORY GRID ─── */
.theory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.theory-card {
    padding: 30px;
    border-radius: 20px;
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.03);
    transition: all 0.4s var(--ease-expo);
}

.theory-card:hover {
    background: rgba(255,255,255,0.03);
    border-color: var(--accent);
}

.theory-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.theory-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.theory-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─── ARCHITECTURE VISUAL ─── */
.arch-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: center;
}

.arch-list {
    list-style: none;
    margin: 24px 0;
}

.arch-list li {
    margin-bottom: 16px;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
}

.arch-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 12px;
    width: 12px; height: 1px;
    background: var(--accent);
}

.arch-list li strong {
    color: var(--text-primary);
    margin-right: 8px;
}

.arch-viz {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.viz-orbit {
    width: 200px; height: 200px;
    position: relative;
    animation: rotate 20s linear infinite;
}

.viz-core {
    position: absolute;
    top: 50%; left: 50%;
    width: 40px; height: 40px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 30px var(--accent);
}

.viz-ring {
    position: absolute;
    top: 50%; left: 50%;
    width: 160px; height: 160px;
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.viz-dot {
    position: absolute;
    width: 8px; height: 8px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff;
}

.d1 { top: 10px; left: 50%; }
.d2 { bottom: 30px; left: 10px; }
.d3 { bottom: 30px; right: 10px; }

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

/* ─── FORMULA BOX ─── */
.formula-box {
    margin-top: 40px;
    padding: 30px;
    text-align: center;
}

.formula-box code {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--accent-hot);
    letter-spacing: 0.05em;
}

/* ─── REFERENCES ─── */
.references-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.ref-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
    line-height: 1.5;
    padding-left: 20px;
    position: relative;
}

.ref-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
    opacity: 0.5;
}

/* ─── FOOTER ─── */
.paper-footer {
    margin-top: 100px;
    padding-bottom: 40px;
}

.footer-line {
    width: 100%; height: 1px;
    background: linear-gradient(to right, transparent, var(--text-muted), transparent);
    margin-bottom: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.footer-links {
    display: flex;
    gap: 24px;
}

/* ─── SIDE TOC ─── */
.side-toc {
    position: fixed;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    /* Removed gap to prevent dead zones */
    padding: 20px 0 20px 40px; /* Extra padding on the left to bridge the mouse path */
}

.toc-dashes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
    cursor: pointer;
}

.toc-dash {
    width: 12px;
    height: 1px;
    background: var(--text-muted);
    opacity: 0.3;
    transition: all 0.3s var(--ease-expo);
}

.toc-dash.active {
    width: 24px;
    background: var(--accent);
    opacity: 1;
    box-shadow: 0 0 10px var(--accent);
}

.toc-panel {
    position: absolute;
    right: 28px; /* Move closer to dashes */
    width: 280px;
    padding: 32px !important;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.4s var(--ease-expo);
    background: rgba(10, 10, 25, 0.95) !important;
    border: 1px solid var(--glass-border) !important;
}

/* Invisible Bridge */
.side-toc::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.side-toc:hover .toc-panel {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.toc-header {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s var(--ease-expo);
}

.toc-link::before {
    content: attr(data-index);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.toc-link:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

.toc-link.active {
    color: var(--accent);
}

@media (max-width: 1200px) {
    .side-toc { display: none; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1000px) {
    .research-container { padding: 0 24px 100px; }
    .glass-panel { padding: 40px; }
    .arch-content { grid-template-columns: 1fr; }
    .arch-viz { height: 200px; }
}

@media (max-width: 600px) {
    .paper-title { font-size: 2.2rem; }
    .paper-header { padding: 40px 20px; }
    .nav-metrics { display: none; }
    .footer-content { flex-direction: column; gap: 20px; text-align: center; }
}
