/* haskeller.net — Classic serif revival meets consultancy professional grid */

:root {
    --bg: #ffffff;
    --surface: #f7f5f0;
    --text: #1a1a1a;
    --text-muted: #555555;
    --link: #1a4a8a;
    --link-hover: #2563eb;
    --purple: #5e4086;
    --rule: #e5e5e0;
    --tag-bg: #ede9f5;
    --amber: #d97706;
    --green: #2f7a3a;
    --teal: #0f766e;

    --serif-display: "Playfair Display", "Times New Roman", serif;
    --serif-body: "Lora", "Charter", Georgia, serif;
    --sans: "Inter", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "Menlo", monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--serif-body);
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 120ms ease;
}
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }

code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--surface);
    padding: 1px 5px;
    border-radius: 2px;
    color: var(--text);
}

button {
    font-family: var(--sans);
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
}

ol, ul { list-style: none; padding: 0; margin: 0; }

/* Lambda watermark */
.lambda-watermark {
    position: absolute;
    top: -4vw;
    right: -2vw;
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: 30vw;
    line-height: 1;
    color: var(--text);
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

/* ============== MASTHEAD ============== */
.masthead {
    border-bottom: 2px solid var(--text);
    background: var(--bg);
    position: relative;
    z-index: 1;
}
.masthead-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px 0;
}
.masthead-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--rule);
}
.site-name {
    margin: 0;
    font-family: var(--serif-display);
    font-weight: 700;
    font-variant: small-caps;
    font-size: 1.85rem;
    letter-spacing: 0.05em;
    color: var(--text);
}
.masthead-meta {
    font-family: var(--sans);
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.masthead-meta .separator { margin: 0 8px; color: var(--rule); }

.primary-nav ul {
    display: flex;
    gap: 28px;
    align-items: center;
    padding: 14px 0;
    flex-wrap: wrap;
}
.primary-nav a {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.02em;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 120ms ease, color 120ms ease;
}
.primary-nav a:hover { color: var(--link); text-decoration: none; border-bottom-color: var(--link); }
.primary-nav a.active { border-bottom-color: var(--text); color: var(--text); }
.nav-divider {
    flex: 1;
    height: 1px;
    background: transparent;
    margin: 0 4px;
    min-width: 12px;
}

/* ============== LEAD BANNER ============== */
.lead-banner {
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    position: relative;
    z-index: 1;
}
.lead-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 24px 40px;
}
.lead-kicker {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--purple);
}
.lead-headline {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3.6vw, 2.8rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
    margin: 12px 0 14px;
    color: var(--text);
    max-width: 880px;
}
.lead-deck {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0 0 18px;
    max-width: 760px;
}
.lead-byline {
    font-family: var(--sans);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.lead-byline .separator { margin: 0 8px; color: var(--rule); }
.lead-byline .byline-author { color: var(--text); font-weight: 500; }

/* ============== PAGE GRID ============== */
.page-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 24px 60px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    position: relative;
    z-index: 1;
}

/* ============== FEED ============== */
.feed-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--text);
    padding-bottom: 10px;
    margin-bottom: 4px;
}
.feed-title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
    margin: 0;
}
.feed-filters {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.filter-btn {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 2px;
    transition: all 120ms ease;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.post-list { padding: 0; }
.post {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 16px;
    padding: 22px 0;
    border-bottom: 1px solid var(--rule);
    align-items: start;
}
.post-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-top: 4px;
}
.vote {
    width: 32px;
    height: 32px;
    border: 1px solid var(--rule);
    border-radius: 2px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1;
    transition: all 120ms ease;
}
.vote:hover { color: var(--amber); border-color: var(--amber); background: #fff8ef; }
.vote-count {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
}

.post-title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: 1.18rem;
    line-height: 1.3;
    letter-spacing: -0.005em;
    margin: 0 0 6px;
}
.post-title a { color: var(--link); }
.post-title a:hover { color: var(--link-hover); text-decoration: none; }
.post-title code {
    font-size: 0.82em;
    font-family: var(--mono);
    background: var(--surface);
    padding: 1px 5px;
    color: var(--text);
}

.post-excerpt {
    font-family: var(--serif-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 8px;
    max-width: 64ch;
}
.post-excerpt code { font-size: 0.82em; }

.post-meta {
    font-family: var(--sans);
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}
.post-meta .separator { margin: 0 7px; color: var(--rule); }
.post-meta .author { color: var(--text); font-weight: 500; }
.post-meta .comments { color: var(--link); font-weight: 500; }

/* Category dots */
.cat-dot {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    color: var(--text);
}
.cat-dot::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 7px;
    background: currentColor;
}
.cat-packages { color: var(--purple); }
.cat-jobs { color: var(--link); }
.cat-discuss { color: var(--amber); }
.cat-learn { color: var(--green); }
.cat-events { color: var(--teal); }

.badge-new {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--bg);
    background: var(--amber);
    padding: 2px 6px;
    border-radius: 2px;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
}

.feed-footer {
    margin-top: 24px;
    padding-top: 12px;
    text-align: left;
}
.more-btn {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--link);
    padding: 10px 16px;
    border: 1px solid var(--rule);
    border-radius: 2px;
    transition: all 120ms ease;
    letter-spacing: 0.02em;
}
.more-btn:hover { background: var(--surface); border-color: var(--link); color: var(--link-hover); }

/* Hidden post (filter) */
.post.hidden { display: none; }

/* ============== SIDEBAR ============== */
.sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.side-block {
    background: var(--surface);
    border: 1px solid var(--rule);
    padding: 20px 22px;
    border-radius: 2px;
}
.side-title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rule);
    color: var(--text);
}

.trending-list li {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid var(--rule);
}
.trending-list li:last-child { border-bottom: none; }
.rank {
    font-family: var(--serif-display);
    font-weight: 400;
    font-size: 1.5rem;
    color: #b8b6ad;
    line-height: 1;
    text-align: right;
    font-feature-settings: "lnum";
}
.rank-body { display: flex; flex-direction: column; gap: 2px; }
.pkg-name {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--link);
    font-weight: 500;
}
.pkg-desc {
    font-family: var(--sans);
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.jobs-list li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rule);
}
.jobs-list li:last-child { border-bottom: none; }
.job-role {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--link);
}
.job-company {
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.02em;
}
.job-loc {
    font-family: var(--sans);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.see-all {
    display: inline-block;
    margin-top: 12px;
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--link);
    letter-spacing: 0.02em;
}

.newsletter-desc {
    font-family: var(--serif-body);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 14px;
}
.newsletter-form {
    display: flex;
    gap: 6px;
    flex-direction: column;
    margin-bottom: 10px;
}
.newsletter-form input {
    font-family: var(--sans);
    font-size: 0.9rem;
    padding: 10px 12px;
    border: 1px solid var(--rule);
    background: var(--bg);
    color: var(--text);
    border-radius: 2px;
    width: 100%;
    transition: border-color 120ms ease;
}
.newsletter-form input:focus { outline: none; border-color: var(--link); }
.newsletter-form button {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 10px 14px;
    background: var(--text);
    color: var(--bg);
    border-radius: 2px;
    transition: background 120ms ease;
}
.newsletter-form button:hover { background: var(--link); }
.newsletter-note {
    font-family: var(--sans);
    font-size: 0.74rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    margin: 0;
    font-style: italic;
}

.colophon p {
    font-family: var(--serif-body);
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0;
}
.colophon em { color: var(--text); font-style: italic; }

/* ============== FOOTER ============== */
.site-footer {
    background: var(--text);
    color: #cfcfcf;
    border-top: 4px double #444;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 24px 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}
.footer-col h4 {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3a3a3a;
}
.footer-col ul li { padding: 5px 0; }
.footer-col a {
    font-family: var(--sans);
    font-size: 0.85rem;
    color: #cfcfcf;
    letter-spacing: 0.01em;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }

.footer-rule {
    height: 1px;
    background: #3a3a3a;
    margin: 36px 0 20px;
}
.footer-base {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-family: var(--sans);
    font-size: 0.78rem;
    color: #999;
    letter-spacing: 0.04em;
}
.footer-mark {
    font-family: var(--serif-display);
    font-size: 1.6rem;
    color: #fff;
    line-height: 1;
}
.footer-copy { flex: 1; min-width: 240px; }
.footer-meta { color: #888; font-style: italic; }

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
    .page-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .sidebar {
        position: static;
        gap: 24px;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}
@media (max-width: 560px) {
    .masthead-inner { padding: 22px 16px 0; }
    .lead-inner { padding: 28px 16px 32px; }
    .page-grid { padding: 28px 16px 50px; }
    .footer-inner { padding: 40px 16px 24px; }
    .primary-nav ul { gap: 16px; }
    .post {
        grid-template-columns: 44px 1fr;
        gap: 12px;
    }
    .vote { width: 28px; height: 28px; font-size: 0.85rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .feed-header { gap: 10px; }
    .feed-filters { width: 100%; }
}
