/* ============================================================
   liridone — a clean, technical theme for an ML/AI engineer
   ============================================================ */

:root {
    --accent: var(--ghost-accent-color, #4f46e5);
    --bg: #ffffff;
    --bg-soft: #f6f7f9;
    --bg-card: #ffffff;
    --text: #14161a;
    --text-soft: #565b64;
    --border: #e6e8ec;
    --radius: 14px;
    --maxw: 1120px;
    --maxw-narrow: 720px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
    --shadow: 0 1px 2px rgba(20,22,26,.04), 0 8px 24px rgba(20,22,26,.06);
}

body.scheme-dark {
    --bg: #0d0f12;
    --bg-soft: #14171c;
    --bg-card: #14171c;
    --text: #f2f4f7;
    --text-soft: #9aa1ad;
    --border: #23272e;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1 0 auto; }

.inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.inner-narrow { max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 24px; }

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

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 68px; flex-wrap: wrap; }
.site-brand { font-weight: 800; letter-spacing: -0.03em; }
.site-title { font-size: 20px; color: var(--text); }
.site-logo { max-height: 34px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.nav-list { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav-item a { color: var(--text-soft); font-size: 15px; font-weight: 500; }
.nav-item a:hover { color: var(--text); text-decoration: none; }
.nav-social { display: flex; gap: 14px; align-items: center; padding-left: 8px; border-left: 1px solid var(--border); }
.nav-social a { color: var(--text-soft); display: inline-flex; }
.nav-social a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 56px; }
.hero-eyebrow {
    font-family: var(--font-mono); font-size: 14px; letter-spacing: .04em;
    color: var(--accent); margin: 0 0 14px; text-transform: uppercase;
}
.hero-name { font-size: clamp(40px, 7vw, 68px); margin: 0 0 18px; }
.hero-desc { font-size: clamp(18px, 2.4vw, 22px); color: var(--text-soft); max-width: 620px; margin: 0 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px; border-radius: 999px; font-size: 15px; font-weight: 600;
    border: 1px solid var(--border); color: var(--text); background: var(--bg-card);
    transition: .18s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { color: #fff; filter: brightness(1.08); }

/* ---------- Sections & cards ---------- */
.section { padding: 44px 0; }
.section-more { border-top: 1px solid var(--border); margin-top: 24px; }
.section-title {
    font-size: 14px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--text-soft); font-family: var(--font-mono); margin: 0 0 24px;
}

.card-grid {
    display: grid; gap: 24px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.post-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.post-card-link { color: inherit; display: block; }
.post-card-link:hover { text-decoration: none; }
.post-card-image { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 20px 22px 24px; }
.post-card-tag { font-family: var(--font-mono); font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.post-card-title { font-size: 21px; margin: 8px 0 10px; color: var(--text); }
.post-card-excerpt { color: var(--text-soft); font-size: 15.5px; margin: 0 0 16px; }
.post-card-meta { font-size: 13px; color: var(--text-soft); font-family: var(--font-mono); }
.post-dot { margin: 0 6px; }

/* ---------- Single post / page ---------- */
.post-header { padding: 64px 0 20px; text-align: center; }
.post-tag { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.post-title { font-size: clamp(30px, 5vw, 48px); margin: 14px 0 16px; }
.post-subtitle { font-size: 21px; color: var(--text-soft); margin: 0 auto 18px; max-width: 620px; }
.post-meta { font-family: var(--font-mono); font-size: 14px; color: var(--text-soft); }
.post-author { font-weight: 600; color: var(--text); }
.post-image { margin: 32px auto 8px; max-width: var(--maxw); padding: 0 24px; }
.post-image img { width: 100%; border-radius: var(--radius); }
.post-image figcaption { text-align: center; font-size: 14px; color: var(--text-soft); margin-top: 10px; }

.post-content { padding-top: 36px; padding-bottom: 24px; font-size: 18.5px; }
.post-content > * { margin-top: 0; margin-bottom: 1.5em; }
.post-content h2 { font-size: 30px; margin-top: 1.8em; }
.post-content h3 { font-size: 23px; margin-top: 1.6em; }
.post-content a { text-decoration: underline; text-underline-offset: 3px; }
.post-content img, .post-content .kg-card { border-radius: var(--radius); }
.post-content figure { margin-left: 0; margin-right: 0; }
.post-content blockquote {
    border-left: 3px solid var(--accent); margin: 0; padding: 4px 0 4px 22px;
    color: var(--text-soft); font-size: 20px;
}
.post-content pre {
    background: #0d0f12; color: #e6e8ec; padding: 20px 22px; border-radius: var(--radius);
    overflow-x: auto; font-family: var(--font-mono); font-size: 15px; line-height: 1.6;
}
.post-content code {
    font-family: var(--font-mono); font-size: .88em;
    background: var(--bg-soft); padding: 2px 6px; border-radius: 6px;
}
.post-content pre code { background: none; padding: 0; }
.post-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }

/* ---------- Image alignment utilities (use via an HTML card) ---------- */
.post-content img.align-left,
.post-content .align-left {
    float: left; max-width: 46%; margin: 6px 28px 18px 0; border-radius: var(--radius);
}
.post-content img.align-right,
.post-content .align-right {
    float: right; max-width: 46%; margin: 6px 0 18px 28px; border-radius: var(--radius);
}
.post-content img.align-center,
.post-content .align-center {
    display: block; margin: 22px auto; border-radius: var(--radius);
}
.post-content .clear { clear: both; }
@media (max-width: 640px) {
    .post-content .align-left,
    .post-content .align-right { float: none; max-width: 100%; margin: 18px 0; }
}

/* ---------- Koenig editor image widths (kg-width-wide / -full) ---------- */
.post-content .kg-card { margin: 1.6em 0; }
.post-content figure img,
.post-content .kg-image { border-radius: var(--radius); }
.post-content figcaption { text-align: center; font-size: 14px; color: var(--text-soft); margin-top: 10px; }
.post-content .kg-width-wide {
    position: relative;
    width: min(92vw, 1040px);
    margin-left: 50%;
    transform: translateX(-50%);
}
.post-content .kg-width-full {
    position: relative;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}
.post-content .kg-width-full img { width: 100%; border-radius: 0; }

.post-footer { padding: 16px 0 48px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
    font-family: var(--font-mono); font-size: 13px; padding: 5px 12px; border-radius: 999px;
    background: var(--bg-soft); color: var(--text-soft); border: 1px solid var(--border);
}
.pill:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---------- Archive (tag/author) ---------- */
.archive-header { padding: 72px 0 16px; text-align: center; }
.archive-eyebrow { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; color: var(--accent); letter-spacing: .05em; margin: 0 0 8px; }
.archive-title { font-size: clamp(30px, 5vw, 46px); margin: 0 0 12px; }
.archive-desc { color: var(--text-soft); max-width: 620px; margin: 0 auto; }
.author-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; }
.author-links { margin-top: 12px; font-family: var(--font-mono); font-size: 14px; color: var(--text-soft); display: flex; gap: 16px; justify-content: center; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 48px; }
.pagination-link { font-family: var(--font-mono); font-size: 14px; padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); }
.pagination-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination-link.disabled { opacity: .35; pointer-events: none; }
.pagination-page { font-family: var(--font-mono); font-size: 13px; color: var(--text-soft); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 32px; }
.site-footer-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; }
.footer-copy { margin: 0; color: var(--text-soft); font-size: 15px; }
.footer-social { display: flex; gap: 20px; }
.footer-social a { color: var(--text-soft); font-size: 15px; }
.footer-social a:hover { color: var(--accent); text-decoration: none; }
.footer-built { margin: 0; color: var(--text-soft); font-size: 14px; font-family: var(--font-mono); }

/* ---------- Error ---------- */
.error-page { text-align: center; padding: 120px 0; }
.error-code { font-family: var(--font-mono); font-size: 64px; color: var(--accent); margin: 0; }
.error-title { font-size: 26px; margin: 8px 0 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    /* Nav stays visible and wraps onto its own row under the brand — no JS needed */
    .site-brand { flex: 1 1 auto; }
    .site-nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 14px 20px; }
    .nav-list { flex-wrap: wrap; gap: 14px 18px; }
    .nav-social { border-left: 0; padding-left: 0; }
    .hero { padding: 60px 0 36px; }
}
