/* ============================================================
   Presolt — Onyx & Mint
   Institutional-grade crypto data & research theme
   Palette: Onyx #0A0E14 · Mints #52B788 / #40916C / #95D5B2
   Type: Inter (UI/body) · JetBrains Mono (data/numerals)
   ============================================================ */

:root {
    /* Onyx surfaces */
    --onyx:        #0A0E14;
    --onyx-800:    #10151E;
    --onyx-700:    #161C28;
    --onyx-600:    #1E2633;
    --border:      #232C3A;
    --border-soft: #1A212C;

    /* Mints */
    --mint:        #52B788;
    --mint-deep:   #40916C;
    --mint-soft:   #95D5B2;

    /* Text */
    --text:        #E6EBF2;
    --text-muted:  #9AA6B6;
    --text-faint:  #6B7688;

    /* Type — custom-font aware (Ghost injects --gh-font-* when set in Design settings) */
    --font-sans: var(--gh-font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    --font-heading: var(--gh-font-heading, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

    /* Layout */
    --maxw:        1200px;
    --maxw-narrow: 720px;
    --radius:      10px;
    --radius-sm:   6px;
    --gap:         2rem;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: var(--onyx);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mint); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--mint-soft); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 0.6em;
}

/* Numerals / data / code always render in mono */
code, kbd, pre, samp, .is-data, time, .post-card-readtime {
    font-family: var(--font-mono);
    font-feature-settings: 'tnum' 1;
}

/* ---------- Layout helpers ---------- */
.inner { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.inner-narrow { max-width: var(--maxw-narrow); }
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; padding: 3rem 0 4rem; }

/* ---------- Header ---------- */
.site-header {
    border-bottom: 1px solid var(--border-soft);
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: saturate(140%) blur(10px);
    position: sticky; top: 0; z-index: 50;
}
.site-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 72px;
}

/* Brand: mark + wordmark lockup */
.site-logo {
    display: inline-flex; align-items: center; gap: 0.6rem;
    text-decoration: none; flex-shrink: 0;
}
.site-logo img { max-height: 30px; width: auto; }
.site-mark { display: inline-flex; }
.site-mark svg { height: 26px; width: auto; display: block; }
.site-wordmark {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1;
}

/* Nav */
.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav .nav {
    list-style: none; display: flex; align-items: center; gap: 1.6rem; margin: 0; padding: 0;
}
.site-nav .nav a {
    color: var(--text-muted); font-size: 0.92rem; font-weight: 500;
    letter-spacing: 0.005em; transition: color .15s var(--ease);
}
.site-nav .nav a:hover,
.site-nav .nav a.nav-current { color: #fff; }
.nav-item-badge { display: inline-flex; align-items: center; gap: 0.5rem; }

/* NEW badge */
.nav-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.18rem 0.55rem 0.18rem 0.45rem;
    border: 1px solid rgba(82, 183, 136, 0.55);
    background: rgba(64, 145, 108, 0.16);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em;
    color: var(--mint-soft); text-transform: uppercase;
}
.nav-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 6px rgba(82,183,136,0.8); }

/* Action buttons */
.site-nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.55rem 1.25rem; border-radius: 999px;
    font-size: 0.9rem; font-weight: 600; letter-spacing: 0.005em;
    text-decoration: none; white-space: nowrap; transition: all .18s var(--ease);
}
.btn-ghost {
    color: #fff; border: 1px solid var(--border);
    background: transparent;
}
.btn-ghost:hover { border-color: var(--mint-deep); color: #fff; }
.btn-primary {
    color: var(--onyx) !important;
    background: linear-gradient(180deg, #95d5b2 0%, #52b788 100%);
    border: 1px solid transparent;
}
.btn-primary:hover { background: linear-gradient(180deg, #a7ddc0 0%, #5fbe90 100%); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); display: block; border-radius: 2px; }

/* ---------- Hero ---------- */
.site-hero {
    border-bottom: 1px solid var(--border-soft);
    background:
        radial-gradient(900px 300px at 15% -10%, rgba(82,183,136,0.10), transparent 60%),
        linear-gradient(180deg, var(--onyx-800), var(--onyx));
    padding: 5rem 0 4rem;
}
.site-hero-inner { max-width: var(--maxw-narrow); }
.site-hero-eyebrow {
    font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--mint); display: inline-block; margin-bottom: 1rem;
}
.site-hero-title { font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: 0.5rem; }
.site-hero-description { font-size: 1.15rem; color: var(--text-muted); max-width: 56ch; margin: 0; }

/* ---------- Post feed / cards ---------- */
.post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--gap);
    padding-top: 1rem;
}
.post-card {
    background: var(--onyx-800);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.post-card:hover { border-color: var(--border); transform: translateY(-2px); }
.post-card-link { display: block; color: inherit; height: 100%; }
.post-card-link:hover { color: inherit; }
.post-card-image-wrap { aspect-ratio: 16/9; overflow: hidden; background: var(--onyx-600); }
.post-card-image { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.post-card:hover .post-card-image { transform: scale(1.03); }
.post-card-content { padding: 1.4rem 1.4rem 1.6rem; }
.post-card-tag {
    font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--mint); display: inline-block; margin-bottom: 0.6rem;
}
.post-card-title { font-size: 1.25rem; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.post-card-excerpt { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 1rem; }
.post-card-meta {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    font-size: 0.8rem; color: var(--text-faint);
}
.post-card-author { color: var(--text-muted); }
.post-card-dot { color: var(--border); }

/* ---------- Post ---------- */
.post-header { padding: 3.5rem 0 2rem; }
.post-header-inner { max-width: var(--maxw-narrow); }
.post-tag, .post-card-tag {
    font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--mint);
}
.post-tag { display: inline-block; margin-bottom: 1rem; }
.post-title { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 0.8rem; }
.post-excerpt { font-size: 1.2rem; color: var(--text-muted); margin: 0 0 1.4rem; }
.post-meta {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    font-size: 0.85rem; color: var(--text-faint);
    padding-top: 1rem; border-top: 1px solid var(--border-soft);
}
.post-meta-author { color: var(--text); font-family: var(--font-sans); font-weight: 500; }
.post-feature-image { margin: 0 auto 3rem; max-width: var(--maxw); padding: 0 24px; }
.post-feature-image img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border-soft); }
.post-feature-image figcaption {
    text-align: center; color: var(--text-faint); font-size: 0.85rem; margin-top: 0.75rem;
    font-family: var(--font-mono);
}

/* ---------- Content typography (gh-content) ---------- */
.gh-content { font-size: 1.08rem; line-height: 1.75; }
.gh-content > * { margin: 0 0 1.5rem; }
.gh-content h2 { font-size: 1.7rem; margin: 2.6rem 0 1rem; padding-top: 0.5rem; }
.gh-content h3 { font-size: 1.3rem; margin: 2rem 0 0.8rem; color: var(--mint-soft); }
.gh-content p { color: var(--text); }
.gh-content a { text-decoration: underline; text-decoration-color: rgba(82,183,136,0.4); text-underline-offset: 3px; }
.gh-content ul, .gh-content ol { padding-left: 1.4rem; color: var(--text); }
.gh-content li { margin-bottom: 0.5rem; }
.gh-content blockquote {
    border-left: 3px solid var(--mint); margin: 2rem 0; padding: 0.4rem 0 0.4rem 1.5rem;
    color: var(--text-muted); font-style: normal;
}
.gh-content code {
    background: var(--onyx-700); color: var(--mint-soft);
    padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.88em;
    border: 1px solid var(--border-soft);
}
.gh-content pre {
    background: var(--onyx-800); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.2rem 1.4rem; overflow-x: auto;
    font-size: 0.9rem; line-height: 1.6;
}
.gh-content pre code { background: none; border: 0; color: var(--text); padding: 0; }
.gh-content img { border-radius: var(--radius); border: 1px solid var(--border-soft); }
.gh-content hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.gh-content figcaption { text-align: center; color: var(--text-faint); font-size: 0.85rem; font-family: var(--font-mono); }

/* Tables render as data — mono numerals */
.gh-content table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.9rem; }
.gh-content th, .gh-content td { border: 1px solid var(--border); padding: 0.6rem 0.9rem; text-align: left; }
.gh-content th { background: var(--onyx-700); color: var(--mint-soft); font-weight: 600; }

/* ---------- Post footer ---------- */
.post-footer { padding: 1rem 0 2rem; }
.post-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.post-tag-chip {
    font-family: var(--font-mono); font-size: 0.78rem;
    background: var(--onyx-700); border: 1px solid var(--border-soft);
    padding: 0.35rem 0.75rem; border-radius: 999px; color: var(--text-muted);
}
.post-tag-chip:hover { border-color: var(--mint); color: var(--mint); }
.post-disclaimer {
    background: var(--onyx-800); border: 1px solid var(--border-soft);
    border-radius: var(--radius); padding: 1rem 1.25rem;
    color: var(--text-faint); font-size: 0.85rem;
}
.post-disclaimer p { margin: 0; }

/* ---------- Archives (tag/author) ---------- */
.archive-header { border-bottom: 1px solid var(--border-soft); padding: 3.5rem 0 2.5rem; }
.archive-header-inner { max-width: var(--maxw-narrow); }
.archive-eyebrow {
    font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--mint); display: block; margin-bottom: 0.8rem;
}
.archive-title { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 0.5rem; }
.archive-description { color: var(--text-muted); font-size: 1.1rem; margin: 0 0 0.8rem; }
.archive-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }
.author-avatar { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--mint); margin-bottom: 1rem; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border-soft);
}
.pagination-link { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.pagination-link:hover { color: var(--mint); }
.pagination-link.is-disabled { color: var(--border); pointer-events: none; }
.pagination-page { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border-soft); background: var(--onyx-800); padding: 3.5rem 0 1.75rem; margin-top: auto; }
.site-footer-inner { display: flex; flex-direction: column; gap: 2.5rem; }

.site-footer-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr); gap: 3rem; }

.site-footer-brand { max-width: 42ch; }
.site-footer-logo { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; }
.site-footer-logo .site-mark { width: 26px; height: 26px; display: inline-flex; }
.site-footer-logo .site-mark svg { width: 100%; height: 100%; }
.site-footer-logo .site-wordmark { font-weight: 700; font-size: 1.35rem; color: var(--text); letter-spacing: -0.01em; }
.site-footer-tagline { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; margin: 1rem 0 1.6rem; }

.site-footer-subscribe-label { display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; color: var(--text-faint); margin-bottom: 0.65rem; }
.footer-subscribe-form { display: flex; gap: 0.6rem; max-width: 380px; }
.footer-subscribe-input {
    flex: 1; min-width: 0; background: var(--onyx-700); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.65rem 0.85rem; color: var(--text);
    font-family: var(--font-sans); font-size: 0.9rem;
}
.footer-subscribe-input::placeholder { color: var(--text-faint); }
.footer-subscribe-input:focus { outline: none; border-color: var(--mint-deep); }
.footer-subscribe-btn { white-space: nowrap; }

.site-footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.footer-col-title { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 1.1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.footer-col a { color: var(--text-muted); font-size: 0.9rem; text-decoration: none; transition: color .18s var(--ease); }
.footer-col a:hover { color: var(--mint); }

.site-footer-bottom {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
    border-top: 1px solid var(--border-soft); padding-top: 1.5rem;
}
.site-footer-copy { color: var(--text-faint); font-size: 0.8rem; margin: 0; }
.site-footer-legal { display: flex; gap: 1.5rem; }
.site-footer-legal a { color: var(--text-muted); font-size: 0.8rem; text-decoration: none; }
.site-footer-legal a:hover { color: var(--mint); }
.site-footer-status { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text-muted); font-size: 0.8rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(82,183,136,0.18); }

/* ---------- Error page ---------- */
.error-page { text-align: center; padding: 7rem 0; }
.error-code { font-family: var(--font-mono); font-size: 5rem; font-weight: 700; color: var(--mint); display: block; }
.error-title { font-size: 1.6rem; color: var(--text-muted); margin-bottom: 2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .site-nav {
        position: fixed; inset: 72px 0 auto 0;
        background: var(--onyx-800); border-bottom: 1px solid var(--border);
        flex-direction: column; align-items: stretch; gap: 1.25rem;
        padding: 1.5rem 24px 1.75rem;
        transform: translateY(-130%); transition: transform .25s var(--ease);
        box-shadow: 0 20px 40px rgba(0,0,0,0.45);
    }
    .site-nav.is-open { transform: translateY(0); }
    .site-nav .nav { flex-direction: column; align-items: flex-start; gap: 1.1rem; width: 100%; }
    .site-nav .nav a { font-size: 1rem; }
    .site-nav-actions { width: 100%; gap: 0.75rem; }
    .site-nav-actions .btn { flex: 1; }
    .nav-toggle { display: flex; }
}
@media (max-width: 900px) {
    .site-footer-top { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 700px) {
    body { font-size: 16px; }
    .site-hero { padding: 3.5rem 0 3rem; }
    .post-feed { grid-template-columns: 1fr; }
    .site-footer-cols { grid-template-columns: 1fr 1fr; gap: 1.75rem 2rem; }
    .site-footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.85rem; }
    .footer-subscribe-form { max-width: 100%; }
}

/* ---------- Koenig editor cards (required) ---------- */
.gh-content {
    --content-width: var(--maxw-narrow);
}
.gh-content > * {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
}
.gh-content .kg-width-wide {
    max-width: 1000px;
}
.gh-content .kg-width-full {
    max-width: 100%;
}
.gh-content .kg-width-full img {
    width: 100%;
}

/* Image card */
.kg-image-card img { margin: 0 auto; }
.kg-image-card figcaption,
.kg-embed-card figcaption { text-align: center; color: var(--text-faint); font-size: 0.85rem; font-family: var(--font-mono); margin-top: 0.75rem; }

/* Gallery card */
.kg-gallery-card, .kg-image-card { margin: 2.5rem 0; }
.kg-gallery-container { display: flex; flex-direction: column; gap: 10px; max-width: 1000px; margin-left: auto; margin-right: auto; }
.kg-gallery-row { display: flex; flex-direction: row; justify-content: center; gap: 10px; }
.kg-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Bookmark card */
.kg-bookmark-card, .kg-bookmark-card * { box-sizing: border-box; }
.kg-bookmark-container { display: flex; min-height: 148px; color: var(--text); background: var(--onyx-700); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; overflow: hidden; }
.kg-bookmark-content { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-start; padding: 20px; }
.kg-bookmark-title { font-weight: 600; color: #fff; }
.kg-bookmark-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; color: var(--text-muted); font-size: 0.9rem; }
.kg-bookmark-metadata { display: flex; align-items: center; margin-top: 14px; font-size: 0.85rem; color: var(--text-faint); font-family: var(--font-mono); }
.kg-bookmark-thumbnail { position: relative; min-width: 33%; max-height: 100%; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* Callout, toggle, button, product cards */
.kg-callout-card { display: flex; padding: 1.2rem 1.4rem; border-radius: var(--radius); background: var(--onyx-700); border: 1px solid var(--border); }
.kg-callout-emoji { padding-right: 0.8rem; }
.kg-toggle-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.4rem; }
.kg-button-card a { display: inline-block; padding: 0.7rem 1.4rem; border-radius: var(--radius-sm); background: var(--mint); color: var(--onyx); font-weight: 600; }
.kg-button-card.kg-align-center { text-align: center; }

/* Header card */
.kg-header-card { padding: 3rem 2rem; text-align: center; }

/* Embed / video responsive */
.kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.kg-embed-card iframe { max-width: 100%; }
