/* ============================================================
   signalby — minimal monospace Ghost theme
   ============================================================ */

/* --- Design tokens --------------------------------------- */

:root {
    --accent: #0055FF;
    --accent-dim: rgba(0, 85, 255, 0.12);
    --text: #111111;
    --muted: #999999;
    --border: #e4e4e4;
    --bg: #ffffff;
    --footer-bg: #111111;
}


/* --- Reset & Base ----------------------------------------- */

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

html {
    font-size: 14px;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Mono', 'Courier New', Courier, monospace;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Footer always at bottom */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: underline;
}

a:hover {
    opacity: 0.65;
}

p {
    margin: 0 0 1em;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    line-height: 1.3;
    margin: 0 0 0.5em;
    font-family: 'IBM Plex Mono', 'Courier New', Courier, monospace;
}

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

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


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

.site-wrapper {
    flex: 1;
    max-width: 950px;
    margin: 0 auto;
    width: 100%;
    padding: 48px 32px 64px;
}


/* --- Blinking cursor on site name ----------------------- */

.site-name::after {
    content: '|';
    margin-left: 2px;
    color: var(--accent);
    animation: blink 1.2s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}


/* --- Header (shared) ------------------------------------- */

.site-header {
    margin-bottom: 0;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.site-name {
    font-size: 1.15em;
    font-weight: bold;
    letter-spacing: 0.04em;
}

.site-name a {
    text-decoration: none;
    color: inherit;
}

.header-nav a {
    text-decoration: none;
    color: var(--text);
    font-size: 0.9em;
}

.header-nav a:hover {
    opacity: 0.6;
}

.header-meta {
    margin-top: 4px;
}

.header-links {
    font-size: 0.88em;
    color: var(--muted);
    margin-bottom: 2px;
}

.header-links a {
    color: var(--muted);
}

.site-tagline {
    font-size: 0.88em;
    color: var(--muted);
    margin-bottom: 2px;
}

.header-now {
    font-size: 0.88em;
    color: var(--muted);
    margin-bottom: 0;
}

.header-now a {
    color: var(--muted);
    text-decoration: none;
}

.header-now a:hover {
    color: var(--accent);
    opacity: 1;
}


/* --- Homepage two-column grid ---------------------------- */

.home-content {
    margin-top: 0;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 64px;
    align-items: start;
}

.home-section {
    margin-bottom: 0;
}

/* Section numbers */
.section-num {
    color: #cccccc;
    margin-right: 6px;
    font-size: 0.85em;
    letter-spacing: 0.02em;
}

.section-title {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 14px;
    letter-spacing: 0.01em;
}

.section-body {
    padding-left: 20px;
    color: #333333;
    font-size: 0.92em;
    line-height: 1.75;
}

.section-body p {
    margin-bottom: 0.5em;
}

.work-desc {
    color: #666666;
    font-size: 0.9em;
}

.archived-label {
    font-size: 0.75em;
    color: #bbbbbb;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    margin-top: 20px;
    margin-bottom: 4px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.archived-item {
    color: #aaaaaa;
    font-size: 0.88em;
    margin-bottom: 0.3em;
}

.archived-item a {
    color: #aaaaaa;
}

.archived-item a:hover {
    color: var(--accent);
    opacity: 1;
}

/* Writing section — full width, wider mini-post list */
.section-body--writing {
    padding-left: 20px;
}

/* Horizontal links row with bullet prefix */
.links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 32px;
    padding-left: 20px;
}

.links-row a {
    text-decoration: none;
    color: var(--text);
    font-size: 0.92em;
}

.links-row a::before {
    content: '• ';
    color: var(--muted);
}

.links-row a:hover {
    color: var(--accent);
    opacity: 1;
}


/* Mini post list on homepage */
.mini-post {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    gap: 20px;
}

.mini-post a {
    text-decoration: none;
    color: var(--text);
    flex: 1;
}

.mini-post a:hover {
    color: var(--accent);
    opacity: 1;
}

.mini-post-date {
    color: var(--muted);
    font-size: 0.82em;
    white-space: nowrap;
    flex-shrink: 0;
}

.see-all {
    margin-top: 16px;
    margin-bottom: 0;
}

.see-all a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.88em;
}

.see-all a:hover {
    color: var(--accent);
    opacity: 1;
}


/* --- Tag filter row -------------------------------------- */

.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.tag-filter-item {
    font-size: 0.8em;
    color: var(--muted);
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.tag-filter-item:hover,
.tag-filter-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    opacity: 1;
}


/* --- Blog listing (index / tag pages) -------------------- */

.post-list {
    margin-top: 0;
    counter-reset: post-counter;
}

.post-card {
    margin-bottom: 40px;
    counter-increment: post-counter;
}

.post-card:last-child {
    margin-bottom: 0;
}

/* Numbered prefix */
.post-card::before {
    content: counter(post-counter, decimal-leading-zero) ".";
    display: block;
    font-size: 0.72em;
    color: #cccccc;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

/* Inner wrapper handles text+image row — keeps ::before number above both */
.post-card-body {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.post-card-text {
    flex: 1;
    min-width: 0;
}

.post-card-image-link {
    flex-shrink: 0;
    display: block;
    text-decoration: none;
}

.post-card-image {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
    border: 1px solid #eeeeee;
}

.post-card .post-title {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 5px;
    letter-spacing: 0.01em;
}

.post-card .post-title a {
    text-decoration: none;
    color: var(--text);
}

.post-card .post-title a:hover {
    text-decoration: underline;
}

.post-meta {
    font-size: 0.82em;
    color: var(--muted);
    margin-bottom: 8px;
}

.post-meta .tag-link {
    color: var(--muted);
    text-decoration: none;
}

.post-meta .tag-link:hover {
    color: var(--accent);
    opacity: 1;
}

.post-excerpt {
    color: #333333;
    font-size: 0.9em;
    line-height: 1.75;
    margin-bottom: 0;
}

/* Pagination */
.pagination {
    margin-top: 56px;
    display: flex;
    justify-content: space-between;
    font-size: 0.82em;
    color: var(--muted);
}

.pagination a {
    color: var(--muted);
    text-decoration: none;
}

.pagination a:hover {
    color: var(--accent);
    opacity: 1;
}

.pagination .page-number {
    color: #bbbbbb;
}


/* --- Post page ------------------------------------------- */

.post-header {
    margin-bottom: 28px;
}

.post-header .header-row {
    margin-bottom: 6px;
    align-items: flex-start;
}

.post-title-main {
    font-size: 1.05em;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 0;
    padding-right: 24px;
}

/* Post feature image */
.post-feature-image {
    margin: 0 0 36px;
    max-width: 680px;
}

.post-feature-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    border: 1px solid #eeeeee;
}

.post-feature-image figcaption {
    font-size: 0.78em;
    color: #aaaaaa;
    margin-top: 8px;
}

/* Subscribe / members CTA box */
.subscribe-box {
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 14px 18px;
    margin-bottom: 44px;
    font-size: 0.82em;
}

.subscribe-box-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.subscribe-label {
    color: #aaaaaa;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8em;
    white-space: nowrap;
}

.subscribe-form {
    display: flex;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.subscribe-form input[type="email"] {
    flex: 1;
    min-width: 180px;
    padding: 7px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', 'Courier New', Courier, monospace;
    font-size: 1em;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}

.subscribe-form input[type="email"]:focus {
    border-color: var(--accent);
}

.subscribe-form input[type="email"]::placeholder {
    color: #bbbbbb;
}

.subscribe-form button {
    padding: 7px 16px;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', 'Courier New', Courier, monospace;
    font-size: 0.9em;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.subscribe-form button:hover {
    opacity: 0.85;
}

/* Post body content */
.post-content {
    max-width: 680px;
    font-size: 1em;
    line-height: 1.85;
    color: var(--text);
}

.post-content p {
    margin-bottom: 1.5em;
}

.post-content h2 {
    font-size: 1em;
    font-weight: bold;
    margin-top: 2.2em;
    margin-bottom: 0.7em;
}

.post-content h3 {
    font-size: 0.95em;
    font-weight: bold;
    margin-top: 2em;
    margin-bottom: 0.6em;
}

.post-content h4,
.post-content h5,
.post-content h6 {
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 1.6em;
    margin-bottom: 0.5em;
}

.post-content blockquote {
    border-left: 2px solid var(--accent);
    margin: 1.6em 0;
    padding-left: 20px;
    color: #555555;
}

.post-content blockquote p {
    margin-bottom: 0.5em;
}

.post-content pre {
    background: #f6f6f6;
    padding: 16px 18px;
    overflow-x: auto;
    border-radius: 4px;
    font-size: 0.85em;
    line-height: 1.65;
    margin: 1.6em 0;
}

.post-content code {
    background: #f0f0f0;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.88em;
    font-family: 'IBM Plex Mono', 'Courier New', Courier, monospace;
}

.post-content pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1.6em 0;
}

.post-content figure {
    margin: 1.6em 0;
}

.post-content figcaption {
    font-size: 0.8em;
    color: var(--muted);
    margin-top: 8px;
}

.post-content ul,
.post-content ol {
    padding-left: 22px;
    margin-bottom: 1.5em;
}

.post-content li {
    margin-bottom: 0.45em;
}

.post-content a {
    color: var(--text);
    text-decoration: underline;
}

.post-content a:hover {
    color: var(--accent);
    opacity: 1;
}

.post-content hr {
    margin: 2.5em 0;
}

/* Ghost Koenig editor — required card width classes */
.kg-width-wide {
    width: calc(100% + 120px);
    margin-left: -60px;
    max-width: none;
}

.kg-width-full {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    max-width: none;
}

.kg-width-wide img,
.kg-width-full img {
    width: 100%;
    height: auto;
    display: block;
}

/* Callout cards (Ghost native) */
.post-content .kg-callout-card {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 4px;
    background: var(--accent-dim);
    border-left: 2px solid var(--accent);
    margin: 1.6em 0;
}

.post-content .kg-callout-emoji {
    font-size: 1.2em;
}

/* Post footer */
.post-footer {
    margin-top: 44px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag-pill {
    display: inline-block;
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 0.78em;
    color: #777777;
    text-decoration: none;
    font-family: 'IBM Plex Mono', 'Courier New', Courier, monospace;
    transition: border-color 0.15s, color 0.15s;
}

.tag-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    opacity: 1;
}


/* --- Static pages ---------------------------------------- */

.page-content {
    margin-top: 32px;
}


/* --- /now page ------------------------------------------- */

.now-page {
    max-width: 680px;
}

.now-header {
    margin-bottom: 36px;
}

.now-title {
    font-size: 1.6em;
    font-weight: bold;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
    color: var(--text);
}

.now-updated {
    font-size: 0.8em;
    color: var(--accent);
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}

.now-content {
    font-size: 1em;
    line-height: 1.85;
}

/* Section headings in now page get a subtle accent underline */
.now-content h2 {
    font-size: 0.95em;
    font-weight: bold;
    text-transform: lowercase;
    letter-spacing: 0.05em;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    margin-top: 2em;
    margin-bottom: 0.8em;
}

.now-content h2::before {
    content: '// ';
    color: var(--accent);
    font-size: 0.85em;
}

.now-footer {
    margin-top: 48px;
}

.now-meta {
    font-size: 0.8em;
    color: var(--muted);
    margin-bottom: 0;
}

.now-meta a {
    color: var(--muted);
}

.now-meta a:hover {
    color: var(--accent);
    opacity: 1;
}


/* --- Project pages --------------------------------------- */

.project-page {
    max-width: 680px;
}

.project-header {
    margin-bottom: 32px;
}

.project-back {
    font-size: 0.82em;
    color: var(--muted);
    margin-bottom: 16px;
}

.project-back a {
    color: var(--muted);
    text-decoration: none;
}

.project-back a:hover {
    color: var(--accent);
    opacity: 1;
}

.project-title {
    font-size: 1.15em;
    font-weight: bold;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.project-subtitle {
    font-size: 0.9em;
    color: #555555;
    margin-bottom: 0;
    line-height: 1.6;
}


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

.error-content {
    padding: 8px 0 0;
    color: var(--muted);
    font-size: 0.9em;
    line-height: 1.8;
}

.error-content a {
    color: var(--muted);
}


/* --- Black footer bar ------------------------------------ */

.site-footer {
    background: var(--footer-bg);
    color: #555555;
    width: 100%;
    flex-shrink: 0;
}

.footer-inner {
    max-width: 950px;
    margin: 0 auto;
    padding: 22px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.footer-name {
    font-size: 0.88em;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 0.03em;
}

.footer-tagline {
    font-size: 0.72em;
    color: #aaaaaa;
}

.footer-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.footer-nav a {
    font-size: 0.78em;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-nav a:hover {
    color: var(--accent);
    opacity: 1;
}


/* --- Responsive ------------------------------------------ */

@media (max-width: 720px) {
    .home-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .home-grid .home-section:first-child {
        margin-bottom: 0;
    }

    /* Add a thin divider between stacked grid items on mobile */
    .home-grid .home-section + .home-section {
        margin-top: 28px;
        padding-top: 28px;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 640px) {
    html {
        font-size: 13px;
    }

    .site-wrapper {
        padding: 32px 20px 56px;
    }

    .post-title-main {
        padding-right: 16px;
    }

    .subscribe-box-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .subscribe-form {
        width: 100%;
    }

    .subscribe-form input[type="email"] {
        min-width: 0;
        width: 100%;
    }

    .mini-post {
        flex-direction: column;
        gap: 2px;
    }

    .mini-post-date {
        font-size: 0.78em;
    }

    .post-card-body {
        gap: 16px;
    }

    .post-card-image {
        width: 72px;
        height: 72px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .footer-nav {
        justify-content: flex-start;
    }

    .tag-filter {
        gap: 4px 14px;
    }
}

@media (max-width: 420px) {
    .site-wrapper {
        padding: 24px 16px 48px;
    }
}
