*, *::before, *::after { margin: 0; padding: 0;  }

article.article-body{
    font-family: var(--font-family-base-articles);
}

 .reveal {
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal.visible { opacity: 1; transform: none; }

/* ── BREADCRUMB ──   margin: 0 auto; */
.breadcrumb {
    max-width: 820px;
    padding: 20px 40px 0;
    display: flex; align-items: center; gap: 8px;
    font-size: 0.78rem; color: var(--muted);
    flex-wrap: wrap;
    margin-top: 72px;
}
.breadcrumb a {
    color: var(--muted); text-decoration: none;
    transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--rust); }
.breadcrumb span { color: var(--line); }

/* ── ARTICLE HEADER ── */
.article-header {
    max-width: 820px; margin: 0 auto;
    padding: 36px 40px 0;
}
.article-cats {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
}
.cat-pill {
    padding: 5px 14px; border-radius: 100px;
    background: var(--rust-pale);
    border: 1px solid rgba(196,80,26,0.2);
    font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--rust);
    text-decoration: none; transition: all 0.18s;
}
.cat-pill:hover { background: var(--rust); color: white; }

.article-header h1 {
    font-family: var(--font-family-base);
    font-size: clamp(2rem, 4.5vw, 3rem);
    line-height: 1.15; letter-spacing: -0.02em;
    color: var(--ink); margin-bottom: 20px;
}
.article-header h1 em { font-style: italic; color: var(--rust); }

.article-deck {
    font-size: 1.1rem; font-weight: 300; line-height: 1.7;
    color: var(--ink-soft); margin-bottom: 28px;
    padding-left: 16px;
    border-left: 3px solid var(--rust);
}

/* Meta bar */
.meta-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-bottom: 0; flex-wrap: wrap; gap: 16px;
}
.meta-left { display: flex; align-items: center; gap: 14px; }
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--white); display: grid; place-items: center;
    font-size: 0.8rem; font-weight: 500; color: white; flex-shrink: 0;
    border: 1px solid var(--line);
}
.meta-author { font-size: 0.88rem; font-weight: 500; color: var(--ink); }
.meta-date { font-size: 0.78rem; color: var(--muted); }
.meta-right {
    display: flex; align-items: center; gap: 16px;
}
.meta-stat {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.78rem; color: var(--muted);
}
.meta-stat svg { flex-shrink: 0; }

/* ── HERO IMAGE / VISUAL ── */
.article-hero-visual {
    max-width: 820px; margin: 0 auto;
    padding: 28px 40px;
}
.hero-visual-inner {
    border-radius: 18px; overflow: hidden;
    background: linear-gradient(135deg, var(--dark) 0%, #2E1810 60%, #8B3410 100%);
    height: 340px; position: relative;
    display: grid; place-items: center;
}
.hero-visual-inner .grid-bg {
    position: absolute; inset: 0;
    background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 36px 36px;
}
.hero-visual-inner svg { position: relative; z-index: 1; }
.hero-caption {
    font-size: 0.75rem; color: var(--muted); text-align: center;
    margin-top: 10px; font-style: italic;
}

/* ── LAYOUT: ARTICLE + SIDEBAR ── */
.article-layout {
    max-width: 1200px; 
    margin: 0 auto;
    padding: 0 40px 80px;
    display: grid; 
    grid-template-columns: 1fr 220px;
    gap: 60px; align-items: start;
    width: 90dvw;
}

/* ── ARTICLE BODY ── */
.article-body {
    min-width: 0;
}

/* Reading progress bar */
.progress-bar {
    position: fixed; top: 0; left: 0; height: 3px;
    background: var(--rust); z-index: 200;
    width: 0%; transition: width 0.1s linear;
}

/* Content styles */
.article-content { padding-top: 8px; }

.article-content h2 {
    font-family: var(--font-family-base);
    font-size: 1.7rem; line-height: 1.25;
    color: var(--ink); margin: 48px 0 16px;
    padding-top: 8px;
    scroll-margin-top: 80px;
    font-weight: 400;
}
.article-content h3 {
    font-family: var(--font-family-base);
    font-size: 1.25rem; color: var(--ink-soft);
    margin: 32px 0 12px;
    scroll-margin-top: 80px;
}
.article-content p {
    font-size: 1rem; line-height: 1.8; color: var(--ink-soft);
    margin-bottom: 20px;
}
.article-content strong { color: var(--ink); font-weight: 500; }

.article-content ul, .article-content ol {
    padding-left: 0; margin-bottom: 20px; list-style: none;
}
.article-content ul li, .article-content ol li {
    font-size: 1rem; line-height: 1.75; color: var(--ink-soft);
    padding: 6px 0 6px 24px; position: relative;
}
.article-content ul li::before {
    content: '↪'; position: absolute; left: 2px;
    color: var(--rust); font-weight: 500;
}
.article-content ol { counter-reset: ol-counter; }
.article-content ol li { counter-increment: ol-counter; }
.article-content ol li::before {
    content: counter(ol-counter);
    position: absolute; left: 0;
    font-family: var(--font-family-base);
    font-size: 0.85rem; color: var(--rust);
    font-weight: 600;
}

/* Callout box */
.callout {
    border-left: 3px solid var(--rust);
    background: var(--rust-pale);
    border-radius: 0 12px 12px 0;
    padding: 18px 22px; margin: 28px 0;
}
.callout-label {
    font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--rust); margin-bottom: 6px;
}
.callout p { margin-bottom: 0; font-size: 0.92rem; }

/* Key equation box */
.equation-box {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px; padding: 24px 28px;
    margin: 28px 0; text-align: center;
}
.equation-box .eq-label {
    font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.equation {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem; color: var(--ink);
    letter-spacing: 0.02em;
}
.equation span { color: var(--rust); }
.eq-note {
    font-size: 0.78rem; color: var(--muted);
    margin-top: 10px; font-style: italic;
}

/* Data table */
.table-wrap {
    overflow-x: auto; margin: 28px 0;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 2px 12px rgba(26,20,16,0.04);
}
table {
    width: 100%; border-collapse: collapse;
    font-size: 0.88rem; background: var(--white);
}
thead { background: var(--ink); color: white; }
thead th {
    padding: 13px 18px; text-align: left;
    font-weight: 500; font-size: 0.78rem;
    letter-spacing: 0.06em; text-transform: uppercase;
}
tbody tr { border-bottom: 1px solid var(--line); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--parchment); }
tbody td { padding: 12px 18px; color: var(--ink-soft); }
tbody td strong { color: var(--rust); }

/* Figure */
figure { margin: 32px 0; }
.fig-inner {
    background: var(--white); border: 1px solid var(--line);
    border-radius: 14px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    padding: 32px; min-height: 200px;
}
figcaption {
    font-size: 0.78rem; color: var(--muted);
    text-align: center; margin-top: 10px; font-style: italic;
}

/* Step boxes */
.steps { margin: 28px 0; }
.step {
    display: flex; gap: 20px; margin-bottom: 20px;
    align-items: flex-start;
}
.step-num {
    width: 36px; height: 36px; flex-shrink: 0;
    background: var(--rust); border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--font-family-base);
    font-size: 1rem; color: white;
}
.step-body h4 {
    font-size: 0.95rem; font-weight: 500; color: var(--ink);
    margin-bottom: 6px;
}
.step-body p { font-size: 0.9rem; margin-bottom: 0; }

/* Share bar */
.share-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 24px 0; margin: 40px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.share-label {
    font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--muted);
    margin-right: 4px;
}
.share-btn {
    padding: 8px 18px;
    border: 1.5px solid var(--line); border-radius: 100px;
    background: transparent;
    font-family: var(--font-family-base); 
    font-size: 0.8rem; color: var(--muted);
    cursor: pointer; transition: all 0.18s;
    display: flex; align-items: center; gap: 6px;
}
.share-btn:hover { border-color: var(--rust); color: var(--rust); }

/* Author card */
.author-card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: 18px; padding: 28px;
    display: flex; gap: 20px; align-items: flex-start;
    margin: 40px 0;
}
.author-avatar {
    width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
    background: var(--white); display: grid; place-items: center;
    font-family: var(--font-family-base);
    font-size: 1.3rem; color: white;
        border: 1px solid var(--line);
}
.author-card h4 {
    font-family: var(--font-family-base);

    font-size: 1.05rem; margin-bottom: 4px;
}
.author-card p {
    font-size: 0.85rem; color: var(--muted); margin-bottom: 0; line-height: 1.6;
}

/* Tags */
.article-tags {
    display: flex; gap: 8px; flex-wrap: wrap; margin: 32px 0;
}
.atag {
    padding: 6px 16px; border-radius: 100px;
    border: 1.5px solid var(--line);
    font-size: 0.78rem; color: var(--muted);
    text-decoration: none; transition: all 0.18s;
}
.atag:hover { border-color: var(--rust); color: var(--rust); }

/* ── SIDEBAR ── */
.sidebar {
    position: sticky; top: 128px;
}

.toc-card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: 16px; padding: 24px;
    margin-bottom: 20px;
}
.toc-title {
    font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--muted);
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.toc-list { list-style: none; }
.toc-list li { margin-bottom: 2px; }
.toc-list a {
    display: flex; align-items: baseline; gap: 8px;
    padding: 7px 10px; border-radius: 8px;
    font-size: 0.83rem; color: var(--muted);
    text-decoration: none; transition: all 0.18s;
    line-height: 1.4;
}
.toc-list a::before {
    content: ''; width: 5px; height: 5px; flex-shrink: 0;
    border-radius: 50%; background: var(--line);
    margin-top: 5px; transition: background 0.2s;
}
.toc-list a:hover, .toc-list a.active {
    background: var(--rust-pale); color: var(--rust);
}
.toc-list a:hover::before, .toc-list a.active::before {
    background: var(--rust);
}

/* Reading time pill */
.read-time-card {
    background: var(--dark); border-radius: 14px;
    padding: 18px 20px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 12px;
}
.rt-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(196,80,26,0.2); display: grid; place-items: center;
    font-size: 1rem; flex-shrink: 0;
}
.rt-label { font-size: 0.72rem; color: rgba(255,255,255,0.4); }
.rt-value { font-family: var(--font-family-base), serif; font-size: 1.1rem; color: white; }

/* Related articles sidebar */
.related-mini { margin-bottom: 20px; }
.related-mini-title {
    font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--muted);
    margin-bottom: 14px;
}
.rmini-item {
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px; border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--white);
    margin-bottom: 8px; cursor: pointer;
    text-decoration: none; transition: all 0.18s;
}
.rmini-item:hover { border-color: var(--rust); transform: translateX(3px); }
.rmini-cat { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust); }
.rmini-title { font-size: 0.83rem; line-height: 1.35; color: var(--ink); }
.rmini-time { font-size: 0.72rem; color: var(--muted); }

/* ── RELATED ARTICLES BOTTOM ── */
.related-bottom {
    max-width: 1140px; margin: 0 auto;
    padding: 0 40px 80px;
}
.sec-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 24px; padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.sec-head h2 {
    font-family: var(--font-family-base); font-size: 1.5rem;
}
.sec-head a {
    font-size: 0.78rem; font-weight: 500; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--rust); text-decoration: none;
}
.related-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.rel-card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: 16px; overflow: hidden;
    cursor: pointer; transition: all 0.22s;
    text-decoration: none; display: flex; flex-direction: column;
}
.rel-card:hover {
    border-color: var(--rust); transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(196,80,26,0.1);
}
.rel-card-visual {
    height: 120px;
    background: linear-gradient(135deg, var(--dark), #3D1A0C);
    position: relative; overflow: hidden;
    display: grid; place-items: center;
}
.rel-card-visual::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 24px 24px;
}
.rel-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.rel-cat { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rust); margin-bottom: 8px; }
.rel-title {
    font-family: var(--font-family-base);
    font-size: 1rem; line-height: 1.3; color: var(--ink); flex: 1;
}
.rel-meta { font-size: 0.73rem; color: var(--muted); margin-top: 12px; }

/* Footer */
.footer-strip {
    border-top: 1px solid var(--line);
    padding: 24px 60px;
    display: flex; justify-content: space-between;
    font-size: 0.78rem; color: var(--muted);
}

/* Reveal */
.reveal {
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible { opacity: 1; transform: none; }

.article-deck em {
    color: var(--rust-light);
}

.article-hero-visual img{
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
}

.article-layout img{
    width: 100%;
}

.article-layout .author-avatar img {
    width: 75%;
}

summary {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 30px;
    padding: var(--space-16);
    margin: 4px 0px;
}

details p {
    padding: var(--space-4) var(--space-16);
}

.avatar img{
    width: 75%;
    border-radius: 40%;
}

.svg-display{
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.art-svg-inline{
    width: 100%;
    display: flex;
    justify-content: center;
}

.svg-display svg, .art-svg-inline svg{
    max-width: 400px;
}

.svg-display-big svg{
    max-width: 800px;
    width: 100%;
}

em{
    color: var(--rust);
    font-weight: 600;
}

p a {
    text-decoration: underline;
}

.clause {
    background-color: var(--line);
    font-size: var(--font-size-xs);
    padding: var(--space-4) var(--space-8);
    border-radius: var(--space-4);
    color: var(--muted);
}

.readme-num {
    color: var(--rust);
    font-size: var(--font-size-lg);
    padding-right: var(--space-12);
}


p.describe-title {
    margin-bottom: 0px;
    font-weight: 500;
}

p.descibe-detail {
    margin-left: var(--space-16);
   
}

p.descibe-detail-middle{
    margin-left: var(--space-16);
    margin-bottom: 0px;
}

p.descibe-detail-subtitle{
    margin-left: var(--space-16);
    margin-bottom: 0px;
    font-weight: bold;
}

p.descibe-detail-subtite-detail{
    margin-left: var(--space-32);
    margin-bottom: 0px;
}

p.descibe-detail-subtite-detail.last{
    margin-bottom: 20px;
}

p.figure-caption, p.remark {
    text-align: center;
    color: var(--muted);
    padding-bottom: var(--space-12);
    font-style: italic;
    font-size: var(--font-size-sm);
    line-height: 1.1;
}

.eq-remark-num {
    color: var(--primary-100);
    font-family: 'JetBrains Mono', monospace;
    font-style: italic;
}

.eq-remark {
    text-align: start;
    /* padding-top: var(--space-12); */
    font-size: var(--font-size-sm);
    font-style: italic;
    color: var(--gray-500);
    padding-bottom: var(--space-32);
    /* font-family: 'JetBrains Mono', monospace; */
}

span.num-color {
    color: var(--rust);
}

@media (max-width: 960px) {
    .article-layout { grid-template-columns: 1fr; padding: 0 20px 60px; }
    .sidebar { position: static; }
    .related-grid { grid-template-columns: 1fr 1fr; }
    .breadcrumb, .article-header, .article-hero-visual { padding-left: 20px; padding-right: 20px; }
    .related-bottom { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 600px) {
    .related-grid { grid-template-columns: 1fr; }
    .article-header h1 { font-size: 1.8rem; }
}

@media (max-width: 450px) {
    .breadcrumb, .article-header, .article-hero-visual { padding-left: 0px; padding-right: 0px; }
    .article-layout{
    padding: 0 0px 60px;
    width: unset;
    }
    .article-content h2{
    margin: 12px 0 8px;
    }
    .article-hero-visual{
    padding-left: 0px;
    padding-right: 0px;
    }
    .equation {
    font-size: 0.9rem;}

    #section-svg {
        width: 80%;
    }

    
}