3131 <!-- Set theme before page renders to prevent flash -->
3232 < script >
3333 ( function ( ) {
34- const theme = localStorage . getItem ( 'theme' ) || 'light' ;
34+ // Check localStorage first, then fall back to system preference
35+ let theme = localStorage . getItem ( 'theme' ) ;
36+ if ( ! theme ) {
37+ // Auto-detect from system preference
38+ theme = window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ? 'dark' : 'light' ;
39+ }
3540 document . documentElement . setAttribute ( 'data-theme' , theme ) ;
3641 } ) ( ) ;
3742 </ script >
162167 opacity : 1 ;
163168 transform : rotate (0deg );
164169 }
170+
171+ .header-right {
172+ display : flex;
173+ align-items : center;
174+ gap : 1.5rem ;
175+ }
176+
177+ .header-divider {
178+ width : 1px ;
179+ height : 1.5rem ;
180+ background-color : var (--border-color );
181+ }
165182
166183 .mission-statement {
167184 border-top : 1px solid var (--border-color );
443460
444461 < div class ="container ">
445462 < header >
446- < div style =" display: flex; gap: 2rem; " >
447- < a href =" # " class ="logo " > Cambrian </ a >
463+ < a href =" # " class =" logo " style =" font-size: 1.5rem; " > Cambrian </ a >
464+ < div class ="header-right " >
448465 < a href ="# " class ="logo "> VISIONx @ NYU</ a >
466+ < div class ="header-divider "> </ div >
467+ < button class ="theme-toggle " id ="theme-toggle " aria-label ="Toggle dark mode ">
468+ < i class ="fas fa-sun "> </ i >
469+ < i class ="fas fa-moon "> </ i >
470+ </ button >
449471 </ div >
450- < button class ="theme-toggle " id ="theme-toggle " aria-label ="Toggle dark mode ">
451- < i class ="fas fa-sun "> </ i >
452- < i class ="fas fa-moon "> </ i >
453- </ button >
454472 </ header >
455473 < div class ="mission-statement ">
456474 < h2 class ="font-styrene text-4xl font-bold mb-4 "> Building Supersensing for Superintelligence</ h2 >
@@ -730,9 +748,9 @@ <h3 class="article-title">Cambrian-1</h3>
730748 < div class ="contact-us-block py-12 md:py-16 ">
731749
732750 < div class ="grid grid-cols-1 md:grid-cols-2 gap-10 md:gap-12 items-center ">
733- < div class ="featured-card ">
751+ < a href =" https://x.com/sainingxie/status/1986685042332958925 " target =" _blank " class ="featured-card block ">
734752 < img src ="imgs/cambrian-s-video-cover.jpg " alt ="VisionX@NYU " class ="rounded-lg shadow-md w-full h-auto object-cover aspect-video md:aspect-auto ">
735- </ div >
753+ </ a >
736754
737755 < div class ="flex flex-col justify-center text-left items-start ">
738756 < h2 class ="font-styrene text-4xl font-bold mb-6 "> Let's Connect</ h2 >
@@ -757,8 +775,12 @@ <h2 class="font-styrene text-4xl font-bold mb-6">Let's Connect</h2>
757775 const themeToggle = document . getElementById ( 'theme-toggle' ) ;
758776 const htmlElement = document . documentElement ;
759777
760- // Check for saved theme preference or default to light mode
761- const currentTheme = localStorage . getItem ( 'theme' ) || 'light' ;
778+ // Check for saved theme preference or auto-detect from system
779+ let currentTheme = localStorage . getItem ( 'theme' ) ;
780+ if ( ! currentTheme ) {
781+ // Auto-detect from system preference
782+ currentTheme = window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ? 'dark' : 'light' ;
783+ }
762784 htmlElement . setAttribute ( 'data-theme' , currentTheme ) ;
763785
764786 // Toggle theme
@@ -770,6 +792,14 @@ <h2 class="font-styrene text-4xl font-bold mb-6">Let's Connect</h2>
770792 localStorage . setItem ( 'theme' , newTheme ) ;
771793 } ) ;
772794
795+ // Listen for system theme changes (optional: auto-switch if user hasn't set preference)
796+ window . matchMedia ( '(prefers-color-scheme: dark)' ) . addEventListener ( 'change' , ( e ) => {
797+ // Only auto-switch if user hasn't manually set a preference
798+ if ( ! localStorage . getItem ( 'theme' ) ) {
799+ htmlElement . setAttribute ( 'data-theme' , e . matches ? 'dark' : 'light' ) ;
800+ }
801+ } ) ;
802+
773803 // Filter functionality
774804 const filterButtons = document . querySelectorAll ( '.filter-btn' ) ;
775805 const articles = document . querySelectorAll ( '.article-list article' ) ;
0 commit comments