:root {
    --color-bg: #1a1a1a;
    --color-surface: #242424;
    --color-border: #333333;
    --color-border-accent: #3a3020;
    --color-text: #e8e6e3;
    --color-text-dim: #a8a39c;
    --color-accent: #d4a05f;
    --color-accent-dim: #2a2010;
    --color-accent-hover: #e0b478;
    --color-status-active: #7a9a6a;

    --font-body: Georgia, serif;
    --font-mono: "JetBrains Mono", "Courier New", monospace;
}

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

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

a {
    color: var(--color-accent);
    text-decoration: none;
}

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

/* ── Navigation ─────────────────────────────────────────── */

.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--color-border);
    background: #1e1e1e;
}

.nav-logo {
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.05em;
}

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

.nav-links a {
    color: var(--color-text-dim);
    font-family: var(--font-body);
    font-size: 0.9rem;
    position: relative;
    transition: color 0.15s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.2s ease;
}

.nav-links a:hover {
    color: var(--color-accent);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ── Layout ─────────────────────────────────────────────── */

main {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* ── Hero ───────────────────────────────────────────────── */

.hero {
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--color-text-dim);
    max-width: 520px;
}

.hero-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.hero-links a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px solid var(--color-border-accent);
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    color: var(--color-accent);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hero-links a:hover {
    background: var(--color-accent-dim);
    border-color: var(--color-accent);
}

/* ── Sections ───────────────────────────────────────────── */

.section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-dim);
    font-family: var(--font-mono);
    margin-bottom: 1.25rem;
}

/* ── Cards ──────────────────────────────────────────────── */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.15s ease, background 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.card p {
    color: var(--color-text-dim);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.35rem;
}

a .card:hover {
    border-color: var(--color-accent);
    background: #2a2a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

a h1 {
    transition: color 0.15s ease;
}

a:hover h1 {
    color: var(--color-accent);
}

/* ── Post cards ─────────────────────────────────────────── */

.post-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.15s ease, background 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card h2 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.post-card p {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

a .post-card:hover {
    border-color: var(--color-accent);
    background: #2a2a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ── Project header island ──────────────────────────────── */

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

.project-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border: 1px solid var(--color-border-accent);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    color: var(--color-accent);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.project-links a:hover {
    background: var(--color-accent-dim);
    border-color: var(--color-accent);
}

.project-body {
    max-width: 680px;
}

.project-body h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.project-body p {
    margin-bottom: 1rem;
}

/* ── Status & tags ──────────────────────────────────────── */

.status {
    font-size: 0.7rem;
    color: var(--color-status-active);
    font-family: var(--font-mono);
}

.post-date {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    font-family: var(--font-mono);
    white-space: nowrap;
}

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

.tag {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--color-accent);
    background: var(--color-accent-dim);
    border: 1px solid var(--color-border-accent);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    transition: background 0.15s ease, color 0.15s ease;
}

a .card .tag:hover {
    background: var(--color-accent-dim);
    color: var(--color-accent);
}

/* ── Typography ─────────────────────────────────────────── */

h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

article {
    line-height: 1.8;
    max-width: 680px;
}

article h1, article h2, article h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

article p {
    margin-bottom: 1rem;
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-surface);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    color: var(--color-accent);
}

pre {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

pre code {
    background: none;
    padding: 0;
    color: var(--color-text);
}

.post-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-dim);
    margin-bottom: 2rem;
}

/* ── Animations ─────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
    @keyframes fade-up {
        from {
            opacity: 0;
            transform: translateY(12px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    main {
        animation: fade-up 0.3s ease-out;
    }
}

/* ── Media ──────────────────────────────────────────────── */

figure.media-single {
    margin: 1.5rem 0;
}

figure.media-single img,
figure.media-single video {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

figure.media-single figcaption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-dim);
    margin-top: 0.5rem;
    text-align: center;
}

.carousel {
    position: relative;
    margin: 1.5rem 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-slide {
    min-width: 100%;
    margin: 0;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    display: block;
}

.carousel-slide figcaption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-dim);
    padding: 0.5rem 1rem;
    text-align: center;
    background: var(--color-surface);
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: background 0.15s ease;
    z-index: 10;
}

.carousel-prev { left: 0.75rem; }
.carousel-next { right: 0.75rem; }

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(0, 0, 0, 0.8);
}