/* Terminal King — Linux-terminal inspired Ghost theme
   Green-on-black, monospace, with a three.js particle field behind. */

:root {
    --bg: #0a0e0a;
    --bg-soft: #0e140e;
    --panel: rgba(10, 20, 10, 0.55);
    --line: #1c2a1c;
    --fg: #c8f7c5;
    --fg-dim: #6f9f6a;
    --green: #00e676;
    --amber: #ffb300;
    --cyan: #4dd0e1;
    --red: #ff5252;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --maxw: 860px;
}

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

html, body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

body { min-height: 100vh; overflow-x: hidden; }

/* three.js particle canvas — fixed behind everything */
#tk-field {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.75;
}

/* subtle grid overlay for the "terminal" feel */
.tk-grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 230, 118, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 230, 118, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
}

/* scanline shimmer */
.tk-scanlines {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0px,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.10) 3px
    );
    opacity: 0.35;
}

.tk-wrap {
    position: relative;
    z-index: 3;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

/* ── header ── */
.tk-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    backdrop-filter: blur(6px);
}

.tk-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--fg);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.tk-logotype { color: var(--fg); }
.tk-prompt { color: var(--green); }
.tk-blink { color: var(--green); animation: tk-blink 1.1s steps(2, start) infinite; }
@keyframes tk-blink { 50% { opacity: 0; } }

.tk-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 0.85rem;
}
.tk-nav a, .tk-nav ul a { color: var(--fg-dim); text-decoration: none; }
.tk-nav a:hover { color: var(--green); }
.tk-nav ul { list-style: none; display: inline; padding: 0; margin: 0; }
.tk-nav li { display: inline; margin-right: 0.9rem; }

.tk-main { margin-top: 2.25rem; }

/* ── hero ── */
.tk-hero { margin-bottom: 2.5rem; }
.tk-hero-title {
    font-family: var(--mono);
    font-size: clamp(1.3rem, 3.4vw, 2rem);
    line-height: 1.3;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: -0.02em;
}
.tk-hero-text { color: var(--fg); }
.tk-hero-sub { margin-top: 0.9rem; font-size: 1rem; }
.tk-hero-meta {
    margin-top: 0.9rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.tk-dim { color: var(--fg-dim); }
.tk-dim-strong { color: #3f5a3c; }

/* ── posts list (terminal `ls`) ── */
.tk-posts-head {
    font-family: var(--mono);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}
.tk-posts-count { color: #3f5a3c; }

.tk-post { border-bottom: 1px solid var(--line); }
.tk-post-link {
    display: block;
    padding: 1rem 0.85rem;
    text-decoration: none;
    color: inherit;
    border-left: 2px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.tk-post-link:hover {
    background: rgba(0, 230, 118, 0.05);
    border-left-color: var(--green);
}
.tk-post-row { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.tk-post-date { font-family: var(--mono); font-size: 0.78rem; flex-shrink: 0; }
.tk-post-title {
    font-family: var(--mono);
    font-size: 1.02rem;
    font-weight: 500;
    color: var(--fg);
}
.tk-post-link:hover .tk-post-title { color: var(--green); }
.tk-post-excerpt { font-size: 0.88rem; margin-top: 0.35rem; }
.tk-post-tags { margin-top: 0.55rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tk-tag {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--cyan);
    border: 1px solid rgba(77, 208, 225, 0.3);
    border-radius: 4px;
    padding: 0.05rem 0.4rem;
}
.tk-tag-more { color: var(--green); border-color: rgba(0, 230, 118, 0.35); }

/* ── pagination ── */
.tk-pagination { margin-top: 2rem; }
.tk-pagination-inner {
    font-family: var(--mono);
    font-size: 0.82rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.tk-pagination a { color: var(--green); text-decoration: none; }
.tk-pagination a:hover { text-decoration: underline; }

/* ── article/post ── */
.tk-article { margin-top: 0.5rem; }
.tk-article-head { margin-bottom: 1.75rem; border-bottom: 1px solid var(--line); padding-bottom: 1.25rem; }
.tk-article-title {
    font-family: var(--mono);
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    line-height: 1.25;
    color: var(--fg);
    letter-spacing: -0.02em;
}
.tk-article-meta {
    margin-top: 0.8rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.tk-content { font-size: 1.02rem; color: #d7f5d4; }
.tk-content > * + * { margin-top: 1.15em; }
.tk-content h2, .tk-content h3 {
    font-family: var(--mono);
    color: var(--fg);
    margin-top: 1.8em;
    line-height: 1.3;
}
.tk-content h2 { font-size: 1.3rem; }
.tk-content h3 { font-size: 1.1rem; }
.tk-content a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(77,208,225,0.35); }
.tk-content a:hover { color: var(--green); border-bottom-color: var(--green); }
.tk-content ul, .tk-content ol { padding-left: 1.4rem; }
.tk-content li { margin-top: 0.4em; }
.tk-content blockquote {
    border-left: 3px solid var(--green);
    padding: 0.4rem 1rem;
    color: var(--fg-dim);
    background: rgba(0,230,118,0.04);
    font-style: italic;
}
.tk-content code {
    font-family: var(--mono);
    background: #0f1a0f;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.9em;
    color: var(--amber);
}
.tk-content pre {
    background: #060a06;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}
.tk-content pre code { background: none; border: 0; padding: 0; color: var(--fg); }
.tk-content img { max-width: 100%; height: auto; border-radius: 8px; }
.tk-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* ── footer ── */
.tk-footer {
    margin-top: 3.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.78rem;
}
.tk-footer-line { margin-bottom: 0.35rem; }
.tk-cursor-line { color: var(--green); margin-right: 0.4rem; }
.tk-footer-nav a { color: var(--fg-dim); text-decoration: none; }
.tk-footer-nav a:hover { color: var(--green); }
.tk-footer-meta { margin-top: 0.75rem; color: #3f5a3c; }

/* ghost cards fall-back (if a template slips through) */
.gh-card, .gh-post-card { color: var(--fg); }
.gh-head { display: none; }
