/* Quiet archival paper inline animations & crisp academic tables */

:root {
    --vz-navy: #23476a;
    --vz-navy-bg: #e9eff7;
    --vz-teal: #1f6b63;
    --vz-teal-bg: #e5f2ee;
    --vz-amber: #a8552a;
    --vz-amber-bg: #faece3;
    --vz-plum: #6b4578;
    --vz-plum-bg: #f3ebf7;
    --vz-red: #b43c3c;
    --vz-red-bg: #fbeaea;
    --vz-stage-bg: #fcfaf6;
    --vz-card-bg: #ffffff;
    --vz-tile-bg: #f5f1e8;
    --vz-ink: #1b2230;
    --vz-muted: #5b6472;
    --vz-line: #d5cfc2;
}

:root[data-theme="dark"] {
    --vz-navy: #7fb0df;
    --vz-navy-bg: rgba(35, 71, 106, 0.34);
    --vz-teal: #6fc6ba;
    --vz-teal-bg: rgba(31, 107, 99, 0.32);
    --vz-amber: #e2956b;
    --vz-amber-bg: rgba(168, 85, 42, 0.30);
    --vz-plum: #be95ce;
    --vz-plum-bg: rgba(107, 69, 120, 0.30);
    --vz-red: #ef8383;
    --vz-red-bg: rgba(180, 60, 60, 0.28);
    --vz-stage-bg: #18191d;
    --vz-card-bg: #202228;
    --vz-tile-bg: #272931;
    --vz-ink: #efede8;
    --vz-muted: #9a9ca3;
    --vz-line: #343741;
}

.anim-fig {
    margin: 1.55em 0;
    text-align: left;
}

.anim-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--vz-stage-bg);
    overflow: hidden;
}

.anim-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.anim-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.anim-pill {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--sans);
    font-size: 0.74rem;
    font-weight: 550;
    line-height: 1.35;
    cursor: pointer;
    white-space: nowrap;
}

.anim-pill:hover {
    color: var(--heading);
    background: var(--surface-hover);
}

.anim-pill.is-active {
    background: var(--vz-card-bg);
    border-color: var(--border-strong);
    color: var(--heading);
}

.anim-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.anim-status {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.anim-toggle {
    appearance: none;
    width: 24px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--vz-card-bg);
    color: var(--secondary);
    font-size: 0.68rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.14s ease, color 0.14s ease;
}

.anim-toggle:hover {
    border-color: var(--primary);
    color: var(--heading);
}

.anim-stage {
    padding: 10px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.anim-stage svg {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
}

.anim-stage svg rect,
.anim-stage svg circle,
.anim-stage svg path {
    transition: fill 0.22s ease, stroke 0.22s ease, opacity 0.22s ease, width 0.3s ease, x 0.3s ease;
}

@keyframes vzFlow {
    to { stroke-dashoffset: -24; }
}

.vz-flow {
    stroke-dasharray: 5 4;
    animation: vzFlow 0.9s linear infinite;
}

.anim-box.is-paused .vz-flow {
    animation-play-state: paused;
}

.anim-fig figcaption {
    margin-top: 8px;
    font-size: 0.85rem;
    line-height: 1.58;
    color: var(--secondary);
    text-align: center;
}

/* Table formatting polish for technical comparison tables */
.post-content table {
    font-size: 0.87rem;
    line-height: 1.52;
}

.post-content th,
.post-content td {
    padding: 8px 10px;
    vertical-align: top;
}

.post-content td.nw,
.post-content th.nw,
.post-content td .katex {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .anim-bar { padding: 6px 8px; }
    .anim-stage { padding: 8px; }
    .anim-stage svg { min-width: 520px; }
    .anim-status { white-space: normal; font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .anim-stage svg rect,
    .anim-stage svg circle,
    .anim-stage svg path {
        transition: none !important;
    }
    .vz-flow {
        animation: none !important;
    }
}
