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


/* Variables */
:root {
    --bg:          #0a0a0a;
    --surface:     #141414;
    --card:        #1a1a1a;
    --text:        #e8e8e8;
    --muted:       rgba(232, 232, 232, 0.42);
    --faint:       rgba(232, 232, 232, 0.18);
    --border:      rgba(255, 255, 255, 0.07);
    --accent:      #cc2222;
    --accent-dim:  rgba(204, 34, 34, 0.18);
    --serif:       'EB Garamond', Georgia, Times, serif;
    --mono:        'JetBrains Mono', 'Courier New', monospace;
    --nav-h:       60px;
    --foot-h:      36px;
    --max-w:       1200px;
    --content-w:   740px;
    --pad:         clamp(20px, 4vw, 48px);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

/* Base */
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.75;
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0);    }
}


.site-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  	overflow-x: hidden;
}
.home-template .nav-menu .nav .nav-explore a {
    color: var(--accent);
}
.site-main {
    flex: 1;
    padding-top: var(--nav-h);
    padding-bottom: calc(var(--foot-h) + 24px);
}


.site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 200;
    height: var(--nav-h);
    background: rgba(10, 10, 10, 0.90);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 0.5px solid var(--border);
}

.site-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
}

/* Logo */
.nav-logo {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--text);
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
}


.nav-menu .nav {
    display: flex;
    gap: 28px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu .nav li a {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--muted);
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-menu .nav li a:hover       { color: var(--text); }
.nav-menu .nav li.nav-current a { color: var(--accent); }

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 4px;
    width: 28px;
    height: 28px;
}

.nav-burger span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
    transform-origin: center;
}

.nav-burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 767px) {
    .home-template .post-card-img {
        filter: grayscale(0%);
    }
}
@media (max-width: 767px) {
    .nav-burger { display: flex; }

    .nav-menu {
        display: none;
        position: fixed;
        top: var(--nav-h);
        inset-inline: 0;
        background: rgba(10, 10, 10, 0.98);
        border-bottom: 0.5px solid var(--border);
        padding: 28px var(--pad) 32px;
    }

    .nav-menu.is-open { 
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu .nav {
        flex-direction: column;
        gap: 20px;
    }

    .nav-menu .nav li a { font-size: 14px; }
}

@media (max-width: 767px) {
    .post-content img {
        max-height: 60vh;
        object-fit: cover;
    }
}
.hero {
    padding: 72px var(--pad) 64px;
    border-bottom: 0.5px solid var(--border);
    animation: fadeUp 0.45s ease both;
}

.hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}

.hero-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
}

.hero-title {
    font-family: var(--serif);
    font-size: clamp(36px, 5vw, 62px);
    font-weight: 400;
    font-style: italic;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 24px;
}

.hero-title em {
    font-style: normal;
    color: var(--accent);
}

.hero-sub {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    line-height: 1.8;
    white-space: nowrap;
}



.feed-section {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
    animation: fadeUp 0.45s 0.12s ease both;
    opacity: 0;
    animation-fill-mode: forwards;
}

.post-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    background-image:
        linear-gradient(45deg, rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 24px 24px;

}

@media (max-width: 991px) { .post-feed { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .post-feed { grid-template-columns: 1fr; } }



.post-card {
    background: var(--bg);
    transition: background 0.25s;
}

.post-card:hover { background: var(--surface); }

.post-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 28px;
}

/* Feature image */
.post-card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 3px;
    margin-bottom: 18px;
    background: var(--surface);
    filter: grayscale(100%);
    transition: filter 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
}
.post-card.tag-hash-banner .post-card-img {
    aspect-ratio: 3 / 1;
    object-fit: contain;
    background: var(--surface);
}
.post-card:hover .post-card-img { filter: grayscale(0%); }
.post-card:hover .post-card-title {
    color: var(--accent);
}

.post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card body */
.post-card-body { flex: 1; display: flex; flex-direction: column; }

.post-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.post-card-tag::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.post-card-title {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.25;
    color: var(--text);
    transition: color 0.25s;
    margin-bottom: 10px;
}

.post-card-excerpt {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--faint);
    letter-spacing: 0.04em;
    margin-top: auto;
}


.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px var(--pad) 24px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.pagination .older-posts,
.pagination .newer-posts {
    border: 0.5px solid var(--border);
    padding: 8px 18px;
    border-radius: 3px;
    transition: border-color 0.2s, color 0.2s;
}

.pagination .older-posts:hover,
.pagination .newer-posts:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination .page-number { color: var(--faint); }



.post-article {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 64px var(--pad);
    animation: fadeUp 0.45s ease both;
}

.post-header { margin-bottom: 40px; text-align: center}

.post-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.post-tag::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.post-title {
    font-family: var(--serif);
    font-size: clamp(30px, 4vw, 50px);
    font-weight: 400;
    line-height: 1.1;
    text-align: center;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 20px;
}

.post-meta {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.post-feature-img {
    margin: 0 0 48px;
    border-radius: 4px;
    overflow: hidden;
    border: 0.5px solid var(--border);
}

.post-feature-img img { width: 100%; height: auto; }


.post-content {
    font-family: var(--serif);
    font-size: 20px;
    line-height: 1.8;
    color: var(--text);
}

.post-content > * + * { margin-top: 1.4em; }

.post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.2;
    color: var(--text);
    margin-top: 2.2em;
    margin-bottom: -0.4em;
}

.post-content h2 { font-size: 1.65em; }
.post-content h3 { font-size: 1.35em; }
.post-content h4 { font-size: 1.15em; }

.post-content a {
    color: var(--accent);
    border-bottom: 0.5px solid var(--accent-dim);
    transition: border-color 0.2s;
}
.post-content a:hover { border-color: var(--accent); }

.post-content blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 24px;
    color: var(--muted);
    font-style: italic;
}

.post-content code {
    font-family: var(--mono);
    font-size: 0.83em;
    background: var(--surface);
    color: var(--accent);
    padding: 2px 7px;
    border-radius: 3px;
    border: 0.5px solid var(--border);
}
@media (max-width: 767px) {
    .post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
.post-content pre {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 4px;
    padding: 20px 24px;
    overflow-x: auto;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
    font-size: 0.9em;
}

.post-content hr {
    border: none;
    border-top: 0.5px solid var(--border);
}

.post-content img {
    border-radius: 4px;
    border: 0.5px solid var(--border);
}

.post-content figure { margin: 0; }
.post-content figcaption {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    margin-top: 8px;
    letter-spacing: 0.04em;
}
.post-content .kg-image-card img {
    width: 100%;
    height: auto;
    background: var(--surface);
}

@media (max-width: 767px) {
    .post-content .kg-image-card img {
        max-height: 80vh;
        object-fit: contain;
    }
}
.post-content ul, .post-content ol {
    padding-left: 1.5em;
}

.post-content li + li { margin-top: 0.4em; }

.post-content table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 13px;
}

.post-content th, .post-content td {
    padding: 10px 14px;
    border: 0.5px solid var(--border);
    text-align: left;
}

.post-content th {
    color: var(--accent);
    letter-spacing: 0.06em;
    font-size: 11px;
    text-transform: uppercase;
}


.archive-header {
    padding: 64px var(--pad) 52px;
    border-bottom: 0.5px solid var(--border);  
    animation: fadeUp 0.45s ease both;
}

.archive-header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.archive-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    color: var(--accent);
    margin-bottom: 14px;
}

.archive-title {
    font-family: var(--serif);
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 400;
    text-align: center;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
}

.archive-desc {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin-top: 16px;
    max-width: 520px;
    text-wrap: balance;
    line-height: 1.7;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 0.5px solid var(--border);
    margin-bottom: 16px;
    filter: grayscale(100%);
}

.site-footer {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 200;
    height: var(--foot-h);
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 0.5px solid var(--border);
}
.archive-header {
    padding: 4rem 1rem 2rem;
}

.archive-title {
    margin-bottom: 0.5rem;
}
.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
}

.footer-logo {
    font-family: var(--mono);
    font-size: 11px;
    color: rgba(232, 232, 232, 0.22);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.footer-logo .footer-dev {
    color: var(--accent);
}
#lightbox-img {
    max-width: none;
}
.footer-tagline {
    font-family: var(--serif);
    font-style: normal;
    font-size: 12px;
    color: rgba(232, 232, 232, 0.40);
    text-align: right;
}

@media (max-width: 560px) {
    .site-footer { height: auto; }
    .site-footer-inner {
        flex-direction: column;
        align-items: center;       
        justify-content: center;
        gap: 2px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .footer-tagline { text-align: center; } 
    .hero-sub {
        white-space: normal;
        font-size: 11px;
    }

    .feed-section {
        padding-left: 0;
        padding-right: 0;
    }

    .post-card-link {
        padding: 20px 16px;
    }
}

.error-body { background: var(--bg); color: var(--text); }

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--pad);
    text-align: center;
    gap: 16px;
}

.error-code {
    font-family: var(--mono);
    font-size: 80px;
    font-weight: 400;
    color: var(--accent);
    line-height: 1;
}

.error-message {
    font-family: var(--serif);
    font-size: 22px;
    color: var(--muted);
}
.hint-mobile { display: none; }

@media (max-width: 767px) {
    .hint-desktop { display: none; }
    .hint-mobile  { display: inline; }
}
.error-back {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--text);
    border-bottom: 0.5px solid var(--border);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.error-back:hover { color: var(--accent); border-color: var(--accent); }
.kg-width-wide {
    margin-left: calc(50% - min(45vw, 600px));
    margin-right: calc(50% - min(45vw, 600px));
    width: auto;
}
.kg-width-full {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: auto;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }




.explore-wrap {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--nav-h) - var(--foot-h));
}
#explore-canvas {
    display: block;
    width: 100%;
    height: 100%;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}
.explore-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.10em;
    color: rgba(232,232,232,0.18);
    pointer-events: none;
    transition: opacity 1.4s ease;
    white-space: nowrap;
    width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

#explore-card {
    position: fixed;
    z-index: 300;
    width: 250px;
    background: #141414;
    border: 0.5px solid rgba(255,255,255,0.10);
    border-radius: 3px;
    padding: 20px 22px 18px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

#explore-card.ec-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ec-close {
    position: absolute;
    top: 10px; right: 12px;
    background: none; border: none;
    font-size: 16px; line-height: 1; padding: 0;
    color: rgba(232,232,232,0.3);
    transition: color 0.15s;
}
.ec-close:hover { color: var(--accent); }

.ec-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.ec-title {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 400;
    font-style: italic;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 8px;
}

.ec-excerpt {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ec-link {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--accent);
    transition: opacity 0.15s;
}
.ec-link:hover { opacity: 0.7; }
