.article-shell {
    width: min(960px, calc(100% - 40px));
    margin: auto;
    padding: 58px 0 90px;
}
.article-back {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    transition: 0.2s;
}
.article-back:hover {
    color: var(--mint);
    transform: translateX(-3px);
}
.article-card-main,
.comments-card {
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 25px 70px color-mix(in srgb, var(--theme-bg) 42%, transparent);
    overflow: hidden;
}
.article-header {
    padding: clamp(30px, 6vw, 58px) clamp(24px, 7vw, 68px) 34px;
}
.article-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    margin-bottom: 19px;
    border: 1px solid color-mix(in srgb, var(--mint) 26%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--mint) 10%, transparent);
    color: var(--mint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.article-header h1 {
    max-width: 790px;
    margin: 0;
    font-size: clamp(35px, 6.2vw, 62px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}
.article-lead {
    max-width: 730px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.75;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 24px;
    margin-top: 30px;
    color: var(--muted);
    font-size: 12px;
}
.article-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.meta-author {
    padding-right: 23px;
    border-right: 1px solid var(--line);
}
.meta-author > span:last-child {
    display: grid;
    gap: 1px;
}
.meta-author small {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.meta-author b {
    color: var(--ink);
    font-size: 12px;
}
.author-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--mint);
    color: var(--ink-on-mint);
    font-size: 11px;
    font-weight: 800;
}
.article-cover {
    position: relative;
    margin: 0 24px;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16/6;
    background: linear-gradient(
        135deg,
        var(--theme-surface-strong),
        var(--theme-accent)
    );
    border: 1px solid var(--line);
}
.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.article-cover-fallback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(35px, 8vw, 88px);
    isolation: isolate;
}
.article-cover-fallback:before,
.article-cover-fallback:after {
    content: "";
    position: absolute;
    border-radius: 50%;
    z-index: -1;
}
.article-cover-fallback:before {
    width: 280px;
    height: 280px;
    top: -150px;
    right: 12%;
    background: color-mix(in srgb, var(--mint) 28%, transparent);
}
.article-cover-fallback:after {
    width: 180px;
    height: 180px;
    bottom: -100px;
    left: 20%;
    background: color-mix(in srgb, var(--accent-purple) 50%, transparent);
}
.article-cover-fallback span {
    font-size: clamp(70px, 15vw, 150px);
    font-weight: 800;
    color: color-mix(in srgb, var(--ink) 13%, transparent);
}
.article-cover-fallback i {
    font-size: clamp(58px, 11vw, 110px);
    color: var(--mint);
}
.article-body {
    padding: clamp(38px, 7vw, 68px);
    font-size: 17px;
    line-height: 1.9;
    color: color-mix(in srgb, var(--ink) 91%, var(--muted));
}
.article-body > :first-child {
    margin-top: 0;
}
.article-body > :last-child {
    margin-bottom: 0;
}
.article-body p {
    margin: 0 0 24px;
}
.article-body h2,
.article-body h3 {
    line-height: 1.3;
    margin: 42px 0 16px;
}
.article-body h2 {
    font-size: 28px;
}
.article-body h3 {
    font-size: 21px;
    color: var(--mint);
}
.article-body a {
    color: var(--mint);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}
.article-body blockquote {
    margin: 30px 0;
    padding: 20px 24px;
    border-left: 3px solid var(--mint);
    background: color-mix(in srgb, var(--mint) 7%, transparent);
    border-radius: 0 14px 14px 0;
}
.article-footer {
    margin: 0 clamp(24px, 7vw, 68px);
    padding: 24px 0 30px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 12px;
}
.article-footer span,
.article-footer a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.article-footer a {
    color: var(--mint);
    font-weight: 600;
}
.comments-card {
    margin-top: 28px;
    padding: clamp(25px, 5vw, 48px);
}
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 30px;
}
.comments-header .eyebrow {
    margin: 0 0 6px;
}
.comments-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: clamp(25px, 4vw, 34px);
}
.comments-header h2 i {
    color: var(--mint);
}
.comment-count {
    flex: none;
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--mint) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--mint) 22%, transparent);
    color: var(--mint);
    font-size: 11px;
    font-weight: 700;
}
.comment-success,
.comment-errors {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 24px;
    padding: 13px 15px;
    border-radius: 12px;
    font-size: 12px;
}
.comment-success {
    color: var(--mint);
    background: color-mix(in srgb, var(--mint) 9%, transparent);
    border: 1px solid color-mix(in srgb, var(--mint) 22%, transparent);
}
.comment-errors {
    color: var(--theme-danger);
    background: var(--theme-danger-soft);
    border: 1px solid var(--theme-danger-border);
}
.comment-thread {
    display: grid;
    gap: 26px;
    margin-bottom: 34px;
}
.comment {
    display: flex;
    gap: 14px;
    margin: 0;
}
.comment-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--mint) 18%, var(--panel));
    border: 1px solid color-mix(in srgb, var(--mint) 28%, transparent);
    color: var(--mint);
    font-size: 11px;
    font-weight: 800;
}
.comment-content {
    flex: 1;
    min-width: 0;
}
.comment-content > header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 12px;
}
.comment-content > header b {
    font-size: 13px;
}
.comment-content > header small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 10px;
}
.comment-content > p {
    margin: 7px 0 8px;
    color: color-mix(in srgb, var(--ink) 88%, var(--muted));
    font-size: 14px;
    line-height: 1.7;
}
.reply-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--mint);
    font:
        600 11px/1.2 Poppins,
        sans-serif;
    cursor: pointer;
}
.reply-button:hover {
    background: color-mix(in srgb, var(--mint) 10%, transparent);
}
.replies {
    display: grid;
    gap: 18px;
    margin: 18px 0 0 5px;
    padding-left: 20px;
    border-left: 2px solid var(--line);
}
.comment-reply {
    margin: 0;
}
.comment-reply .comment-avatar {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    font-size: 9px;
}
.reply-form {
    display: none;
    gap: 12px;
    margin-top: 15px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg) 65%, var(--panel));
}
.reply-form.open {
    display: grid;
    animation: commentFormIn 0.22s ease;
}
.reply-fields,
.comment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.comment-form {
    padding: 23px;
    background: color-mix(in srgb, var(--bg) 62%, var(--panel));
    border: 1px solid var(--line);
    border-radius: 20px;
}
.comment-form h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    font-size: 16px;
}
.comment-form h3 i {
    color: var(--mint);
}
.comment-form label,
.reply-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}
.comment-form input,
.comment-form textarea,
.reply-form input,
.reply-form textarea {
    width: 100%;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: var(--panel);
    color: var(--ink);
    font:
        400 12px/1.5 Poppins,
        sans-serif;
}
.comment-form input:focus,
.comment-form textarea:focus,
.reply-form input:focus,
.reply-form textarea:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 12%, transparent);
}
.comment-form textarea,
.reply-form textarea {
    min-height: 100px;
    resize: vertical;
}
.comment-form > label {
    margin-top: 12px;
}
.comment-form-actions,
.reply-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 14px;
}
.comment-form-actions small {
    color: var(--muted);
    font-size: 10px;
}
.comment-form .button,
.reply-form .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    cursor: pointer;
}
.cancel-reply {
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.reply-actions {
    justify-content: flex-end;
}
.comments-empty {
    text-align: center;
    padding: 20px 0 35px;
    color: var(--muted);
}
.comments-empty > i {
    font-size: 34px;
    color: var(--mint);
}
.comments-empty h3 {
    color: var(--ink);
    margin: 8px 0 4px;
}
.comments-empty p {
    margin: 0;
    font-size: 13px;
}
@keyframes commentFormIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@media (max-width: 640px) {
    .article-shell {
        width: min(100% - 22px, 960px);
        padding-top: 30px;
    }
    .article-card-main,
    .comments-card {
        border-radius: 20px;
    }
    .article-header {
        padding: 28px 20px 25px;
    }
    .article-meta {
        gap: 13px;
    }
    .meta-author {
        width: 100%;
        padding: 0;
        border: 0;
    }
    .article-cover {
        margin: 0 10px;
        aspect-ratio: 16/8;
    }
    .article-body {
        padding: 34px 20px;
        font-size: 15px;
    }
    .article-footer {
        margin: 0 20px;
        align-items: flex-start;
        flex-direction: column;
    }
    .comments-card {
        padding: 24px 18px;
    }
    .comments-header {
        align-items: flex-start;
    }
    .comment-count {
        margin-top: 5px;
    }
    .reply-fields,
    .comment-form-grid {
        grid-template-columns: 1fr;
    }
    .comment-form-actions {
        align-items: flex-start;
        flex-direction: column;
    }
    .comment-form-actions .button {
        width: 100%;
    }
    .replies {
        padding-left: 12px;
    }
    .comment-avatar {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }
}
/* Structured article code blocks */
.article-body .ql-code-block-container > select.ql-ui {
    display: none !important;
}
.article-code-frame {
    margin: 30px 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--mint) 20%, var(--theme-border));
    border-radius: 15px;
    background: var(--theme-bg);
    box-shadow: var(--theme-shadow-soft);
}
.article-code-heading {
    display: flex;
    align-items: center;
    min-height: 45px;
    gap: 10px;
    padding: 0 13px 0 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--mint) 14%, var(--theme-border));
    background: color-mix(in srgb, var(--panel) 86%, var(--theme-bg));
}
.article-code-heading > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--theme-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.article-code-heading > b {
    padding: 4px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--mint) 11%, transparent);
    color: var(--theme-accent-strong);
    font-size: 11px;
}
.article-code-heading button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 31px;
    margin-left: auto;
    padding: 5px 10px;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    background: var(--theme-surface);
    color: var(--theme-text-secondary);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}
.article-code-heading button:hover,
.article-code-heading button:focus-visible {
    border-color: var(--mint);
    color: var(--mint);
    outline: 0;
}
.article-code-frame > pre,
.article-body > pre {
    margin: 0;
    padding: 21px 23px;
    overflow-x: auto;
    border: 0;
    border-radius: 0;
    background: var(--theme-bg) !important;
    color: var(--theme-text-primary);
    tab-size: 4;
}
.article-code-frame code,
.article-body > pre code {
    display: block;
    min-width: max-content;
    background: transparent !important;
    color: var(--theme-text-primary);
    font: 13px/1.8 Consolas, "SFMono-Regular", monospace;
    white-space: pre;
}
.article-body .hljs-keyword,
.article-body .hljs-selector-tag,
.article-body .hljs-literal,
.article-body .hljs-section {
    color: var(--theme-danger);
}
.article-body .hljs-string,
.article-body .hljs-attr,
.article-body .hljs-addition {
    color: var(--theme-success);
}
.article-body .hljs-title,
.article-body .hljs-function,
.article-body .hljs-property {
    color: var(--theme-info);
}
.article-body .hljs-number,
.article-body .hljs-variable,
.article-body .hljs-params {
    color: var(--theme-warning);
}
.article-body .hljs-comment,
.article-body .hljs-quote,
.article-body .hljs-meta {
    color: var(--theme-text-muted);
    font-style: italic;
}
.article-body .hljs-built_in,
.article-body .hljs-type,
.article-body .hljs-class,
.article-body .hljs-name {
    color: var(--theme-accent-strong);
}
.article-body .hljs-deletion {
    color: var(--theme-danger);
}
@media (max-width: 560px) {
    .article-code-frame {
        margin: 24px -4px;
        border-radius: 12px;
    }
    .article-code-heading {
        padding-inline: 11px;
    }
    .article-code-frame > pre,
    .article-body > pre {
        padding: 17px 16px;
    }
    .article-code-frame code,
    .article-body > pre code {
        font-size: 12px;
    }
}

/* Password-protected articles */
.protected-article {
    max-width: var(--content-width-md);
    margin: var(--space-xl) auto;
    padding: var(--space-3xl);
    text-align: center;
}
.protected-article-icon {
    display: grid;
    place-items: center;
    width: var(--icon-size-lg);
    height: var(--icon-size-lg);
    margin: 0 auto var(--space-lg);
    border-radius: var(--radius-round);
    background: color-mix(in srgb, var(--mint) 10%, var(--panel));
    color: var(--mint);
    font-size: var(--icon-font-size-lg);
}
.protected-article h1 {
    margin: var(--space-xs) 0 var(--space-sm);
}
.protected-article > p:not(.eyebrow) {
    color: var(--muted);
}
.protected-article form {
    display: grid;
    gap: var(--space-sm);
    max-width: var(--form-width-md);
    margin: var(--space-xl) auto 0;
    text-align: left;
}
.protected-article input {
    width: 100%;
    padding: var(--space-sm);
    border: var(--border-size) solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--ink);
    font: inherit;
}
.protected-article form button {
    justify-content: center;
    margin-top: var(--space-2xs);
}
.protected-article-error {
    color: var(--orange);
}

/* Automatically generated article table of contents */
html {
    scroll-behavior: smooth;
}
.article-toc {
    margin: clamp(38px, 7vw, 68px) clamp(24px, 7vw, 68px) 0;
    padding: 22px 24px;
    border: 1px solid color-mix(in srgb, var(--mint) 20%, var(--line));
    border-radius: 18px;
    background: color-mix(in srgb, var(--mint) 6%, var(--panel));
}
.article-toc-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
}
.article-toc-heading i {
    color: var(--mint);
    font-size: 20px;
}
.article-toc-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.4;
}
.article-toc ol {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 22px;
}
.article-toc li {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}
.article-toc-subsection {
    margin-left: 18px;
}
.article-toc a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}
.article-toc a:hover,
.article-toc a:focus-visible {
    color: var(--mint);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-body h2,
.article-body h3 {
    scroll-margin-top: 90px;
}
@media (max-width: 640px) {
    .article-toc {
        margin: 34px 20px 0;
        padding: 19px 18px;
    }
    .article-toc-subsection {
        margin-left: 10px;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
.article-reading-progress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    height: 4px;
    overflow: hidden;
    background: color-mix(in srgb, var(--panel) 80%, transparent);
    pointer-events: none;
}
.article-reading-progress span {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    background: linear-gradient(90deg, var(--theme-accent), var(--theme-link));
    box-shadow: 0 0 12px
        color-mix(in srgb, var(--theme-accent) 65%, transparent);
    will-change: transform;
}
