/* CSS Custom Properties (Variables) */
:root {
    /* Light Mode Colors */
    --color-primary: #1A1A2E;
    --color-secondary: #6B7280;
    --color-accent: #00D4FF;
    --color-accent-hover: #00B8E6;
    --color-accent-warm: #A47864;
    --color-accent-warm-hover: #8B6552;
    --color-text: #1A1A2E;
    --color-text-light: #6B7280;
    --color-text-lighter: #9CA3AF;
    --color-background: #FFFFFF;
    --color-background-alt: #F9FAFB;
    --color-border: #E5E7EB;
    --color-border-light: #F3F4F6;
    --color-code-bg: #F3F4F6;
    --color-code-border: #E5E7EB;

    /* Typography */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-family-mono: 'JetBrains Mono', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;

    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1.125rem;   /* 18px - increased from 16px */
    --font-size-lg: 1.25rem;      /* 20px */
    --font-size-xl: 1.5rem;       /* 24px */
    --font-size-2xl: 1.875rem;    /* 30px */
    --font-size-3xl: 2.25rem;     /* 36px */
    --font-size-4xl: 3rem;        /* 48px */
    --font-size-5xl: 3.75rem;     /* 60px */
    --font-size-6xl: 4.5rem;      /* 72px */
    --font-size-hero: 5rem;       /* 80px */

    --line-height-tight: 1.2;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Layout */
    --container-max-width: 1400px;
    --content-max-width: 800px;   /* increased from 65ch */
    --sidebar-width: 320px;

    /* Borders and Shadows */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --box-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --box-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --box-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-base: 0.2s ease-in-out;
    --transition-colors: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    --transition-transform: transform 0.2s ease-in-out;
    --transition-all: all 0.2s ease-in-out;
}

/* Dark mode variables */
:root[data-theme="dark"] {
    --color-primary: #E8E8E8;
    --color-secondary: #9CA3AF;
    --color-text: #E8E8E8;
    --color-text-light: #D1D5DB;
    --color-text-lighter: #9CA3AF;
    --color-background: #1A1A2E;
    --color-background-alt: #252538;
    --color-border: #374151;
    --color-border-light: #2D2D42;
    --color-code-bg: #252538;
    --color-code-border: #374151;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-primary: #E8E8E8;
        --color-secondary: #9CA3AF;
        --color-text: #E8E8E8;
        --color-text-light: #D1D5DB;
        --color-text-lighter: #9CA3AF;
        --color-background: #1A1A2E;
        --color-background-alt: #252538;
        --color-border: #374151;
        --color-border-light: #2D2D42;
        --color-code-bg: #252538;
        --color-code-border: #374151;
    }
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout Components */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-background);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--space-6) var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--color-background-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-all);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.theme-toggle:hover svg {
    color: white;
}

.theme-toggle svg {
    color: var(--color-text);
    transition: var(--transition-colors);
    position: absolute;
}

.sun-icon {
    opacity: 1;
}

.moon-icon {
    opacity: 0;
}

:root[data-theme="dark"] .sun-icon {
    opacity: 0;
}

:root[data-theme="dark"] .moon-icon {
    opacity: 1;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .sun-icon {
        opacity: 0;
    }
    :root:not([data-theme="light"]) .moon-icon {
        opacity: 1;
    }
}

.site-title {
    font-family: var(--font-family-serif);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-primary);
}

.site-title a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-colors);
}

.site-title a:hover {
    color: var(--color-accent);
}

.site-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    margin-top: var(--space-2);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-link {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--color-text-light);
    text-decoration: none;
    transition: var(--transition-colors);
    position: relative;
    padding: var(--space-2) 0;
}

.nav-link:hover {
    color: var(--color-accent-warm);
}

.nav-link.active {
    color: var(--color-primary);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-accent-warm);
    border-radius: var(--border-radius-sm);
}

/* Hero Section */
.hero {
    padding: var(--space-24) 0;
    text-align: center;
    background: linear-gradient(135deg, var(--color-background) 0%, var(--color-background-alt) 100%);
    border-bottom: 1px solid var(--color-border);
}

.hero-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.hero-title {
    font-family: var(--font-family-serif);
    font-size: var(--font-size-hero);
    font-weight: 800;
    line-height: var(--line-height-tight);
    color: var(--color-primary);
    margin-bottom: var(--space-6);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: var(--color-text-light);
    line-height: var(--line-height-snug);
    max-width: 700px;
    margin: 0 auto var(--space-8);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    background-color: var(--color-accent-warm);
    color: white;
    font-size: var(--font-size-base);
    font-weight: 600;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    transition: var(--transition-all);
    box-shadow: var(--box-shadow-md);
}

.hero-cta:hover {
    background-color: var(--color-accent-warm-hover);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.breadcrumb a {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    text-decoration: none;
    transition: var(--transition-colors);
}

.breadcrumb a:hover {
    color: var(--color-accent);
}

.main-content {
    flex: 1;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--space-20) var(--space-20);
    width: 100%;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--space-12);
    align-items: start;
}

.posts-section {
    min-width: 0; /* Prevent grid overflow */
}

.content-text {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-light);
}

.posts-header {
    margin-bottom: var(--space-12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.posts-header h2 {
    font-family: var(--font-family-serif);
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.view-all-link {
    color: var(--color-accent);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition-colors);
}

.view-all-link:hover {
    color: var(--color-primary);
}

.filter-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background-color: var(--color-accent);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.clear-filter-btn {
    background: none;
    border: none;
    color: white;
    font-size: var(--font-size-xl);
    font-weight: 700;
    cursor: pointer;
    padding: 0 var(--space-1);
    margin-left: var(--space-2);
    line-height: 1;
    transition: var(--transition-colors);
}

.clear-filter-btn:hover {
    opacity: 0.8;
}

/* Bento Grid Layout */
.posts-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
}

.post-item {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-xl);
    padding: 0;
    transition: var(--transition-all);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.post-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-lg);
    border-color: var(--color-accent);
}

/* Post Hero Image */
.post-hero-link {
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.post-hero-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    transition: var(--transition-transform);
}

.post-item:hover .post-hero-image {
    transform: scale(1.05);
}

/* Add padding back to content when image is present */
.post-item:has(.post-hero-image) .post-title,
.post-item:has(.post-hero-image) .post-meta,
.post-item:has(.post-hero-image) .post-description,
.post-item:has(.post-hero-image) .post-tags {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
}

.post-item:has(.post-hero-image) .post-title {
    padding-top: var(--space-6);
}

.post-item:has(.post-hero-image) .post-tags {
    padding-bottom: var(--space-8);
}

/* Fallback padding for posts without images */
.post-item:not(:has(.post-hero-image)) {
    padding: var(--space-8);
}

/* Featured post (first item) - larger */
.post-item:first-child {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--color-background-alt) 0%, var(--color-background) 100%);
}

.post-item:first-child .post-hero-image {
    height: 400px;
}

.post-item:first-child .post-title {
    font-size: var(--font-size-3xl);
}

/* Alternating sizes for visual interest */
.post-item:nth-child(4),
.post-item:nth-child(7) {
    grid-column: 1 / -1;
}

.post-title {
    font-family: var(--font-family-serif);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
    line-height: var(--line-height-tight);
}

.post-title a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-colors);
}

.post-title a:hover {
    color: var(--color-accent);
}

.post-meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
}

.post-meta-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.post-date {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-description {
    color: var(--color-text-light);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-4);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.tag {
    background-color: var(--color-background-alt);
    color: var(--color-text);
    font-size: var(--font-size-xs);
    font-weight: 500;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-border);
    text-decoration: none;
    transition: var(--transition-colors);
    cursor: pointer;
    display: inline-block;
}

.tag:hover {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.tag.active {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    font-weight: 600;
}

/* Post Content Styles */
.post-content {
    min-width: 0; /* Prevent grid overflow */
}

.post-container {
    max-width: var(--content-max-width);
}

.post-header {
    margin-bottom: var(--space-8);
}

.post-header .post-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-4);
}

/* Markdown Content Styles */
.post-container h1,
.post-container h2,
.post-container h3,
.post-container h4,
.post-container h5,
.post-container h6 {
    font-family: var(--font-family-serif);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--color-primary);
    margin-top: var(--space-12);
    margin-bottom: var(--space-6);
    letter-spacing: -0.02em;
}

.post-container h1 {
    font-size: var(--font-size-5xl);
    margin-top: 0;
    margin-bottom: var(--space-8);
}

.post-container h2 {
    font-size: var(--font-size-3xl);
    margin-top: var(--space-16);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border-light);
}

.post-container h3 {
    font-size: var(--font-size-2xl);
}

.post-container h4 {
    font-size: var(--font-size-xl);
}

.post-container p {
    margin-bottom: var(--space-6);
    line-height: var(--line-height-relaxed);
    color: var(--color-text);
}

.post-container ul,
.post-container ol {
    margin-bottom: var(--space-6);
    padding-left: var(--space-6);
}

.post-container li {
    margin-bottom: var(--space-2);
    line-height: var(--line-height-relaxed);
}

.post-container li ul,
.post-container li ol {
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
}

.post-container blockquote {
    margin: var(--space-6) 0;
    padding-left: var(--space-6);
    border-left: 4px solid var(--color-accent);
    background-color: var(--color-background-alt);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--border-radius-md);
}

.post-container blockquote p {
    color: var(--color-text-light);
    font-style: italic;
    margin-bottom: 0;
}

.post-container code {
    font-family: var(--font-family-mono);
    font-size: 0.9em;
    background-color: var(--color-code-bg);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-code-border);
}

.post-container pre {
    background-color: var(--color-code-bg);
    border: 1px solid var(--color-code-border);
    border-radius: var(--border-radius-md);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    overflow-x: auto;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.post-container pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

.post-container table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-6) 0;
    font-size: var(--font-size-sm);
}

.post-container th,
.post-container td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.post-container th {
    font-weight: 600;
    background-color: var(--color-background-alt);
    color: var(--color-primary);
}

.post-container a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: var(--transition-colors);
}

.post-container a:hover {
    color: var(--color-accent-hover);
}

/* Exception: Tags should not have underlines */
.post-container a.tag,
.post-header a.tag {
    text-decoration: none;
}

.post-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: var(--space-6) 0;
    border-radius: var(--border-radius-md);
}

.post-body > h1:first-child {
    display: none;
}

/* Sidebar Styles */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.sidebar-section {
    background-color: var(--color-background-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
}

.sidebar-section h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--space-4);
}

.bio {
    text-align: center;
}

.bio-avatar {
    margin-bottom: var(--space-4);
}

.bio-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border);
}

.bio-content p {
    color: var(--color-text-light);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-4);
}

.bio-content p:last-child {
    margin-bottom: 0;
}

.social-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.social-links a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-text-light);
    text-decoration: none;
    font-size: var(--font-size-base);
    font-weight: 500;
    line-height: 1;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--border-radius-md);
    transition: var(--transition-colors);
}

.social-links a svg {
    display: block;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.social-links a:hover {
    background-color: var(--color-accent);
    color: white;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Share trigger button below post content */
.share-trigger-btn {
    background-color: var(--color-background-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text-light);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-all);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-12);
    width: fit-content;
}

.share-trigger-btn:hover {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.share-trigger-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.share-trigger-btn::after {
    content: 'Share';
    font-size: var(--font-size-base);
    font-weight: 500;
}

/* Share menu modal */
.share-menu-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.share-menu-modal.active {
    display: flex;
}

.share-menu-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.share-menu-content {
    position: relative;
    background-color: var(--color-background);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease-out;
}

.share-menu-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.share-menu-close {
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--border-radius-md);
    transition: var(--transition-colors);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-menu-close:hover {
    background-color: var(--color-background-alt);
    color: var(--color-text);
}

.share-menu-close svg {
    width: 24px;
    height: 24px;
}

.share-menu-options {
    padding: var(--space-4) 0;
}

.share-menu-option {
    width: 100%;
    background: none;
    border: none;
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    cursor: pointer;
    transition: var(--transition-colors);
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-weight: 500;
}

.share-menu-option:hover {
    background-color: var(--color-background-alt);
}

.share-menu-option svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--color-text-light);
}

.share-menu-option span {
    text-align: left;
}

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

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Footer */
.footer {
    border-top: 1px solid var(--color-border);
    background-color: var(--color-background-alt);
    padding: var(--space-8) var(--space-4);
    text-align: center;
}

.footer p {
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
    max-width: var(--container-max-width);
    margin: 0 auto;
}

/* Utility Classes */
.loading {
    text-align: center;
    color: var(--color-text-light);
    font-style: italic;
    padding: var(--space-8);
}

/* Responsive Design */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 280px;
    }

    .main-content {
        padding: var(--space-16) var(--space-12);
    }

    .hero-title {
        font-size: var(--font-size-6xl);
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 250px;
    }

    .content-grid {
        gap: var(--space-8);
    }

    .main-content {
        padding: var(--space-12) var(--space-8);
    }

    .hero {
        padding: var(--space-16) 0;
    }

    .hero-title {
        font-size: var(--font-size-5xl);
    }

    .posts-container {
        grid-template-columns: 1fr;
    }

    .post-item:nth-child(4),
    .post-item:nth-child(7) {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .header-content {
        padding: var(--space-4) var(--space-4);
        flex-wrap: wrap;
        gap: var(--space-4);
    }

    .site-title {
        font-size: var(--font-size-xl);
    }

    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: var(--space-6);
    }

    .nav-link {
        font-size: var(--font-size-sm);
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .main-content {
        padding: var(--space-8) var(--space-4);
    }

    .hero {
        padding: var(--space-12) 0;
    }

    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-lg);
    }

    .sidebar {
        order: 1;
    }

    .posts-section,
    .post-content {
        order: 0;
    }

    .post-container h1 {
        font-size: var(--font-size-3xl);
    }

    .post-container h2 {
        font-size: var(--font-size-2xl);
    }

    .post-container h3 {
        font-size: var(--font-size-xl);
    }

    .social-links {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .posts-header h2 {
        font-size: var(--font-size-3xl);
    }

    .post-item:first-child .post-title {
        font-size: var(--font-size-2xl);
    }

    .post-item:first-child .post-hero-image {
        height: 280px;
    }

    .post-hero-image {
        height: 200px;
    }

    .post-title {
        font-size: var(--font-size-xl);
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-base: 1rem;
    }

    .main-content {
        padding: var(--space-6) var(--space-3);
    }

    .header-content {
        padding: var(--space-4) var(--space-3);
    }

    .hero {
        padding: var(--space-10) 0;
    }

    .hero-content {
        padding: 0 var(--space-3);
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }

    .hero-cta {
        padding: var(--space-3) var(--space-6);
        font-size: var(--font-size-sm);
    }

    .sidebar-section {
        padding: var(--space-4);
    }

    .post-item:first-child .post-hero-image {
        height: 220px;
    }

    .post-hero-image {
        height: 180px;
    }

    .post-container pre {
        padding: var(--space-4);
        margin-left: calc(-1 * var(--space-3));
        margin-right: calc(-1 * var(--space-3));
        border-radius: 0;
    }

    .post-item {
        padding: var(--space-6);
    }

    .posts-header h2 {
        font-size: var(--font-size-2xl);
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
    }

    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}