:root {
  --bg: #090909;
  --surface: #101010;
  --surface-2: #141414;
  --text: #f2f2ed;
  --muted: #888884;
  --line: #292929;
  --accent: #c8ff3d;
  --max: 1280px;
  --serif: Inter, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--serif); font-size: 16px; line-height: 1.7; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; }
button { font: inherit; }
.container { width: min(calc(100% - 48px), var(--max)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; }

.site-noise { position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }
.site-header { width: min(calc(100% - 48px), var(--max)); margin: 0 auto; min-height: 88px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.brand { font-size: 20px; font-weight: 700; letter-spacing: -.04em; }
.site-nav { display: flex; gap: 28px; justify-content: center; }
.site-nav a { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.site-nav a:hover { color: var(--text); }
.menu-toggle { display: none; justify-self: end; border: 0; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }

.hero { padding: 15vh 0 12vh; border-bottom: 1px solid var(--line); }
.hero-meta { color: var(--accent); margin-bottom: 28px; }
.hero-title { margin: 0; max-width: 950px; font-size: clamp(64px, 11vw, 156px); line-height: .84; letter-spacing: -.075em; font-weight: 700; }
.hero-title em { color: var(--muted); font-style: normal; }
.hero-intro { max-width: 520px; margin: 44px 0 0; color: var(--muted); font-size: 19px; line-height: 1.5; }

.feed { padding: 54px 0 100px; }
.section-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--line); color: var(--muted); }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.post-card { background: var(--bg); min-width: 0; }
.card-image { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1), filter .5s; }
.post-card:hover .card-image img { transform: scale(1.025); filter: brightness(.8); }
.card-body { padding: 30px; }
.card-meta { color: var(--muted); display: flex; gap: 10px; }
.card-body h2 { margin: 14px 0 12px; font-size: clamp(27px, 3vw, 43px); line-height: 1; letter-spacing: -.045em; }
.card-body p { max-width: 600px; margin: 0 0 28px; color: var(--muted); line-height: 1.6; }
.read-more { color: var(--text); transition: color .2s; }
.read-more:hover { color: var(--accent); }
.no-image .card-body { min-height: 300px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.no-image .card-body p { max-width: 620px; }

.pagination { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; color: var(--muted); }
.pagination a:hover { color: var(--accent); }

.post { padding-bottom: 120px; }
.post-header { padding: 14vh 0 8vh; max-width: 1000px; }
.post-meta { display: flex; gap: 12px; color: var(--muted); margin-bottom: 26px; }
.post-header h1, .page-header h1, .tag-header h1, .author-header h1 { margin: 0; font-size: clamp(56px, 8vw, 118px); line-height: .9; letter-spacing: -.07em; }
.post-header h1 { max-width: 1100px; }
.post-excerpt { max-width: 720px; margin: 32px 0 0; color: var(--muted); font-size: 20px; line-height: 1.5; }
.author-line { display: flex; align-items: center; gap: 10px; margin-top: 32px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--muted); }
.author-line img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.post-feature { margin: 0 0 80px; }
.post-feature img { width: 100%; max-height: 75vh; object-fit: cover; }
.post-feature figcaption { margin-top: 10px; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.gh-content { max-width: 760px; margin-inline: auto; font-size: 18px; }
.gh-content > * { margin-block: 1.3em; }
.gh-content h2 { font-size: 42px; line-height: 1.05; letter-spacing: -.045em; margin-top: 2em; }
.gh-content h3 { font-size: 28px; line-height: 1.1; letter-spacing: -.03em; margin-top: 2em; }
.gh-content p { color: #d2d2cc; }
.gh-content a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gh-content blockquote { border-left: 2px solid var(--accent); margin-left: 0; padding-left: 24px; font-size: 25px; line-height: 1.4; color: var(--text); }
.gh-content pre { overflow-x: auto; padding: 24px; background: var(--surface); border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; }
.gh-content code { font-family: var(--mono); font-size: .9em; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gh-content th, .gh-content td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }
.gh-content figure { margin-inline: -120px; }
.gh-content figure img { width: 100%; }
.gh-content figcaption { color: var(--muted); font-family: var(--mono); font-size: 10px; }

.post-footer { max-width: 1000px; margin: 80px auto 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 0; border-top: 1px solid var(--line); }
.tag { color: var(--muted); }
.button { display: inline-block; padding: 12px 18px; border: 1px solid var(--text); font-family: var(--mono); font-size: 10px; text-transform: uppercase; white-space: nowrap; }
.button:hover { background: var(--text); color: var(--bg); }

.page, .tag-page, .author-page { padding-bottom: 120px; }
.page-header, .tag-header { padding: 14vh 0 8vh; border-bottom: 1px solid var(--line); }
.page-header .mono, .tag-header .mono { color: var(--accent); margin-bottom: 22px; }
.tag-header p { max-width: 650px; color: var(--muted); font-size: 18px; }
.author-header { padding: 14vh 0 8vh; display: grid; grid-template-columns: 160px 1fr; gap: 36px; align-items: center; }
.author-header .mono { color: var(--accent); margin-bottom: 16px; }
.author-header p { color: var(--muted); max-width: 600px; }
.author-avatar { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; }
.error-page { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.error-page .mono { color: var(--accent); }
.error-page h1 { max-width: 900px; margin: 16px 0; font-size: clamp(50px, 8vw, 110px); line-height: .9; letter-spacing: -.06em; }
.error-page p { color: var(--muted); }

.site-footer { width: min(calc(100% - 48px), var(--max)); margin: 0 auto; padding: 0 0 34px; color: var(--muted); }
.footer-rule { border-top: 1px solid var(--line); margin-bottom: 22px; }
.footer-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; font-family: var(--mono); font-size: 10px; }
.footer-grid > :last-child { text-align: right; }
.footer-links { display: flex; gap: 18px; }

@media (max-width: 800px) {
  .container, .site-header, .site-footer { width: min(calc(100% - 32px), var(--max)); }
  .site-header { min-height: 72px; grid-template-columns: 1fr auto; }
  .menu-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 72px; left: 16px; right: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); flex-direction: column; align-items: flex-start; z-index: 10; }
  .site-nav.is-open { display: flex; }
  .hero { padding: 12vh 0 10vh; }
  .hero-title { font-size: clamp(58px, 18vw, 110px); }
  .post-grid { grid-template-columns: 1fr; }
  .card-body { padding: 24px; }
  .post-header, .page-header, .tag-header, .author-header { padding-top: 10vh; }
  .post-header h1, .page-header h1, .tag-header h1, .author-header h1 { font-size: clamp(50px, 15vw, 90px); }
  .gh-content { font-size: 17px; }
  .gh-content figure { margin-inline: 0; }
  .author-header { grid-template-columns: 90px 1fr; gap: 20px; }
  .author-avatar { width: 90px; height: 90px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > :last-child { text-align: left; }
}


/* Ghost Koenig editor image widths */
.gh-content .kg-width-wide {
  width: min(100% + 240px, 1200px);
  max-width: none;
  margin-left: -120px;
  margin-right: -120px;
}

.gh-content .kg-width-full {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.gh-content .kg-width-full img,
.gh-content .kg-width-wide img {
  width: 100%;
}

@media (max-width: 1040px) {
  .gh-content .kg-width-wide {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 800px) {
  .gh-content .kg-width-full {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}


/* ─────────────────────────────────────────
   DUCKZ / POLISHED ARTICLE PAGE
   ───────────────────────────────────────── */

.post-shell {
    min-height: 100vh;
    padding: 0 5vw 7rem;
}

.post-page {
    max-width: 1180px;
    margin: 0 auto;
}

.post-header {
    padding: clamp(4rem, 10vw, 9rem) 0 3.5rem;
}

.post-kicker {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    color: var(--muted, #777);
    font: 600 .68rem/1.2 var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    letter-spacing: .14em;
    text-transform: uppercase;
}

.post-rule {
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: .3;
}

.post-title {
    max-width: 1050px;
    margin: 0;
    font-size: clamp(3.2rem, 8.2vw, 8rem);
    line-height: .91;
    letter-spacing: -.055em;
    font-weight: 650;
    text-wrap: balance;
}

.post-excerpt {
    max-width: 760px;
    margin: 2.2rem 0 0;
    color: var(--muted, #888);
    font-size: clamp(1.05rem, 1.5vw, 1.35rem);
    line-height: 1.55;
}

.post-byline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 3.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(127,127,127,.25);
    color: var(--muted, #777);
    font: .68rem/1.4 var(--mono, ui-monospace, monospace);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.byline-author,
.byline-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.byline-author > span:last-child {
    color: inherit;
}

.byline-label {
    opacity: .55;
}

.meta-divider {
    opacity: .35;
}

.post-hero {
    margin: 0 0 clamp(4rem, 8vw, 7rem);
}

.post-hero img {
    display: block;
    width: 100%;
    max-height: 760px;
    object-fit: cover;
    background: #151515;
}

.post-hero figcaption {
    padding-top: .7rem;
    color: var(--muted, #777);
    font: .65rem/1.4 var(--mono, ui-monospace, monospace);
}

.post-layout {
    display: grid;
    grid-template-columns: 150px minmax(0, 720px);
    gap: clamp(2rem, 7vw, 8rem);
    justify-content: center;
}

.post-index {
    position: sticky;
    top: 2rem;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding-top: .55rem;
    color: var(--muted, #777);
    font: .62rem/1.3 var(--mono, ui-monospace, monospace);
    letter-spacing: .12em;
}

.index-mark {
    font-size: .7rem;
    color: var(--accent, #c7ff45);
}

.index-line {
    width: 28px;
    height: 1px;
    margin: .35rem 0;
    background: currentColor;
    opacity: .35;
}

.post-content {
    min-width: 0;
    font-size: clamp(1.06rem, 1.35vw, 1.18rem);
    line-height: 1.8;
}

.post-content > * {
    margin-top: 0;
    margin-bottom: 1.7rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 4rem;
    margin-bottom: 1.2rem;
    letter-spacing: -.025em;
    line-height: 1.1;
}

.post-content h2 {
    font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.post-content h3 {
    font-size: 1.55rem;
}

.post-content p {
    max-width: 700px;
}

.post-content a {
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.post-content blockquote {
    margin: 3rem 0;
    padding: 1rem 0 1rem 1.5rem;
    border-left: 2px solid var(--accent, #c7ff45);
    font-size: 1.35em;
    line-height: 1.45;
}

.post-content pre {
    margin: 2.5rem 0;
    padding: 1.4rem;
    overflow-x: auto;
    border: 1px solid rgba(127,127,127,.25);
    border-radius: 2px;
    background: rgba(127,127,127,.06);
    font-size: .8em;
    line-height: 1.6;
}

.post-content code {
    font-family: var(--mono, ui-monospace, monospace);
}

.post-content :not(pre) > code {
    padding: .12em .3em;
    border: 1px solid rgba(127,127,127,.2);
    font-size: .82em;
}

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

.post-content .kg-card {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.post-content .kg-image-card {
    margin-left: calc(min(0px, (720px - 100vw) / 2));
    margin-right: calc(min(0px, (720px - 100vw) / 2));
}

.post-content .kg-card img {
    display: block;
}

.post-content .kg-card figcaption {
    margin-top: .65rem;
    color: var(--muted, #777);
    font: .65rem/1.4 var(--mono, ui-monospace, monospace);
}

.post-footer {
    max-width: 1050px;
    margin: clamp(5rem, 10vw, 10rem) auto 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(127,127,127,.35);
}

.footer-label {
    color: var(--muted, #777);
    font: .62rem/1.4 var(--mono, ui-monospace, monospace);
    letter-spacing: .14em;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.4rem;
}

.post-tag {
    padding: .45rem .65rem;
    border: 1px solid rgba(127,127,127,.3);
    color: inherit;
    font: .65rem/1 var(--mono, ui-monospace, monospace);
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.post-tag:hover {
    background: currentColor;
    color: var(--background, #0b0b0b);
}

.post-footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 3rem;
    padding-bottom: 1rem;
}

.footer-back {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    font: 600 .68rem/1 var(--mono, ui-monospace, monospace);
    letter-spacing: .1em;
    text-decoration: none;
}

.footer-back span:first-child {
    font-size: 1.2rem;
    transition: transform .2s ease;
}

.footer-back:hover span:first-child {
    transform: translateX(-4px);
}

.footer-signature {
    color: var(--muted, #777);
    font: .62rem/1 var(--mono, ui-monospace, monospace);
    letter-spacing: .08em;
}

@media (max-width: 800px) {
    .post-shell {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .post-header {
        padding-top: 4rem;
    }

    .post-kicker {
        margin-bottom: 1.8rem;
    }

    .post-byline {
        align-items: flex-start;
        flex-direction: column;
        gap: .7rem;
    }

    .post-layout {
        display: block;
    }

    .post-index {
        position: static;
        flex-direction: row;
        align-items: center;
        margin-bottom: 2.5rem;
    }

    .index-line {
        width: 35px;
        margin: 0;
    }

    .post-content {
        font-size: 1.05rem;
    }

    .post-footer-grid {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-signature {
        order: -1;
    }
}


/* ─────────────────────────────────────────
   DUCKZ / ARTICLE ALIGNMENT OVERRIDE
   Keep article content comfortably left-aligned
   instead of forcing it into a centered column.
   ───────────────────────────────────────── */

.post-layout {
    display: grid;
    grid-template-columns: 110px minmax(0, 820px);
    gap: clamp(1.5rem, 4vw, 4rem);
    justify-content: start;
    margin-left: clamp(0rem, 4vw, 4rem);
}

.post-content {
    max-width: 820px;
}

.post-content p {
    max-width: 820px;
}

@media (max-width: 800px) {
    .post-layout {
        display: block;
        margin-left: 0;
    }

    .post-content,
    .post-content p {
        max-width: none;
    }
}


/* DUCKZ / ARTICLE CARD IMAGE FIX */
.post-card,
.article-card,
.gh-card {
    min-width: 0;
}

.post-card-image,
.article-card-image,
.gh-card-image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #151515;
}

.post-card-image img,
.article-card-image img,
.gh-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
    transition: transform .45s cubic-bezier(.2,.7,.2,1);
}

.post-card:hover .post-card-image img,
.article-card:hover .article-card-image img,
.gh-card:hover .gh-card-image img {
    transform: scale(1.025);
}

.kg-card.kg-image-card,
.kg-card.kg-card-hascaption {
    overflow: hidden;
}

.kg-card.kg-image-card img,
.kg-card.kg-card-hascaption img {
    display: block;
    width: 100%;
    height: auto;
}

@media (max-width: 700px) {
    .post-card-image,
    .article-card-image,
    .gh-card-image {
        aspect-ratio: 16 / 10;
    }
}


/* ─────────────────────────────────────────
   DUCKZ / INDEX ARTICLE CARDS
   Full-width editorial rows instead of a
   half-empty two-column grid.
   ───────────────────────────────────────── */

.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
}

.post-card {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    min-height: 430px;
    background: var(--bg);
}

.post-card .card-image {
    height: 100%;
    min-height: 430px;
    aspect-ratio: auto;
}

.post-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(28px, 4vw, 58px);
}

.post-card .card-body h2 {
    max-width: 620px;
    font-size: clamp(34px, 4.5vw, 68px);
}

.post-card .card-body p {
    max-width: 540px;
}

.post-card .read-more {
    margin-top: 4px;
}

.post-card.no-image {
    display: block;
}

.post-card.no-image .card-body {
    min-height: 430px;
}

@media (max-width: 800px) {
    .post-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .post-card .card-image {
        min-height: 0;
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .post-card .card-body,
    .post-card.no-image .card-body {
        min-height: 330px;
    }
}


/* ─────────────────────────────────────────
   DUCKZ / NATIVE SEARCH
   Ghost's built-in search opens with click
   or Ctrl/Cmd + K.
   ───────────────────────────────────────── */

.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 18px;
}

.search-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .1em;
    line-height: 1;
    text-transform: uppercase;
    transition: color .2s ease;
}

.search-toggle:hover {
    color: var(--text);
}

.search-toggle svg {
    flex: 0 0 auto;
}

@media (max-width: 800px) {
    .header-actions {
        gap: 14px;
    }

    .search-toggle {
        padding: 7px 0;
    }
}


@media (max-width: 700px) {
    .header-actions {
        display: flex;
    }
}
