:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #60a5fa;
    --secondary-color: #94a3b8;
    --hover-color: #2563eb;
    --memory-grid: rgba(96, 165, 250, 0.05);
    --terminal-green: #4ade80;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Binary pattern background */
@keyframes subtleFloat {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.02; }
    50% { opacity: 0.05; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(96, 165, 250, 0.03) 0%, transparent 3%),
        radial-gradient(circle at 80% 70%, rgba(96, 165, 250, 0.03) 0%, transparent 3%),
        linear-gradient(90deg, rgba(96, 165, 250, 0.01) 1px, transparent 1px),
        linear-gradient(0deg, rgba(96, 165, 250, 0.01) 1px, transparent 1px),
        radial-gradient(circle at 60% 40%, rgba(96, 165, 250, 0.02) 0%, transparent 20%);
    background-size: 
        300px 300px,
        400px 400px,
        20px 20px,
        20px 20px,
        600px 600px;
    animation: subtleFloat 60s linear infinite;
}

body::before {
    content: "01";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: monospace;
    font-size: 12px;
    color: rgba(96, 165, 250, 0.03);
    pointer-events: none;
    white-space: pre;
    line-height: 1;
    animation: fadeInOut 8s infinite;
    z-index: -1;
}

.content-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    backdrop-filter: blur(100px);
    background: rgba(15, 23, 42, 0.7);
    min-height: 100vh;
}

.content-wrapper::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 95%, rgba(96, 165, 250, 0.05) 95%),
        linear-gradient(transparent 95%, rgba(96, 165, 250, 0.05) 95%);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: -1;
}

/* Navigation */
.nav-links {
    display: flex;
    gap: 2rem;
    margin-bottom: 4rem;
    position: relative;
    padding: 1rem 0;
}

.nav-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--terminal-green);
    margin-right: 0.5rem;
    animation: blink 2s infinite;
}

/* Profile Section */
.profile-section {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    position: relative;
}

.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(96, 165, 250, 0.2);
    filter: grayscale(20%);
    transition: all 0.3s ease;
}

.profile-image:hover {
    filter: grayscale(0%);
    transform: scale(1.02);
    border-color: var(--accent-color);
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    color: var(--accent-color);
    margin: 3rem 0 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.section-title::before {
    content: "";
    position: absolute;
    left: -30px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--accent-color) 25%, 
        transparent 25%,
        transparent 75%,
        var(--accent-color) 75%
    );
    opacity: 0.5;
}

/* Cards */
.project-card, .research-card {
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    background: 
        linear-gradient(90deg, transparent 98%, rgba(96, 165, 250, 0.1) 98%),
        linear-gradient(transparent 98%, rgba(96, 165, 250, 0.1) 98%)
        rgba(30, 41, 59, 0.5);
    background-size: 20px 20px;
    backdrop-filter: blur(10px);
    position: relative;
    transition: all 0.3s ease;
}

.project-card:hover, .research-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.7);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.project-card::before, .research-card::before {
    content: attr(data-addr);
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.8rem;
    color: rgba(96, 165, 250, 0.3);
    pointer-events: none;
}

/* Code Decorations */
.code-decoration {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.85rem;
    color: rgba(96, 165, 250, 0.4);
    position: absolute;
    pointer-events: none;
    user-select: none;
    white-space: pre;
}

.code-top-right {
    top: 1rem;
    right: 1rem;
}

/* Tech Tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tech-tags::before {
    content: "stack[0x00]:";
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--secondary-color);
    opacity: 0.5;
    display: block;
    margin-bottom: 0.5rem;
}

.tech-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 6px;
    color: var(--accent-color);
    font-size: 0.9rem;
    margin: 0.5rem 0.5rem 0.5rem 0;
    transition: all 0.2s ease;
}

.tech-tag:hover {
    background: rgba(96, 165, 250, 0.2);
    transform: translateY(-2px);
}

/* Title Row */
.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin: 0;
}

.project-title::before {
    content: ">";
    color: var(--accent-color);
    margin-right: 0.5rem;
    font-family: monospace;
    opacity: 0.7;
}

.date {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Description */
.description {
    color: var(--text-color);
    line-height: 1.7;
    margin: 1rem 0;
}

/* Contact Links */
.contact-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-link:hover {
    color: var(--hover-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 1.5rem;
    }
    
    .profile-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .profile-image {
        margin: 0 auto;
        width: 150px;
        height: 150px;
    }
    
    .code-decoration,
    .project-card::before,
    .section::before,
    .tech-tags::before,
    .section-title::before {
        display: none;
    }
    
    .project-card, .research-card {
        padding: 1.5rem;
    }
    
    .title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .tech-tags {
        justify-content: center;
    }
    
    .nav-links {
        font-size: 1rem;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.5rem;
    }
    
    .profile-image {
        width: 120px;
        height: 120px;
    }
    
    .tech-tags {
        flex-direction: column;
        align-items: center;
    }
    
    .tech-tag {
        width: 100%;
        text-align: center;
    }
    
    .project-card, .research-card {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: none;
        color: black;
    }

    .content-wrapper {
        padding: 0;
        background: none;
        backdrop-filter: none;
    }

    .code-decoration,
    .project-card::before,
    .project-card:hover,
    .status-indicator {
        display: none;
    }

    a {
        text-decoration: underline;
        color: black;
    }

    .tech-tag {
        border: 1px solid black;
        background: none;
        color: black;
    }

    .profile-image {
        filter: grayscale(100%);
        print-color-adjust: exact;
    }

    .project-card, .research-card {
        break-inside: avoid;
        border: 1px solid black;
        margin-bottom: 1em;
        page-break-inside: avoid;
        background: none;
    }

    section {
        page-break-inside: avoid;
    }

    .contact-links {
        display: none;
    }
}

/*****************************************************
  Blog Page Specific Styles
*****************************************************/
.blog-body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #fff;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    
    /* 
       Create a layered background:
       1. Base dark gradient.
       2. Repeating diagonal lines (mimicking digital traces).
       3. A second, finer repeating pattern for texture.
       
       The blend mode ensures the layers mix in an interesting way.
    */
    background: 
      /* Base gradient: dark blue-to-black */
      linear-gradient(135deg, #0A0E12, #102A43),
      /* Diagonal grid overlay */
      repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 1px, transparent 1px, transparent 10px),
      /* Finer grid overlay for additional texture */
      repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 10px);
    
    background-blend-mode: overlay;
  }
  
  /* 
     1) Fullscreen assembly code image (or any interesting low-level background).
     2) Adjust opacity as needed.
  */
  .blog-body::before {
    content: "";
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: url('../images/assembly-bg.jpg') center center / cover no-repeat;
    opacity: 0.25;  /* tweak for more or less visibility */
    pointer-events: none;  /* so clicks pass through */
    z-index: -1;
  }
  
  /* 
     2) Semi-transparent gradient overlay
     - Helps text stand out.
  */
  .blog-body::after {
    content: "";
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: linear-gradient(
      135deg,
      rgba(0,0,0,0.8),
      rgba(10,10,10,0.7)
    );
    pointer-events: none;
    z-index: -1;
  }
  
  /* Center the blog content and keep it from spanning the entire width */
  .blog-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
  }
  
  /* Blog post card styling:
     - Translucent background so the underlying image is hinted behind.
  */
  .blog-post {
    background: rgba(20, 24, 29, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  }
  
  /* Title row style in each blog post */
  .blog-post .title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
  }
  
  /* Blog post title style with a bright accent color */
  .blog-title {
    color: #66FCF1; /* Teal accent, adjust to your liking */
    font-size: 1.3rem;
    margin: 0;
  }
  
  /* Blog date style */
  .blog-post .date {
    color: #9ea2a8;
    font-size: 0.9rem;
  }
  
  /* Description text */
  .blog-post .description {
    color: #cfd2d6;
    margin: 0.75rem 0;
    line-height: 1.6;
  }
  
  /* Tech tags in the blog post */
  .blog-post .tech-tags {
    margin-top: 0.5rem;
  }
  .blog-post .tech-tag {
    display: inline-block;
    background: #2a2f3c;
    color: #cfd2d6;
    padding: 0.3rem 0.6rem;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
  }
  
  /*****************************************************
    Navigation & Header (reuse or adapt from main style)
  *****************************************************/
  .nav-links {
    display: flex;
    gap: 1rem;
    background: rgba(0,0,0,0.3);
    padding: 1rem;
  }
  
  .nav-link.active {
    font-weight: bold;
    text-decoration: underline;
  }
  