/* Chart cards, tables and scroll animation for research posts with `interactiveCharts`.
   Scoped to .aic so it cannot leak into the rest of the site. Prose (h2, p, lists) keeps
   the site's .di-prose typography. */
.aic {
  --sans: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --green: #42ca80; --green-text: #2f9e62;
  --coral: #ff8686; --coral-text: #ef6461;
  --cream: #fff9eb; --cream-ink: #1a1a1a; --cream-grid: #e6e0d0; --cream-muted: #5f5a4e;
  --text: #0d0d0d; --muted: #6b665a; --line: #e8e2d2; --line-2: #ddd6c4;
  --area-other-line: #a79f8c; --area-ai-line: #2f9e62;
  --grid: #ece7da; --wm-filter: none; --wm-op: .2; --card-border: #ece5d3;
}
.aic section.s { padding: 40px 0 8px; }
.aic .label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.aic .takeaways li::marker { color: var(--green-text); }
.aic .divider { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 48px auto 0; }
.aic .divider i { width: 80px; height: 1px; background: var(--line-2); display: block; }
.aic .divider b { width: 7px; height: 7px; background: var(--line-2); transform: rotate(45deg); display: block; }

.aic figure { margin: 32px 0 8px; }
.aic .pchart-title { text-align: center; font-family: var(--sans); font-weight: 600; font-size: 19px; letter-spacing: -.01em; margin-bottom: 8px; line-height: 1.4; }
.aic .legend { display: flex; flex-wrap: wrap; row-gap: 6px; justify-content: center; gap: 22px; font-family: var(--mono); font-size: 12px; line-height: 1.4; color: var(--muted); margin-bottom: 10px; }
.aic .legend span { white-space: nowrap; }
.aic .legend i { display: inline-block; position: relative; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.aic .legend i.hatch { width: 12px; height: 10px; background: repeating-linear-gradient(45deg, #8f8877 0 2px, #e4ddca 2px 5px) !important; }
.aic .plot { position: relative; }
.aic .plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.aic .plot img.wm { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); width: 150px; max-width: none; opacity: var(--wm-op); filter: var(--wm-filter); pointer-events: none; z-index: 2; margin: 0; border-radius: 0; }
.aic .src { text-align: center; font-family: var(--sans); font-size: 12.5px; line-height: 1.6; color: var(--muted); margin-top: 14px; }
.aic .src b { font-weight: 600; color: var(--text); }

.aic .card { background: var(--cream); color: var(--cream-ink); border: 1px solid var(--card-border); padding: 40px 48px 28px; }
.aic .card-title { text-align: center; font-family: var(--mono); font-weight: 600; font-size: 17px; line-height: 1.4; letter-spacing: -.01em; margin-bottom: 26px; }
.aic .card .src { color: var(--cream-muted); }
.aic .card .src b { color: var(--cream-ink); }
.aic svg text { font-family: var(--sans); font-size: 13px; }
.aic .card svg text { fill: var(--cream-ink); }
.aic .pchart svg text { fill: var(--muted); font-family: var(--mono); font-size: 11px; }

.aic table.g { display: table; width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; margin: 28px 0 0; }
.aic table.g th, .aic table.g td { border: 0; border-bottom: 1px solid var(--line); background: none; }
.aic table.g th { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom-color: var(--line-2); }
.aic table.g td { padding: 12px; }
.aic table.g td.n, .aic table.g th.n { text-align: right; font-family: var(--mono); }
.aic table.g td.neg { color: var(--coral-text); }
.aic table.g tr:first-child td { font-weight: 500; }

.aic .methods dt { font-family: var(--mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--green-text); margin-top: 22px; }
.aic .methods dd { margin: 6px 0 0; }

.aic-tip { position: fixed; pointer-events: none; background: #0d0d0d; color: #e3dcc8; border: 1px solid #2a2a2a; font-family: "IBM Plex Mono", Consolas, ui-monospace, monospace; font-size: 12px; padding: 8px 10px; line-height: 1.5; opacity: 0; transition: opacity .12s; z-index: 1001; white-space: nowrap; }

/* Scroll animation: only when JS is on and motion is allowed (.anim added by the script). */
.aic.anim .grow { transform: scaleY(0); transform-box: fill-box; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.aic.anim .growx { transform: scaleX(0); transform-box: fill-box; transform-origin: right; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.aic.anim .draw { transition: stroke-dashoffset 1.6s ease; }
.aic.anim .fade { opacity: 0; transition: opacity .5s ease .9s; }
.aic.anim .in .grow, .aic.anim .in .growx { transform: none; }
.aic.anim .in .draw { stroke-dashoffset: 0 !important; }
.aic.anim .in .fade { opacity: 1; }

@media (max-width: 760px) {
  .aic .card { padding: 26px 14px 18px; }
  .aic .card-title { font-size: 14px; margin-bottom: 16px; }
  .aic .plot img.wm { width: 104px; }
  .aic table.g { font-size: 12.5px; }
  .aic table.g td, .aic table.g th { padding: 9px 6px; }
}
@media print { .aic .card, .aic figure { break-inside: avoid; } }
