/* ===================================
   MAIN.CSS - Base Styles
   Physical Intelligence Inspired
   =================================== */

/* --- 1. FONTS & VARIABLES --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Display:ital,wght@1,400&display=swap');

:root {
    /* DEFAULT (LIGHT) - Swiss/Laboratory Look */
    /* Colors */
    --bg-color: #F4F6F8;
    --panel-bg: #FFFFFF;
    --content-bg: #F8FAFC;
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --accent-color: #00A3C4;
    --border-color: #E2E8F0;
    
    /* Fonts */
    --font-head: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-greek: 'Noto Serif Display', serif;
    
    /* Layout */
    --sidebar-width: 350px;
    --header-height: 60px;
}

/* DARK MODE OVERRIDES - Cyber/Matrix Look */
[data-theme="dark"] {
    --bg-color: #020406;       /* Deepest Black */
    --panel-bg: #0B1120;       /* Dark Navy Panel */
    --content-bg: #0F172A;     /* Slate Content */
    --text-primary: #E2E8F0;   /* Bright White/Grey */
    --text-secondary: #94A3B8; /* Muted Grey */
    --accent-color: #00F3FF;   /* Neon Cyan (Glowing) */
    --border-color: #1E293B;   /* Dark Borders */
    --code-bg: #1E293B;
}

/* Smooth transition for theme switching */
body, .site-header, .timeline-panel, .content-panel, .contact-card, a {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

#theme-toggle:hover {
    color: var(--accent-color) !important;
}

#theme-toggle svg {
    transition: transform 0.5s ease;
}

#theme-toggle:hover svg {
    transform: rotate(45deg); /* Cool spin effect on hover */
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

/* --- 3. HEADER --- */
.site-header {
    height: var(--header-height);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.brand-identity {
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.greek-script {
    font-family: var(--font-greek);
    font-style: italic;
    color: var(--accent-color);
    font-size: 1.25rem;
    font-weight: 400;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    opacity: 1;
}

.nav-links a.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 2px;
}

/* --- 4. MAIN GRID LAYOUT --- */
.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

/* Grid with sidebar (home and blog pages) */
.app-grid:has(.timeline-panel) {
    grid-template-columns: var(--sidebar-width) 1fr;
}

/* --- 5. TIMELINE SIDEBAR --- */
.timeline-panel {
    background: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 2rem;
}

.timeline-header {
    font-family: var(--font-head);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}

.timeline-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.timeline-item:hover {
    /* background-color: var(--content-bg); */
    background-color: var(--code-bg);
}

.timeline-date {
    display: block;
    font-family: var(--font-head);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary);
}

/* --- 6. CONTENT PANEL --- */
.content-panel {
    position: relative;
    background: var(--content-bg);
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
}

/* --- 7. PROSE (Typography Container) --- */
.prose {
    max-width: 800px;
    padding: 4rem;
    margin: 0 auto;
}

.prose h1 {
    font-family: var(--font-head);
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.prose h2 {
    font-family: var(--font-head);
    font-size: 2rem;
    line-height: 1.2;
    margin: 2rem 0 1rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.prose h3 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
}

.prose p {
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    /* color: #334155; */
}

.prose a {
    color: var(--accent-color);
    text-decoration: underline;
}

.prose a:hover {
    opacity: 0.8;
}

.prose code {
    background: #F1F5F9;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.prose pre {
    background: #1E293B;
    color: #E2E8F0;
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.prose pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.prose blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* --- 8. CIPHER TEXT ACCENT --- */
.cipher-text {
    font-family: var(--font-greek);
    font-style: italic;
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* --- 9. HOME PAGE SPECIFIC --- */
.home-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 4rem;
    height: 100%;
    align-items: start;
}

.bio-section {
    max-width: 600px;
}

.bio-title {
    font-family: var(--font-head);
    font-size: 3rem;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.bio-section p {
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.matrix-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.matrix-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- 10. BLOG LIST STYLES --- */
.blog-intro {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.blog-list {
    margin-top: 2rem;
}

.blog-list-item {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.blog-list-item:last-child {
    border-bottom: none;
}

.blog-list-item .post-date {
    display: block;
    font-family: var(--font-head);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.blog-list-item .post-title {
    font-family: var(--font-head);
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.blog-list-item .post-title a {
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.blog-list-item .post-title a:hover {
    color: var(--accent-color);
    opacity: 1;
}

.blog-list-item .post-excerpt {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- 11. BLOG POST STYLES --- */
.blog-post {
    max-width: 750px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.post-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.post-header h1 {
    font-family: var(--font-head);
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.post-header .post-date {
    font-family: var(--font-head);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.post-content {
    font-size: 1.15rem;
    line-height: 1.8;
}

/* --- 12. CONTACT PAGE --- */
.contact-page h1 {
    text-align: center;
}

.contact-page > p {
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.contact-card {
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 163, 196, 0.1);
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.contact-card h3 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-card p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.contact-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    color: var(--accent-color);
    font-weight: 500;
    transition: all 0.2s ease;
}

.contact-link:hover {
    background: var(--accent-color);
    color: white;
    opacity: 1;
}

.github-logo {
    width: 48px;
    height: 48px;
    fill: var(--accent-color);
}

/* --- 13. FOOTER --- */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    background: var(--panel-bg);
    margin-top: auto;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
}

.footer-text {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    align-items: center;
}

.footer-links a {
    color: var(--accent-color);
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}

.footer-links a:hover {
    transform: scale(1.2);
    opacity: 1;
}

.footer-icon {
    width: 24px;
    height: 24px;
    fill: var(--accent-color);
}

/* --- 14. RESPONSIVE --- */
@media (max-width: 1024px) {
    .home-container {
        grid-template-columns: 1fr;
    }
    
    .matrix-container {
        min-height: 400px;
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .app-grid:has(.timeline-panel) {
        grid-template-columns: 1fr;
    }
    
    .timeline-panel {
        display: none;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a {
        font-size: 0.75rem;
    }
    
    .prose {
        padding: 2rem;
    }
    
    .prose h1 {
        font-size: 2rem;
    }
    
    .home-container {
        padding: 2rem;
    }
    
    .bio-title {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .site-header {
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 0.75rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
}