/* CSS Variables */
:root {
    --sidebar-width: 16rem;
    --primary-color: #2563eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

/* Dark theme overrides */
body.theme-dark {
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --bg-primary: #111827;
    --bg-secondary: #0b1220;
    --border-color: #374151;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.6);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.6);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
}

/* Layout */
.site-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.mobile-header {
    display: none;
}

/* Sidebar */
.sidebar {
    background: var(--bg-primary);
    padding: 2rem;
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

/* Make sidebar content fill height so footer can stick to bottom */
.sidebar > nav {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
}

.theme-toggle .icon {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
}

.sidebar-logo {
    margin-bottom: 3rem;
}

.sidebar-logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
}

.sidebar-logo-img {
    vertical-align: middle;
    margin-right: 0.5rem;
}

.sidebar-logo-img.round {
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-banner {
    width: 100%;
    height: auto;
}

/* Default (light mode): show dark banner (dark text) */
.sidebar-banner-light {
    display: none;
}

.sidebar-banner-dark {
    display: inline;
}

/* Dark mode: show light banner (light text) */
body.theme-dark .sidebar-banner-dark {
    display: none;
}

body.theme-dark .sidebar-banner-light {
    display: inline;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.25rem;
}

/* Collapsible nav group */
.nav-group-toggle {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    justify-content: flex-start;
}

.nav-group-arrow {
    margin-left: auto;
    font-size: 1rem;
    transition: transform 0.2s;
}

.nav-group.open > .nav-group-toggle .nav-group-arrow {
    transform: rotate(90deg);
}

.nav-group-menu {
    display: none;
    flex-direction: column;
    padding-left: 1.25rem;
}

.nav-group.open > .nav-group-menu {
    display: flex;
}

.nav-sub-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.sidebar-social {
    display: flex;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    justify-content: center;
    margin-top: auto;
}

.social-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-link img {
    /* Base size (mobile first) */
    width: 1.25rem;   /* 20px */
    height: 1.25rem;
    opacity: 0.6;
    transition: opacity 0.2s, filter 0.2s;
    display: block; /* avoid inline-gap baseline issues */
}

/* Scale icon size with screen size */
@media (min-width: 640px) {
    .social-link img {
        width: 1.375rem; /* 22px */
        height: 1.375rem;
    }
}

@media (min-width: 1024px) {
    .social-link img {
        width: 1.5rem; /* 24px */
        height: 1.5rem;
    }
}

/* Light theme - darken icons for contrast on light background */
.social-link img { filter: brightness(0.25); }

/* Dark theme - lighten icons */
/* Dark theme - invert to white-ish, keep same opacity */
body.theme-dark .social-link img { filter: brightness(0) invert(1) opacity(0.7); }

/* Hover: tint to primary color (works for both themes) */
.social-link:hover img {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(40%) sepia(40%) saturate(3000%) hue-rotate(200deg);
}

body.theme-dark .social-link:hover img {
    filter: brightness(0) saturate(100%) invert(40%) sepia(100%) saturate(3000%) hue-rotate(200deg);
}

/* Main content */
main {
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.content-container {
    max-width: 800px;
    margin: 0 auto;
}

.content-container-wide {
    max-width: 1200px;
    margin: 0 auto;
}

/* Page header */
.page-header {
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.back-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.back-link:hover {
    text-decoration: underline;
}

.header-links {
    margin-top: 1rem;
}

.header-links a {
    color: var(--primary-color);
    text-decoration: none;
    margin-right: 1rem;
}

/* Home page */
.home-container {
    max-width: 800px;
    margin: 0 auto;
}

.home-intro {
    margin-bottom: 2.5rem;
    text-align: center;
}

.home-banner {
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

/* Default (light mode): show dark banner */
.home-banner-light {
    display: none;
}

.home-banner-dark {
    display: inline;
}

/* Dark mode: show light banner */
body.theme-dark .home-banner-dark {
    display: none;
}

body.theme-dark .home-banner-light {
    display: inline;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Granite CTA card */
.home-card-granite {
    margin-bottom: 2rem;
}

.home-card-link {
    display: block;
    text-decoration: none;
    background: #2D3142;
    border-radius: 0.75rem;
    padding: 2rem 2.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.home-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.home-granite-logo {
    max-width: 240px;
    height: auto;
    margin-bottom: 0.75rem;
}

/* Default: show dark logo (light text for dark card bg) */
.home-granite-logo-light {
    display: none;
}

.home-granite-logo-dark {
    display: inline;
}

.home-card-desc {
    color: #BFC0C0;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 0.75rem;
}

.home-card-action {
    color: #D4A843;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Tools & Projects grid */
.home-grid-section {
    margin-bottom: 3rem;
}

.home-grid-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.home-grid-card {
    display: block;
    text-decoration: none;
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.home-grid-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.home-grid-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.home-grid-card h3 {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}

.home-grid-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .home-grid {
        grid-template-columns: 1fr;
    }

    .home-granite-logo {
        max-width: 180px;
    }
}

.latest-post-section {
    margin-bottom: 2rem;
}

.latest-post-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.view-all {
    text-align: center;
    margin-top: 2rem;
}

.view-all a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Post cards */
.post-card {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
}

.post-date {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

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

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

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

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* Featured images */
.post-featured-image-link {
    display: block;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 0.5rem;
}

.post-featured-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
}

.post-featured-image-link:hover .post-featured-image {
    transform: scale(1.02);
}

.post-featured-image-container {
    margin: 2rem 0;
    overflow: hidden;
    border-radius: 0.5rem;
}

.post-featured-image-detail {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0.5rem;
}

/* Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 9999px;
    font-size: 0.875rem;
}

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

/* Blog post */
.blog-post,
.tutorial-post {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 3rem;
    box-shadow: var(--shadow-sm);
}

.post-header {
    margin-bottom: 2rem;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

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

/* Prose styles */
.prose {
    max-width: 65ch;
    line-height: 1.7;
    font-size: 1.125rem;
}

.prose h1 { font-size: 2.5rem; margin: 2rem 0 1rem; }
.prose h2 { font-size: 2rem; margin: 1.5rem 0 0.75rem; }
.prose h3 { font-size: 1.5rem; margin: 1.25rem 0 0.5rem; }
.prose h4 { font-size: 1.25rem; margin: 1rem 0 0.5rem; }
.prose p { margin: 1rem 0; }
.prose ul, .prose ol { margin: 1rem 0; padding-left: 2rem; }
.prose li { margin: 0.5rem 0; }
.prose a { color: var(--primary-color); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}
body.theme-dark .prose code {
    color: #1f2937; /* dark text on light background in dark mode */
}
body.theme-dark .prose pre code {
    color: inherit; /* inherit light text from pre in dark mode */
}
.prose pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.prose pre code {
    background: none;
    padding: 0;
}
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}
.prose blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
.prose th,
.prose td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}
.prose th {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* Archive */
.archive-year {
    margin-bottom: 3rem;
}

.archive-year h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.archive-list {
    list-style: none;
}

.archive-list li {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
}

.archive-list time {
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 6rem;
}

.archive-list a {
    color: var(--text-primary);
    text-decoration: none;
}

.archive-list a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Tutorial grid */
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tutorial-card {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.tutorial-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tutorial-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

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

.tutorial-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Tutorials list */
.tutorials-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tutorial-item {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.tutorial-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.tutorial-item h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.tutorial-item h3 a:hover {
    color: var(--primary-color);
}

.tutorial-item p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.tutorial-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Projects grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.project-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

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

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.project-link:hover {
    text-decoration: underline;
}

/* Featured project card */
.featured-project {
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
    border-radius: 0.75rem;
    padding: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border: 2px solid #ff6b9d;
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
}

.featured-project::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
}

.featured-badge {
    display: inline-block;
    background: #ff6b9d;
    color: #1a0a2e;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.featured-content {
    position: relative;
    z-index: 1;
}

.featured-content h2 {
    font-size: 1.75rem;
    color: #fff;
    margin-bottom: 0.25rem;
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.5);
}

.featured-tagline {
    font-size: 1rem;
    color: #00d4ff;
    margin-bottom: 1rem;
    font-style: italic;
}

.featured-content p {
    color: #e0e0e0;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.featured-link {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b9d 0%, #b967ff 100%);
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.featured-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* Chiptune promo on home page */
.chiptune-promo {
    margin-bottom: 3rem;
}

.chiptune-promo-link {
    text-decoration: none;
    display: block;
}

.promo-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 100%);
    border: 2px solid #ff6b9d;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.promo-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.3);
}

.badge-icon {
    font-size: 2rem;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 5px #ff6b9d; }
    50% { text-shadow: 0 0 20px #ff6b9d, 0 0 30px #b967ff; }
}

.badge-text {
    flex: 1;
}

.badge-title {
    display: block;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.5);
}

.badge-subtitle {
    display: block;
    color: #00d4ff;
    font-size: 0.875rem;
}

.badge-arrow {
    color: #ff6b9d;
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.promo-badge:hover .badge-arrow {
    transform: translateX(4px);
}

/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-card {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.gallery-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gallery-cover {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.gallery-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-card:hover .gallery-cover img {
    transform: scale(1.05);
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.gallery-info p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.photo-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Photo grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    grid-auto-rows: 280px;
}

.photo-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    display: block;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}

.photo-card:hover img {
    opacity: 0.9;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.photo-card:hover .photo-overlay {
    transform: translateY(0);
}

.photo-overlay h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.photo-overlay p {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Photo viewer */
.photo-viewer {
    background: #000;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 2rem;
}

.photo-full {
    width: 100%;
    height: auto;
    display: block;
}

.photo-info {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.photo-info h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.photo-caption {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.photo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.photo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.photo-nav {
    display: flex;
    justify-content: space-between;
}

.nav-button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.nav-button:hover {
    background: #1d4ed8;
}

.contact-success {
    text-align: center;
    padding: 1rem 0;
}

.contact-success h3 {
    margin-bottom: 0.75rem;
}

.contact-success p {
    margin-bottom: 1.5rem;
}

.contact-success .nav-button {
    display: inline-block;
}

/* Mobile styles */
@media (max-width: 768px) {
    .site-wrapper {
        grid-template-columns: 1fr;
    }
    
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .logo {
        font-size: 1.25rem;
        font-weight: bold;
        color: var(--text-primary);
        text-decoration: none;
    }
    
    .menu-toggle {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-primary);
        cursor: pointer;
        padding: 0.5rem;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        display: none;
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    main {
        padding: 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .about-header {
        flex-direction: column;
        text-align: center;
    }
    
    .about-header h1 {
        font-size: 2rem;
    }
    
    .blog-post,
    .tutorial-post {
        padding: 1.5rem;
    }
    
    .post-header h1 {
        font-size: 2rem;
    }
    
    .prose {
        font-size: 1rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-auto-rows: 150px;
    }
    
    .tutorial-grid,
    .projects-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}


/* Make mugshot.png images circular without outline */
/* Use contains selector to be robust to different paths or query strings */
img[src*="mugshot.png"] {
  border-radius: 50%;
  clip-path: circle(50%);
  object-fit: cover;
  display: block;
  aspect-ratio: 1 / 1; /* ensure square box even if only one dimension is set */
  overflow: hidden; /* ensure perfect circle crop */
}
