/*
 * Shared styles for somepago.github.io
 * Typewriter-style minimal theme
 */

:root {
    --bg: #faf9f7;
    --text: #2c2c2c;
    --text-muted: #666;
    --link: #0066cc;
    --border: #e0e0e0;
    --code-bg: #f4f4f4;
    --font-mono: 'IBM Plex Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --font-serif: 'Georgia', 'Times New Roman', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 17px; }

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

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

/* Navigation */
nav {
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-right: 2rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

nav a:hover, nav a.active { color: var(--text); }
nav a.active::before { content: '> '; }

/* Header */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 3rem;
}

.intro { flex: 1; }

h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.links { display: flex; flex-wrap: wrap; gap: 1.5rem; }

.links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.links a:hover { color: var(--link); }
.links a::before { content: '['; }
.links a::after { content: ']'; }

.portrait {
    width: 140px;
    height: 140px;
    border-radius: 4px;
    object-fit: cover;
    filter: grayscale(20%);
    transition: filter 0.3s;
}

.portrait:hover { filter: grayscale(0%); }

/* Sections */
section { margin-bottom: 3rem; }

h2 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

/* About */
.about p {
    margin-bottom: 1rem;
    font-family: var(--font-serif);
    font-size: 1rem;
}

.about a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.about a:hover { border-bottom-color: var(--link); }

.contact {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.email {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: var(--code-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

/* Visual grid */
.visual-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.visual-grid figure { margin: 0; }

.visual-grid img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.visual-grid img:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.visual-grid figcaption {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.4;
}

.visual-grid .venue {
    display: block;
    font-size: 0.75rem;
    color: var(--text);
    font-weight: 500;
    margin-top: 0.2rem;
}

/* Papers */
.paper {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dotted var(--border);
}

.paper .year {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    width: 50px;
}

.paper-content { flex: 1; }

.paper-content a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: color 0.2s;
}

.paper-content a:hover { color: var(--link); }

.paper-meta {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
}

.paper-content .venue {
    color: var(--text-muted);
}

.paper-links::before {
    content: ' · ';
    color: var(--text-muted);
}

.paper-links a::before {
    content: '[';
}

.paper-links a::after {
    content: ']';
}

.paper-links a {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.paper-links a:hover { color: var(--link); }

.more-papers { margin-top: 1rem; }

.more-papers a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.more-papers a:hover { color: var(--link); }

/* Featured posts */
.post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.post-card {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    border-color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    margin: 0.5rem 0;
    line-height: 1.4;
}

.post-card p {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* News */
.news ul { list-style: none; }

.news li {
    margin-bottom: 0.7rem;
    font-size: 0.9rem;
}

.news .date {
    color: var(--text-muted);
    margin-right: 1rem;
    font-size: 0.85rem;
}

.news a {
    color: var(--link);
    text-decoration: none;
}

/* Notes */
.notes-list { margin-top: 2rem; }

.note {
    padding: 1.5rem 0;
    border-bottom: 1px dotted var(--border);
}

.note:first-child { padding-top: 0; }

.note-header {
    margin-bottom: 0.75rem;
}

.note-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.note-header h2 {
    font-size: 1rem;
    font-weight: 500;
    margin: 0.3rem 0;
    letter-spacing: 0;
    display: inline;
}

.note-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 0.5rem;
}

.note-link:hover { color: var(--link); }

.note-content {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.6;
}

.note-content p {
    margin-bottom: 0.5rem;
}

.note-content ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.note-content li {
    margin-bottom: 0.25rem;
}

/* Stories */
.stories-list { margin-top: 2rem; }

.story-preview {
    padding: 1.5rem 0;
    border-bottom: 1px dotted var(--border);
}

.story-preview:first-child { padding-top: 0; }

.story-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.story-preview h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0.4rem 0;
    letter-spacing: 0;
}

.story-preview h2 a {
    color: var(--text);
    text-decoration: none;
}

.story-preview h2 a:hover { color: var(--link); }

.story-teaser {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.story-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Story page */
.story-header h1 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.story-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.story-content {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.9;
}

.story-content p {
    margin-bottom: 1.5rem;
}

.story-break {
    text-align: center;
    color: var(--text-muted);
    margin: 2rem 0;
}

.story-end {
    text-align: center;
    color: var(--text-muted);
    margin-top: 2rem;
}

.story-inspiration {
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--code-bg);
    border-radius: 4px;
}

.story-inspiration h3 {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

.story-inspiration p {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
}

.story-inspiration em {
    color: var(--text);
}

.story-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Blog list */
.blog-list { margin-top: 2rem; }

.blog-post {
    padding: 1.5rem 0;
    border-bottom: 1px dotted var(--border);
}

.blog-post:first-child { padding-top: 0; }

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.blog-post h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0.5rem 0;
    letter-spacing: 0;
}

.blog-post h2 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-post h2 a:hover { color: var(--link); }

.post-excerpt {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

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

.tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--code-bg);
    border-radius: 3px;
    color: var(--text-muted);
}

/* Blog post page */
.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.back-link:hover { color: var(--link); }

.post-header h1 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Post content */
.post-content {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.8;
}

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

.post-content .lead {
    font-size: 1.15rem;
    border-left: 3px solid var(--border);
    padding-left: 1rem;
    margin-bottom: 2rem;
}

.post-content h2 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: 0;
}

.post-content h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-content a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.post-content a:hover { border-bottom-color: var(--link); }

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

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

/* Code blocks */
.post-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--code-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.post-content pre code {
    background: none;
    padding: 0;
}

/* Images in posts */
.post-content figure {
    margin: 2rem 0;
}

.post-content figure img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.post-content figcaption {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    line-height: 1.5;
}

/* Side by side images */
.image-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.image-row img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.image-row figcaption {
    grid-column: 1 / -1;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

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

.post-content th {
    font-weight: 600;
    background: var(--code-bg);
}

/* Blockquotes */
.post-content blockquote {
    border-left: 3px solid var(--border);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

footer p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
    html { font-size: 15px; }
    .container { padding: 2rem 1.5rem; }

    .header-content {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }

    .links { justify-content: center; }
    .portrait { width: 120px; height: 120px; }
    .post-grid { grid-template-columns: 1fr; }
    .visual-grid { grid-template-columns: 1fr; }

    .paper { flex-direction: column; gap: 0.3rem; }
    .paper .year { width: auto; }
    nav a { margin-right: 1rem; }

    .post-header h1 { font-size: 1.3rem; }
    .post-content pre { padding: 1rem; font-size: 0.8rem; }
    .post-content table { font-size: 0.75rem; }
    .image-row { grid-template-columns: 1fr; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1a;
        --text: #e0e0e0;
        --text-muted: #999;
        --link: #6db3f2;
        --border: #333;
        --code-bg: #252525;
    }

    .portrait { filter: grayscale(30%); }
    .portrait:hover { filter: grayscale(10%); }
}
