/* =====================================================================
   WOZA  ·  Ghost theme
   Deep-tech editorial. Monochrome. Engineering-grade typography.
   ===================================================================== */

/* ---------- Tokens ---------------------------------------------------- */
:root {
    --paper:      #ffffff;
    --paper-2:    #f6f6f4;
    --ink:        #0a0a0a;
    --ink-soft:   #2b2b2b;
    --muted:      #767674;
    --line:       #e6e6e2;
    --line-2:     #d6d6d1;

    --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --wrap:       1200px;
    --narrow:     720px;
    --gutter:     clamp(20px, 5vw, 56px);

    --step:       clamp(64px, 9vw, 120px);
    --radius:     0px;

    --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

/* Explicit dark selection */
html[data-scheme="Dark"] {
    --paper:      #0a0a0a;
    --paper-2:    #141414;
    --ink:        #f4f4f1;
    --ink-soft:   #cfcfca;
    --muted:      #8f8f8a;
    --line:       #242422;
    --line-2:     #333330;
}

/* Auto = follow the OS */
@media (prefers-color-scheme: dark) {
    html[data-scheme="Auto"] {
        --paper:      #0a0a0a;
        --paper-2:    #141414;
        --ink:        #f4f4f1;
        --ink-soft:   #cfcfca;
        --muted:      #8f8f8a;
        --line:       #242422;
        --line-2:     #333330;
    }
}

/* ---------- Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--gh-font-body, var(--font-sans));
    font-size: 17px;
    line-height: 1.6;
    font-feature-settings: "ss01", "cv05", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color .3s var(--ease), color .3s var(--ease);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--gh-font-heading, var(--font-sans)); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
p { margin: 0 0 1.2em; }
button { font-family: inherit; }

::selection { background: var(--ink); color: var(--paper); }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--ink); color: var(--paper); padding: 10px 16px;
    font-family: var(--font-mono); font-size: 12px;
}
.skip-link:focus { left: 0; }

/* ---------- Layout ---------------------------------------------------- */
.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.wrap-narrow {
    width: 100%;
    max-width: var(--narrow);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.site-main { display: block; }

.section-rule { border-top: 1px solid var(--line); height: 0; padding-inline: 0; }

/* shared micro-label */
.eyebrow, .col-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 11px 18px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius);
    transition: background-color .2s var(--ease), color .2s var(--ease);
    white-space: nowrap;
}
.btn:hover { background: transparent; color: var(--ink); }

/* ---------- Header ---------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: var(--paper);
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    -webkit-backdrop-filter: saturate(120%) blur(10px);
    backdrop-filter: saturate(120%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px;
    min-height: 68px;
}
.brand { display: flex; align-items: center; }
.brand-logo { max-height: 26px; width: auto; }
.brand-mark {
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.02em;
    font-size: 16px;
    text-transform: uppercase;
}
/* invert a black logo when the surface goes dark */
@media (prefers-color-scheme: dark) {
    html[data-scheme="Auto"] .brand-logo { filter: invert(1); }
}
html[data-scheme="Dark"] .brand-logo { filter: invert(1); }

.site-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-item {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
    transition: color .18s var(--ease);
}
.nav-item:hover { color: var(--ink); }
.nav-slash { color: var(--muted); margin-right: 4px; }
.nav-item:hover .nav-slash { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
    display: none;
    width: 40px; height: 40px;
    border: 1px solid var(--line-2); background: transparent;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    cursor: pointer; border-radius: var(--radius);
}
.nav-toggle-bar { width: 16px; height: 1.5px; background: var(--ink); transition: transform .2s var(--ease), opacity .2s var(--ease); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

.mobile-nav { display: none; border-top: 1px solid var(--line); background: var(--paper); }
.mobile-nav.is-open { display: block; }
.mobile-nav .wrap { display: flex; flex-direction: column; padding-block: 8px; }
.mobile-nav-item {
    font-family: var(--font-mono); font-size: 15px; padding: 14px 0;
    border-bottom: 1px solid var(--line); color: var(--ink);
}
.mobile-nav-item:last-child { border-bottom: 0; }

/* ---------- Masthead (home hero) ------------------------------------- */
.masthead { padding-block: clamp(48px, 8vw, 96px) clamp(36px, 5vw, 60px); }
.masthead .eyebrow { margin-bottom: 26px; }
.masthead-title {
    font-size: clamp(2.6rem, 6.4vw, 5.4rem);
    letter-spacing: -0.035em;
    line-height: 0.98;
    max-width: 15ch;
    margin-bottom: 22px;
}
.masthead-sub {
    color: var(--muted);
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    max-width: 52ch;
    margin: 0;
}

/* ---------- Page heads (archives) ------------------------------------ */
.page-head { padding-block: clamp(40px, 6vw, 72px) 28px; }
.page-head .eyebrow { margin-bottom: 18px; }
.page-head-title {
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    letter-spacing: -0.03em;
}
.archive-desc { color: var(--muted); max-width: 56ch; margin: 16px 0 10px; font-size: 1.05rem; }
.archive-count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.author-head-inner { display: flex; gap: 22px; align-items: center; }
.author-avatar.lg { width: 84px; height: 84px; border-radius: 0; object-fit: cover; border: 1px solid var(--line); }

/* ---------- Feed / index --------------------------------------------- */
.feed {
    counter-reset: post;
    border-top: 1px solid var(--line);
    margin-bottom: var(--step);
}
.entry { border-bottom: 1px solid var(--line); counter-increment: post; }
.entry-inner {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 26px;
    align-items: start;
    padding-block: clamp(28px, 3.4vw, 44px);
    transition: background-color .2s var(--ease);
}
.entry-inner::before {
    content: "[" counter(post, decimal-leading-zero) "]";
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.02em;
    padding-top: 6px;
    transition: color .2s var(--ease);
}
.entry:hover .entry-inner::before { color: var(--ink); }
.entry-inner:hover { background: var(--paper-2); }
.entry-body { min-width: 0; }
.entry-kicker { display: flex; gap: 14px; margin-bottom: 12px; }
.tag-label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.tag-label.is-featured { color: var(--ink); }
.entry-title {
    font-size: clamp(1.4rem, 2.6vw, 2.15rem);
    letter-spacing: -0.025em;
    line-height: 1.04;
    margin-bottom: 12px;
    transition: opacity .2s var(--ease);
}
.entry:hover .entry-title { opacity: 0.72; }
.entry-excerpt {
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.55;
    max-width: 62ch;
    margin-bottom: 16px;
}
.entry-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.03em;
    color: var(--muted);
    text-transform: uppercase;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.entry-meta .sep { opacity: 0.5; }
.entry-media {
    width: 148px; height: 108px; overflow: hidden;
    border: 1px solid var(--line);
    align-self: start;
}
.entry-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.entry:hover .entry-media img { transform: scale(1.04); }
.feed-empty { color: var(--muted); padding-block: 60px; font-family: var(--font-mono); }

/* ---------- Pagination ----------------------------------------------- */
.pagination {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding-block: 20px 90px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.page-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color .2s var(--ease); }
.page-link:hover { border-color: var(--ink); }
.page-link.is-disabled { color: var(--muted); opacity: 0.4; pointer-events: none; }
.page-count { color: var(--muted); }

/* ---------- Article --------------------------------------------------- */
.article { padding-top: clamp(36px, 5vw, 64px); }
.article-header { text-align: left; }
.article-kicker { margin-bottom: 20px; }
.article-title {
    font-size: clamp(2rem, 4.8vw, 3.6rem);
    letter-spacing: -0.032em;
    line-height: 1.02;
    max-width: 18ch;
}
.article-dek {
    color: var(--muted);
    font-size: clamp(1.1rem, 1.7vw, 1.32rem);
    line-height: 1.5;
    max-width: 54ch;
    margin: 22px 0 0;
}
.article-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}
.article-meta .sep { opacity: 0.5; }

.article-image { margin-block: clamp(32px, 5vw, 56px); }
.article-image img { width: 100%; border: 1px solid var(--line); }
.article-image figcaption {
    font-family: var(--font-mono); font-size: 12px; color: var(--muted);
    text-align: left; margin-top: 12px; letter-spacing: 0.02em;
}

/* ---------- Content (gh-content) ------------------------------------- */
.gh-content { font-size: 1.14rem; line-height: 1.72; color: var(--ink-soft); }
.gh-content > * { margin-block: 0 1.5em; }
.gh-content h2 { font-size: 1.7rem; letter-spacing: -0.02em; margin-top: 2em; color: var(--ink); }
.gh-content h3 { font-size: 1.32rem; letter-spacing: -0.015em; margin-top: 1.6em; color: var(--ink); }
.gh-content h4 { font-size: 1.12rem; margin-top: 1.4em; color: var(--ink); }
.gh-content a { color: var(--ink); border-bottom: 1px solid var(--line-2); transition: border-color .2s var(--ease); }
.gh-content a:hover { border-color: var(--ink); }
.gh-content strong { color: var(--ink); font-weight: 600; }
.gh-content blockquote {
    margin: 1.8em 0; padding: 4px 0 4px 26px;
    border-left: 2px solid var(--ink);
    font-size: 1.28rem; line-height: 1.5; color: var(--ink);
    letter-spacing: -0.01em;
}
.gh-content ul, .gh-content ol { padding-left: 1.25em; }
.gh-content li { margin-bottom: 0.5em; }
.gh-content li::marker { color: var(--muted); }
.gh-content hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.4em; }
.gh-content img, .gh-content video { border: 1px solid var(--line); }
.gh-content figcaption { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }
.gh-content code {
    font-family: var(--font-mono); font-size: 0.88em;
    background: var(--paper-2); padding: 2px 6px; border: 1px solid var(--line);
}
.gh-content pre {
    font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.6;
    background: var(--ink); color: #f4f4f1;
    padding: 22px; overflow-x: auto; border: 0;
}
.gh-content pre code { background: transparent; border: 0; padding: 0; color: inherit; }

/* Ghost cards */
.gh-content .kg-card { margin-block: 2em; }
.kg-width-wide { max-width: min(var(--wrap), 1000px); margin-inline: auto; }
.kg-width-full { max-width: 100vw; margin-inline: calc(50% - 50vw); }
.kg-width-full img { border-radius: 0; border: 0; }

/* ---------- Article footer ------------------------------------------- */
.article-footer { padding-top: 44px; margin-top: 48px; border-top: 1px solid var(--line); padding-bottom: 8px; }
.article-tags { margin-bottom: 40px; }
.article-tags .col-label { display: block; margin-bottom: 14px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.03em;
    padding: 7px 12px; border: 1px solid var(--line-2); color: var(--ink-soft);
    transition: border-color .2s var(--ease), color .2s var(--ease);
}
.pill:hover { border-color: var(--ink); color: var(--ink); }

.article-author { display: flex; gap: 18px; align-items: flex-start; }
.author-avatar { width: 52px; height: 52px; object-fit: cover; border: 1px solid var(--line); }
.author-body .col-label { display: block; margin-bottom: 8px; }
.author-name { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.author-bio { color: var(--muted); margin: 8px 0 0; font-size: 0.98rem; max-width: 56ch; }

.article-comments { margin-top: 64px; padding-bottom: 40px; }
.article-comments .col-label { display: block; margin-bottom: 20px; }

/* ---------- Read next ------------------------------------------------- */
.read-next { border-top: 1px solid var(--line); background: var(--paper-2); padding-block: clamp(48px, 6vw, 80px); }
.read-next .page-head { padding-block: 0 26px; }
.read-next .feed { border-top: 1px solid var(--line-2); margin-bottom: 0; }
.read-next .entry:last-child { border-bottom: 0; }
.read-next .entry-inner:hover { background: transparent; }

/* ---------- Error ----------------------------------------------------- */
.error-page { padding-block: clamp(80px, 14vw, 180px); text-align: left; }
.error-page .eyebrow { margin-bottom: 20px; }
.error-title { font-size: clamp(2.4rem, 6vw, 4.5rem); letter-spacing: -0.03em; margin-bottom: 14px; }
.error-sub { color: var(--muted); margin-bottom: 30px; }

/* ---------- Footer ---------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 0; padding-top: clamp(52px, 6vw, 84px); }
.footer-inner { display: grid; grid-template-columns: 1.2fr 2fr; gap: clamp(32px, 5vw, 72px); padding-bottom: 56px; }
.footer-brand { display: inline-block; margin-bottom: 18px; }
.footer-brand img { max-height: 24px; width: auto; }
@media (prefers-color-scheme: dark) { html[data-scheme="Auto"] .footer-brand img { filter: invert(1); } }
html[data-scheme="Dark"] .footer-brand img { filter: invert(1); }
.footer-note { font-size: 1.4rem; letter-spacing: -0.02em; line-height: 1.15; max-width: 16ch; margin: 0; color: var(--ink); }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col .col-label { margin-bottom: 6px; }
.footer-col a { font-size: 0.96rem; color: var(--ink-soft); width: fit-content; border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
.footer-col a:hover { border-color: var(--ink); }
.footer-base {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding-block: 22px 40px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--muted);
}
.footer-built a { border-bottom: 1px solid var(--line-2); }
.footer-built a:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Focus / a11y --------------------------------------------- */
a:focus-visible, button:focus-visible, .btn:focus-visible {
    outline: 2px solid var(--ink); outline-offset: 3px;
}

/* ---------- Responsive ------------------------------------------------ */
@media (max-width: 860px) {
    .site-nav { display: none; }
    .nav-toggle { display: flex; }
    .footer-inner { grid-template-columns: 1fr; gap: 40px; }
    .footer-cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    body { font-size: 16px; }
    .entry-inner { grid-template-columns: 1fr; gap: 14px; padding-block: 26px; }
    .entry-inner::before { padding-top: 0; }
    .entry-media { width: 100%; height: 190px; order: -1; }
    .footer-cols { grid-template-columns: 1fr; }
    .footer-base { flex-direction: column; align-items: flex-start; gap: 10px; }
    .author-head-inner { flex-direction: column; align-items: flex-start; }
}

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