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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #444444;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.main-content {
    max-width: 620px;
    margin: 0 auto;
    padding: 100px 24px 60px;
}

/* Kernel tile accent — matmul-style wave, one loop */
.kernel-grid-wrap {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.kernel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 4px;
    width: 32px;
    height: 32px;
}

.kernel-cell {
    width: 100%;
    aspect-ratio: 1;
    background: #e8e8e8;
    border-radius: 2px;
    animation: kernel-pulse 5s ease-in-out infinite;
}

.kernel-cell:nth-child(1)  { animation-delay: 0s; }
.kernel-cell:nth-child(2)  { animation-delay: 0.31s; }
.kernel-cell:nth-child(3)  { animation-delay: 0.62s; }
.kernel-cell:nth-child(4)  { animation-delay: 0.93s; }
.kernel-cell:nth-child(5)  { animation-delay: 1.25s; }
.kernel-cell:nth-child(6)  { animation-delay: 1.56s; }
.kernel-cell:nth-child(7)  { animation-delay: 1.87s; }
.kernel-cell:nth-child(8)  { animation-delay: 2.18s; }
.kernel-cell:nth-child(9)  { animation-delay: 2.5s; }
.kernel-cell:nth-child(10) { animation-delay: 2.81s; }
.kernel-cell:nth-child(11) { animation-delay: 3.12s; }
.kernel-cell:nth-child(12) { animation-delay: 3.43s; }
.kernel-cell:nth-child(13) { animation-delay: 3.75s; }
.kernel-cell:nth-child(14) { animation-delay: 4.06s; }
.kernel-cell:nth-child(15) { animation-delay: 4.37s; }
.kernel-cell:nth-child(16) { animation-delay: 4.68s; }

@keyframes kernel-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.92); }
    8%      { opacity: 1;   transform: scale(1); }
    16%, 100% { opacity: 0.4; transform: scale(0.92); }
}

.container-wrap {
    position: relative;
    padding-left: 52px;
}

.container {
    max-width: 620px;
}

h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666666;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: #444444;
}

a {
    color: #000000;
    text-decoration: none;
    border-bottom: 1px solid #e0e0e0;
    transition: border-color 0.2s ease;
}

a:hover {
    border-bottom-color: #000000;
}

.social-icons {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 20px;
}

.social-icons a {
    border-bottom: none;
    display: inline-flex;
    transition: transform 0.2s ease;
}

.social-icons a:hover {
    transform: translateY(-1px);
}

.social-icons img {
    width: 24px;
    height: 24px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    filter: none;
}

.social-icons a:hover img {
    opacity: 1;
}

/* Blog Listing Styles */
.blog-list {
    margin-top: 1.5rem;
}

.blog-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.blog-item:last-child {
    border-bottom: none;
}

.blog-item h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: #444444;
}

.blog-item h2 a {
    color: #444444;
}

.blog-date {
    color: #666666;
    font-size: 0.875rem;
    white-space: nowrap;
    margin-left: 1rem;
}

/* Blog Post Styles */
.blog-post-title {
    margin-bottom: 0.5rem;
}

.blog-post-date {
    color: #666666;
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

/* Project Styles */
.project-list {
    margin-top: 1.5rem;
}

.project-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.project-item:last-child {
    border-bottom: none;
}

.project-item h3 {
    margin-top: 0;
}

.project-description {
    color: #666666;
    margin-bottom: 0.5rem;
}

/* Markdown Content Styles */
#markdown-content {
    line-height: 1.6;
}

#markdown-content img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin: 1rem 0;
}

#markdown-content pre {
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

#markdown-content code {
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 0.875em;
}

#markdown-content ul,
#markdown-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

#markdown-content li {
    margin-bottom: 0.25rem;
}

/* Table of Contents */
.main-nav {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.toc-section {
    margin-top: 1.5rem;
}

.toc-section h2 {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

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

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-link {
    color: #444444;
    font-size: 0.9rem;
    border-bottom: 1px solid #e0e0e0;
    display: inline;
}

.toc-link:hover {
    border-bottom-color: #000000;
}

.toc-link.active {
    font-weight: 600;
}

/* Sidebar (if used) */
.sidebar {
    display: none;
}

/* Responsive */
@media (max-width: 600px) {
    .container-wrap {
        padding-left: 0;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .kernel-grid-wrap {
        position: static;
        width: auto;
        height: auto;
        justify-content: flex-start;
    }

    .main-content {
        padding: 60px 24px 40px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .blog-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .blog-date {
        margin-left: 0;
    }
}
