/* =====================================================================
   Личная Стратегия — Ghost theme stylesheet
   Ported from letters.tsaryuk.ru static site (index + article css)
   ===================================================================== */

/* ----- Reset & base ----- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #000;
    --surface: #0d0d0d;
    --border: #1a1a1a;
    --text: #e8e8e8;
    --muted: #888;
    --dim: #555;
    --accent: #2d5a3f;
    --serif: 'Lora', Georgia, serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* Ghost custom font hooks (required by gscan) */
    --gh-font-heading: var(--serif);
    --gh-font-body: var(--serif);
}

html {
    overflow-x: hidden;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}

a:hover {
    color: var(--text);
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ----- Layout ----- */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 24px;
}

.wide {
    max-width: 960px;
}

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

/* ----- Brand block ----- */
.brand {
    text-align: center;
    padding: 48px 0 0;
}

.brand-name {
    display: inline-block;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
}

.brand-name:hover {
    color: var(--text);
}

.brand-sep {
    width: 40px;
    height: 1px;
    background: var(--dim);
    margin: 16px auto;
}

/* ----- Author block (homepage) ----- */
.author-block {
    text-align: center;
    margin-bottom: 8px;
}

.author-block .author-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.author-desc {
    font-size: 12px;
    color: var(--dim);
    font-style: italic;
}

/* ----- Hero ----- */
.hero {
    padding: 40px 0 56px;
    text-align: center;
}

.hero h1 {
    font-family: var(--serif);
    font-size: clamp(28px, 4.5vw, 42px);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 20px;
    letter-spacing: -.02em;
}

.hero-desc {
    font-size: 17px;
    color: var(--muted);
    max-width: 500px;
    margin: 0 auto 36px;
    line-height: 1.6;
}

/* ----- Subscribe form ----- */
.subscribe-form {
    display: flex;
    gap: 8px;
    max-width: 420px;
    margin: 0 auto;
}

.subscribe-form input {
    flex: 1;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text);
    font-family: var(--sans);
    outline: none;
    transition: border-color .2s;
}

.subscribe-form input:focus {
    border-color: var(--dim);
}

.subscribe-form input:focus-visible {
    border-color: var(--accent);
}

.subscribe-form input::placeholder {
    color: var(--dim);
}

.subscribe-form button {
    padding: 14px 28px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    transition: opacity .2s;
    white-space: nowrap;
}

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

.subscribe-form button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.subscribe-form button:disabled {
    opacity: .5;
    cursor: default;
}

.subscribe-form.loading button {
    opacity: .5;
    cursor: default;
}

.subscribe-count {
    font-size: 13px;
    color: var(--dim);
    margin-top: 14px;
    text-align: center;
}

.form-success {
    font-size: 13px;
    color: var(--muted);
    margin-top: 12px;
    text-align: center;
}

/* ----- Section ----- */
.section {
    padding: 48px 0;
}

.section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: var(--dim);
    margin-bottom: 24px;
    text-align: center;
}

/* ----- Features grid ----- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    text-align: left;
}

.feature h3 {
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 8px;
}

.feature p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

/* ----- Latest article card ----- */
.latest {
    padding: 48px 0;
}

.latest-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: border-color .2s;
}

.latest-card:hover {
    border-color: var(--dim);
    color: var(--text);
}

.latest-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--border);
    display: block;
}

.latest-cover--empty {
    background: var(--surface);
}

.latest-body {
    padding: 24px;
}

.latest-body h3 {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 8px;
}

.latest-body p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.latest-meta {
    font-size: 12px;
    color: var(--dim);
}

/* ----- Nav tabs ----- */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 0 24px;
    flex-wrap: wrap;
}

.nav-tab {
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--dim);
    transition: all .2s;
    background: transparent;
    text-decoration: none;
    display: inline-block;
}

.nav-tab:hover,
.nav-tab.active {
    color: var(--text);
    border-color: var(--dim);
    text-decoration: none;
}

/* ----- Archive list ----- */
.archive-list {
    display: flex;
    flex-direction: column;
}

.archive-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: opacity .2s;
}

.archive-item:hover {
    opacity: .8;
    text-decoration: none;
}

.archive-item:last-child {
    border-bottom: none;
}

.archive-cover {
    width: 88px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--surface);
    flex-shrink: 0;
    display: block;
}

.archive-cover--empty {
    background: var(--surface);
}

.archive-body {
    flex: 1;
    min-width: 0;
}

.archive-body h4 {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 3px;
}

.archive-body span {
    font-size: 12px;
    color: var(--dim);
}

.archive-empty {
    text-align: center;
    padding: 24px 0;
    color: var(--dim);
    font-size: 14px;
}

/* ----- Gated badge ----- */
.gated-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 8px;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    vertical-align: middle;
    font-family: var(--sans);
}

/* ----- Join heading (second subscribe) ----- */
.join-heading {
    font-family: var(--serif);
    font-size: 20px;
    margin-bottom: 24px;
    color: var(--text);
}

/* ----- Footer ----- */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 12px;
    color: var(--dim);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--dim);
}

/* Страницы сайта в футере (как у Дэна: About / Archive / …) */
.footer-pages {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.footer-pages a {
    color: var(--muted);
}

.footer-pages a:hover {
    color: var(--text);
}

.footer-icon-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-icon-link svg {
    opacity: .7;
}

.footer-copy {
    margin-top: 20px;
}

/* Замочек платной статьи в ленте (перед заголовком) */
.gated-lock {
    display: inline-flex;
    vertical-align: baseline;
    margin-right: 7px;
    color: var(--dim);
}

/* Подзаголовок в ленте */
.archive-excerpt {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin: 4px 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Дефолтный CTA Ghost на платных постах скрыт — у темы своя карточка
   .paywall с кнопкой оплаты Lava (портальный signup без Stripe не работает) */
.gh-post-upgrade-cta {
    /* !important: cards.min.css Ghost грузится после темы и ставит flex */
    display: none !important;
}

/* Блоки кода/промптов в статьях */
.article-body pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 22px;
    margin: 28px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Страница лид-магнита /book/ */
.book-page {
    padding: 56px 0 120px;
    text-align: center;
}

.book-page .section-label {
    margin-bottom: 20px;
}

.book-title {
    font-family: var(--serif);
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -.02em;
    max-width: 600px;
    margin: 0 auto 20px;
}

.book-desc {
    font-size: 16px;
    color: var(--muted);
    line-height: 1.65;
    max-width: 560px;
    margin: 0 auto 32px;
}

.book-form {
    max-width: 460px;
    margin: 0 auto;
}

.book-hint {
    font-size: 13px;
    color: var(--dim);
    line-height: 1.6;
    max-width: 480px;
    margin: 18px auto 0;
}

.book-access {
    padding: 8px 0 16px;
}

.book-access .paywall-btn {
    margin-bottom: 4px;
}

/* =====================================================================
   ACTIVATE PAGE (/activate/)
   ===================================================================== */

.activate-page {
    min-height: 60vh;
}

.activate-wrap {
    max-width: 420px;
    margin: 0 auto;
}

.activate-bot-note {
    font-size: 14px;
    color: var(--muted);
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
}

.activate-tg-wrap {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.activate-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.activate-email {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    font-family: var(--sans);
    outline: none;
    transition: border-color .2s;
}

.activate-email:focus {
    border-color: var(--dim);
}

.activate-email::placeholder {
    color: var(--dim);
}

.activate-btn {
    width: 100%;
}

.activate-status {
    font-size: 14px;
    line-height: 1.6;
    min-height: 1.4em;
    margin-bottom: 16px;
}

.activate-status--ok {
    color: var(--text);
}

.activate-status--error {
    color: #d97474;
}

.activate-hint {
    margin-top: 8px;
}

/* Кнопка «Смотреть все выпуски» вместо фич-блока */
.view-all-btn {
    display: inline-block;
    padding: 12px 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--muted);
    transition: all .2s;
}

.view-all-btn:hover {
    color: var(--text);
    border-color: var(--dim);
}

.footer-links a:hover {
    color: var(--text);
}

.footer-copy {
    color: var(--dim);
}

/* =====================================================================
   POST / PAGE STYLES
   ===================================================================== */

/* ----- Post header bar ----- */
.post-header-bar {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.header-inner-wide {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

.back {
    font-size: 13px;
    color: var(--dim);
    text-decoration: none;
    transition: color .2s;
}

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

.logo {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-decoration: none;
}

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

/* ----- Article wrapper ----- */
/* 744px − 48px паддингов = 696px контента (~72 знака Lora 19px) —
   шире старых 632px, чуть уже субстековских 728px у Дэна Коэ */
.article {
    max-width: 744px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* ----- Article header ----- */
.article-cat {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--dim);
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.article-tag {
    color: var(--dim);
    text-decoration: none;
    border-bottom: none;
    padding: 2px 0;
    transition: color .15s;
}

.article-tag:hover {
    color: var(--text);
}

.article-title {
    font-family: var(--serif);
    font-size: clamp(28px, 4.5vw, 40px);
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -.02em;
}

.article-sub {
    font-family: var(--serif);
    font-style: italic;
    font-size: 18px;
    color: var(--muted);
    margin-bottom: 12px;
}

/* ----- Post author row ----- */
.author {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
    margin-top: 24px;
}

.author .author-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(100%);
    flex-shrink: 0;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-info .author-name {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text);
    margin-bottom: 0;
}

.author-date {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--dim);
}

/* ----- Article cover image ----- */
.article-cover {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 40px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--surface);
    display: block;
}

/* ----- Article body ----- */
.article-body {
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.7;
    color: #f0f0f0;
}

.article-body p {
    margin-bottom: 1.2em;
}

.article-body h2 {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 48px 0 16px;
    color: var(--text);
}

.article-body h3 {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 600;
    margin: 40px 0 14px;
    color: var(--text);
}

.article-body h4 {
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 600;
    margin: 32px 0 10px;
    color: var(--text);
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 20px;
    margin: 24px 0;
    font-style: italic;
    color: var(--muted);
}

.article-body blockquote p {
    margin-bottom: 0;
}

.article-body blockquote cite {
    display: block;
    margin-top: 8px;
    font-style: normal;
    font-size: 14px;
    font-family: var(--sans);
    color: var(--dim);
}

.article-body strong {
    color: #fff;
}

.article-body a {
    color: var(--muted);
    border-bottom: 1px dotted var(--dim);
    text-decoration: none;
}

.article-body a:hover {
    color: var(--text);
}

.article-body hr,
.article-body hr.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.article-body img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 32px auto;
    border-radius: 8px;
    aspect-ratio: auto !important;
    object-fit: initial !important;
}

.article-body ul,
.article-body ol {
    padding-left: 1.5em;
    margin-bottom: 1.4em;
}

.article-body li {
    margin-bottom: .4em;
}

/* ----- Legacy custom blocks (migrated HTML) ----- */
.insight {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 20px;
    margin: 32px 0;
}

.ins-label {
    font-family: var(--sans);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--accent);
    margin-bottom: 6px;
}

.ins-text {
    font-family: var(--serif);
    font-style: italic;
    font-size: 19px;
    line-height: 1.5;
}

.qblock {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 28px 0;
    margin: 40px 0;
}

.q-label {
    font-family: var(--sans);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--dim);
    margin-bottom: 10px;
}

.q-text {
    font-family: var(--serif);
    font-style: italic;
    font-size: 22px;
    line-height: 1.4;
}

.muted-text {
    color: var(--muted);
    font-size: 16px;
    font-family: var(--serif);
}

.video-embed {
    position: relative;
    margin: 32px 0;
    border-radius: 8px;
    overflow: hidden;
}

.video-embed iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
}

/* ----- Ghost Koenig card styles ----- */
.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin: auto calc(50% - 50vw);
    transform: translateX(calc(50vw - 50%));
}

.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.kg-image-card {
    margin: 32px auto;
}

.kg-image-card img,
.kg-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.kg-image-card figcaption,
figcaption {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--dim);
    text-align: center;
    margin-top: 8px;
}

.kg-gallery-card {
    margin: 32px auto;
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kg-gallery-row {
    display: flex;
    gap: 8px;
}

.kg-gallery-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
}

.kg-embed-card {
    margin: 32px 0;
}

.kg-embed-card iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 8px;
    display: block;
}

.kg-video-card {
    margin: 32px 0;
}

.kg-video-card video {
    width: 100%;
    border-radius: 8px;
}

.kg-audio-card {
    margin: 32px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.kg-blockquote-alt {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 20px;
    margin: 24px 0;
    font-style: italic;
    color: var(--muted);
}

.kg-callout-card {
    margin: 32px 0;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.kg-callout-emoji {
    font-size: 20px;
    line-height: 1.4;
    flex-shrink: 0;
}

.kg-callout-text {
    font-family: var(--serif);
    font-size: 17px;
    line-height: 1.6;
}

.kg-toggle-card {
    margin: 32px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.kg-toggle-heading-text {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    padding: 16px 20px;
    cursor: pointer;
}

.kg-toggle-content {
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.6;
    padding: 0 20px 16px;
}

.kg-button-card {
    margin: 32px 0;
    text-align: center;
}

.kg-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: #fff;
    color: #000;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--sans);
    text-decoration: none;
    transition: opacity .2s;
}

.kg-btn:hover {
    opacity: .85;
    color: #000;
}

.kg-divider-card {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

.kg-bookmark-card {
    margin: 32px 0;
}

.kg-bookmark-container {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: border-color .2s;
}

.kg-bookmark-container:hover {
    border-color: var(--dim);
}

.kg-bookmark-content {
    flex: 1;
    padding: 16px;
    min-width: 0;
}

.kg-bookmark-title {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.kg-bookmark-description {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}

.kg-bookmark-thumbnail {
    width: 100px;
    flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0 !important;
    border-radius: 0 !important;
}

.kg-product-card {
    margin: 32px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.kg-product-card-image img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 12px;
}

.kg-product-card-title {
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.kg-product-card-description {
    font-family: var(--serif);
    font-size: 15px;
    color: var(--muted);
    line-height: 1.5;
}

/* ----- Paywall ----- */
.paywall {
    position: relative;
    margin: 0 0 8px;
    padding-top: 80px;
}

.paywall-fade {
    position: absolute;
    left: 0;
    right: 0;
    top: -120px;
    height: 120px;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, var(--bg) 100%);
    pointer-events: none;
}

.paywall-body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 28px;
    text-align: center;
}

.paywall-lock {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(45, 90, 63, .12);
    color: var(--accent);
    margin-bottom: 16px;
}

.paywall-lock svg {
    width: 22px;
    height: 22px;
}

.paywall-title {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 10px;
    color: var(--text);
}

.paywall-desc {
    font-family: var(--sans);
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 22px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

.paywall-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    background: #fff;
    color: #000;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--sans);
    text-decoration: none;
    transition: opacity .2s;
}

.paywall-btn:hover {
    opacity: .85;
    color: #000;
    text-decoration: none;
}

.paywall-hint {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--dim);
    margin: 16px 0 0;
}

/* ----- Subscribe CTA (article bottom) ----- */
.subscribe-cta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin-top: 40px;
}

.subscribe-cta h3 {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 8px;
}

.subscribe-cta p {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
}

.subscribe-cta .subscribe-form input {
    padding: 12px 16px;
    background: var(--bg);
    font-size: 14px;
}

.subscribe-cta .subscribe-form button {
    padding: 12px 24px;
    font-size: 13px;
}

/* ----- Tag page ----- */
.tag-page {
    padding: 40px 0 80px;
}

.tag-title {
    font-family: var(--serif);
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 400;
    margin-bottom: 8px;
    text-align: center;
}

.tag-desc {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 32px;
}

/* ----- Error page ----- */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 80px 0;
    text-align: center;
}

.error-code {
    font-family: var(--sans);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: var(--dim);
    margin-bottom: 16px;
}

.error-title {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 12px;
}

.error-desc {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 28px;
}

.error-link {
    display: inline-block;
    padding: 12px 28px;
    background: #fff;
    color: #000;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--sans);
    text-decoration: none;
    transition: opacity .2s;
}

.error-link:hover {
    opacity: .85;
    color: #000;
}

/* ----- Pagination ----- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 32px 0 0;
    font-size: 13px;
    color: var(--dim);
}

.pagination .older-posts,
.pagination .newer-posts {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--dim);
    transition: all .2s;
}

.pagination .older-posts:hover,
.pagination .newer-posts:hover {
    border-color: var(--dim);
    color: var(--text);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 640px) {
    .brand {
        padding: 32px 0 0;
    }

    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 32px 0 40px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero-desc {
        font-size: 15px;
    }

    .subscribe-form {
        flex-direction: column;
    }

    .subscribe-form button {
        width: 100%;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section {
        padding: 36px 0;
    }

    .latest-body h3 {
        font-size: 18px;
    }

    .nav-tabs {
        gap: 6px;
        padding: 0 16px 24px;
    }

    .nav-tab {
        font-size: 11px;
        padding: 5px 12px;
    }

    .archive-cover {
        width: 64px;
        height: 44px;
    }

    .article {
        padding: 32px 16px 60px;
    }

    .article-body {
        font-size: 17px;
    }

    .article-title {
        font-size: 26px;
    }

    .post-header-bar {
        padding: 16px 0;
    }

    .header-inner-wide {
        padding: 0 16px;
    }

    .subscribe-cta {
        padding: 24px 16px;
    }

    .paywall-body {
        padding: 24px 16px;
    }

    .error-title {
        font-size: 24px;
    }
}

/* =====================================================================
   SITE HEADER
   ===================================================================== */

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.site-header-inner {
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.header-left {
    min-width: 120px;
}

.header-back {
    font-size: 13px;
    color: var(--dim);
    text-decoration: none;
    transition: color .2s;
}

.header-back:hover {
    color: var(--text);
}

.header-brand {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-brand:hover {
    color: var(--text);
}

/* Фото автора в шапке — слева, ссылка на главную */
.header-avatar {
    display: inline-flex;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter .2s;
}

.header-avatar:hover img {
    filter: grayscale(0%);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 120px;
    justify-content: flex-end;
}

.header-icon {
    background: none;
    border: none;
    color: var(--dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .2s;
}

.header-icon:hover {
    color: var(--text);
}

.header-icon:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.header-signin {
    font-size: 13px;
    color: var(--dim);
    text-decoration: none;
    transition: color .2s;
    white-space: nowrap;
}

.header-signin:hover {
    color: var(--text);
}

.header-subscribe {
    padding: 8px 18px;
    background: #fff;
    color: #000;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--sans);
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .2s;
}

.header-subscribe:hover {
    opacity: .85;
    color: #000;
}

/* =====================================================================
   SHARE BAR
   ===================================================================== */

.share-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.share-label {
    font-size: 12px;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-right: 4px;
}

.share-btn {
    display: inline-block;
    font-size: 12px;
    font-family: var(--sans);
    color: var(--dim);
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    background: none;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}

.share-btn:hover {
    border-color: var(--dim);
    color: var(--text);
}

/* =====================================================================
   COMMENTS
   ===================================================================== */

.comments-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.comments-title {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 16px;
    color: var(--text);
}

/* =====================================================================
   FEATURED HERO + POPULAR ROW
   ===================================================================== */

.featured-hero {
    padding: 40px 0 32px;
}

.hero-card {
    display: flex;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: border-color .2s;
}

.hero-card:hover {
    border-color: var(--dim);
    color: var(--text);
}

.hero-card-cover {
    width: 55%;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--border);
    display: block;
    min-height: 260px;
}

.hero-card-cover--empty {
    background: var(--surface);
}

.hero-card-body {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.hero-card-body .section-label {
    text-align: left;
    margin-bottom: 16px;
}

.hero-card-title {
    font-family: var(--serif);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 12px;
    letter-spacing: -.01em;
}

.hero-card-excerpt {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.hero-card-meta {
    font-size: 12px;
    color: var(--dim);
}

.popular {
    padding: 32px 0 40px;
}

.popular .section-label {
    text-align: left;
    margin-bottom: 20px;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Hero-карточка первым экраном */
.featured-hero--top {
    padding: 32px 0 8px;
}

/* Прозрачные строки в стиле «Most Popular» Substack:
   текст слева, маленькая квадратная обложка справа, колонки через разделитель */
.popular-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
    color: var(--text);
    background: transparent;
    border: none;
    padding: 4px 24px 4px 0;
    transition: opacity .2s;
}

.popular-card + .popular-card {
    border-left: 1px solid var(--border);
    padding-left: 24px;
}

.popular-card:hover {
    opacity: .8;
    color: var(--text);
}

.popular-card-cover {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 4px;
    object-fit: cover;
    background: var(--border);
    display: block;
}

.popular-card-cover--empty {
    background: var(--surface);
    border: 1px solid var(--border);
}

.popular-card-body {
    min-width: 0;
}

.popular-card-title {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-card-meta {
    font-size: 12px;
    color: var(--dim);
}

.popular .section-label {
    text-align: left;
}

/* =====================================================================
   RESPONSIVE (additions)
   ===================================================================== */

@media (max-width: 640px) {
    .site-header-inner {
        padding: 0 16px;
    }

    .header-right {
        gap: 8px;
    }

    .header-signin {
        display: none;
    }

    /* На мобильном бренду в шапке не хватает места рядом с лупой, кнопкой
       и бургером: на главной его дублирует бренд-блок ниже, на статьях
       путь назад — «← Выпуски» */
    .header-brand {
        display: none;
    }

    .header-back {
        white-space: nowrap;
        font-size: 12px;
    }

    .header-left {
        min-width: 0;
    }

    .header-subscribe {
        padding: 7px 14px;
        font-size: 12px;
    }

    .hero-card {
        flex-direction: column;
    }

    .hero-card-cover {
        width: 100%;
        min-height: 180px;
    }

    .hero-card-body {
        padding: 20px;
    }

    .hero-card-title {
        font-size: 22px;
    }

    .popular-grid {
        grid-template-columns: 1fr;
    }

    /* В столбик: разделители сверху вместо вертикальных */
    .popular-card {
        padding: 12px 0;
    }

    .popular-card + .popular-card {
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
    }

    .share-bar {
        gap: 6px;
    }
}

/* =====================================================================
   HOME TWO-COLUMN LAYOUT (Substack-style)
   ===================================================================== */

/* Wider container for the archive section */
.home-wide {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Two-column grid: feed + sidebar */
.home-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 48px;
    align-items: start;
}

/* Sidebar */
.home-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

/* «Мои проекты» — прозрачный блок без подложки */
.sidebar-projects {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 4px;
}

/* Subscribe card */
.sidebar-brand {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 10px;
}

.sidebar-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 16px;
}

/* Stack layout for sidebar subscribe form */
.subscribe-form--stack {
    flex-direction: column;
    max-width: none;
    margin: 0;
}

.subscribe-form--stack input,
.subscribe-form--stack button {
    width: 100%;
}

/* Projects card */
.project-link {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.project-link:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.project-name {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: color .2s;
    white-space: nowrap;
}

.project-link:hover .project-name {
    color: #fff;
}

.project-desc {
    font-size: 12px;
    color: var(--dim);
    text-align: right;
    flex-shrink: 0;
}

/* Nav-tabs: left-aligned inside feed */
.home-feed .nav-tabs {
    justify-content: flex-start;
    padding-bottom: 16px;
}

/* Archive item: cover right, bigger thumbnail, title 2-line */
.archive-item {
    padding: 20px 0;
}

.archive-cover {
    width: 130px;
    height: 87px;
    border-radius: 6px;
}

.archive-body h4 {
    font-size: 17px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.archive-body span {
    font-size: 12px;
    color: var(--dim);
}

/* Mobile: single column, hide subscribe sidebar card */
@media (max-width: 900px) {
    .home-columns {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .home-sidebar {
        position: static;
    }

    .sidebar-subscribe {
        display: none;
    }

    .home-feed .nav-tabs {
        justify-content: flex-start;
    }

    .archive-cover {
        width: 96px;
        height: 64px;
    }
}

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