:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #666666;
    --link-color: #000000;
    --container-bg: rgba(255, 255, 255, 0.75);
    --border-color: rgba(0, 0, 0, 0.1);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6; /* Subtle effect */
}

/* Top navigation bar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.navbar .nav-brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    border-bottom: none;
}

.navbar .nav-brand:hover {
    color: #000000;
}

.nav-links {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 400;
    border-bottom: none;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #000000;
    border-bottom: 1px solid var(--accent-color);
}

.background-motion-toggle {
    margin-left: 4px;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-color);
    font: inherit;
    font-size: 0.82rem;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.background-motion-toggle:hover {
    color: #000000;
    border-color: #111111;
}

/* Motion off: muted styling signals the background is paused. */
.background-motion-toggle[data-motion-state="paused"] {
    background: rgba(0, 0, 0, 0.04);
    color: var(--accent-color);
}

.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: var(--container-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.12);
}

header {
    text-align: center;
    margin-bottom: 60px;
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

h1 {
    font-weight: 600;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.name-bengali {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 300;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.subtitle a {
    border-bottom: none;
}

.subtitle a:hover {
    color: #000000;
}

.identity {
    font-size: 1rem;
    color: var(--accent-color);
    font-weight: 300;
    margin-bottom: 0.3rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.social-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.social-links a:hover {
    border-color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.05);
    color: #000000;
}

section {
    margin-bottom: 60px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.01em;
}

p {
    margin-bottom: 1.5rem;
    font-weight: 300;
    color: #333333;
}

a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
    transition: color 0.2s ease;
}

a:hover {
    color: #000000;
    border-bottom-style: solid;
}

.section-link {
    display: inline-block;
    margin-top: 0.25rem;
    font-weight: 600;
    border-bottom-style: solid;
}

.publication-list {
    list-style: none;
}

.publication-list li {
    margin-bottom: 25px;
}

.pub-title {
    display: block;
    font-weight: 400;
    margin-bottom: 4px;
    color: #000000;
}

.pub-info {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-style: italic;
    margin-right: 10px;
}

.pub-link {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none;
    opacity: 0.7;
}

.pub-link:hover {
    opacity: 1;
}

.blog-index {
    display: grid;
    gap: 24px;
}

.post-card {
    padding: 28px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
}

.post-card h2 {
    margin-bottom: 10px;
    border-bottom: none;
    padding-bottom: 0;
}

.post-meta {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-card .section-link {
    margin-top: 0;
}

.article-page {
    background:
        radial-gradient(circle at 12% 4%, rgba(0, 0, 0, 0.05), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(0, 0, 0, 0.04), transparent 32%),
        var(--bg-color);
}

.article-shell {
    display: grid;
    grid-template-columns: minmax(0, 820px) minmax(300px, 420px);
    gap: 28px;
    align-items: start;
    min-width: 0;
    max-width: 1360px;
    margin: 40px auto;
    padding: 0 28px;
}

.article-card,
.reference-panel {
    background: var(--container-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.12);
}

.article-card {
    border-radius: 18px;
    padding: 48px;
    min-width: 0;
    overflow-wrap: break-word;
}

.back-link {
    display: inline-flex;
    margin-bottom: 36px;
    color: var(--accent-color);
    font-size: 0.9rem;
}

.article-header {
    text-align: left;
    margin-bottom: 56px;
}

.eyebrow {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.article-header h1 {
    max-width: 100%;
    font-size: clamp(2.35rem, 5.6vw, 4.15rem);
    line-height: 0.92;
    letter-spacing: -0.06em;
    text-wrap: balance;
}

.article-dek {
    max-width: 680px;
    margin-top: 1.4rem;
    color: #222222;
    font-size: clamp(1.2rem, 2.4vw, 1.75rem);
    line-height: 1.35;
}

.article-meta {
    color: var(--accent-color);
    font-size: 0.92rem;
}

.article-disclaimer {
    margin-top: 28px;
    padding: 18px 20px;
    border-left: 3px solid #111111;
    background: rgba(0, 0, 0, 0.04);
    color: #2a2a2a;
    font-size: 0.94rem;
    line-height: 1.65;
}

.article-body {
    font-size: 1.04rem;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
}

.article-body p {
    margin-bottom: 1.55rem;
    color: #252525;
    font-weight: 300;
}

.article-body strong {
    color: #050505;
    font-weight: 600;
}

.article-outline {
    margin: 34px 0 62px;
    padding: 22px 0 20px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    scroll-margin-top: 96px;
}

.article-outline-label {
    margin-bottom: 0.8rem;
    color: var(--accent-color);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.article-outline ul {
    display: grid;
    gap: 0.85rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.article-outline li {
    position: relative;
    padding-left: 18px;
}

.article-outline li::before {
    content: "";
    position: absolute;
    top: 0.65em;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #111111;
}

.article-outline a {
    border-bottom: none;
    color: #111111;
    font-weight: 600;
}

.article-outline a:hover {
    border-bottom: 1px solid var(--accent-color);
}

.article-outline span {
    display: block;
    margin-top: 0.12rem;
    color: var(--accent-color);
    font-size: 0.86rem;
    line-height: 1.45;
}

.sections-fab {
    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
    color: #111111;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.16);
    -webkit-tap-highlight-color: transparent;
}

.sections-fab:visited,
.sections-fab:hover,
.sections-fab:active {
    border-color: rgba(0, 0, 0, 0.16);
    background: rgba(255, 255, 255, 0.9);
    color: #111111;
}

.sections-fab:focus-visible {
    outline: 3px solid rgba(15, 110, 86, 0.22);
    outline-offset: 4px;
}

@media (min-width: 1181px) {
    .sections-fab {
        right: auto;
        left: calc(max(0px, calc(50% - 680px)) + 820px);
        transform: translateX(-100%);
    }
}

@media (min-width: 769px) and (max-width: 1180px) {
    .sections-fab {
        right: auto;
        left: min(calc(100vw - 52px), calc(max(0px, calc(50% - 450px)) + 848px));
        transform: translateX(-100%);
    }
}

.article-body h2 {
    margin-top: 70px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    letter-spacing: -0.04em;
}

.article-section {
    scroll-margin-top: 96px;
    border-radius: 16px;
    min-width: 0;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.article-section.is-active h2 {
    border-bottom-color: rgba(0, 0, 0, 0.35);
}

.article-section.has-selected-ref {
    background: rgba(0, 0, 0, 0.025);
    box-shadow: 0 0 0 12px rgba(0, 0, 0, 0.025);
}

.ref-chip,
.reference-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: #111111;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
}

.ref-chip {
    border-bottom: 1px solid var(--border-color);
}

.paragraph-refs {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: 0.35rem;
    white-space: normal;
    vertical-align: 0.08em;
}

.inline-ref {
    min-width: 23px;
    height: 23px;
    font-size: 0.68rem;
}

.article-body p[data-refs] {
    scroll-margin-top: 120px;
    border-radius: 10px;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.article-body p.is-active-evidence {
    background: rgba(0, 0, 0, 0.025);
    box-shadow: 0 0 0 8px rgba(0, 0, 0, 0.025);
}

.article-body p.has-selected-ref {
    background: rgba(0, 0, 0, 0.045);
    box-shadow: 0 0 0 8px rgba(0, 0, 0, 0.045);
}

.ref-chip:hover,
.ref-chip.is-selected,
.reference-number:hover,
.reference-number.is-selected {
    border-color: #111111;
    background: #111111;
    color: #ffffff;
}

.reference-rail {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
}

.reference-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-height: calc(100vh - 110px);
    border-radius: 18px;
    padding: 24px;
}

.reference-panel h2 {
    margin-bottom: 8px;
    padding-bottom: 0;
    border-bottom: none;
}

.reference-panel-header p {
    color: var(--accent-color);
    font-size: 0.92rem;
}

.reference-filter-label {
    margin-bottom: 6px;
    color: var(--accent-color);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.reference-filter {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    font: inherit;
}

.reference-reset {
    align-self: flex-start;
    margin-bottom: 16px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-color);
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
}

.reference-reset:hover {
    border-color: #111111;
}

.reference-list {
    overflow: auto;
    list-style: none;
    /* Right gutter keeps the selected-card frame clear of the scrollbar. */
    padding-right: 14px;
}

.reference-group {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 18px 0 10px;
    padding: 8px 0;
    /* Opaque so a sticky header fully hides the one it slides over. */
    background: #ffffff;
    color: #111111;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reference-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.reference-card p {
    margin-bottom: 0;
    color: #333333;
    font-size: 0.82rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.reference-card.is-relevant {
    border-color: rgba(0, 0, 0, 0.18);
    background: rgba(255, 255, 255, 0.72);
}

.reference-card.is-muted {
    opacity: 0.38;
}

.reference-card.is-selected {
    border-color: #111111;
    background: rgba(0, 0, 0, 0.055);
    opacity: 1;
}

.reference-card.is-hidden,
.reference-group.is-hidden {
    display: none;
}

.sourcing-note {
    margin-top: 72px;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.03);
}

.sourcing-note h2 {
    margin-top: 0;
}

.review-body h3 {
    margin: 34px 0 10px;
    color: #111111;
    font-size: 1.12rem;
    font-weight: 600;
}

.review-body h4 {
    margin: 24px 0 8px;
    color: var(--accent-color);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.review-body ul {
    margin: 0 0 1.45rem;
    padding-left: 1.25rem;
}

.review-body li {
    margin-bottom: 0.65rem;
    color: #252525;
    font-weight: 300;
}

.review-body code {
    border-radius: 6px;
    background: rgba(15, 110, 86, 0.08);
    color: #0c4f3f;
    font-size: 0.86em;
    padding: 1px 5px;
}

.review-body .eq,
.artifact-modal .eq {
    position: relative;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    padding: 14px 20px;
    border-left: 3px solid #0f6e56;
    border-radius: 0 10px 10px 0;
    background: rgba(255, 255, 255, 0.9);
    color: #1b2a28;
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.55;
    white-space: nowrap;
}

.review-body .eq .lbl,
.artifact-modal .eq .lbl {
    color: var(--accent-color);
    font-size: 0.68rem;
    font-style: normal;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.review-body figure.fig,
.artifact-modal figure.fig {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    margin: 26px 0 30px;
    padding: 20px 20px 10px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
}

.review-body figure.fig .figsvg,
.artifact-modal figure.fig .figsvg {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.review-body figure.fig svg,
.artifact-modal figure.fig svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.review-body figcaption,
.artifact-modal figcaption {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    color: #3a423f;
    font-size: 0.84rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.review-body figcaption .fno,
.artifact-modal figcaption .fno {
    margin-right: 8px;
    color: #0f6e56;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.review-body .callout {
    max-width: 100%;
    margin: 22px 0;
    padding: 16px 20px;
    border: 1px solid #cfe4db;
    border-radius: 12px;
    background: #eef5f2;
    color: #1f312d;
}

.review-body .callout .tag {
    display: block;
    margin-bottom: 6px;
    color: #0f6e56;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.review-table-wrap {
    position: relative;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 22px 0;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
}

.review-body table.tbl,
.artifact-modal table.tbl {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.review-body table.tbl th,
.review-body table.tbl td,
.artifact-modal table.tbl th,
.artifact-modal table.tbl td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-color);
    color: #252525;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.review-body table.tbl th,
.artifact-modal table.tbl th {
    color: var(--accent-color);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.review-body table.tbl tr:last-child td,
.artifact-modal table.tbl tr:last-child td {
    border-bottom: none;
}

.review-body table.tbl td strong,
.artifact-modal table.tbl td strong {
    color: #0f6e56;
}

.review-body .lin {
    margin: -4px 0 18px;
    padding: 2px 0 2px 14px;
    border-left: 2px solid #0f6e56;
    color: #465451;
    font-size: 0.92rem;
}

.review-body .lin b {
    margin-right: 8px;
    color: #0f6e56;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.review-body svg text.t,
.artifact-modal svg text.t {
    fill: #3a423f;
    font-size: 14px;
    font-weight: 400;
}

.review-body svg text.ts,
.artifact-modal svg text.ts {
    fill: #6e7a77;
    font-size: 12px;
    font-weight: 400;
}

.review-body svg text.th,
.artifact-modal svg text.th {
    fill: #1b2a28;
    font-size: 14px;
    font-weight: 500;
}

.review-body svg .box,
.artifact-modal svg .box {
    fill: #ffffff;
    stroke: #c3c2b7;
    stroke-width: 0.5;
}

.review-body svg .c-gray rect,
.review-body svg rect.c-gray,
.review-body svg .c-gray circle,
.artifact-modal svg .c-gray rect,
.artifact-modal svg rect.c-gray,
.artifact-modal svg .c-gray circle {
    fill: #d3d1c7;
    stroke: #5f5e5a;
    stroke-width: 0.5;
}

.review-body svg .c-gray .th,
.artifact-modal svg .c-gray .th {
    fill: #2c2c2a;
}

.review-body svg .c-gray .ts,
.artifact-modal svg .c-gray .ts {
    fill: #444441;
}

.review-body svg .c-teal rect,
.review-body svg rect.c-teal,
.review-body svg .c-teal circle,
.artifact-modal svg .c-teal rect,
.artifact-modal svg rect.c-teal,
.artifact-modal svg .c-teal circle {
    fill: #9fe1cb;
    stroke: #0f6e56;
    stroke-width: 0.5;
}

.review-body svg .c-teal .th,
.review-body svg .c-teal .t,
.artifact-modal svg .c-teal .th,
.artifact-modal svg .c-teal .t {
    fill: #04342c;
}

.review-body svg .c-teal .ts,
.artifact-modal svg .c-teal .ts {
    fill: #085041;
}

.review-body svg .c-coral rect,
.review-body svg rect.c-coral,
.artifact-modal svg .c-coral rect,
.artifact-modal svg rect.c-coral {
    fill: #f5c4b3;
    stroke: #993c1d;
    stroke-width: 0.5;
}

.review-body svg .c-coral .th,
.artifact-modal svg .c-coral .th {
    fill: #4a1b0c;
}

.review-body svg .c-coral .ts,
.artifact-modal svg .c-coral .ts {
    fill: #712b13;
}

.review-body svg .c-amber rect,
.review-body svg rect.c-amber,
.artifact-modal svg .c-amber rect,
.artifact-modal svg rect.c-amber {
    fill: #fac775;
    stroke: #854f0b;
    stroke-width: 0.5;
}

.review-body svg .c-amber .th,
.artifact-modal svg .c-amber .th {
    fill: #412402;
}

.review-body svg .c-amber .ts,
.artifact-modal svg .c-amber .ts {
    fill: #633806;
}

.review-body svg .c-green rect,
.review-body svg rect.c-green,
.artifact-modal svg .c-green rect,
.artifact-modal svg rect.c-green {
    fill: #c0dd97;
    stroke: #3b6d11;
    stroke-width: 0.5;
}

.review-body svg .c-green .th,
.artifact-modal svg .c-green .th {
    fill: #173404;
}

.review-body svg .c-green .ts,
.artifact-modal svg .c-green .ts {
    fill: #27500a;
}

.review-body svg .c-blue rect,
.review-body svg rect.c-blue,
.artifact-modal svg .c-blue rect,
.artifact-modal svg rect.c-blue {
    fill: #b5d4f4;
    stroke: #185fa5;
    stroke-width: 0.5;
}

.review-body svg .c-blue .th,
.artifact-modal svg .c-blue .th {
    fill: #042c53;
}

.review-body svg .c-blue .ts,
.artifact-modal svg .c-blue .ts {
    fill: #0c447c;
}

.review-body svg .c-purple rect,
.review-body svg rect.c-purple,
.artifact-modal svg .c-purple rect,
.artifact-modal svg rect.c-purple {
    fill: #cecbf6;
    stroke: #534ab7;
    stroke-width: 0.5;
}

.review-body svg .c-purple .th,
.artifact-modal svg .c-purple .th {
    fill: #26215c;
}

.review-body svg .c-purple .ts,
.artifact-modal svg .c-purple .ts {
    fill: #3c3489;
}

.review-body svg .c-red rect,
.review-body svg rect.c-red,
.artifact-modal svg .c-red rect,
.artifact-modal svg rect.c-red {
    fill: #f7c1c1;
    stroke: #a32d2d;
    stroke-width: 0.5;
}

.review-body svg .c-red .th,
.artifact-modal svg .c-red .th {
    fill: #501313;
}

.review-body svg .c-red .ts,
.artifact-modal svg .c-red .ts {
    fill: #791f1f;
}

.review-artifact {
    position: relative;
}

.artifact-expand {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
    cursor: pointer;
    font: inherit;
    font-size: 0.92rem;
    line-height: 1;
}

.artifact-expand:hover {
    border-color: #111111;
    background: #111111;
    color: #ffffff;
}

.review-body figure.fig.review-artifact {
    padding-top: 54px;
}

.review-body .eq.review-artifact {
    padding-right: 58px;
}

.review-table-wrap.review-artifact {
    padding-top: 48px;
}

.review-table-wrap.review-artifact table.tbl {
    min-width: 700px;
}

.artifact-modal-open {
    overflow: hidden;
}

.artifact-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.artifact-modal.is-open {
    display: flex;
}

.artifact-modal-dialog {
    width: min(1200px, 100%);
    max-height: calc(100vh - 56px);
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--container-bg);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
    padding: 24px;
}

.artifact-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.artifact-modal-title {
    color: var(--accent-color);
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.artifact-modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
}

.artifact-modal-close:hover {
    border-color: #111111;
    background: #111111;
    color: #ffffff;
}

.artifact-modal-body > :first-child {
    margin-top: 0;
}

.artifact-modal-body figure.fig,
.artifact-modal-body .eq,
.artifact-modal-body .review-table-wrap {
    margin: 0;
}

.artifact-modal-body .eq {
    white-space: normal;
    overflow-wrap: anywhere;
}

.artifact-modal-body .review-table-wrap {
    overflow: auto;
}

.artifact-modal-body table.tbl {
    min-width: 760px;
}

.artifact-modal-body figure.fig svg {
    min-width: min(760px, 180vw);
    max-width: none;
    max-height: 78vh;
}

.artifact-modal-body figure.fig {
    overflow: hidden;
}

.artifact-modal-body figure.fig .figsvg {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .navbar {
        padding: 14px 20px;
    }

    .nav-links {
        gap: 18px;
    }

    .container {
        margin: 0;
        border-radius: 0;
        padding: 30px 20px;
        min-height: 100vh;
    }

    h1 {
        font-size: 2rem;
    }
}

@media (max-width: 1180px) {
    .article-shell {
        grid-template-columns: 1fr;
        max-width: 900px;
    }

    .reference-rail {
        position: static;
        max-height: none;
    }

    .reference-panel {
        max-height: none;
    }

    .reference-list {
        max-height: 520px;
    }
}

@media (max-width: 768px) {
    .article-shell {
        margin: 0;
        padding: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    .article-card,
    .reference-panel {
        border-radius: 0;
        padding: 30px 20px;
        max-width: 100%;
    }

    .article-header h1 {
        font-size: 2.35rem;
    }

    .article-body {
        font-size: 1rem;
    }

    .paragraph-refs {
        margin-left: 0.2rem;
    }

    .review-body h3 {
        font-size: 1.04rem;
        line-height: 1.35;
    }

    .review-body .eq {
        margin: 18px 0;
        padding: 12px 14px;
        font-size: 0.92rem;
    }

    .review-body .eq.review-artifact {
        padding-right: 50px;
    }

    .review-body figure.fig {
        margin: 22px 0 26px;
        padding: 14px 12px 10px;
        border-radius: 12px;
    }

    .review-body figure.fig.review-artifact {
        padding-top: 48px;
    }

    .review-body figcaption {
        font-size: 0.78rem;
        line-height: 1.5;
    }

    .review-body .callout {
        padding: 14px 16px;
        border-radius: 10px;
    }

    .review-table-wrap.review-artifact {
        padding-top: 44px;
    }

    .artifact-expand {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
    }

    .sections-fab {
        right: max(16px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
        min-height: 38px;
        padding: 0 14px;
        font-size: 0.8rem;
    }

    .review-table-wrap.review-artifact table.tbl,
    .artifact-modal-body table.tbl {
        min-width: 620px;
    }

    .artifact-modal {
        padding: 12px;
    }

    .artifact-modal-dialog {
        max-height: calc(100vh - 24px);
        padding: 18px;
    }

}

@media (max-width: 480px) {
    .navbar {
        padding: 12px 16px;
    }

    .nav-links {
        gap: 12px;
    }

    .article-card,
    .reference-panel {
        padding: 28px 16px;
    }

    .article-header {
        margin-bottom: 44px;
    }

    .article-header h1 {
        font-size: clamp(2rem, 12vw, 2.35rem);
        letter-spacing: -0.045em;
    }

    .article-dek {
        font-size: 1.08rem;
    }

    .article-body h2 {
        margin-top: 54px;
        font-size: 1.55rem;
        letter-spacing: -0.025em;
    }

    .review-body figure.fig {
        padding-right: 10px;
        padding-left: 10px;
    }

    .review-body table.tbl,
    .artifact-modal table.tbl {
        font-size: 0.84rem;
    }

    .review-table-wrap.review-artifact table.tbl,
    .artifact-modal-body table.tbl {
        min-width: 560px;
    }

    .artifact-modal-dialog {
        padding: 14px;
        border-radius: 14px;
    }

    .artifact-modal-header {
        margin-bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .article-section,
    .article-body p[data-refs],
    .reference-card,
    .ref-chip,
    .reference-number,
    .artifact-expand,
    .artifact-modal-close {
        transition: none;
    }
}
