/* Infinite Static — screen.css
   Industrial-minimalist monospace theme. See DESIGN.md. */

/* --- Tokens --------------------------------------------------------- */

:root {
    --orange: #FF6A00;
    --orange-muted: #FFB080;
    --black: #000000;
    --warm-bg: #F6F5F0;
    --surface: #FFFFFF;

    --text-primary: #000000;
    --text-secondary: #8A8A8A;
    --text-tertiary: #BBBBBB;
    --divider: rgba(0, 0, 0, 0.15);
    --divider-dashed: rgba(0, 0, 0, 0.4);

    --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Liberation Mono', monospace;
    --font-serif: 'EB Garamond', 'Iowan Old Style', 'Palatino', 'Georgia', serif;

    --text-display: 2.5rem;
    --text-h1: 1.625rem;
    --text-h2: 1.375rem;
    --text-h3: 1.125rem;
    --text-body-lg: 1rem;
    --text-body: 0.9375rem;
    --text-small: 0.8125rem;
    --text-micro: 0.75rem;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    --content-narrow: 720px;
    --content-wide: 880px;
    --content-max: 1200px;

    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --warm-bg: #1C1B19;
        --surface: #2B2A28;
        --text-primary: #F5F5F5;
        --text-secondary: #9A9A9A;
        --text-tertiary: #6A6A6A;
        --divider: rgba(255, 255, 255, 0.15);
        --divider-dashed: rgba(255, 255, 255, 0.4);
    }
}

/* --- Reset ---------------------------------------------------------- */

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

html, body { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--warm-bg);
    color: var(--text-primary);
    font-family: var(--gh-font-body, var(--font-mono));
    font-size: var(--text-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: var(--gh-font-heading, var(--font-mono));
}

.site-title {
    font-family: var(--font-serif);
}

.post-title,
.feed-article__title,
.feed-link__title,
.archive-title,
.channel-header__title,
.post-content h2,
.post-content h3 {
    font-family: var(--font-mono);
}

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

a {
    color: #FF6A00;
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--black); }

button, input, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button { cursor: pointer; border: none; background: none; padding: 0; }

hr {
    border: none;
    border-top: 1px solid var(--divider);
    margin: var(--space-8) 0;
}

/* --- Layout shell --------------------------------------------------- */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    width: 100%;
}

.wrap {
    max-width: var(--content-wide);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.wrap--narrow { max-width: var(--content-narrow); }

/* --- Site header ---------------------------------------------------- */

.site-header {
    padding: var(--space-16) var(--space-6) var(--space-8);
    text-align: center;
}

.site-title {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.site-title a {
    color: var(--text-primary);
}
.site-title a:hover { color: var(--orange); }

.site-logo {
    display: inline-block;
    line-height: 0;
}
.site-logo img {
    max-height: 58px;
    width: auto;
    margin: 0 auto;
}

.site-tagline {
    margin: var(--space-4) 0 0;
    font-size: var(--text-small);
    letter-spacing: 1.5px;
 
    color: var(--text-secondary);
}

/* --- Navigation ----------------------------------------------------- */

.site-nav {
    margin-top: var(--space-6);
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    flex-wrap: wrap;
}

.site-nav a {
    position: relative;
    padding: var(--space-2) 0;
    font-size: var(--text-small);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-secondary);
}
.site-nav a:hover { color: var(--text-primary); }

.site-nav a.is-active { color: var(--text-primary); }
.site-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--orange);
}

/* --- Subscribe card ------------------------------------------------- */

.subscribe {
    margin: var(--space-10) 0;
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: 1.5px dashed var(--divider-dashed);
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.subscribe__input {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: var(--text-small);
    font-family: var(--gh-font-body, var(--font-mono));
    transition: border-color var(--transition-fast);
}
.subscribe__input:focus {
    outline: none;
    border-color: var(--orange);
}
.subscribe__input::placeholder { color: var(--text-tertiary); }

.subscribe__button {
    background: #FF6A00;
    color: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: var(--text-micro);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background var(--transition-fast);
}
.subscribe__button:hover { background: #E35C00; }

.subscribe__message {
    flex-basis: 100%;
    font-size: var(--text-small);
    color: var(--text-secondary);
    display: none;
}
.subscribe__message.is-visible { display: block; }
.subscribe__message.is-error { color: #C0392B; }

/* --- Section labels ------------------------------------------------- */

.section-label {
    font-size: var(--text-micro);
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 var(--space-5);
}

/* --- Feed ----------------------------------------------------------- */

.feed {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feed__item {
    padding: var(--space-10) 0;
    border-top: 1px solid var(--divider);
}

.feed__item:first-child { border-top: none; padding-top: var(--space-4); }

/* Full-article feed entry */

.feed-article__meta,
.feed-link__meta {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 var(--space-4);
}

.feed-article__meta .sep,
.feed-link__meta .sep {
    color: var(--text-tertiary);
    margin: 0 var(--space-2);
}

.feed-article__title {
    font-size: var(--text-h1);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 var(--space-6);
    letter-spacing: -0.01em;
}
.feed-article__title a { color: var(--text-primary); }
.feed-article__title a:hover { color: #FF6A00; }

.feed-article__body {
    font-size: var(--text-body-lg);
    line-height: 1.7;
}

.feed-article__body > * + * { margin-top: 1.2em; }

.feed-article__footer {
    margin-top: var(--space-8);
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.feed-article__footer .permalink { color: #FF6A00; font-weight: 600; }
.feed-article__footer .permalink:hover { color: var(--black); }
.feed-article__footer .sep { color: var(--text-tertiary); margin: 0 var(--space-2); }

/* Linked-item feed entry */

.feed-link {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: var(--space-3);
    align-items: start;
}

.feed-link__arrow {
    color: #FF6A00;
    font-weight: 600;
    line-height: 1.6;
    padding-top: 2px;
}

.feed-link__meta { margin-bottom: var(--space-2); }

.feed-link__title {
    font-size: var(--text-h3);
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 var(--space-3);
}
.feed-link__title a { color: var(--text-primary); }
.feed-link__title a:hover { color: #FF6A00; }
.feed-link__title .ext {
    color: var(--orange);
    margin-left: var(--space-1);
    font-weight: 400;
}

.feed-link__quote {
    margin: 0;
    padding: var(--space-2) 0 var(--space-2) var(--space-4);
    border-left: 2px solid var(--divider);
    color: var(--text-primary);
    font-size: var(--text-body);
    line-height: 1.6;
}
.feed-link__quote p { margin: 0; }

.feed-link__body {
    margin-top: var(--space-5);
    font-size: var(--text-body-lg);
    line-height: 1.7;
}

.feed-link__body > * + * { margin-top: 1.2em; }

.feed-link__footer {
    margin-top: var(--space-8);
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.feed-link__footer .permalink { color: #FF6A00; font-weight: 600; }
.feed-link__footer .permalink:hover { color: var(--black); }
.feed-link__footer .sep { color: var(--text-tertiary); margin: 0 var(--space-2); }

/* --- Single post ---------------------------------------------------- */

.post-nav-back {
    display: inline-block;
    margin-bottom: var(--space-8);
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #FF6A00;
}
.post-nav-back:hover { color: var(--black); }

.post-header { margin-bottom: var(--space-8); }

.post-header__meta {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 var(--space-5);
}
.post-header__meta .sep { color: var(--text-tertiary); margin: 0 var(--space-2); }

.post-title {
    font-size: var(--text-h1);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 var(--space-4);
}

.post-byline {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-body);
}

.post-divider {
    border: none;
    border-top: 1px solid var(--divider);
    margin: var(--space-8) 0;
}

.post-content {
    font-size: var(--text-body-lg);
    line-height: 1.7;
}

.post-content > * + * { margin-top: 1.2em; }
.post-content h2 {
    font-size: var(--text-h2);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2em;
}
.post-content h3 {
    font-size: var(--text-h3);
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1.6em;
}
.post-content blockquote,
.feed-article__body blockquote,
.feed-link__body blockquote {
    margin: 1.4em 0;
    padding: var(--space-3) var(--space-5);
    border-left: 2px solid #FF6A00;
    color: var(--text-primary);
}
.post-content blockquote p,
.feed-article__body blockquote p,
.feed-link__body blockquote p { margin: 0; }
.post-content code {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.95em;
}
.post-content pre {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: 8px;
    padding: var(--space-4);
    overflow-x: auto;
    font-size: var(--text-small);
}
.post-content pre code {
    background: none;
    border: none;
    padding: 0;
}
.post-content img,
.post-content figure { margin: 1.6em 0; }
.post-content figcaption {
    margin-top: var(--space-2);
    font-size: var(--text-small);
    color: var(--text-secondary);
    text-align: center;
}
.post-content a {
    color: var(--orange);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.post-content a:hover {
    color: var(--black);
    text-decoration-color: var(--black);
}
.post-content hr {
    border: none;
    border-top: 1px dashed var(--divider-dashed);
    margin: 2em 0;
}
.post-content ul,
.post-content ol {
    padding-left: 1.5em;
}
.post-content li + li { margin-top: 0.4em; }

.post-feature-image {
    margin: 0 0 var(--space-8);
    border-radius: 8px;
    overflow: hidden;
}

/* Prev / next navigation */

.post-pager {
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--divider);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
}

.post-pager a {
    display: block;
    color: var(--text-primary);
}
.post-pager a:hover .post-pager__title { color: var(--orange); }

.post-pager__label {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}
.post-pager__title {
    font-size: var(--text-body);
    font-weight: 500;
    transition: color var(--transition-fast);
}
.post-pager__newer { text-align: right; }

@media (max-width: 680px) {
    .post-pager { grid-template-columns: 1fr; }
    .post-pager__newer { text-align: left; }
}

/* --- Archive -------------------------------------------------------- */

.archive-header { margin: var(--space-8) 0 var(--space-6); }

.archive-title {
    font-size: var(--text-h1);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 var(--space-3);
    letter-spacing: -0.01em;
}

.archive-meta {
    margin: 0;
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.archive-meta .sep { margin: 0 var(--space-2); color: var(--text-tertiary); }

.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) 0;
    border-top: 1px solid var(--divider);
    border-bottom: 1.5px dashed var(--divider-dashed);
    flex-wrap: wrap;
}

.filter-bar__label {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-right: var(--space-2);
}

.filter-pill {
    background: transparent;
    border: 1px solid var(--divider);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: var(--text-micro);
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.filter-pill:hover { border-color: var(--orange); color: var(--orange); }

.filter-pill.is-active {
    background: #FF6A00;
    border-color: #FF6A00;
    color: #fff;
}

.archive-year {
    margin: var(--space-10) 0 var(--space-5);
    display: flex;
    align-items: baseline;
    gap: var(--space-4);
}

.archive-year__num {
    font-size: 2rem;
    font-weight: 600;
    color: #FF6A00;
    line-height: 1;
}

.archive-year__count {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: var(--space-5);
    align-items: baseline;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--divider);
}
.archive-row:first-child { border-top: 1.5px solid var(--divider); }

.archive-row__date {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.archive-row__title { font-size: var(--text-body); }
.archive-row__title a { color: var(--text-primary); }
.archive-row__title a:hover { color: var(--orange); }

.archive-row__tag {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

@media (max-width: 680px) {
    .archive-row {
        grid-template-columns: 1fr;
        gap: var(--space-1);
    }
}

/* --- Contact page --------------------------------------------------- */

.contact-intro {
    max-width: var(--content-narrow);
    font-size: var(--text-body-lg);
    line-height: 1.7;
    margin: 0 0 var(--space-6);
}

.contact-note {
    max-width: var(--content-narrow);
    color: var(--text-secondary);
    font-size: var(--text-body);
    margin: 0 0 var(--space-8);
}

.contact-list {
    list-style: none;
    margin: 0 0 var(--space-8);
    padding: 0;
    border-top: 1.5px dashed var(--divider-dashed);
}

.contact-row {
    display: grid;
    grid-template-columns: 120px 28px 1fr auto;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--divider);
}

.contact-row__label {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.contact-row__arrow {
    color: #FF6A00;
    font-weight: 600;
}

.contact-row__value { font-size: var(--text-body); }
.contact-row__value a { color: var(--text-primary); }
.contact-row__value a:hover { color: var(--orange); }

.contact-row__note {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

@media (max-width: 680px) {
    .contact-row {
        grid-template-columns: 28px 1fr;
        gap: var(--space-2) var(--space-3);
    }
    .contact-row__label,
    .contact-row__note {
        grid-column: 1 / -1;
    }
}

.contact-subscribe-lede {
    margin: var(--space-10) 0 var(--space-4);
    font-size: var(--text-body);
    line-height: 1.6;
    color: var(--text-secondary);
}

/* --- Footer --------------------------------------------------------- */

.site-footer {
    margin-top: var(--space-16);
    padding: 0 var(--space-6) var(--space-8);
    font-size: var(--text-small);
    color: var(--text-secondary);
}

.site-footer__inner {
    max-width: var(--content-narrow);
    margin: 0 auto;
    padding-top: var(--space-8);
    border-top: 1.5px dashed var(--divider-dashed);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.site-footer__links {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.site-footer__links a { color: var(--text-primary); }
.site-footer__links a:hover { color: #FF6A00; }
.site-footer__links .rss { color: #FF6A00; }
.site-footer__links .rss::before { content: "→ "; }

.site-footer__attr { color: var(--text-tertiary); }

@media (max-width: 680px) {
    .site-footer__inner { flex-direction: column; align-items: flex-start; }
}

/* --- Show older --------------------------------------------------- */

.show-older {
    margin: var(--space-10) 0 var(--space-8);
    padding-top: var(--space-8);
    border-top: 1.5px dashed var(--divider-dashed);
    text-align: center;
    font-size: var(--text-micro);
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.show-older a { color: #FF6A00; }
.show-older a:hover { color: var(--black); }

/* --- Pagination (default) ------------------------------------------- */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: var(--space-10) 0;
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.pagination a { color: var(--orange); font-weight: 600; }
.pagination a:hover { color: var(--black); }

/* --- Tag / author pages -------------------------------------------- */

.channel-header {
    margin: var(--space-8) 0 var(--space-8);
    max-width: var(--content-narrow);
}
.channel-header__label {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 var(--space-3);
}
.channel-header__title {
    font-size: var(--text-h1);
    font-weight: 700;
    margin: 0 0 var(--space-3);
    letter-spacing: -0.01em;
}
.channel-header__desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-body);
}

/* --- Error page ----------------------------------------------------- */

.error {
    text-align: center;
    padding: var(--space-16) var(--space-6);
}
.error__code {
    font-size: 5rem;
    font-weight: 700;
    color: var(--orange);
    line-height: 1;
    margin: 0;
}
.error__message {
    font-size: var(--text-h2);
    font-weight: 600;
    margin: var(--space-4) 0 var(--space-6);
}
.error__link {
    font-size: var(--text-micro);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* --- Kg cards (Ghost native blocks) --------------------------------- */

.kg-width-wide  { max-width: var(--content-wide); margin-left: auto; margin-right: auto; }
.kg-width-full  { max-width: none; margin-left: calc(-1 * var(--space-6)); margin-right: calc(-1 * var(--space-6)); }
.kg-bookmark-card,
.kg-callout-card,
.kg-toggle-card,
.kg-product-card {
    border: 1px solid var(--divider);
    border-radius: 12px;
    padding: var(--space-5);
    margin: 1.4em 0;
}
.kg-bookmark-container {
    display: flex;
    gap: var(--space-5);
    align-items: stretch;
    text-decoration: none;
    color: var(--text-primary);
}
.kg-bookmark-content { flex: 1; }
.kg-bookmark-title { font-weight: 600; margin-bottom: var(--space-2); }
.kg-bookmark-description { color: var(--text-secondary); font-size: var(--text-small); }

/* --- Utilities ------------------------------------------------------ */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
