@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=JetBrains+Mono:wght@400&display=swap');

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

:root {
    --ink: #2a2318;
    --muted: #7a6f5e;
    --accent: #8b6c42;
    --bg: #faf8f0;
    --grid-color: rgba(160, 140, 100, 0.18);
}

html { font-size: 18px; }

body {
    font-family: 'EB Garamond', Georgia, serif;
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px),
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--ink);
    max-width: 660px;
    margin: 0 auto;
    padding: 3.5rem 2rem 7rem;
    line-height: 1.75;
    min-height: 100vh;
}

/* ── Nav / shared header bits ── */

nav {
    font-size: 0.88rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0;
}

nav a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
    padding-bottom: 1px;
}

nav a:hover { border-bottom-color: var(--accent); }

nav .sep {
    color: var(--muted);
    margin: 0 0.45em;
    user-select: none;
}

/* ── Index page ── */

.site-header {
    margin-bottom: 2.8rem;
}

.site-header h1 {
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    margin-bottom: 0.55rem;
    line-height: 1.2;
}

.site-header nav { margin-top: 0.1rem; }

section {
    margin-bottom: 2.6rem;
}

section > p {
    font-size: 1rem;
    color: var(--ink);
    max-width: 560px;
}

section h2 {
    font-size: 0.78rem;
    font-weight: 400;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.9rem;
}

/* ── Article list (index) ── */

.article-list {
    list-style: none;
    counter-reset: article-counter;
}

.article-list li {
    counter-increment: article-counter;
    display: flex;
    align-items: baseline;
    gap: 0.7em;
    padding: 0.25rem 0;
    /* border-bottom: 1px solid rgba(160, 140, 100, 0.15); */
}

.article-list li:last-child { border-bottom: none; }

.article-list li::before {
    content: counter(article-counter) ".";
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    min-width: 1.6em;
    text-align: right;
    flex-shrink: 0;
}

.article-list a {
    color: var(--ink);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s, color 0.15s;
}

.article-list a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Article page ── */

.article-header {
    margin-bottom: 2.8rem;
    padding-bottom: 1.4rem;
    /* border-bottom: 1px solid rgba(160, 140, 100, 0.25); */
}

.article-header .back {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 1.4rem;
    letter-spacing: 0.03em;
    transition: color 0.15s;
}

.article-header .back:hover { color: var(--accent); }

.article-header .back::before { content: "← "; }

.article-header h1 {
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    max-width: 560px;
}

.article-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    display: flex;
    gap: 1.2em;
    flex-wrap: wrap;
}

/* ── Article body ── */

.article-body {
    max-width: 600px;
}

.article-body p {
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

.article-body h2 {
    font-size: 1.15rem;
    font-weight: 500;
    margin: 2rem 0 0.6rem;
    font-style: italic;
}

.article-body h3 {
    font-size: 0.82rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 1.6rem 0 0.5rem;
}

.article-body ul,
.article-body ol {
    padding-left: 1.4em;
    margin-bottom: 1.2rem;
}

.article-body li { margin-bottom: 0.3rem; }

.article-body blockquote {
    border-left: 2px solid var(--accent);
    margin: 1.4rem 0;
    padding: 0.1rem 0 0.1rem 1.2rem;
    color: var(--muted);
    font-style: italic;
}

.article-body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    background: rgba(139, 108, 66, 0.08);
    padding: 0.1em 0.35em;
    border-radius: 2px;
}

.article-body pre {
    background: rgba(139, 108, 66, 0.07);
    border: 1px solid rgba(160, 140, 100, 0.2);
    border-radius: 3px;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin-bottom: 1.2rem;
}

.article-body pre code {
    background: none;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.6;
}

.article-body a {
    color: var(--accent);
    text-decoration: none;
    /* border-bottom: 1px solid rgba(139, 108, 66, 0.35); */
    transition: border-color 0.15s;
}

.article-body a:hover { border-bottom-color: var(--accent); }

.article-body hr {
    border: none;
    border-top: 1px solid rgba(160, 140, 100, 0.25);
    margin: 2rem 0;
}

/* ── Footer ── */

footer {
    margin-top: 4rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--muted);
    opacity: 0.6;
}

/* ── Hero image ── */

.hero-image {
    margin: 0 0 2.8rem;
}

.hero-image__frame {
    position: relative;
    border: 1px solid rgba(139, 108, 66, 0.45);
    box-shadow:
        4px 4px 0 0 rgba(139, 108, 66, 0.15),
        8px 8px 0 0 rgba(139, 108, 66, 0.07);
    overflow: hidden;
    background: rgba(139, 108, 66, 0.04);
}

.hero-image__frame img {
    display: block;
    width: 100%;
    height: 400px;
    object-fit: cover;
    opacity: 0.92;
    filter: sepia(8%) contrast(1.02);
}

figcaption {
    margin-top: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    display: flex;
    align-items: baseline;
    gap: 0.8em;
}

.hero-image__label {
    color: var(--accent);
    flex-shrink: 0;
}

.inside-article-list a {
    /* color: var(--ink); */
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s, color 0.15s;
}

.inside-article-list a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Responsive ── */

@media (max-width: 480px) {
    body { padding: 2rem 1.2rem 5rem; }
    .site-header h1 { font-size: 1.45rem; }
    .article-header h1 { font-size: 1.3rem; }
}
