/* ============================================================
   Публичная часть: шапка, профиль, лента, пост
   ============================================================ */

.site {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1180px;
    min-height: 100svh;
    margin: 0 auto;
    padding: 16px clamp(16px, 3vw, 32px) 30px;
    display: flex;
    flex-direction: column;
}

/* ---------- Шапка ---------- */
.topbar {
    position: sticky;
    top: 14px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 10px 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(26px) saturate(170%);
    backdrop-filter: blur(26px) saturate(170%);
    box-shadow:
        inset 0 1px 0 var(--glass-top),
        0 20px 45px -30px rgba(0, 0, 0, 0.7);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
    box-shadow: inset 0 1px 0 var(--glass-top);
    color: var(--text);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.brand__name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand__tagline {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.nav__link {
    padding: 7px 11px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition:
        color 0.25s ease,
        background 0.25s ease;
}

.nav__link:hover {
    color: var(--text);
    background: var(--glass);
}

.nav__link.is-active {
    color: var(--text);
    background: var(--glass-hover);
}

.topbar .theme-toggle {
    margin-left: 4px;
}

/* ---------- Основной контейнер ---------- */
.main {
    flex: 1;
    padding-top: clamp(26px, 4vw, 44px);
}

/* ---------- Главная ---------- */
.home-grid {
    display: grid;
    grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
    gap: clamp(20px, 3vw, 30px);
    align-items: start;
}

.profile-column {
    position: sticky;
    top: 104px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    align-self: start;
}

.profile-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border: 1px solid var(--stroke);
    border-radius: 30px;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(28px) saturate(175%);
    backdrop-filter: blur(28px) saturate(175%);
    box-shadow: var(--shadow);
    animation: rise-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.profile-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        150deg,
        var(--edge-1),
        var(--edge-2) 26%,
        transparent 54%,
        var(--edge-2) 76%,
        var(--edge-3)
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.profile-card > * {
    position: relative;
    z-index: 1;
}

.profile-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.profile-card__name {
    margin-top: 22px;
    font-size: clamp(30px, 3vw, 37px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.profile-card__role {
    margin-top: 8px;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 500;
}

.profile-card__bio {
    margin-top: 16px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.65;
    text-wrap: pretty;
}

.profile-card__socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.profile-card__socials .btn--icon {
    width: 42px;
    min-height: 42px;
    color: var(--muted-strong);
}

.profile-card__socials .icon {
    width: 17px;
    height: 17px;
}

.profile-card__meta {
    display: grid;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
    color: var(--muted);
    font-size: 11.5px;
}

.profile-card__meta-item {
    display: flex;
    align-items: center;
    gap: 7px;
}

.profile-card__meta-item time {
    color: var(--muted-strong);
    font-variant-numeric: tabular-nums;
}

/* ---------- Лента ---------- */
.feed {
    min-width: 0;
    scroll-margin-top: 100px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    animation: fade-in 0.9s 0.1s ease both;
}

.feed.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.feed.is-leaving {
    opacity: 0 !important;
    transform: translateY(8px);
    animation: none !important;
    pointer-events: none;
}

.feed.is-entering {
    animation: feed-enter 0.42s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

@keyframes feed-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.feed__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.feed__title {
    margin-top: 5px;
    font-size: clamp(28px, 3.4vw, 38px);
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.045em;
}

.feed__description {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.feed__actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.rss-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid var(--chip-border);
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition:
        color 0.25s ease,
        border-color 0.25s ease;
}

.rss-link:hover {
    color: var(--text);
    border-color: var(--stroke-strong);
}

.rss-link .icon {
    width: 14px;
    height: 14px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 22px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--chip-border);
    background: var(--chip-bg);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    transition:
        color 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease;
}

.chip:hover {
    color: var(--text);
    border-color: var(--stroke-strong);
}

.chip.is-active {
    color: var(--text);
    background: var(--glass-hover);
    border-color: var(--stroke-strong);
}

.chip--cat::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cat);
    box-shadow: 0 0 8px var(--cat);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--stroke);
    border-radius: 24px;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    backdrop-filter: blur(24px) saturate(170%);
    box-shadow: 0 30px 60px -45px rgba(0, 0, 0, 0.9);
    transition:
        transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
        border-color 0.3s ease,
        box-shadow 0.4s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: var(--stroke-strong);
    box-shadow:
        0 34px 70px -40px rgba(0, 0, 0, 0.95),
        inset 0 1px 0 var(--glass-top);
}

.post-card__cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background:
        radial-gradient(circle at 24% 18%, var(--cat-soft), transparent 62%),
        linear-gradient(150deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
}

.post-card__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(4, 5, 10, 0.28));
    pointer-events: none;
}

.post-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.post-card:hover .post-card__cover img {
    transform: scale(1.045);
}

.post-card__placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    color: var(--cat-text);
}

.post-card__placeholder > span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.post-card__placeholder .icon {
    width: 26px;
    height: 26px;
    opacity: 0.8;
}

.post-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px 18px 18px;
}

.post-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--muted);
    font-size: 10.5px;
    letter-spacing: 0.01em;
}

.post-card__meta time {
    font-variant-numeric: tabular-nums;
}

.post-card__meta > span:not(.category-pill)::before {
    content: "·";
    margin-right: 7px;
    color: var(--muted);
}

.post-card__title {
    margin: 10px 0 7px;
    font-size: clamp(18px, 1.7vw, 21px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.post-card__title a {
    transition: color 0.25s ease;
}

.post-card__title a:hover {
    color: var(--cat-text);
}

.post-card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 15px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.post-card__more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    color: var(--cat-text);
    font-size: 11.5px;
    font-weight: 600;
}

.post-card__more .icon {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
}

.post-card__more:hover .icon {
    transform: translate(2px, -2px);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding: 12px 16px;
    border: 1px solid var(--stroke);
    border-radius: 18px;
    background: var(--glass);
    color: var(--muted);
    font-size: 11.5px;
}

.pagination__step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-strong);
    transition: color 0.25s ease;
}

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

.pagination__step.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.pagination__status {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

/* ---------- Пост ---------- */
.post {
    max-width: 860px;
    margin: 0 auto;
    padding: clamp(24px, 4.5vw, 46px);
    border: 1px solid var(--stroke);
    border-radius: clamp(26px, 3vw, 34px);
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(30px) saturate(175%);
    backdrop-filter: blur(30px) saturate(175%);
    box-shadow: var(--shadow);
    animation: rise-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 11.5px;
}

.breadcrumbs a {
    color: var(--muted-strong);
    transition: color 0.25s ease;
}

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

.post__header {
    max-width: 68ch;
}

.post__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--muted);
    font-size: 11.5px;
}

.post__meta > span:not(.category-pill)::before {
    content: "·";
    margin-right: 9px;
}

.post__title {
    margin: 14px 0 0;
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.post__lede {
    margin-top: 16px;
    color: var(--muted-strong);
    font-size: clamp(15px, 1.6vw, 17px);
    line-height: 1.6;
    text-wrap: pretty;
}

.post__cover {
    overflow: hidden;
    margin: 28px 0 30px;
    border: 1px solid var(--stroke);
    border-radius: 20px;
    background: var(--cat-soft);
}

.post__cover img {
    width: 100%;
    max-height: 540px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.prose {
    max-width: 68ch;
    overflow-wrap: break-word;
    color: var(--text);
    font-size: 16px;
    line-height: 1.78;
}

.prose > * + * {
    margin-top: 1.15em;
}

.prose h2 {
    margin-top: 2em;
    font-size: clamp(23px, 2.6vw, 29px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.prose h3 {
    margin-top: 1.7em;
    font-size: clamp(19px, 2.1vw, 22px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.prose h4 {
    margin-top: 1.5em;
    font-size: 17px;
    font-weight: 700;
}

.prose p {
    color: var(--muted-strong);
}

.prose strong {
    color: var(--text);
    font-weight: 700;
}

.prose em {
    color: var(--text);
}

.prose a {
    color: var(--cat-text);
    text-decoration: underline;
    text-decoration-color: var(--cat-soft);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.25s ease;
}

.prose a:hover {
    text-decoration-color: currentColor;
}

.prose ul,
.prose ol {
    padding-left: 1.35em;
    color: var(--muted-strong);
}

.prose ul {
    list-style: disc;
}

.prose ol {
    list-style: decimal;
}

.prose li + li {
    margin-top: 0.4em;
}

.prose li::marker {
    color: var(--cat);
}

.prose blockquote {
    padding: 14px 20px;
    border-left: 2px solid var(--cat);
    border-radius: 0 14px 14px 0;
    background: var(--glass);
    color: var(--muted-strong);
    font-style: italic;
}

.prose blockquote p {
    color: inherit;
}

.prose code {
    padding: 2px 6px;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
    font-size: 0.88em;
}

.prose pre {
    overflow-x: auto;
    padding: 18px 20px;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background: #07080e;
    color: #dfe5ff;
    font-size: 12.5px;
    line-height: 1.65;
}

.prose pre code {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
}

.prose img {
    width: 100%;
    border: 1px solid var(--stroke);
    border-radius: 16px;
    cursor: zoom-in;
}

.prose figure {
    margin: 1.5em 0;
}

.prose figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 11.5px;
    text-align: center;
}

.prose hr {
    border: 0;
    border-top: 1px solid var(--hairline);
    margin: 2.2em 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.prose th,
.prose td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--hairline);
    text-align: left;
}

.prose th {
    color: var(--text);
    font-weight: 700;
}

.prose td {
    color: var(--muted-strong);
}

.post__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--hairline);
}

.post__footer {
    margin-top: 24px;
}

.author-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 16px;
    border: 1px solid var(--stroke);
    border-radius: 18px;
    background: var(--glass);
}

.author-card__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.author-card__text strong {
    font-size: 13px;
    font-weight: 700;
}

.author-card__text span {
    color: var(--muted);
    font-size: 11.5px;
}

.author-card__links {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.post-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    max-width: 860px;
    margin: 18px auto 0;
}

.post-nav__item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px 18px;
    border: 1px solid var(--stroke);
    border-radius: 18px;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    transition:
        border-color 0.25s ease,
        transform 0.3s ease;
}

.post-nav__item:hover {
    border-color: var(--stroke-strong);
    transform: translateY(-2px);
}

.post-nav__item--next {
    text-align: right;
    align-items: flex-end;
}

.post-nav__label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.post-nav__item strong {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.post-nav__date {
    color: var(--muted);
    font-size: 10.5px;
}

.post__back {
    display: flex;
    justify-content: center;
    margin-top: 26px;
}

/* ---------- 404 ---------- */
.not-found {
    display: grid;
    justify-items: center;
    gap: 12px;
    max-width: 560px;
    margin: 8vh auto 0;
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid var(--stroke);
    border-radius: 30px;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(28px) saturate(170%);
    backdrop-filter: blur(28px) saturate(170%);
    box-shadow: var(--shadow);
    text-align: center;
}

.not-found__code {
    font-size: clamp(64px, 12vw, 120px);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.07em;
    background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.not-found h1 {
    font-size: clamp(24px, 3.4vw, 32px);
    letter-spacing: -0.035em;
}

.not-found p {
    max-width: 40ch;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.not-found .btn {
    margin-top: 8px;
}

.error-page {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: 100svh;
    padding: 24px;
}

.error-card {
    display: grid;
    justify-items: center;
    gap: 12px;
    max-width: 520px;
    padding: 44px;
    border: 1px solid var(--stroke);
    border-radius: 30px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    text-align: center;
}

.error-card h1 {
    font-size: 30px;
    letter-spacing: -0.035em;
}

.error-card p {
    color: var(--muted);
    font-size: 14px;
}

/* ---------- Виджет «Сейчас» ---------- */
.now-card {
    padding: 16px;
    border: 1px solid var(--stroke);
    border-radius: 24px;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    backdrop-filter: blur(24px) saturate(170%);
    box-shadow: 0 30px 60px -45px rgba(0, 0, 0, 0.9);
    animation: rise-in 0.9s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.now-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.now-card__label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.now-card__pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: now-pulse 2.4s ease-in-out infinite;
}

@keyframes now-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.75); }
}

.now-card__list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.now-card__item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 7px;
    border: 1px solid var(--hairline);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.025);
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

:root[data-theme="light"] .now-card__item {
    background: rgba(255, 255, 255, 0.35);
}

.now-card__item:hover {
    border-color: var(--stroke);
    background: var(--glass-hover);
    transform: translateY(-1px);
}

.now-card__cover {
    width: 48px;
    height: 44px;
    flex: none;
    border: 1px solid var(--hairline);
    border-radius: 9px;
    object-fit: cover;
    background: var(--glass);
}

.now-card__cover--empty {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.now-card__cover--empty .icon {
    width: 16px;
    height: 16px;
}

.now-card__body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.now-card__kicker {
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.now-card__title {
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.now-card__sub {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.now-card__eq {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    margin-left: auto;
    flex: none;
}

.now-card__eq i {
    width: 2px;
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    animation: eq-bounce 0.9s ease-in-out infinite;
    transform-origin: bottom;
}

.now-card__eq i:nth-child(2) {
    animation-delay: 0.15s;
    background: var(--accent-2);
}

.now-card__eq i:nth-child(3) {
    animation-delay: 0.3s;
    background: var(--accent-3);
}

@keyframes eq-bounce {
    0%, 100% { transform: scaleY(0.35); }
    50% { transform: scaleY(1); }
}

.now-card__empty {
    padding: 2px 2px 0;
    color: var(--muted);
    font-size: 10.5px;
}

@media (max-height: 820px) {
    .profile-column {
        position: static;
    }
}

@media (max-width: 760px) {
    .now-card {
        padding: 14px;
        border-radius: 20px;
    }

    .now-card__cover {
        width: 44px;
        height: 40px;
    }
}

/* ---------- Подвал ---------- */
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    flex-wrap: wrap;
    margin-top: 46px;
    padding-top: 18px;
    border-top: 1px solid var(--hairline);
    color: var(--muted);
    font-size: 11px;
}

.footer__nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer__nav a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    transition: color 0.25s ease;
}

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

.footer__nav .icon {
    width: 13px;
    height: 13px;
}

/* ---------- Адаптив ---------- */
@media (max-width: 1040px) {
    .home-grid {
        grid-template-columns: 1fr;
    }

    .profile-column {
        position: static;
    }

    .profile-card__name {
        font-size: clamp(32px, 5vw, 42px);
    }

    .profile-card__bio {
        max-width: 62ch;
    }
}

@media (max-width: 900px) {
    .brand__tagline {
        display: none;
    }

    .nav__link {
        padding-inline: 9px;
        font-size: 11.5px;
    }
}

@media (max-width: 760px) {
    .site {
        padding-top: 10px;
    }

    .topbar {
        top: 8px;
        gap: 8px;
        padding: 7px 8px;
    }

    .nav {
        display: none;
    }

    .brand {
        margin-right: auto;
    }

    .profile-card {
        padding: 18px;
        border-radius: 24px;
    }

    .profile-card__top {
        align-items: flex-start;
    }

    .avatar--xl {
        width: 78px;
        height: 78px;
    }

    .avatar--xl .avatar__monogram {
        font-size: 25px;
    }

    .profile-card__name {
        margin-top: 16px;
        font-size: 28px;
    }

    .profile-card__role {
        font-size: 12.5px;
    }

    .profile-card__bio {
        display: -webkit-box;
        overflow: hidden;
        margin-top: 12px;
        font-size: 13px;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }

    .profile-card__socials {
        margin-top: 16px;
    }

    .profile-card__socials .btn--icon {
        width: 38px;
        min-height: 38px;
    }

    .profile-card__meta {
        display: flex;
        flex-wrap: wrap;
        gap: 7px 14px;
        margin-top: 16px;
        padding-top: 12px;
    }

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

    .post-card__cover {
        aspect-ratio: 16 / 9;
    }

    .post {
        padding: 22px;
    }

    .post__cover {
        margin: 22px 0 24px;
    }

    .post-nav {
        grid-template-columns: 1fr;
    }

    .post-nav__item--next {
        text-align: left;
        align-items: flex-start;
    }

    .footer {
        margin-top: 32px;
    }

    .reading-progress {
        display: none;
    }
}

@media (max-width: 560px) {
    .brand__mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .brand__name {
        font-size: 12px;
    }

    .feed.is-loading {
    opacity: 0.45;
    pointer-events: none;
}

.feed__head {
        align-items: flex-start;
    }

    .feed__title {
        font-size: 30px;
    }

    .post {
        padding: 18px;
        border-radius: 24px;
    }

    .post__title {
        font-size: 32px;
    }

    .prose {
        font-size: 15.5px;
    }

    .post-card__body {
        padding: 15px 16px 17px;
    }

    .pagination {
        font-size: 10.5px;
        padding-inline: 12px;
    }

    .footer__nav {
        gap: 12px;
    }

    .author-card {
        flex-wrap: wrap;
    }

    .author-card__links {
        margin-left: 0;
        width: 100%;
    }
}

/* Первое появление страницы */
.topbar {
    animation: topbar-in 0.65s ease both;
}

.feed__head {
    animation: rise-in 0.65s 0.12s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chips {
    animation: fade-in 0.5s 0.2s ease both;
}

.scene__blobs {
    animation: scene-in 1.1s ease both;
}

.posts-grid .post-card {
    animation: card-rise 0.65s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.posts-grid .post-card:nth-child(1) { animation-delay: 0.04s; }
.posts-grid .post-card:nth-child(2) { animation-delay: 0.09s; }
.posts-grid .post-card:nth-child(3) { animation-delay: 0.14s; }
.posts-grid .post-card:nth-child(4) { animation-delay: 0.19s; }
.posts-grid .post-card:nth-child(5) { animation-delay: 0.24s; }
.posts-grid .post-card:nth-child(6) { animation-delay: 0.29s; }
.posts-grid .post-card:nth-child(n + 7) { animation-delay: 0.34s; }

@keyframes topbar-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scene-in {
    from { opacity: 0; transform: scale(1.03); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes card-rise {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .profile-card,
    .feed,
    .post,
    .topbar,
    .feed__head,
    .chips,
    .scene__blobs,
    .posts-grid .post-card {
        animation: none !important;
    }

    .feed {
        transition: none !important;
    }
}

/* ---------- Поиск ---------- */
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    flex: none;
}

.topbar__button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--glass);
    color: var(--muted-strong);
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.topbar__button:hover {
    background: var(--glass-hover);
    border-color: var(--stroke-strong);
    color: var(--text);
    transform: translateY(-1px);
}

.topbar__button:active {
    transform: scale(0.94);
}

.topbar__button .icon {
    width: 17px;
    height: 17px;
}

html.search-open {
    overflow: hidden;
}

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: start center;
    padding: 12vh 18px 18px;
}

.search-modal[hidden] {
    display: none;
}

.search-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 4, 8, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.search-modal__panel {
    position: relative;
    width: min(680px, 100%);
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--stroke-strong);
    border-radius: 24px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(32px) saturate(170%);
    backdrop-filter: blur(32px) saturate(170%);
    box-shadow: 0 40px 100px -35px rgba(0, 0, 0, 0.8), inset 0 1px 0 var(--glass-top);
    animation: search-panel-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes search-panel-in {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-modal__form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hairline);
}

.search-modal__form > .icon {
    flex: none;
    width: 19px;
    height: 19px;
    color: var(--muted);
}

.search-modal__form input {
    flex: 1;
    min-width: 0;
    padding: 5px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 16px;
}

.search-modal__form input::placeholder {
    color: var(--muted);
}

.search-modal__close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--hairline);
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.search-modal__close:hover {
    color: var(--text);
    background: var(--glass-hover);
}

.search-modal__close .icon {
    width: 15px;
    height: 15px;
}

.search-modal__results {
    min-height: 90px;
    overflow-y: auto;
    padding: 7px;
}

.search-modal__empty {
    padding: 28px 18px;
    color: var(--muted);
    text-align: center;
    font-size: 12.5px;
}

.search-result {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
}

.search-result:hover,
.search-result:focus-visible {
    background: var(--glass-hover);
}

.search-result__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search-result__head strong {
    overflow: hidden;
    font-size: 13.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-result__category {
    flex: none;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-result__excerpt {
    overflow: hidden;
    color: var(--muted);
    font-size: 11.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-modal__hint {
    padding: 9px 16px 11px;
    border-top: 1px solid var(--hairline);
    color: var(--muted);
    font-size: 10px;
    text-align: center;
}

.search-page {
    max-width: 960px;
    margin: 0 auto;
}

.search-page__head {
    margin-bottom: 26px;
}

.search-page__title {
    margin-top: 5px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 0.98;
    font-weight: 700;
    letter-spacing: -0.055em;
}

.search-page__sub {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
}

.search-page__form {
    display: flex;
    gap: 9px;
    margin-top: 20px;
}

.search-page__field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 0 15px;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: var(--glass);
}

.search-page__field .icon {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--muted);
}

.search-page__field input {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
}

.search-page__count {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 640px) {
    .search-modal {
        padding-top: 8vh;
    }

    .search-modal__panel {
        max-height: 78vh;
        border-radius: 18px;
    }

    .search-page__form {
        flex-direction: column;
    }

    .search-page__form .btn {
        justify-content: center;
    }
}

/* ---------- Аккаунт в шапке ---------- */
.topbar__link {
    padding: 8px 9px;
    border-radius: 9px;
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.topbar__link:hover {
    background: var(--glass-hover);
    color: var(--text);
}

.topbar__link--muted {
    color: var(--muted);
}

.userchip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 130px;
    padding: 7px 10px;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    color: var(--muted-strong);
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.userchip .icon {
    width: 13px;
    height: 13px;
    flex: none;
}

.userchip--admin {
    border-color: var(--status-border);
    background: var(--status-bg);
    color: var(--status-text);
    text-decoration: none;
}

.userbar__logout {
    display: inline-flex;
}

/* ---------- Вход и регистрация ---------- */
.auth-page {
    display: grid;
    place-items: center;
    min-height: 55vh;
    padding: 10px 0 30px;
}

.auth-card {
    width: min(460px, 100%);
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid var(--stroke);
    border-radius: 28px;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    backdrop-filter: blur(28px) saturate(160%);
    box-shadow: var(--shadow);
    animation: rise-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-card__title {
    margin-top: 5px;
    font-size: clamp(34px, 6vw, 48px);
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.055em;
}

.auth-card__sub {
    margin: 10px 0 22px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form__submit {
    justify-content: center;
    margin-top: 4px;
}

.auth-card__switch {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.auth-card__switch a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.auth-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ---------- Комментарии ---------- */
.comments {
    max-width: 860px;
    margin: 28px auto 0;
    width: 100%;
}

.comments__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.comments__title {
    margin-top: 5px;
    font-size: clamp(26px, 3.5vw, 36px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.comments__title span {
    color: var(--muted);
    font-size: 0.55em;
    letter-spacing: 0;
    vertical-align: middle;
}

.comments__empty,
.comments__closed {
    padding: 22px;
    border: 1px dashed var(--hairline);
    border-radius: 16px;
    color: var(--muted);
    font-size: 12.5px;
    text-align: center;
}

.comments__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment {
    display: flex;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background: var(--glass);
}

.comment--author {
    border-color: var(--status-border);
}

.comment__avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    overflow: hidden;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.comment__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-tone-0 { background: #6d5bd0; }
.avatar-tone-1 { background: #0e7490; }
.avatar-tone-2 { background: #b23a68; }
.avatar-tone-3 { background: #a85b20; }
.avatar-tone-4 { background: #227a4a; }
.avatar-tone-5 { background: #4c5f9e; }
.avatar-tone-6 { background: #8a4b9e; }
.avatar-tone-7 { background: #5a6b28; }

.comment__main {
    min-width: 0;
    flex: 1;
}

.comment__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
}

.comment__meta strong {
    font-size: 12px;
}

.comment__meta time {
    color: var(--muted);
}

.comment__badge {
    padding: 2px 6px;
    border: 1px solid var(--status-border);
    border-radius: 999px;
    background: var(--status-bg);
    color: var(--status-text);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.comment__text {
    margin-top: 5px;
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.comment__actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 5px;
}

.comment__actions form {
    display: inline-flex;
}

.comment__reply,
.comment__delete {
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.comment-form__cancel {
    padding: 0;
    border: 0;
    background: none;
    color: var(--danger);
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.comment__reply:hover {
    color: var(--accent);
}

.comment__delete:hover {
    color: var(--danger);
}

.comment__children {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 10px;
    padding-left: 12px;
    border-left: 1px solid var(--hairline);
}

.comment-form {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--stroke);
    border-radius: 18px;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
}

.comment-form__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-form__as {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted-strong);
    font-size: 10.5px;
    font-weight: 700;
}

.comment-form__as .icon {
    width: 13px;
    height: 13px;
}

.comment-form__reply {
    color: var(--accent);
    font-size: 10.5px;
}

.comment-form__body {
    min-height: 92px;
    resize: vertical;
    line-height: 1.55;
}

.comment-form__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.comment-form__bar .field__hint {
    max-width: 70%;
}

.comments__login {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 14px;
    border: 1px dashed var(--hairline);
    border-radius: 16px;
}

.comments__login p {
    margin-right: auto;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 760px) {
    .topbar__link--muted {
        display: none;
    }

    .userchip span {
        display: none;
    }

    .userchip {
        padding: 7px;
        max-width: 34px;
    }

    .comment-form__bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .comment-form__bar .field__hint {
        max-width: none;
    }
}


.flashes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 0;
}

.flash {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: var(--card-bg);
    font-size: 12px;
}

.flash .icon {
    width: 15px;
    height: 15px;
    flex: none;
}

.flash--success {
    color: var(--status-text);
    border-color: var(--status-border);
    background: var(--status-bg);
}

.flash--error {
    color: var(--danger);
    border-color: rgba(255, 107, 138, 0.28);
    background: rgba(255, 107, 138, 0.08);
}

/* ---------- Новый экран входа ---------- */
.auth-page {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 6px 0 30px;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    width: min(980px, 100%);
    min-height: 540px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--stroke);
    border-radius: 30px;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(28px) saturate(155%);
    backdrop-filter: blur(28px) saturate(155%);
    box-shadow: var(--shadow);
    animation: rise-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-visual {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: clamp(24px, 4vw, 40px);
    border-right: 1px solid var(--hairline);
    background:
        radial-gradient(90% 70% at 0% 0%, var(--cat-soft, rgba(124, 92, 255, 0.2)), transparent 65%),
        linear-gradient(155deg, rgba(124, 92, 255, 0.2), transparent 48%),
        rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .auth-visual {
    background:
        radial-gradient(90% 70% at 0% 0%, rgba(124, 92, 255, 0.24), transparent 65%),
        linear-gradient(155deg, rgba(124, 92, 255, 0.16), transparent 48%),
        rgba(255, 255, 255, 0.28);
}

.auth-visual__brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.auth-visual__brand > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.auth-visual__brand strong {
    overflow: hidden;
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.auth-visual__brand small {
    color: var(--muted);
    font-size: 10px;
}

.auth-visual__body {
    margin: auto 0;
}

.auth-visual__body h2 {
    max-width: 360px;
    margin-top: 6px;
    font-size: clamp(27px, 3.6vw, 38px);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.auth-visual__body > p:not(.eyebrow) {
    max-width: 360px;
    margin-top: 12px;
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.65;
}

.auth-visual__body ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted-strong);
    font-size: 11.5px;
}

.auth-visual__body li {
    display: flex;
    align-items: center;
    gap: 7px;
}

.auth-visual__body li .icon {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

.auth-visual__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    color: var(--muted);
    font-size: 10.5px;
    text-decoration: none;
}

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

.auth-visual__back .icon {
    width: 13px;
    height: 13px;
}

.auth-shell > .auth-card {
    width: 100%;
    padding: clamp(24px, 4vw, 40px);
    border: 0;
    border-radius: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    animation: none;
    align-self: center;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    padding: 4px;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--glass);
}

.auth-tab {
    flex: 1;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

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

.auth-tab.is-active {
    background: var(--glass-hover);
    color: var(--text);
    box-shadow: inset 0 1px 0 var(--glass-top);
}

.auth-password {
    position: relative;
    display: block;
}

.auth-password .input {
    width: 100%;
    padding-right: 44px;
}

.auth-password__toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.auth-password__toggle:hover {
    background: var(--glass-hover);
    color: var(--text);
}

.auth-password__toggle .icon {
    width: 15px;
    height: 15px;
}

.auth-shell .auth-card__title {
    font-size: clamp(30px, 4vw, 40px);
}

.auth-shell .auth-card__sub {
    margin-bottom: 18px;
}

.auth-shell .auth-card__switch {
    margin-top: 15px;
}

@media (max-width: 820px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .auth-visual {
        gap: 16px;
        padding: 22px;
        border-right: 0;
        border-bottom: 1px solid var(--hairline);
    }

    .auth-visual__body {
        margin: 0;
    }

    .auth-visual__body h2 {
        font-size: 26px;
    }

    .auth-visual__body > p:not(.eyebrow),
    .auth-visual__body ul,
    .auth-visual__back {
        display: none;
    }

    .auth-shell > .auth-card {
        padding: 22px;
    }
}

/* ---------- Поля форм на публичной части ---------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field__label {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
    color: var(--muted-strong);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.field__hint {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: none;
}

.field__error {
    color: var(--danger);
    font-size: 10.5px;
}

.input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--stroke);
    border-radius: 11px;
    background: var(--glass);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

:root[data-theme="light"] .input {
    background: rgba(255, 255, 255, 0.55);
}

.input:hover {
    border-color: var(--stroke-strong);
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--glass-hover);
    box-shadow: 0 0 0 3px var(--btn-glow);
}

.input::placeholder {
    color: var(--muted);
    opacity: 0.75;
}

.input--file {
    padding: 8px;
}

.input--range {
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: var(--accent);
}

.form-error {
    padding: 10px 12px;
    border: 1px solid rgba(255, 107, 138, 0.28);
    border-radius: 10px;
    background: rgba(255, 107, 138, 0.08);
    color: var(--danger);
    font-size: 11px;
    line-height: 1.5;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-strong);
    font-size: 11px;
    cursor: pointer;
}

.checkbox input {
    accent-color: var(--accent);
}

/* ---------- Быстрый вход без перезагрузки ---------- */
.userbar {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

html.auth-open {
    overflow: hidden;
}

.auth-pop {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: grid;
    place-items: start end;
    padding: 82px 18px 18px;
}

.auth-pop[hidden] {
    display: none;
}

.auth-pop__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 4, 8, 0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.auth-pop__panel {
    position: relative;
    width: min(366px, 100%);
    max-height: calc(100svh - 100px);
    overflow-y: auto;
    padding: 16px;
    border: 1px solid var(--stroke-strong);
    border-radius: 22px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    backdrop-filter: blur(30px) saturate(160%);
    box-shadow: 0 35px 80px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 var(--glass-top);
    animation: search-panel-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-pop__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 11px;
    padding: 0 2px;
}

.auth-pop__head strong {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-pop__tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 14px;
    padding: 3px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--glass);
}

.auth-pop__tab {
    flex: 1;
    padding: 7px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.auth-pop__tab.is-active {
    background: var(--glass-hover);
    color: var(--text);
    box-shadow: inset 0 1px 0 var(--glass-top);
}

.auth-pop__form {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.auth-pop__form[hidden] {
    display: none;
}

.auth-pop__form .auth-form__submit {
    margin-top: 2px;
}

.auth-pop__error {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 107, 138, 0.1);
    color: var(--danger);
    font-size: 10.5px;
    line-height: 1.45;
}

.auth-pop__hint {
    margin-top: 12px;
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 640px) {
    .auth-pop {
        place-items: center;
        padding: 16px;
    }

    .auth-pop__panel {
        width: 100%;
        max-height: 88svh;
        border-radius: 18px;
    }
}

/* ---------- Реакции ---------- */
.reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: var(--glass);
    color: var(--muted-strong);
    font: inherit;
    font-size: 10.5px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.reaction:hover {
    border-color: var(--stroke-strong);
    background: var(--glass-hover);
    transform: translateY(-1px);
}

.reaction.is-active {
    border-color: var(--accent);
    background: var(--btn-glow);
    color: var(--text);
}

.reaction__emoji {
    font-size: 12px;
    line-height: 1;
}

.reaction__count {
    min-width: 0.7em;
    font-variant-numeric: tabular-nums;
}

.post__reactions {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--hairline);
}

.post-card .reactions {
    margin-top: 9px;
}

.post-card .reaction {
    min-height: 26px;
    padding: 3px 7px;
    font-size: 10px;
}

/* Плавное открытие/закрытие быстрого входа */
.auth-pop {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.auth-pop.is-open {
    opacity: 1;
    visibility: visible;
}

.auth-pop__backdrop {
    opacity: 0;
    transition: opacity 0.22s ease;
}

.auth-pop.is-open .auth-pop__backdrop {
    opacity: 1;
}

.auth-pop__panel {
    opacity: 0;
    transform: translateY(-10px) scale(0.975);
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    animation: none;
}

.auth-pop.is-open .auth-pop__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.auth-pop.is-closing .auth-pop__panel {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
}

/* Плавная смена темы */
html.theme-animating,
html.theme-animating *,
html.theme-animating *::before,
html.theme-animating *::after {
    transition:
        background-color 0.34s ease,
        color 0.34s ease,
        border-color 0.34s ease,
        fill 0.34s ease,
        stroke 0.34s ease,
        box-shadow 0.34s ease,
        backdrop-filter 0.34s ease !important;
}

@media (prefers-reduced-motion: reduce) {
    .auth-pop,
    .auth-pop__backdrop,
    .auth-pop__panel,
    html.theme-animating,
    html.theme-animating * {
        transition: none !important;
    }
}

/* ---------- Кодовые блоки ---------- */
.code-block {
    margin: 1.25em 0;
    overflow: hidden;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: var(--glass-strong);
}

.code-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 11px;
    border-bottom: 1px solid var(--hairline);
}

.code-block__lang {
    color: var(--accent);
    font-family: var(--font);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.code-block__copy {
    padding: 3px 7px;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 9px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.code-block__copy:hover {
    border-color: var(--stroke-strong);
    background: var(--glass-hover);
    color: var(--text);
}

.code-block__copy.is-copied {
    border-color: var(--status-border);
    background: var(--status-bg);
    color: var(--status-text);
}

.code-block pre {
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.comment__reaction-form {
    display: inline-flex;
}

.comment__reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    padding: 3px 7px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    cursor: pointer;
}

.comment__reaction:hover,
.comment__reaction.is-active {
    border-color: var(--stroke-strong);
    background: var(--glass-hover);
    color: var(--text);
}

html.appearance-open {
    overflow: hidden;
}

.appearance-pop {
    position: fixed;
    inset: 0;
    z-index: 135;
    display: grid;
    place-items: start end;
    padding: 82px 18px 18px;
}

.appearance-pop[hidden] {
    display: none;
}

.appearance-pop__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(3, 4, 8, 0.42);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.appearance-pop__panel {
    position: relative;
    width: min(380px, 100%);
    max-height: calc(100svh - 100px);
    overflow-y: auto;
    padding: 16px;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

.appearance-pop__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.appearance-pop__head strong {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.appearance-pop__section + .appearance-pop__section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--hairline);
}

.appearance-pop__label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.appearance-design.is-active {
    border-color: var(--accent);
    background: var(--glass-hover);
    color: var(--text);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.appearance-design-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.appearance-design {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: var(--glass);
    color: var(--muted-strong);
    text-align: left;
    font-size: 10.5px;
    cursor: pointer;
}

.appearance-design__preview {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3px;
    height: 38px;
    padding: 5px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
}

.appearance-design__preview i {
    border-radius: 3px;
}

.appearance-design--glass .appearance-design__preview i:nth-child(1) { background: #7c5cff; }
.appearance-design--glass .appearance-design__preview i:nth-child(2) { background: #22d3ee; }
.appearance-design--glass .appearance-design__preview i:nth-child(3) { background: #ff4d8d; }
.appearance-design--xp .appearance-design__preview i:nth-child(1) { background: #0a246a; }
.appearance-design--xp .appearance-design__preview i:nth-child(2) { background: #ece9d8; }
.appearance-design--xp .appearance-design__preview i:nth-child(3) { background: #3c9a3c; }
.appearance-design--tui .appearance-design__preview i:nth-child(1) { background: #071007; border: 1px solid #2f7a45; }
.appearance-design--tui .appearance-design__preview i:nth-child(2) { background: #8dff9d; }
.appearance-design--tui .appearance-design__preview i:nth-child(3) { background: #f5d76e; }
.appearance-design--paper .appearance-design__preview i:nth-child(1) { background: #efe7d6; }
.appearance-design--paper .appearance-design__preview i:nth-child(2) { background: #8a5a2b; }
.appearance-design--paper .appearance-design__preview i:nth-child(3) { background: #1f3d2e; }
.appearance-design--neon .appearance-design__preview i:nth-child(1) { background: #ff2d95; }
.appearance-design--neon .appearance-design__preview i:nth-child(2) { background: #00e5ff; }
.appearance-design--neon .appearance-design__preview i:nth-child(3) { background: #f9f871; }

.appearance-pop__note {
    margin: -2px 0 10px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.appearance-palette-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.appearance-palette {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2px 8px;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--glass);
    color: var(--muted-strong);
    text-align: left;
    font-size: 10px;
    cursor: pointer;
}

.appearance-palette svg {
    grid-column: 1 / -1;
    width: 78px;
    height: 24px;
}

.appearance-palette.is-active {
    border-color: var(--accent);
    background: var(--glass-hover);
    color: var(--text);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.appearance-palette__selected {
    visibility: hidden;
    color: var(--accent);
    font-weight: 800;
}

.appearance-palette.is-active .appearance-palette__selected {
    visibility: visible;
}

.appearance-custom-palette {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.appearance-color {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 9px;
}

.appearance-color input {
    width: 100%;
    height: 32px;
    padding: 3px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--glass);
    cursor: pointer;
}

.appearance-custom-palette__apply {
    grid-column: 1 / -1;
    justify-content: center;
}

@media (max-width: 640px) {
    .appearance-pop {
        place-items: center;
        padding: 16px;
    }
    .appearance-pop__panel {
        width: 100%;
        max-height: 88svh;
    }
}

.code-block pre code {
    display: block;
    padding: 13px 14px;
    overflow-x: auto;
}

:root[data-design="xp"] .code-block {
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    border-radius: 2px;
    background: #ffffff;
}

:root[data-design="xp"] .code-block__head {
    background: #ece9d8;
    border-bottom-color: #a7a39a;
}

:root[data-design="tui"] .code-block {
    border-radius: 0;
    background: #020402;
}

:root[data-design="tui"] .code-block__head {
    border-bottom-color: var(--stroke);
}

:root[data-design="paper"] .code-block {
    border-radius: 4px;
    background: #fffaf0;
}

:root[data-design="neon"] .code-block {
    box-shadow: 0 0 30px -20px rgba(0, 229, 255, 0.45);
}

/* ---------- Публичный профиль читателя ---------- */
.userchip {
    text-decoration: none;
}

.comment__author-link {
    color: inherit;
    text-decoration: none;
}

.comment__author-link:hover {
    color: var(--accent);
}

.reader-profile {
    max-width: 760px;
    margin: 0 auto;
}

.reader-profile__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    text-decoration: none;
}

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

.reader-profile__back .icon {
    width: 14px;
    height: 14px;
}

.reader-profile__head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding: 22px;
    border: 1px solid var(--stroke);
    border-radius: 24px;
    background: var(--card-bg);
    -webkit-backdrop-filter: blur(24px) saturate(155%);
    backdrop-filter: blur(24px) saturate(155%);
    box-shadow: var(--shadow);
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.reader-profile__head h1 {
    margin-top: 3px;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.reader-profile__head p:not(.eyebrow) {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.reader-profile__me {
    margin-left: auto;
    align-self: flex-start;
    padding: 4px 8px;
    border: 1px solid var(--status-border);
    border-radius: 999px;
    background: var(--status-bg);
    color: var(--status-text);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.reader-profile__comments {
    margin-top: 22px;
}

.reader-profile__comments h2 {
    margin-bottom: 11px;
    font-size: 15px;
    letter-spacing: -0.02em;
}

.reader-profile__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reader-profile__comment {
    padding: 12px 14px;
    border: 1px solid var(--hairline);
    border-radius: 13px;
    background: var(--glass);
}

.reader-profile__comment a {
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.reader-profile__comment a:hover {
    color: var(--accent);
}

.reader-profile__comment p {
    margin: 6px 0;
    color: var(--muted-strong);
    font-size: 12px;
    line-height: 1.55;
}

.reader-profile__comment time {
    color: var(--muted);
    font-size: 9.5px;
}

@media (max-width: 560px) {
    .reader-profile__head {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 17px;
    }

    .reader-profile__me {
        margin-left: 0;
    }
}
