Soma / frontend /src /components /CognitiveBrainScene.css
Komalpreet Kaur
fix: mobile responsiveness improvements for graph and sleep pages
48a9a61 unverified
/* CognitiveBrainScene.css - "Thinking Screen" Aesthetic */
.brain-viewport {
width: 100%;
height: 100%;
position: relative;
display: flex;
align-items: center;
justify-content: center;
perspective: 1100px;
}
.brain-core {
position: relative;
width: 380px;
height: 380px;
z-index: 10;
transition: transform 0.5s ease;
}
/* ── Exclusive Layer Stacking ── */
.brain-layer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain;
opacity: 0;
transform: scale(0.98);
transition:
opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
filter 0.6s ease;
pointer-events: none;
filter: contrast(1.1);
}
.brain-layer.active {
opacity: 1;
transform: scale(1);
}
/* Ensure only ONE layer is ever visible (The Swap) */
.brain-layer.base.active {
z-index: 1;
}
.brain-layer.region.active {
z-index: 2;
opacity: 1 !important;
}
/* If a region is active, hide the base entirely to avoid overlapping/ghosting */
.brain-viewport:has(.brain-layer.region.active) .brain-layer.base {
opacity: 0 !important;
}
.brain-layer.base.active {
/* Clean slate for multiply blend */
}
.brain-layer.region.active {
/* Clean slate for multiply blend */
}
/* ── Layer 1: Ambient Motion (Breathing) ── */
.ambient-breath {
position: absolute;
inset: 0;
background: radial-gradient(circle, rgba(255, 107, 53, 0.04) 0%, transparent 75%);
animation: breathing 8s infinite ease-in-out;
pointer-events: none;
z-index: -1;
}
@keyframes breathing {
0%, 100% { transform: scale(0.96); opacity: 0.3; }
50% { transform: scale(1.04); opacity: 0.5; }
}
/* ── Layer 2: Cognitive Signals (Floating Labels) ── */
.neural-signals {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 20;
}
.signal-node {
position: absolute;
display: flex;
align-items: center;
gap: 16px;
opacity: 0.2;
transition: all 0.6s ease;
filter: grayscale(1) blur(0.5px);
}
.signal-node.active {
opacity: 1;
filter: grayscale(0) blur(0);
transform: scale(1.1) translateX(10px);
transition: all 0.1s ease-out;
}
.signal-node.hot {
opacity: 1;
filter: grayscale(0) blur(0);
animation: signal-hot-throb 1.5s infinite ease-in-out;
}
@keyframes signal-hot-throb {
0%, 100% { transform: scale(1.1) translateX(10px); filter: brightness(1); }
50% { transform: scale(1.15) translateX(15px); filter: brightness(1.3); }
}
.signal-dot {
width: 10px;
height: 10px;
background-color: #d1d5db;
border-radius: 50%;
box-shadow: none;
transition: all 0.6s ease;
}
.signal-node.active .signal-dot {
transition: all 0.1s ease-out;
}
/* ── Active Color Mapping ── */
.signal-node.active.prefrontal .signal-dot { background-color: #f59e0b; box-shadow: 0 0 15px rgba(245, 158, 11, 0.8); }
.signal-node.active.parietal .signal-dot { background-color: #ff6b35; box-shadow: 0 0 15px rgba(255, 107, 53, 0.8); }
.signal-node.active.temporal .signal-dot { background-color: #10b981; box-shadow: 0 0 15px rgba(16, 185, 129, 0.8); }
.signal-node.active.thalamus-label .signal-dot { background-color: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.8); }
.signal-node.active.prefrontal strong { color: #f59e0b; }
.signal-node.active.parietal strong { color: #ff6b35; }
.signal-node.active.temporal strong { color: #10b981; }
.signal-node.active.thalamus-label strong { color: #3b82f6; }
.signal-copy {
display: flex;
flex-direction: column;
}
.signal-copy strong {
font-size: 0.7rem;
font-weight: 800;
color: #1a1a1a;
line-height: 1.1;
transition: color 0.6s ease;
}
.signal-node.active strong {
transition: color 0.1s ease-out;
}
.signal-copy span {
font-size: 0.6rem;
color: #999;
text-transform: uppercase;
letter-spacing: 0.08em;
font-weight: 600;
}
.prefrontal { top: 5%; left: -60px; }
.parietal { top: 5%; right: -60px; flex-direction: row-reverse; text-align: right; }
.temporal { bottom: 10%; left: -60px; }
.thalamus-label { bottom: 10%; right: -60px; flex-direction: row-reverse; text-align: right; }
/* ── State Glow Hubs (Subtle Ambient Backglow) ── */
.glow-hub {
position: absolute;
width: 400px;
height: 400px;
border-radius: 50%;
filter: blur(100px);
opacity: 0;
transition: opacity 1.2s ease;
pointer-events: none;
z-index: 0;
}
.glow-hub.visible {
opacity: 0.25;
}
.prefrontal-glow { top: 0%; left: 5%; background: radial-gradient(circle, rgba(255, 107, 53, 0.3) 0%, transparent 70%); }
.parietal-glow { top: 0%; right: 5%; background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%); }
.temporal-glow { bottom: 5%; left: 15%; background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%); }
.thalamus-glow { top: 15%; left: 25%; background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, transparent 70%); }
/* ── Listening/Responding Shimmer ── */
.listening-particles {
position: absolute;
inset: 0;
background: radial-gradient(circle, rgba(255, 107, 53, 0.03) 0%, transparent 85%);
animation: brain-shimmer 3s infinite alternate;
z-index: 5;
}
@keyframes brain-shimmer {
from { opacity: 0.1; transform: scale(1); }
to { opacity: 0.3; transform: scale(1.05); }
}
@media (max-width: 768px) {
.brain-core {
max-width: 100% !important;
height: auto !important;
aspect-ratio: 1 / 1 !important;
}
}
/* ── Mobile Responsive Overrides for iPhone 14 ── */
@media (max-width: 480px) {
.brain-core {
width: 240px !important;
height: 240px !important;
margin: 0 auto;
}
.signal-node {
gap: 8px !important;
}
/* Bring offsets inward so they fit cleanly within the 390px iPhone 14 viewport */
.prefrontal { top: -10px !important; left: -20px !important; }
.parietal { top: -10px !important; right: -20px !important; }
.temporal { bottom: 10px !important; left: -20px !important; }
.thalamus-label { bottom: 10px !important; right: -20px !important; }
.signal-copy strong {
font-size: 0.58rem !important;
}
.signal-copy span {
font-size: 0.48rem !important;
}
.glow-hub {
width: 260px !important;
height: 260px !important;
}
}