/* =========================================================================
   Field Notes — a Ghost theme
   Paper / ink / stone, one Suunto-amber accent, an IBM Plex Mono instrument
   layer, and an excellent dark mode. Mobile-first.
   ========================================================================= */

/* ---- Tokens ------------------------------------------------------------ */
:root {
    --paper: #f4f2ec;
    --surface: #faf8f3;
    --surface2: #ece8df;
    --code-bg: #1d1b18;

    --ink: #1d1b18;
    --ink2: #5b554d;
    --ink3: #9b958a;

    --line: #e4ded2;
    --line2: #d4ccbd;

    --accent: #b8542f;
    --accent2: #a34a29;
    --accent-tint: rgba(184, 84, 47, 0.10);

    --dot: rgba(29, 27, 24, 0.07);

    --font-sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --container: 1140px;
    --reading: 720px;
    --wide: 1180px;
    --rail: 252px;
}

[data-theme="dark"] {
    --paper: #161512;
    --surface: #1e1c19;
    --surface2: #262320;
    --code-bg: #100f0d;

    --ink: #ece8df;
    --ink2: #a8a097;
    --ink3: #6f685e;

    --line: rgba(255, 255, 255, 0.08);
    --line2: rgba(255, 255, 255, 0.14);

    --accent: #d97a4e;
    --accent2: #e08a60;
    --accent-tint: rgba(217, 122, 78, 0.13);

    --dot: rgba(255, 255, 255, 0.06);
}

/* ---- Base -------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--gh-font-body, var(--font-sans));
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    transition: background-color .35s ease, color .35s ease;
}

::selection { background: var(--accent-tint); }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
h1, h2, h3, h4 { font-weight: 600; font-family: var(--gh-font-heading, var(--font-sans)); }

/* ---- Utilities --------------------------------------------------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: var(--reading); margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) {
    .container, .container--narrow { padding: 0 28px; }
}

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}
.mono-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink3);
}
.dotgrid {
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: 14px 14px;
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
    display: inline-block;
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn--solid { background: var(--ink); color: var(--paper); border: none; padding: 12px 20px; }
.btn--solid:hover { background: var(--accent); }
.btn--block { display: block; width: 100%; }
.btn--ghost { color: var(--ink); padding: 11px 18px; border: 1px solid var(--line2); font-weight: 500; }
.btn--ghost:hover { border-color: var(--ink2); }

/* ---- Header ------------------------------------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    background: color-mix(in srgb, var(--paper) 80%, transparent);
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.post-template .site-header__inner,
.page-template .site-header__inner { max-width: var(--wide); }
@media (min-width: 768px) { .site-header__inner { padding: 0 28px; gap: 24px; } }

.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--ink); }
.brand--back { align-items: center; gap: 10px; }
.brand__back { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.brand__name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand__label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink3);
}

.site-nav { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--ink2); }
@media (min-width: 768px) { .site-nav { gap: 24px; } }
.site-nav__link { color: inherit; text-decoration: none; transition: color .2s ease; }
.site-nav__link:hover { color: var(--ink); }
@media (max-width: 599px) { .site-nav__link { display: none; } }

.site-nav__tools { display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.icon-btn {
    cursor: pointer;
    width: 34px; height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line2);
    border-radius: 9px;
    color: var(--ink2);
    transition: border-color .2s ease, color .2s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--ink); }

.theme-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--line2);
    color: var(--ink2);
    border-radius: 999px;
    padding: 7px 11px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: border-color .2s ease, color .2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--ink); }
.theme-toggle__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* ---- Hero -------------------------------------------------------------- */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
    align-items: end;
    padding: 52px 0 44px;
}
@media (min-width: 900px) {
    .hero { grid-template-columns: 1.55fr 1fr; gap: 56px; padding: 80px 0 56px; }
}
.hero__title {
    font-size: 36px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.028em;
    margin: 22px 0 20px;
    max-width: 16ch;
    text-wrap: balance;
}
@media (min-width: 768px) { .hero__title { font-size: 48px; margin: 22px 0 22px; } }
.hero__title em { font-style: italic; color: var(--accent); }
.hero__text {
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink2);
    margin: 0 0 26px;
    max-width: 50ch;
}
@media (min-width: 768px) { .hero__text { font-size: 18px; } }
.hero__subscribe { display: flex; gap: 10px; flex-wrap: wrap; max-width: 440px; }
.hero__input {
    flex: 1;
    min-width: 190px;
    font-family: var(--font-sans);
    font-size: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--line2);
    background: var(--surface);
    color: var(--ink);
    outline: none;
    transition: border-color .2s ease;
}
.hero__input:focus { border-color: var(--accent); }
.hero__note {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: var(--ink3);
    margin-top: 11px;
}
.hero__note:empty { display: none; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---- Field station ----------------------------------------------------- */
.station { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 20px; }
.station__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink3);
    margin-bottom: 18px;
}
.station__live { color: var(--accent); }
.station__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; font-family: var(--font-mono); }
.station__k { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink3); margin-bottom: 5px; }
.station__v { font-size: 16px; font-weight: 500; }
.station__chart { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.station__chart-head {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink3);
    margin-bottom: 8px;
}
.station svg { display: block; }

/* ---- Section scaffolding ----------------------------------------------- */
.section { padding: 56px 0; }
.section--bordered { border-top: 1px solid var(--line); }
.section__head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.section__head--inline { justify-content: flex-start; }
.section__num {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}
.section h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
@media (min-width: 768px) { .section h2 { font-size: 26px; } }
.section__sub { font-size: 14px; color: var(--ink3); }

/* ---- Feed controls ----------------------------------------------------- */
.feed-section { padding: 36px 0 8px; border-top: 1px solid var(--line); }
.feed-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}
.seg {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 5px;
}
.seg__btn {
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--ink2);
    transition: background-color .2s ease, color .2s ease;
}
.seg__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.viewswitch { display: flex; align-items: center; gap: 12px; }
.viewswitch__label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink3);
}
.viewswitch__btns { display: flex; align-items: center; gap: 5px; }
.viewswitch__btn {
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 7px 13px;
    border-radius: 7px;
    border: 1px solid var(--line2);
    background: transparent;
    color: var(--ink3);
    transition: all .2s ease;
}
.viewswitch__btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Feed (one item DOM, three layouts) -------------------------------- */
.feed--cards { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 700px) { .feed--cards { grid-template-columns: 1fr 1fr; } }
.feed--list, .feed--compact { display: flex; flex-direction: column; }
.feed--compact { border-top: 1px solid var(--line); }

.feed__item { text-decoration: none; color: inherit; }
.feed__item.is-hidden { display: none !important; }

/* hidden by default; each view re-shows what it needs */
.feed__thumb, .feed__fig, .feed__chip,
.feed__tagline, .feed__dek, .feed__meta,
.feed__date--lead, .feed__rel-wrap { display: none; }

.feed__title {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin: 0;
    text-wrap: balance;
    color: inherit;
}
.feed__cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.feed__access { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.access--public { color: var(--ink3); }
.access--members, .access--paid { color: var(--accent); }
.feed__meta { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; color: var(--ink3); gap: 4px; }

.feed__thumb {
    background-color: var(--surface2);
    background-size: cover;
    background-position: center;
}
.feed__thumb--ph { background-image: repeating-linear-gradient(45deg, var(--dot) 0, var(--dot) 1px, transparent 1px, transparent 11px); }
.feed__chip {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink3);
    background: var(--surface);
    padding: 4px 8px;
    border-radius: 5px;
    border: 1px solid var(--line);
}
.feed__chip.access--members, .feed__chip.access--paid { color: var(--accent); }
.feed__fig { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; color: var(--ink3); }

/* CARDS */
.feed--cards .feed__item {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    transition: border-color .2s ease;
}
.feed--cards .feed__item:hover { border-color: var(--line2); }
.feed--cards .feed__thumb {
    display: flex;
    aspect-ratio: 16 / 9;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px;
}
.feed--cards .feed__chip { display: inline-block; }
.feed--cards .feed__main { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.feed--cards .feed__title { display: block; margin: 0 0 9px; }
.feed--cards .feed__dek { display: block; font-size: 14.5px; line-height: 1.55; color: var(--ink2); margin: 0 0 16px; flex: 1; }
.feed--cards .feed__meta { display: flex; }

/* LIST */
.feed--list .feed__item {
    display: flex;
    gap: 22px;
    align-items: stretch;
    padding: 22px 6px;
    border-bottom: 1px solid var(--line);
    transition: background-color .2s ease;
}
.feed--list .feed__item:hover { background: var(--surface); }
.feed--list .feed__thumb {
    display: flex;
    flex: none;
    width: 132px;
    height: 88px;
    border-radius: 10px;
    border: 1px solid var(--line);
    align-items: flex-end;
    padding: 8px;
}
.feed--list .feed__fig { display: block; }
.feed--list .feed__main { display: flex; flex-direction: column; justify-content: center; flex: 1; min-width: 0; }
.feed--list .feed__tagline { display: flex; gap: 10px; margin-bottom: 7px; }
.feed--list .feed__title { display: block; font-size: 20px; margin: 0 0 6px; }
.feed--list .feed__dek {
    display: block;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ink2);
    margin: 0 0 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feed--list .feed__meta { display: flex; }
.feed--list .feed__rel-wrap { display: inline; }

/* COMPACT */
.feed--compact .feed__item {
    display: block;
    border-bottom: 1px solid var(--line);
    transition: background-color .2s ease;
}
.feed--compact .feed__item:hover { background: var(--surface); }
.feed--compact .feed__main {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 18px;
    align-items: baseline;
    padding: 15px 6px;
}
.feed--compact .feed__date--lead { display: block; order: 1; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink3); }
.feed--compact .feed__title {
    display: block;
    order: 2;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.feed--compact .feed__item:hover .feed__title { color: var(--accent); }
.feed--compact .feed__tagline { display: flex; order: 3; gap: 12px; }

@media (max-width: 560px) {
    .feed--compact .feed__main { grid-template-columns: 80px 1fr; }
    .feed--compact .feed__tagline { display: none; }
}

/* ---- Load more / end --------------------------------------------------- */
.load-more-wrap { display: flex; justify-content: center; padding: 36px 0 8px; }
.load-more {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--line2);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 13px 26px;
    border-radius: 10px;
    transition: border-color .2s ease, color .2s ease;
}
.load-more:hover { border-color: var(--accent); color: var(--accent); }
.load-more[hidden] { display: none; }
.load-more__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.feed-end {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 34px 6px 0;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink3);
}
.feed-end[hidden] { display: none; }
.feed-end__mark { width: 8px; height: 8px; background: var(--accent); display: inline-block; }

/* ---- Browse by topic --------------------------------------------------- */
.cat-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 760px) { .cat-grid { grid-template-columns: 1fr 1fr; } }
.cat-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 24px; }
.cat-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.cat-card__name { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 0; display: flex; align-items: center; gap: 10px; }
.cat-card__count { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--ink3); }
.cat-card__all {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink3);
    text-decoration: none;
    white-space: nowrap;
    padding-top: 4px;
    transition: color .2s ease;
}
.cat-card__all:hover { color: var(--accent); }
.cat-card__desc { font-size: 13.5px; line-height: 1.5; color: var(--ink2); margin: 0 0 16px; }
.cat-card__list { display: flex; flex-direction: column; }
.cat-post {
    display: flex;
    gap: 13px;
    align-items: baseline;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    transition: color .2s ease;
}
.cat-post:hover { color: var(--accent); }
.cat-post__n { font-family: var(--font-mono); font-size: 11px; color: var(--accent); flex: none; }
.cat-post__title { font-size: 14.5px; line-height: 1.4; }

/* ---- Selected projects ------------------------------------------------- */
.project-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 640px) { .project-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 920px) { .project-grid { grid-template-columns: 1fr 1fr 1fr; } }
.project-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: border-color .2s ease;
}
.project-card:hover { border-color: var(--line2); }
.project-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.project-card__idx { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.project-card__status { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink3); }
.project-card__name { font-size: 17px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.project-card__dek { font-size: 14px; line-height: 1.55; color: var(--ink2); margin: 0; }

/* ---- Recent notes ------------------------------------------------------ */
.note-list { display: flex; flex-direction: column; }
.note { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 18px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
@media (min-width: 640px) { .note { grid-template-columns: 128px 1fr; gap: 24px; } }
.note__date { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink3); padding-top: 3px; }
.note__body { font-size: 16px; line-height: 1.6; color: var(--ink); margin: 0; max-width: 62ch; transition: color .2s ease; }
.note:hover .note__body { color: var(--accent); }

/* ---- Archive (tag / author) -------------------------------------------- */
.archive-hero { padding: 48px 0 32px; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .archive-hero { padding: 58px 0 38px; } }
.archive-hero__crumb {
    display: flex;
    gap: 12px;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink3);
    margin-bottom: 20px;
}
.archive-hero__crumb a { color: inherit; text-decoration: none; transition: color .2s ease; }
.archive-hero__crumb a:hover { color: var(--accent); }
.archive-hero__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.archive-hero__lead { max-width: 64ch; }
.archive-hero__title { font-size: 34px; line-height: 1.08; font-weight: 600; letter-spacing: -0.028em; margin: 0 0 16px; }
@media (min-width: 768px) { .archive-hero__title { font-size: 46px; } }
.archive-hero__desc { font-size: 17px; line-height: 1.6; color: var(--ink2); margin: 0; max-width: 54ch; }
@media (min-width: 768px) { .archive-hero__desc { font-size: 18px; } }
.archive-hero__stats { display: flex; gap: 28px; font-family: var(--font-mono); padding-bottom: 6px; }
.stat__k { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink3); margin-bottom: 6px; }
.stat__v { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; }

.archive-layout { display: grid; grid-template-columns: 1fr; gap: 40px; padding: 34px 0 60px; align-items: start; }
@media (min-width: 940px) { .archive-layout { grid-template-columns: 1fr var(--rail); gap: 48px; } }
.archive-layout .feed-section { border-top: none; padding: 0; min-width: 0; }

.archive-rail { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 940px) { .archive-rail { position: sticky; top: 88px; } }
.rail-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 20px; }
.rail-card .mono-label { margin-bottom: 14px; }
.rail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.rail-tag {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--ink2);
    text-decoration: none;
    border: 1px solid var(--line2);
    border-radius: 999px;
    padding: 6px 12px;
    transition: border-color .2s ease, color .2s ease;
}
.rail-tag:hover { border-color: var(--accent); color: var(--ink); }
.rail-tag__count { font-family: var(--font-mono); font-size: 10px; color: var(--ink3); }
.rail-card__text { font-size: 14px; line-height: 1.55; color: var(--ink2); margin: 0 0 14px; }
.rail-input {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    padding: 11px 13px;
    border-radius: 9px;
    border: 1px solid var(--line2);
    background: var(--paper);
    color: var(--ink);
    outline: none;
    margin-bottom: 9px;
    transition: border-color .2s ease;
}
.rail-input:focus { border-color: var(--accent); }

/* ---- Plain archive header (index.hbs) ---------------------------------- */
.archive { padding-top: 44px; }
@media (min-width: 768px) { .archive { padding-top: 56px; } }
.archive__head { margin-bottom: 28px; }
.archive__title { font-size: 32px; font-weight: 600; letter-spacing: -0.025em; margin: 10px 0 0; }
@media (min-width: 768px) { .archive__title { font-size: 40px; } }
.archive__desc { font-size: 17px; line-height: 1.6; color: var(--ink2); margin: 12px 0 0; max-width: 60ch; }

/* ---- Pagination -------------------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 40px 0 0;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.pagination__link, .pagination__placeholder { border: 1px solid var(--line2); border-radius: 8px; padding: 8px 14px; }
.pagination__link { color: var(--ink2); text-decoration: none; transition: border-color .2s ease, color .2s ease; }
.pagination__link:hover { border-color: var(--accent); color: var(--ink); }
.pagination__placeholder { color: var(--ink3); opacity: 0.4; border-style: dashed; }
.pagination__pos { color: var(--ink3); }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.site-footer .container { padding-top: 48px; padding-bottom: 40px; }
.site-footer__grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; } }
.site-footer__name { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 10px; }
.site-footer__bio { font-size: 14.5px; line-height: 1.6; color: var(--ink2); margin: 0; max-width: 38ch; }
.site-footer__links { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; font-size: 14px; }
.site-footer__links a { color: var(--ink2); text-decoration: none; transition: color .2s ease; }
.site-footer__links a:hover { color: var(--accent); }
.site-footer__base {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    color: var(--ink3);
}
.site-footer--slim .site-footer__base { margin-top: 0; padding-top: 0; border-top: none; }

/* ---- Reading progress -------------------------------------------------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: transparent; }
.reading-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .08s linear; }

/* ---- Post hero --------------------------------------------------------- */
.post__hero { padding: 52px 20px 8px; }
@media (min-width: 768px) { .post__hero { padding: 64px 28px 8px; } }
.post__kicker {
    display: flex;
    gap: 14px;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
}
.post__kicker .sep, .post__kicker .muted { color: var(--ink3); }
.post__title { font-size: 32px; line-height: 1.14; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 20px; text-wrap: balance; }
@media (min-width: 768px) { .post__title { font-size: 42px; margin: 0 0 22px; } }
.post__dek { font-size: 19px; line-height: 1.55; color: var(--ink2); margin: 0 0 28px; }
@media (min-width: 768px) { .post__dek { font-size: 20px; } }
.post__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--ink3);
}
.post__author { color: var(--ink2); }
.post__meta [data-word-count]:empty { display: none; }
.post__feature { margin: 28px auto 0; }
.post__feature img { width: 100%; border-radius: 14px; display: block; }
.post__feature-caption { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink3); margin-top: 12px; text-align: center; }

/* ---- Post layout ------------------------------------------------------- */
.post__layout { max-width: var(--wide); margin: 0 auto; padding: 32px 20px 0; display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 1080px) { .post__layout { grid-template-columns: 1fr var(--reading) 1fr; padding: 40px 28px 0; } }
.post__toc { display: none; }
.post__rail { display: none; }
@media (min-width: 1080px) { .post__toc { display: block; padding-right: 32px; } .post__rail { display: block; } }
.post__toc-sticky { position: sticky; top: 96px; }
.post__toc-sticky .mono-label { margin-bottom: 16px; }
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc a { text-decoration: none; font-size: 13px; line-height: 1.4; color: var(--ink3); padding: 6px 0 6px 14px; border-left: 2px solid var(--line); transition: color .2s ease, border-color .2s ease; }
.toc a:hover, .toc a.is-active { color: var(--ink); border-left-color: var(--accent); }
.toc a.toc__sub { padding-left: 26px; font-size: 12px; }
.post__toc-meta { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink3); line-height: 1.7; }
.post__content { min-width: 0; max-width: var(--reading); margin: 0 auto; }
@media (min-width: 1080px) { .post__content { max-width: none; margin: 0; } }

/* ---- Article body (gh-content) ----------------------------------------- */
.gh-content { font-size: 17px; line-height: 1.72; color: var(--ink); padding-bottom: 64px; }
@media (min-width: 768px) { .gh-content { font-size: 18px; } }
.gh-content > p, .gh-content > ul, .gh-content > ol, .gh-content > figure { margin: 0 0 24px; }
.gh-content > p:first-of-type::first-letter { float: left; font-size: 62px; line-height: 0.78; font-weight: 600; padding: 6px 12px 0 0; color: var(--accent); letter-spacing: -0.02em; }
.gh-content h2 { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; margin: 48px 0 16px; scroll-margin-top: 90px; }
@media (min-width: 768px) { .gh-content h2 { font-size: 27px; } }
.gh-content h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin: 36px 0 12px; scroll-margin-top: 90px; }
.gh-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li { margin: 0 0 8px; }
.gh-content img { border-radius: 12px; }
.gh-content blockquote { margin: 36px 0; padding: 8px 0 8px 26px; border-left: 3px solid var(--accent); font-size: 21px; line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
@media (min-width: 768px) { .gh-content blockquote { font-size: 23px; } }
.gh-content blockquote p { margin: 0; }
.gh-content :not(pre) > code { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface2); padding: 2px 6px; border-radius: 5px; }
.gh-content figure { margin: 32px 0; }
.gh-content figcaption { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink3); margin-top: 12px; text-align: center; }
.gh-content hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

/* Koenig card spacing + width helpers */
.gh-content .kg-card { margin: 32px 0; }
.gh-content .kg-width-wide { width: 100%; }
.gh-content .kg-width-full { width: 100%; border-radius: 0; }
.gh-content .kg-width-full img { border-radius: 0; }
@media (min-width: 1080px) {
    .gh-content .kg-width-wide { width: calc(100% + 160px); margin-left: -80px; }
    .gh-content .kg-width-full { width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }
}

/* ---- Code blocks ------------------------------------------------------- */
.code-block { margin: 32px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.code-block__head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; }
.code-block__name { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink3); }
.gh-content pre { margin: 32px 0; background: var(--code-bg); color: #e8e4da; padding: 20px; overflow-x: auto; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; border-radius: 12px; border: 1px solid var(--line); -webkit-font-smoothing: auto; }
.code-block pre { margin: 0; border: none; border-radius: 0; }
.gh-content pre code { font-family: var(--font-mono); font-size: inherit; background: none; padding: 0; color: inherit; }

/* Prism token palette — tuned for the dark code surface */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #9b958a; font-style: italic; }
.token.punctuation, .token.operator { color: #b8b2a7; }
.token.keyword, .token.boolean, .token.atrule, .token.important, .token.tag, .token.property, .token.selector { color: #d97a4e; }
.token.class-name, .token.builtin, .token.constant, .token.symbol, .token.number, .token.attr-name { color: #c8a96a; }
.token.string, .token.char, .token.attr-value, .token.regex, .token.inserted { color: #9bb08a; }
.token.function { color: #e8e4da; }
.token.deleted { color: #d97a4e; }

/* ---- Post end + comments + related ------------------------------------- */
.post__end { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink3); }
.post__end-mark { width: 8px; height: 8px; background: var(--accent); display: inline-block; }
.post__comments { margin-top: 48px; }
.post--page .post__content { padding-top: 8px; }

/* ---- Error ------------------------------------------------------------- */
.error { min-height: 60vh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 16px; }
.error__title { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.error__text { font-size: 16px; color: var(--ink2); margin: 0; max-width: 44ch; }

/* ---- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
