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

html {
    scroll-behavior: smooth;
}

::selection {
    background: #000;
    color: #fff;
}

body {
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    background: #fff;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Header ── */

header {
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.portrait-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #fff;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.portrait-small:hover {
    opacity: 0.7;
}

header h1 {
    font-size: 18px;
    font-weight: normal;
    margin-bottom: 4px;
}

header h1 a {
    color: #000;
    text-decoration: none;
}

header h1 a:hover {
    background: none;
    color: #666;
}

header p {
    font-size: 14px;
    color: #666;
}

/* ── Navigation ── */

nav {
    margin-bottom: 60px;
    border-bottom: 1px solid #000;
    padding-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
}

nav a {
    color: #000;
    text-decoration: none;
    transition: color 0.15s;
}

nav a:hover {
    text-decoration: underline;
}

/* ── Layout ── */

main {
    margin-bottom: 60px;
}

section {
    margin-bottom: 60px;
}

/* ── Typography ── */

h2 {
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 30px;
    text-transform: lowercase;
    letter-spacing: 0.05em;
}

h3 {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

/* ── Links ── */

a {
    color: #000;
    text-decoration: underline;
    transition:
        color 0.15s,
        background-color 0.15s;
}

a:hover {
    background: #000;
    color: #fff;
}

/* ── Articles ── */

article {
    margin-bottom: 40px;
}

article time {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

article p {
    margin-bottom: 10px;
}

/* ── Lists ── */

ul {
    list-style: none;
    padding-left: 0;
}

ul li {
    margin-bottom: 6px;
}

ul li::before {
    content: "- ";
}

/* ── Intro section ── */

#intro {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;
}

/* ── About section ── */

#about p {
    margin-bottom: 24px;
    line-height: 1.7;
}

/* ── Project cards ── */

.project-card {
    border: 1px solid #000;
    padding: 24px;
    margin-bottom: 24px;
    transition: border-color 0.2s;
}

.project-card:hover {
    border-color: #666;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.project-header h3 {
    margin-bottom: 0;
}

.project-preview {
    display: block;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    transition: border-color 0.2s;
}

.project-preview:hover {
    background: none;
    border-color: #999;
}

.project-preview-img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s;
}

.project-preview:hover .project-preview-img {
    opacity: 0.9;
}

.project-badge {
    flex-shrink: 0;
    margin-left: 16px;
    text-decoration: none;
}

.project-badge:hover {
    background: none;
}

.project-badge img {
    display: block;
    height: 20px;
}

.project-card > p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: #374151;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.project-tags span {
    font-size: 11px;
    color: #666;
    border: 1px solid #ddd;
    padding: 2px 8px;
    transition:
        border-color 0.15s,
        color 0.15s;
}

.project-card:hover .project-tags span {
    border-color: #bbb;
}

.project-links {
    display: flex;
    gap: 20px;
    font-size: 13px;
}

.project-links a {
    color: #000;
    text-decoration: none;
}

.project-links a:hover {
    text-decoration: underline;
    background: none;
}

/* ── View all link ── */

.view-all {
    display: inline-block;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
}

.view-all:hover {
    color: #000;
    background: none;
    text-decoration: underline;
}

/* ── Blog cards ── */

.blog-card {
    border: 1px solid #000;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: border-color 0.2s;
}

.blog-card:hover {
    border-color: #666;
}

.blog-thumbnail {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border: 1px solid #e0e0e0;
}

.blog-content {
    flex: 1;
}

.blog-content h3 {
    font-size: 16px;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 10px;
}

.blog-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.read-link {
    font-size: 14px;
    color: #000;
    text-decoration: none;
    display: inline-block;
}

.read-link:hover {
    background: #000;
    color: #fff;
}

/* ── Code ── */

code {
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    background: #f5f5f5;
    padding: 2px 4px;
}

pre {
    background: #f5f5f5;
    padding: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

pre code {
    background: none;
    padding: 0;
}

/* ── Footer ── */

footer {
    border-top: 1px solid #000;
    padding-top: 20px;
    font-size: 12px;
    color: #666;
}

/* ── Responsive ── */

@media (max-width: 600px) {
    body {
        padding: 20px 15px;
    }

    header {
        margin-bottom: 30px;
    }

    nav {
        margin-bottom: 40px;
        gap: 4px 16px;
    }

    section {
        margin-bottom: 40px;
    }

    .project-card {
        padding: 16px;
    }

    .project-header {
        flex-direction: column;
        gap: 8px;
    }

    .project-badge {
        margin-left: 0;
    }

    .blog-card {
        flex-direction: column;
    }

    .blog-thumbnail {
        width: 100%;
        height: 200px;
    }
}