/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    line-height: 1.6;
    color: #e8e8e8;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f172a 100%);
    min-height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: hidden;
}

/* 3D Printer/Maker background animation */
#printer-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.layer-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(79, 172, 254, 0.1) 20%, 
        rgba(79, 172, 254, 0.3) 50%, 
        rgba(79, 172, 254, 0.1) 80%, 
        transparent 100%);
    animation: printing-layer 8s ease-in-out infinite;
}

@keyframes printing-layer {
    0% { 
        opacity: 0; 
        transform: translateX(-100%); 
    }
    20% { 
        opacity: 1; 
        transform: translateX(0%); 
    }
    80% { 
        opacity: 1; 
        transform: translateX(0%); 
    }
    100% { 
        opacity: 0; 
        transform: translateX(100%); 
    }
}

.grid-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: rgba(79, 172, 254, 0.15);
    border-radius: 50%;
}

/* Header styles */
header {
    padding: 2rem 0;
    border-bottom: 2px solid rgba(79, 172, 254, 0.3);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-top: 1rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

nav h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #4facfe;
    text-shadow: 0 0 20px rgba(79, 172, 254, 0.5);
    letter-spacing: 1px;
}

nav h1 a {
    text-decoration: none;
    color: inherit;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: #a8a8b3;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

nav a:hover {
    color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
    transform: translateY(-2px);
}

/* Main content */
main {
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

/* Post styles */
.post {
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid rgba(79, 172, 254, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.post:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    border-color: rgba(79, 172, 254, 0.4);
}

/* Article page styles */
.post h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #4facfe;
    font-weight: 700;
    line-height: 1.2;
}

.post h2 {
    font-size: 1.8rem;
    margin: 2.5rem 0 1.5rem 0;
    color: #00d4aa;
    font-weight: 600;
    border-left: 4px solid #00d4aa;
    padding-left: 1rem;
}

.post h3 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem 0;
    color: #6ee7b7;
    font-weight: 600;
}

.post ul, .post ol {
    margin: 1.5rem 0 1.5rem 2rem;
    color: #c7d2fe;
}

.post li {
    margin-bottom: 0.8rem;
    line-height: 1.7;
}

.post li strong {
    color: #a5b4fc;
    font-weight: 600;
}

.post pre {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(79, 172, 254, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.post code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #22d3ee;
    background: rgba(79, 172, 254, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.post a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.post a:hover {
    color: #93c5fd;
    border-bottom-color: #60a5fa;
}

.post p {
    margin-bottom: 1.5rem;
    color: #d1d5db;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Homepage post title styles */
.post h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    font-weight: 600;
    border: none;
    padding: 0;
}

.post h2 a {
    text-decoration: none;
    color: #4facfe;
    transition: all 0.3s ease;
    display: block;
}

.post h2 a:hover {
    color: #00d4aa;
    transform: translateX(8px);
    border: none;
}

.read-more {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 8px;
    background: rgba(96, 165, 250, 0.1);
}

.read-more:hover {
    color: #93c5fd;
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.2);
    transform: translateX(4px);
}

.read-more::after {
    content: "→";
    transition: transform 0.3s ease;
}

.read-more:hover::after {
    transform: translateX(4px);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 1rem;
    margin: 3rem 0;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.page-link {
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    color: #a8a8b3;
    border: 2px solid rgba(79, 172, 254, 0.3);
    border-radius: 12px;
    transition: all 0.3s ease;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    font-weight: 600;
}

.page-link:hover {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
    border-color: #4facfe;
    transform: translateY(-2px);
}

.page-link.active {
    background: rgba(79, 172, 254, 0.2);
    color: #4facfe;
    border-color: #4facfe;
}

/* Footer */
footer {
    border-top: 2px solid rgba(79, 172, 254, 0.3);
    padding: 2rem 0;
    text-align: center;
    color: #8b9bb3;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-bottom: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 0 15px;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    nav h1 {
        font-size: 1.6rem;
    }
    
    nav ul {
        gap: 1.5rem;
    }
    
    .post {
        padding: 1.5rem;
    }
    
    .post h1 {
        font-size: 2rem;
    }
    
    .post h2 {
        font-size: 1.4rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0 10px;
    }
    
    header {
        padding: 1.5rem 0;
    }
    
    .post {
        margin-bottom: 2rem;
        padding: 1rem;
    }
    
    .post h1 {
        font-size: 1.8rem;
    }
    
    .pagination {
        gap: 0.5rem;
    }
    
    .page-link {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .layer-line {
        animation: none;
    }
    
    .post:hover {
        transform: none;
    }
    
    nav a:hover {
        transform: none;
    }
    
    .read-more:hover {
        transform: none;
    }
    
    .read-more:hover::after {
        transform: none;
    }
}