/* ==========================================================
   Article / Working Paper Template
   Aligned with main landing design tokens (Inter only)
   ========================================================== */

/* ===== Article container ===== */
.article {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* ===== Fade-in on load (hero block) ===== */
.article > .article-eyebrow,
.article > .article-tag,
.article > .article-title,
.article > .article-dek,
.article > .article-meta-grid,
.article > .article-abstract,
.article > .article-stat-grid,
.article > .article-toc {
    opacity: 0;
    transform: translateY(12px);
    animation: articleFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.article > .article-eyebrow      { animation-delay: 0.05s; }
.article > .article-tag          { animation-delay: 0.12s; }
.article > .article-title        { animation-delay: 0.18s; }
.article > .article-dek          { animation-delay: 0.32s; }
.article > .article-meta-grid    { animation-delay: 0.42s; }
.article > .article-abstract     { animation-delay: 0.52s; }
.article > .article-stat-grid    { animation-delay: 0.62s; }
.article > .article-toc          { animation-delay: 0.72s; }

@keyframes articleFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .article > * {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===== Hero section ===== */
.article-eyebrow {
    font-size: 14px;
    color: #a5a5a5;
    margin-bottom: 18px;
    letter-spacing: -0.2px;
}

.article-tag {
    display: inline-flex;
    background: #f5f5f5;
    color: #000;
    padding: 6px 16px;
    border-radius: 100px;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 28px;
}

.article-title {
    font-size: clamp(46px, 7vw, 80px);
    font-weight: 570;
    line-height: 0.96;
    letter-spacing: -0.04em;
    margin: 0 0 26px;
    color: #000;
    font-variation-settings: "opsz" 28;
    max-width: 980px;
}

.article-dek {
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.28;
    color: #666;
    letter-spacing: -0.2px;
    margin: 0 0 48px;
    max-width: 760px;
    font-weight: 400;
}

/* ===== Meta grid ===== */
.article-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #ececec;
    border: 1px solid #ececec;
    border-radius: 24px;
    overflow: hidden;
    max-width: 980px;
    margin: 0;
    padding: 0;
}

.article-meta-grid > div {
    background: #fff;
    padding: 20px 24px;
}

.article-meta-grid dt {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #a5a5a5;
    margin-bottom: 8px;
    font-weight: 500;
}

.article-meta-grid dd {
    margin: 0;
    font-size: 15px;
    color: #000;
    letter-spacing: -0.2px;
}

/* ===== Abstract ===== */
.article-abstract {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 720px);
    column-gap: 64px;
    padding: 80px 0 32px;
    margin-top: 40px;
    border-top: 1px solid #ececec;
    border-bottom: 1px solid #ececec;
}

.article-abstract h2 {
    font-size: 14px;
    line-height: 1.2;
    margin: 0;
    color: #a5a5a5;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    padding: 0;
}

.article-abstract p {
    grid-column: 2;
    margin: 0 0 18px;
    font-size: 18px;
    line-height: 1.6;
    color: #2a2a2a;
    letter-spacing: -0.2px;
}

.article-abstract h2 + p {
    margin-top: 0;
}

.article-keywords {
    grid-column: 2;
    font-size: 14px !important;
    color: #a5a5a5 !important;
    margin-top: 20px !important;
}

.article-keywords strong {
    color: #000;
    font-weight: 500;
    margin-right: 6px;
}

/* ===== Stat grid ===== */
.article-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 56px 0 64px;
}

.article-stat-card {
    background: #f5f5f5;
    border-radius: 24px;
    padding: 28px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-stat-num {
    font-size: 52px;
    line-height: 1;
    letter-spacing: -0.05em;
    font-weight: 570;
    color: #000;
    font-variation-settings: "opsz" 28;
    margin-bottom: 24px;
}

.article-stat-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: -0.2px;
}

/* ===== TOC ===== */
.article-toc {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 720px);
    column-gap: 64px;
    padding: 56px 0 80px;
    border-bottom: 1px solid #ececec;
    margin-bottom: 64px;
}

.article-toc h2 {
    font-size: 14px;
    color: #a5a5a5;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0;
    border: none;
    padding: 0;
}

.article-toc ol {
    grid-column: 2;
    margin: 0;
    padding-left: 0;
    list-style: none;
    counter-reset: toc;
}

.article-toc li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    counter-increment: toc;
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.article-toc li:last-child {
    border-bottom: none;
}

.article-toc li::before {
    content: counter(toc, decimal-leading-zero);
    color: #a5a5a5;
    font-size: 13px;
    letter-spacing: 0.04em;
    min-width: 32px;
}

.article-toc a {
    color: #000;
    text-decoration: none;
    font-size: 16px;
    letter-spacing: -0.2px;
    transition: color 0.2s ease;
}

.article-toc a:hover {
    color: #666;
}

/* ===== Body content ===== */
.article-body {
    max-width: 760px;
    margin: 0 auto;
}

.article-body h2 {
    font-size: clamp(34px, 4vw, 52px);
    font-weight: 570;
    line-height: 1.02;
    letter-spacing: -0.04em;
    margin: 96px 0 24px;
    padding-top: 36px;
    border-top: 1px solid #ececec;
    color: #000;
    font-variation-settings: "opsz" 28;
    scroll-margin-top: 40px;
}

.article-body h3 {
    font-size: 26px;
    font-weight: 570;
    line-height: 1.18;
    letter-spacing: -0.025em;
    margin: 48px 0 14px;
    color: #000;
    scroll-margin-top: 40px;
}

.article-body h4 {
    font-size: 20px;
    font-weight: 570;
    margin: 32px 0 12px;
    letter-spacing: -0.02em;
    color: #000;
}

.article-body p {
    font-size: 18px;
    line-height: 1.65;
    color: #2a2a2a;
    margin: 0 0 20px;
    letter-spacing: -0.2px;
}

.article-body p strong {
    font-weight: 500;
    color: #000;
}

.article-body p em {
    font-style: italic;
    font-weight: 500;
    color: #000;
}

/* ===== Lists ===== */
.article-body ul {
    margin: 8px 0 28px;
    padding-left: 0;
    list-style: none;
}

.article-body ul li {
    position: relative;
    margin: 0 0 12px;
    padding-left: 24px;
    font-size: 18px;
    line-height: 1.6;
    color: #2a2a2a;
    letter-spacing: -0.2px;
}

.article-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #000;
}

.article-body ul li strong {
    font-weight: 500;
    color: #000;
}

/* ===== Tables ===== */
.article-table-wrap {
    margin: 32px 0 48px;
    overflow-x: auto;
    border: 1px solid #ececec;
    border-radius: 24px;
    background: #fff;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: -0.2px;
}

.article-table th {
    text-align: left;
    padding: 16px 20px;
    font-weight: 500;
    color: #000;
    background: #f5f5f5;
    font-size: 13px;
    border-bottom: 1px solid #ececec;
}

.article-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
    color: #2a2a2a;
    vertical-align: top;
}

.article-table tr:last-child td {
    border-bottom: none;
}

.article-table tr.row-highlight {
    background: #fafafa;
}

.article-table tr.row-highlight td {
    font-weight: 500;
    color: #000;
}

.article-table .yes {
    color: #1a7a3a;
    font-weight: 500;
}

.article-table .no {
    color: #c9302c;
    font-weight: 500;
}

.article-table .partial {
    color: #d97706;
    font-weight: 500;
}

.article-table .positive {
    color: #1a7a3a;
    font-weight: 500;
}

.article-table .negative {
    color: #c9302c;
    font-weight: 500;
}

/* ===== Charts: empirical effects (horizontal bars) ===== */
.effects-chart {
    margin: 48px 0;
    padding: 40px;
    background: #f5f5f5;
    border-radius: 24px;
}

.effects-chart-title {
    font-size: 14px;
    color: #a5a5a5;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 28px;
    font-weight: 500;
}

.effect-row {
    display: grid;
    grid-template-columns: 220px 1fr 80px;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.effect-label {
    font-size: 14px;
    color: #2a2a2a;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.effect-bar-track {
    background: #fff;
    border-radius: 8px;
    height: 28px;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
}

.effect-bar-zero {
    position: absolute;
    left: 50%;
    top: -6px;
    bottom: -6px;
    width: 1px;
    background: #d0d0d0;
}

.effect-bar {
    height: 100%;
    background: #1a7a3a;
    border-radius: 8px;
    position: absolute;
    left: 50%;
    width: var(--width);
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.effect-bar.negative {
    background: #c9302c;
    left: auto;
    right: 50%;
}

.effect-value {
    font-size: 15px;
    font-weight: 500;
    color: #000;
    letter-spacing: -0.01em;
    text-align: right;
}

.effect-value.positive { color: #1a7a3a; }
.effect-value.negative { color: #c9302c; }

/* ===== Comparison chart (CLEF vs LLMs) ===== */
.comparison-chart {
    margin: 48px 0;
    padding: 40px;
    background: #f5f5f5;
    border-radius: 24px;
}

.chart-title {
    font-size: 14px;
    color: #a5a5a5;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    font-weight: 500;
}

.chart-subtitle {
    font-size: 16px;
    color: #2a2a2a;
    margin-bottom: 28px;
    letter-spacing: -0.2px;
}

.chart-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}

.chart-row:last-of-type {
    margin-bottom: 0;
}

.chart-label {
    font-size: 15px;
    font-weight: 500;
    color: #000;
    letter-spacing: -0.2px;
}

.chart-bar-container {
    background: #fff;
    border-radius: 8px;
    height: 36px;
    position: relative;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    background: #d0d0d0;
    border-radius: 8px;
    width: var(--width);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 14px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.chart-bar-kicker {
    background: #000;
}

.chart-value {
    color: #000;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.chart-bar-kicker .chart-value {
    color: #fff;
}

.chart-caption {
    font-size: 13px;
    color: #a5a5a5;
    text-align: center;
    margin-top: 24px;
    line-height: 1.5;
    letter-spacing: -0.2px;
}

/* ===== CPL chart (before/after) ===== */
.cpl-chart {
    margin: 48px 0;
    padding: 48px;
    background: #f5f5f5;
    border-radius: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: end;
}

.cpl-bar-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.cpl-bar {
    width: 100%;
    background: #d0d0d0;
    border-radius: 12px 12px 0 0;
    position: relative;
    transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.cpl-bar.kicker {
    background: #000;
}

.cpl-bar-baseline {
    height: 200px;
}

.cpl-bar-kicker {
    height: 100px;
}

.cpl-bar-value {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 36px;
    font-weight: 570;
    color: #000;
    letter-spacing: -0.022em;
    font-variation-settings: "opsz" 28;
}

.cpl-bar.kicker .cpl-bar-value {
    color: #fff;
}

.cpl-bar-label {
    font-size: 14px;
    color: #666;
    letter-spacing: -0.2px;
    text-align: center;
}

.cpl-result {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #ececec;
}

.cpl-result-arrow {
    font-size: 32px;
    color: #1a7a3a;
    font-weight: 570;
    letter-spacing: -0.022em;
    margin-bottom: 4px;
    font-variation-settings: "opsz" 28;
}

.cpl-result-label {
    font-size: 14px;
    color: #a5a5a5;
    letter-spacing: -0.2px;
}

/* ===== Reproducibility chart ===== */
.repro-chart {
    margin: 48px 0;
    padding: 40px;
    background: #f5f5f5;
    border-radius: 24px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    align-items: center;
}

.repro-ring {
    width: 180px;
    height: 180px;
    position: relative;
    margin: 0 auto;
}

.repro-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.repro-ring-track {
    fill: none;
    stroke: #ececec;
    stroke-width: 16;
}

.repro-ring-fill {
    fill: none;
    stroke: #000;
    stroke-width: 16;
    stroke-linecap: round;
    stroke-dasharray: 471;
    stroke-dashoffset: 28;
    transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.repro-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.repro-ring-pct {
    font-size: 38px;
    font-weight: 570;
    color: #000;
    letter-spacing: -0.04em;
    line-height: 1;
    font-variation-settings: "opsz" 28;
}

.repro-ring-label {
    font-size: 12px;
    color: #a5a5a5;
    letter-spacing: -0.2px;
    margin-top: 4px;
}

.repro-chart-text h4 {
    font-size: 22px;
    font-weight: 570;
    margin: 0 0 8px;
    letter-spacing: -0.022em;
    color: #000;
}

.repro-chart-text p {
    font-size: 15px;
    color: #666;
    margin: 0 0 8px;
    line-height: 1.5;
    letter-spacing: -0.2px;
}

/* ===== CTA at bottom ===== */
.article-cta {
    text-align: center;
    padding: 64px 32px;
    background: #f5f5f5;
    border-radius: 24px;
    margin-top: 80px;
}

.article-cta-title {
    font-size: 36px;
    font-weight: 570;
    line-height: 1.1;
    letter-spacing: -0.022em;
    margin: 0 0 12px;
    color: #000;
    font-variation-settings: "opsz" 28;
}

.article-cta-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0 0 28px;
    letter-spacing: -0.2px;
    line-height: 1.5;
}

/* ===== Divider ===== */
.article-divider {
    border: none;
    border-top: 1px solid #ececec;
    margin: 80px 0 56px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .article-stat-grid,
    .article-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-abstract,
    .article-toc {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 24px;
    }

    .article-abstract p,
    .article-keywords,
    .article-toc ol {
        grid-column: 1;
    }

    .effect-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .repro-chart {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .article {
        padding: 24px 20px 64px;
    }

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

    .article-dek {
        font-size: 18px;
        margin-bottom: 32px;
    }

    .article-body h2 {
        font-size: 30px;
        margin: 56px 0 18px;
    }

    .article-body h3 {
        font-size: 22px;
    }

    .article-body p,
    .article-body ul li {
        font-size: 16px;
    }

    .article-stat-card {
        padding: 22px;
        min-height: 140px;
    }

    .article-stat-num {
        font-size: 40px;
    }

    .effects-chart,
    .comparison-chart,
    .cpl-chart,
    .repro-chart {
        padding: 24px 20px;
    }

    .cpl-chart {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .article-cta {
        padding: 40px 24px;
    }

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

    .chart-row {
        grid-template-columns: 100px 1fr;
    }
}

@media (max-width: 600px) {
    .article-stat-grid,
    .article-meta-grid {
        grid-template-columns: 1fr;
    }
}
