/* Erald Caka: shared site styles, used by index.html and every generated /articles page. */

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

:root {
    --ink: #16181b;
    --ink-soft: rgba(22, 24, 27, 0.66);
    --ink-faint: rgba(22, 24, 27, 0.44);
    --paper: #fafaf8;
    --paper-raised: #f1f0ec;
    --line: #e2e1db;
    --accent: #2b5d4c;
    --accent-soft: rgba(43, 93, 76, 0.1);

    --font-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    --max: 760px;
    --max-wide: 960px;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-body); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; }
p { max-width: 62ch; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--max-wide); margin: 0 auto; padding: 0 24px; }
.prose-wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ── nav ────────────────────────────────────────────── */
.nav-bar {
    position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}
.nav-inner {
    max-width: var(--max-wide); margin: 0 auto; padding: 16px 24px;
    display: flex; align-items: center; gap: 28px;
}
.nav-brand { font-weight: 600; font-size: 15px; margin-right: auto; }
.nav-brand .role { font-weight: 400; color: var(--ink-faint); margin-left: 8px; }
.nav-links { display: none; gap: 24px; align-items: center; font-size: 14px; color: var(--ink-soft); }
@media (min-width: 720px) { .nav-links { display: flex; } }
.nav-links a { padding-bottom: 3px; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.nav-links a:hover, .nav-links a.current { color: var(--ink); border-color: var(--accent); }
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* ── buttons / tags ─────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; font-weight: 500; font-size: 14px;
    border: 1px solid var(--line); padding: 9px 16px; background: transparent; color: var(--ink);
    border-radius: 3px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--paper-raised); border-color: var(--ink-faint); }
.tag {
    display: inline-flex; align-items: center; font-size: 12px; font-family: var(--font-mono);
    padding: 3px 9px; border-radius: 3px; background: var(--paper-raised); color: var(--ink-soft);
}

/* ── section shell ──────────────────────────────────── */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.section-title { font-size: 22px; }
.section-meta { font-size: 13px; color: var(--ink-faint); }

/* ── hero ───────────────────────────────────────────── */
.hero { padding: 64px 0 56px; }
.hero-name { font-size: clamp(34px, 5vw, 50px); letter-spacing: -0.02em; margin-bottom: 6px; }
.hero-role { font-size: 17px; color: var(--ink-soft); margin-bottom: 26px; }
.hero-lead { font-size: 17px; line-height: 1.7; color: var(--ink-soft); max-width: 58ch; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.hero-fact-k { font-size: 12px; color: var(--ink-faint); margin-bottom: 3px; }
.hero-fact-v { font-size: 14.5px; }

/* ── work ───────────────────────────────────────────── */
.work-list { display: flex; flex-direction: column; gap: 40px; }
.work-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.work-name { font-size: 20px; }
.work-tagline { font-size: 14px; color: var(--ink-faint); }
.work-desc { font-size: 15px; line-height: 1.7; color: var(--ink-soft); max-width: 62ch; margin-bottom: 6px; }
.work-desc:last-of-type { margin-bottom: 14px; }
.work-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.work-links { display: flex; gap: 18px; font-size: 13.5px; }
.work-links a { color: var(--accent); border-bottom: 1px solid transparent; }
.work-links a:hover { border-color: var(--accent); }

/* ── writing list (shared: homepage preview + /articles index) ─ */
.post-list { display: flex; flex-direction: column; }
.post-row {
    display: grid; grid-template-columns: 108px 1fr; gap: 20px;
    padding: 20px 0; border-bottom: 1px solid var(--line);
}
.post-row:first-child { padding-top: 0; }
a.post-row { color: inherit; transition: opacity 0.15s; }
a.post-row:hover .post-title { color: var(--accent); }
.post-date { font-size: 13px; color: var(--ink-faint); padding-top: 2px; }
.post-title { font-size: 17px; margin-bottom: 6px; transition: color 0.15s; }
.post-excerpt { font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; max-width: 60ch; margin-bottom: 8px; }
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 520px) {
    .post-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── articles index page ───────────────────────────── */
.articles-header { padding: 56px 0 12px; }
.articles-header h1 { font-size: 30px; margin-bottom: 10px; }
.articles-header p { color: var(--ink-soft); font-size: 15.5px; }
.articles-body { padding: 8px 0 64px; }

/* ── article detail page ──────────────────────────── */
.post-header { padding: 56px 0 8px; }
.post-back { display: inline-block; font-size: 13.5px; color: var(--ink-faint); margin-bottom: 22px; }
.post-back:hover { color: var(--accent); }
.post-header h1 { font-size: clamp(28px, 4.4vw, 40px); letter-spacing: -0.02em; margin-bottom: 14px; }
.post-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13.5px; color: var(--ink-faint); margin-bottom: 16px; }
.post-header .post-tags { margin-bottom: 6px; }
.post-body { padding: 28px 0 40px; font-size: 17px; line-height: 1.75; }
.post-body h2 { font-size: 22px; margin: 34px 0 14px; }
.post-body h3 { font-size: 18px; margin: 28px 0 12px; }
.post-body p { margin-bottom: 18px; max-width: 100%; }
.post-body ul, .post-body ol { margin: 0 0 18px 22px; }
.post-body li { margin-bottom: 8px; line-height: 1.7; }
.post-body a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.post-body a:hover { border-color: var(--accent); }
.post-body code { font-family: var(--font-mono); font-size: 0.88em; background: var(--paper-raised); padding: 2px 5px; border-radius: 3px; }
.post-body pre { background: var(--ink); color: #eceae4; padding: 18px 20px; border-radius: 4px; overflow-x: auto; margin-bottom: 20px; }
.post-body pre code { background: none; padding: 0; font-size: 14px; line-height: 1.6; }
.post-body blockquote { border-left: 2px solid var(--accent); padding-left: 18px; color: var(--ink-soft); margin: 0 0 18px; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.post-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 56px; border-top: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.post-footer a { color: var(--accent); }
.post-nav-side { max-width: 45%; }
.post-nav-label { font-size: 12px; color: var(--ink-faint); margin-bottom: 4px; }

/* ── experience timeline ────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 34px; }
.tl-item { display: grid; grid-template-columns: 1fr; gap: 4px; }
@media (min-width: 640px) { .tl-item { grid-template-columns: 150px 1fr; gap: 24px; } }
.tl-date { font-size: 13.5px; color: var(--ink-faint); padding-top: 2px; }
.tl-role { font-size: 18px; margin-bottom: 2px; }
.tl-sub { font-size: 13.5px; color: var(--ink-faint); margin-bottom: 12px; }
.tl-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 15px; line-height: 1.65; color: var(--ink-soft); max-width: 62ch; }

/* ── stack ──────────────────────────────────────────── */
.stack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.stack-label { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 10px; }
.stack-items { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── about ──────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 36px; }
@media (min-width: 700px) { .about-grid { grid-template-columns: 200px 1fr; gap: 44px; } }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; filter: grayscale(0.3); }
.about-body p { font-size: 15.5px; line-height: 1.75; color: var(--ink-soft); margin-bottom: 16px; max-width: 60ch; }

/* ── contact ────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 700px) { .contact-grid { grid-template-columns: 1.2fr 0.8fr; gap: 44px; } }
.contact-copy { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); max-width: 50ch; margin-bottom: 22px; }
.contact-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.contact-rows { display: flex; flex-direction: column; }
.contact-row { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.contact-row:last-child { border-bottom: 0; }
.contact-row a:hover { color: var(--accent); }
.contact-row-k { color: var(--ink-faint); }

/* ── footer ─────────────────────────────────────────── */
.site-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 24px 0 40px; border-top: 1px solid var(--line);
    font-size: 13px; color: var(--ink-faint);
}
