/* ================================
   CSS Custom Properties
   ================================ */

/* Dark mode (default) */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --bg-dark: #18181b;
    --bg-card: #27272a;
    --bg-hover: #3f3f46;
    --text-primary: #fafafa;
    --text-secondary: #c7c7cd;
    --gradient-1: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --shadow-lg: 0 20px 60px rgba(59, 130, 246, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode */
[data-theme="light"] {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --accent-color: #0891b2;
    --bg-dark: #ffffff;
    --bg-card: #f4f4f5;
    --bg-hover: #e4e4e7;
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --gradient-1: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --gradient-2: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    --shadow-lg: 0 20px 60px rgba(37, 99, 235, 0.12);
}

/* Light mode specific overrides */
[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .nav-menu {
    background: var(--bg-card);
}

[data-theme="light"] .post-content code {
    background: rgba(0, 0, 0, 0.05);
    color: #7c3aed;
}

[data-theme="light"] .post-content pre {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .post-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .post-content hr {
    border-top-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .post-content th,
[data-theme="light"] .post-content td {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .post-content th {
    background: rgba(0, 0, 0, 0.03);
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-2);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

.theme-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ================================
   Accessibility
   ================================ */
.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 8px 0;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ================================
   Reset & Base Styles
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ================================
   Navigation
   ================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-brand i {
    animation: rotate 10s linear infinite;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-shrink: 0;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
    white-space: nowrap;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ================================
   Hero Section
   ================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}

.hero .container {
    position: relative;
    z-index: 1;
    width: 100%;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
}

/* Quantum Visual Effect */
.hero-visual {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
}

.quantum-circle {
    position: absolute;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
}

.quantum-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 50px;
    left: 50px;
    animation: rotate 20s linear infinite;
}

.quantum-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 100px;
    left: 100px;
    animation: rotate 15s linear infinite reverse;
}

.quantum-circle:nth-child(3) {
    width: 100px;
    height: 100px;
    top: 150px;
    left: 150px;
    animation: rotate 10s linear infinite;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--primary-color);
    font-size: 2rem;
    animation: bounce 2s infinite;
    z-index: 2;
}

/* ================================
   Interests Section
   ================================ */
.interests {
    padding: 6rem 0;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-card) 100%);
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.interest-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.interest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-2);
    transform: scaleX(0);
    transition: var(--transition);
}

.interest-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.interest-card:hover::before {
    transform: scaleX(1);
}

.interest-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.interest-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

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

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.tech-stack li {
    background: rgba(59, 130, 246, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary-color);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ================================
   Blog Preview Section
   ================================ */
.blog-preview {
    padding: 6rem 0;
    background: var(--bg-dark);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.blog-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.15);
    transition: var(--transition);
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.blog-card-header {
    padding: 1.5rem;
    background: var(--gradient-1);
    color: white;
}

.blog-category {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.blog-card h3 {
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

.blog-date {
    font-size: 0.9rem;
    opacity: 0.8;
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.blog-read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-read-more:hover {
    gap: 1rem;
}

.text-center {
    text-align: center;
}

/* ================================
   Blog Page Specific
   ================================ */
.blog-header {
    padding: 8rem 0 3rem;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-card) 100%);
}

.blog-header h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.blog-filters {
    padding: 2rem 0;
    background: var(--bg-card);
    position: sticky;
    top: 70px;
    z-index: 100;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.blog-filters .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    background: transparent;
    border: 2px solid rgba(59, 130, 246, 0.25);
    color: var(--text-secondary);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 3rem;
    background: var(--bg-dark);
    border: 2px solid rgba(59, 130, 246, 0.25);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.blog-section {
    padding: 4rem 0;
    min-height: 60vh;
}

/* ================================
   Modal
   ================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

#newPostForm {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--bg-dark);
    border: 2px solid rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ================================
   Contact Section
   ================================ */
.contact {
    padding: 6rem 0;
    background: var(--bg-card);
}

.contact-content {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 900px;
}

.contact-info .contact-item {
    flex: 0 1 auto;
    min-width: 280px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-dark);
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: var(--transition);
    min-height: 85px;
    text-decoration: none;
    color: inherit;
}

.contact-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.contact-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
    min-width: 35px;
}

.contact-item span {
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ================================
   Footer
   ================================ */
.footer {
    padding: 2rem 0;
    text-align: center;
    background: var(--bg-dark);
    border-top: 1px solid rgba(59, 130, 246, 0.15);
    color: var(--text-secondary);
}

/* ================================
   Blog Post Page Styles
   ================================ */
.blog-post {
    padding: 6rem 0 4rem;
    min-height: 100vh;
    background: var(--bg-dark);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.back-link:hover {
    transform: translateX(-5px);
    color: var(--secondary-color);
}

.post-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.post-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.post-category.quantum {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.post-category.ai {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.post-category.software {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.post-category.chess {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.post-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-meta i {
    color: var(--primary-color);
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--text-primary);
    max-width: 100%; 
    width: 100%; 
}

.post-content p {
    margin-bottom: 1.0rem;
}

.post-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: var(--text-primary);
}

.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.post-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.post-content ul, 
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.post-content a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.post-content a:hover {
    color: var(--secondary-color);
}

.post-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
    color: #f093fb;
}

.post-content pre {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.post-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

.post-content hr {
    border: none;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    margin: 3rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.post-content th,
.post-content td {
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.post-content th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

/* ================================
   Animations
   ================================ */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -20px); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 768px) {
    .navbar .container {
        padding: 1rem;
    }
    
    .nav-brand {
        font-size: 1.25rem;
    }
    
    .nav-menu {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 0;
        gap: 0;
        border-bottom: 1px solid rgba(59, 130, 246, 0.2);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .nav-menu.active {
        max-height: 300px;
        padding: 1rem 0;
    }
    
    .nav-menu a {
        padding: 1rem 2rem;
    }
    
    .nav-menu a::after {
        display: none;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .interests-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-filters .container {
        flex-direction: column;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .contact-info {
        flex-direction: column;
        align-items: center;
    }

    .contact-info .contact-item {
        max-width: 100%;
        width: 100%;
    }
    
    .contact-item {
        text-align: left;
    }
    
    .blog-post {
        padding: 5rem 0 3rem;
    }
    
    .post-header h1 {
        font-size: 2rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
    
    .post-content h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .blog-header h1 {
        font-size: 2.5rem;
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .contact-item span {
        font-size: 0.85rem;
    }
    
    .post-header h1 {
        font-size: 1.75rem;
    }
    
    .post-content {
        font-size: 0.95rem;
    }
}

/* ================================
   Reduced Motion Support
   ================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================
   High Contrast Mode Support
   ================================ */
@media (prefers-contrast: more) {
  :root {
    --primary-color: #0c47a1;
    --text-secondary: #e0e0e0;
  }
  .interest-card, .blog-card {
    border: 2px solid var(--primary-color) !important;
  }
}

/* ================================
   Reading Progress Bar
   ================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-2);
  z-index: 1001;
  transition: width 0.1s ease;
}

/* ================================
   Share Buttons
   ================================ */
.share-section {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.15);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.share-buttons { display: flex; gap: 0.75rem; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.share-btn:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }

/* ================================
   Newsletter/CTA Section
   ================================ */
.cta-section {
  padding: 4rem 0;
  background: var(--gradient-1);
  color: white;
  text-align: center;
}
.newsletter-form .form-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.newsletter-form input {
  padding: 1rem;
  border: none;
  border-radius: 8px;
  min-width: 280px;
}

/* ================================
   Reading Time
   ================================ */
.reading-time {
  display: inline-block;
  margin-left: 1rem;
  font-size: 0.85rem;
  opacity: 0.9;
}

/* ================================
   Table of Contents
   ================================ */
.table-of-contents {
  background: var(--bg-card);
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 8px;
}
.table-of-contents ul { list-style: none; padding: 0; }
.table-of-contents a { color: var(--text-secondary); text-decoration: none; }
.table-of-contents a:hover { color: var(--primary-color); }

/* ================================
   Related Posts
   ================================ */
.related-posts { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(59, 130, 246, 0.15); }
.related-posts h3 { margin-bottom: 1.5rem; }
.related-posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.related-post-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  transition: var(--transition);
}
.related-post-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-lg);
}
.related-post-card h4 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}
.related-post-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}
.blog-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ================================
   Bookmarks
   ================================ */
.bookmark-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
}
.bookmark-btn:hover, .bookmark-btn.active { color: var(--primary-color); }
.bookmark-btn.active i { font-weight: 900; }

/* ================================
   Chess Puzzles
   ================================ */
.chess-puzzles-section {
  padding: 5rem 0;
  background: var(--bg-secondary);
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

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

.puzzle-card {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 16px;
  padding: 1.5rem;
  transition: var(--transition);
}

.puzzle-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.puzzle-card.completed {
  border-color: #10b981;
}

.puzzle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.puzzle-difficulty {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
}

.puzzle-completed-icon {
  color: #10b981;
  font-size: 1.25rem;
}

.puzzle-title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.puzzle-board-placeholder {
  background: var(--bg-dark);
  border-radius: 8px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 3rem;
  color: var(--text-secondary);
}

.puzzle-stats {
  text-align: center;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.puzzle-start-btn {
  width: 100%;
}

/* Puzzle Modal */
.puzzle-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.puzzle-modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.puzzle-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

.puzzle-modal-close:hover { color: var(--text-primary); }

.puzzle-modal-title {
  margin-bottom: 0.5rem;
  padding-right: 2rem;
}

.puzzle-modal-difficulty {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.puzzle-turn {
  color: var(--text-secondary);
  font-style: italic;
}

/* Chess Board */
.puzzle-board-container {
  margin-bottom: 1.5rem;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  border: 3px solid var(--primary-color);
  border-radius: 4px;
  overflow: hidden;
}

.chess-square {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.light-square { background: #f0d9b5; }
.dark-square { background: #b58863; }

.chess-piece {
  line-height: 1;
}

.white-piece {
  color: #fff;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    0 0 3px #000;
}

.black-piece {
  color: #1a1a1a;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff;
}

.board-coordinates {
  margin-top: 0.25rem;
}

.board-coordinates .files {
  display: flex;
  justify-content: space-around;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Puzzle Controls */
.puzzle-controls {
  margin-bottom: 1rem;
}

.puzzle-move-counter {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.puzzle-input-group {
  display: flex;
  gap: 0.5rem;
}

.puzzle-move-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
}

.puzzle-move-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.puzzle-feedback {
  margin-top: 0.75rem;
  text-align: center;
  min-height: 1.5rem;
}

.feedback-success {
  color: #10b981;
  font-weight: 600;
}

.feedback-error {
  color: #ef4444;
  font-weight: 600;
}

/* Puzzle Actions */
.puzzle-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.puzzle-actions .btn {
  flex: 1;
}

.puzzle-hint, .puzzle-solution {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 0.75rem;
  border-left: 4px solid var(--primary-color);
}

.puzzle-hint i { color: #f59e0b; }
.puzzle-solution i { color: var(--primary-color); }

.solution-explanation {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Solved state */
.puzzle-solved {
  border: 2px solid #10b981;
}

.puzzle-solved::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(16, 185, 129, 0.05);
  border-radius: 16px;
  pointer-events: none;
}

/* ================================
   Print Styles
   ================================ */
@media print {
    /* Reset colors for print */
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Hide non-essential elements */
    .navbar,
    .skip-link,
    .mobile-toggle,
    .hero-visual,
    .quantum-circle,
    .scroll-indicator,
    .filter-buttons,
    .search-box,
    .blog-filters,
    .back-link,
    .contact,
    .footer,
    .btn,
    .hero-buttons,
    .theme-toggle {
        display: none !important;
    }

    /* Adjust page layout */
    body {
        margin: 0;
        padding: 0;
        font-size: 12pt;
        line-height: 1.5;
    }

    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    /* Reset hero section */
    .hero {
        min-height: auto;
        padding: 1rem 0;
        page-break-after: always;
    }

    .hero-text h1 {
        font-size: 24pt;
        color: black !important;
        -webkit-text-fill-color: black !important;
        margin-bottom: 0.5rem;
    }

    .hero-subtitle {
        font-size: 14pt;
        margin-bottom: 1rem;
    }

    /* Section titles */
    .section-title {
        font-size: 18pt;
        margin-bottom: 1rem;
        color: black !important;
        -webkit-text-fill-color: black !important;
    }

    /* Blog cards for print */
    .blog-grid {
        display: block;
    }

    .blog-card {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .blog-card-header {
        background: none !important;
        padding: 0;
        margin-bottom: 0.5rem;
    }

    .blog-category {
        font-weight: bold;
        text-transform: uppercase;
        font-size: 10pt;
    }

    .blog-card h3 {
        font-size: 14pt;
        margin: 0.5rem 0;
    }

    .blog-read-more {
        display: none !important;
    }

    /* Interest cards */
    .interests-grid {
        display: block;
    }

    .interest-card {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .interest-icon {
        display: none;
    }

    .tech-stack {
        display: inline;
    }

    .tech-stack li {
        display: inline;
        border: 1px solid #ccc !important;
        padding: 0.2rem 0.5rem;
        margin-right: 0.5rem;
    }

    /* Blog post page */
    .blog-post {
        padding: 0;
    }

    .post-header {
        border-bottom: 2px solid #ccc !important;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .post-header h1 {
        font-size: 20pt;
    }

    .post-category {
        border: 1px solid #ccc !important;
        background: none !important;
        color: black !important;
    }

    .post-content {
        font-size: 11pt;
        line-height: 1.6;
    }

    .post-content h2 {
        font-size: 16pt;
        page-break-after: avoid;
    }

    .post-content h3 {
        font-size: 14pt;
        page-break-after: avoid;
    }

    /* Links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666 !important;
    }

    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }

    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }

    ul, ol, img {
        page-break-inside: avoid;
    }
}
