/* interactive figure objects */
.ifig { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 18px; box-shadow: var(--shadow-card); }
.ifig + .ifig { margin-top: 34px; }
.ifig > figcaption { margin-top: 14px; color: var(--ink-3); font-size: .9rem; line-height: 1.55; }
.ifig > figcaption b { color: var(--ink-2); }
.fig-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.fig-enlarge { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; color: var(--primary-ink); border-radius: 8px; padding: 6px 10px; font-size: .82rem; font-weight: 600; cursor: zoom-in; }
.fig-enlarge span { font-size: 1rem; line-height: 1; }
.fig-enlarge:hover { background: var(--primary-ghost); border-color: var(--primary-soft); }
.sc-hint { color: var(--ink-3); font-size: .84rem; }
.ifig input[type=range] { accent-color: var(--primary); width: 160px; }

/* wipe comparison */
.wipe { position: relative; width: 100%; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #f3f1f9; user-select: none; touch-action: none; cursor: ew-resize; }
.wipe img { display: block; width: 100%; height: auto; }
.wipe .wr { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.wipe-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; transform: translateX(-1px); box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.wipe-handle { position: absolute; top: 50%; width: 40px; height: 40px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid #fff; background: var(--primary); color: #fff; font-size: 1.05rem; box-shadow: 0 4px 14px rgba(40, 20, 120, .35); display: grid; place-items: center; }
.wipe-handle:focus-visible { outline: 3px solid var(--accent); }
.wipe-lab { position: absolute; top: 10px; padding: 4px 9px; border-radius: 6px; font-size: .76rem; font-weight: 700; background: rgba(35, 26, 18, .72); color: #fff; letter-spacing: .02em; pointer-events: none; transition: opacity .15s; }
.wipe-lab.l { left: 10px; } .wipe-lab.r { right: 10px; }
.wipe-ctrl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.wipe-ctrl button { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 8px 6px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.wipe-ctrl button.active { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-ghost); }

/* architecture */
.archfig .arch-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.arch-step { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--bg-tint-2); border-radius: 10px; padding: 9px 12px; color: var(--ink-2); font-weight: 600; font-size: .86rem; line-height: 1.25; transition: all .15s; }
.arch-step .no { flex: 0 0 auto; font-family: var(--mono); font-size: .74rem; color: var(--primary); }
.arch-step:hover { border-color: var(--primary-soft); background: var(--primary-ghost); }
.arch-step[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-ghost); color: var(--primary-ink); box-shadow: inset 0 2px 0 var(--primary); }
.arch-stage { width: 100%; overflow-x: auto; }
.arch-stage svg { display: block; width: 100%; height: auto; min-width: 760px; }
.arch-stage .st { transition: opacity .25s; }
.archfig[data-step="sample"] .st:not(.sample), .archfig[data-step="static"] .st:not(.static), .archfig[data-step="dyn"] .st:not(.dyn), .archfig[data-step="time"] .st:not(.time) { opacity: .13; }
.arch-cap { margin-top: 10px; border-left: 3px solid var(--primary); padding: 6px 14px; background: var(--primary-ghost); border-radius: 0 8px 8px 0; min-height: 64px; }
.arch-cap strong { color: var(--primary-ink); }
.arch-cap p { margin-top: 2px; color: var(--ink-2); font-size: .92rem; }

/* teaser explorer */
.ifig[data-fig="teaser"] { width: min(1120px, calc(100vw - 32px)); margin-left: 50%; transform: translateX(-50%); }
.ifig[data-fig="teaser"].reveal:not(.in) { transform: translateX(-50%) translateY(14px); }
.tz-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.tz-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; width: 100%; }
.tz-thumb { aspect-ratio: 16 / 9; border: 2px solid var(--line); border-radius: 6px; padding: 0; background: #eee; overflow: hidden; cursor: pointer; transition: transform .12s, border-color .12s; }
.tz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .72; transition: opacity .12s; }
.tz-thumb:hover { transform: scale(1.06); border-color: var(--primary-soft); } .tz-thumb:hover img { opacity: 1; }
.tz-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); } .tz-thumb.active img { opacity: 1; }
.tz-grid { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
.tz-axes { font-size: .74rem; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; padding-left: 22px; }
.tz-padbox { display: grid; grid-template-columns: 16px 1fr; gap: 6px; align-items: stretch; }
.tz-side { display: flex; align-items: flex-start; justify-content: center; }
.tz-side .ax-v { writing-mode: vertical-rl; white-space: nowrap; font-size: .74rem; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
.tz-pad { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; }
.tz-cell { aspect-ratio: 1; border: 0; border-radius: 4px; background: var(--line); padding: 0; transition: transform .1s; cursor: pointer; }
.tz-padbox.hit { padding: 8px; margin: -8px; }
.tz-cell.obs { background: var(--accent); }
.tz-cell.cur, .tz-cell.cur.obs { background: var(--primary); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }
.tz-info { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-size: .8rem; color: var(--ink-3); }
.tz-info .k { display: inline-flex; align-items: center; gap: 7px; }
.tz-info .k.hint { flex-basis: 100%; margin-top: 4px; font-style: italic; }
.tz-info .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--line); flex: 0 0 auto; }
.tz-info .sw.obs { background: var(--accent); } .tz-info .sw.cur { background: var(--primary); }
.tz-panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tz-panel { margin: 0; transition: opacity .15s; }
.tz-panel img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); border: 2px solid var(--line); background: #eee; display: block; }
.tz-panel.ours img { border-color: var(--primary); }
.tz-panel.gt img { border-color: var(--green); }
.tz-panel.dim { opacity: .25; }
.tz-panel figcaption { margin-top: 5px; font-size: .78rem; font-weight: 650; color: var(--ink-2); }
.tz-panel.ours figcaption { color: var(--primary-ink); } .tz-panel.gt figcaption { color: var(--green); }

/* evaluation settings */
.ev-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ev-legend button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.ev-legend .sw { width: 13px; height: 13px; border-radius: 3px; border: 2.5px solid var(--red); } .ev-legend .sw.tgt { border-color: #0070c0; }
.ev-wrap { display: grid; grid-template-columns: 4fr 5fr 5fr; gap: 18px; align-items: start; }
.ev-panel { padding: 10px; border-radius: 10px; border: 1px solid transparent; transition: all .15s; }
.ev-panel.active { border-color: var(--primary-soft); background: var(--primary-ghost); }
.ev-axes { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.ev-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 5px; }
.ev-cell { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; border: 2.5px solid transparent; opacity: .55; transition: opacity .15s, transform .1s; }
.ev-cell.ctx { border-color: var(--red); opacity: 1; } .ev-cell.tgt { border-color: #0070c0; opacity: 1; }
.ev-cell:hover { transform: scale(1.12); opacity: 1; }
[data-hl="ctx"] .ev-cell:not(.ctx), [data-hl="tgt"] .ev-cell:not(.tgt) { opacity: .18; }
.ev-title { margin-top: 8px; text-align: center; font-weight: 650; font-size: .9rem; }
.ev-cap { margin-top: 12px; color: var(--ink-2); font-size: .92rem; min-height: 44px; border-left: 3px solid var(--primary); padding: 4px 12px; background: var(--primary-ghost); border-radius: 0 8px 8px 0; }

/* compare static */
.cs-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.cs-strip { display: grid; grid-template-columns: 62px repeat(8, 1fr); gap: 5px; align-items: center; margin-bottom: 12px; }
.cs-lab { font-size: .74rem; font-weight: 700; color: var(--ink-3); line-height: 1.2; }
.cs-thumb { width: 100%; height: auto; border-radius: 5px; border: 1px solid var(--line); display: block; }
.cs-row { display: grid; grid-template-columns: 2fr 3fr; gap: 14px; align-items: center; }
.cs-static { margin: 0; }
.cs-static img { width: 100%; border-radius: var(--radius-sm); border: 2px solid var(--line-2); }
.cs-static figcaption { margin-top: 6px; font-size: .8rem; color: var(--ink-3); }
.cs-static figcaption b { color: var(--ink); }
.cs-tgrid { display: grid; gap: 6px; }
.cs-thead, .cs-trow { display: grid; grid-template-columns: 50px repeat(var(--n, 3), 1fr); gap: 6px; align-items: center; }
.cs-thead span { font-size: .72rem; font-weight: 700; color: var(--ink-3); text-align: center; }
.cs-rlab { justify-self: end; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .04em; line-height: 1; white-space: nowrap; }
.cs-trow.ours .cs-rlab { color: var(--primary-ink); background: var(--primary-soft); } .cs-trow.gt .cs-rlab { color: var(--green); background: var(--green-soft); }
.cs-trow img { width: 100%; border-radius: 5px; border: 2px solid var(--line); display: block; }
.cs-trow.ours img { border-color: var(--primary); } .cs-trow.gt img { border-color: var(--green); }

/* feature grids */
.gf-axis { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; padding-left: 96px; font-size: .74rem; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
.gf-axis .sc-hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.gf-grid { display: grid; grid-template-columns: 90px repeat(var(--n), 1fr); gap: 6px; align-items: center; }
.gf-head { font-size: .7rem; font-weight: 700; color: var(--ink-3); text-align: center; }
.gf-lab { font-size: .78rem; font-weight: 650; color: var(--ink-2); line-height: 1.2; padding-right: 6px; }
.gf-cell { position: relative; border-radius: 4px; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.gf-cell img { width: 100%; display: block; }
.gf-cell img.ov { position: absolute; inset: 0; mix-blend-mode: multiply; opacity: .6; }
.gf-grid[data-col]:not([data-col=""]) .gf-cell { opacity: .55; }
.gf-grid[data-col="0"] .gf-cell[data-c="0"], .gf-grid[data-col="1"] .gf-cell[data-c="1"], .gf-grid[data-col="2"] .gf-cell[data-c="2"], .gf-grid[data-col="3"] .gf-cell[data-c="3"], .gf-grid[data-col="4"] .gf-cell[data-c="4"], .gf-grid[data-col="5"] .gf-cell[data-c="5"], .gf-grid[data-col="6"] .gf-cell[data-c="6"], .gf-grid[data-col="7"] .gf-cell[data-c="7"] { opacity: 1; transform: scale(1.55); z-index: 3; box-shadow: 0 10px 30px rgba(35, 26, 18, .25); }
.gf-grid[data-col="0"] .gf-cell[data-c="0"] { transform-origin: left center; } .gf-grid[data-col="7"] .gf-cell[data-c="7"] { transform-origin: right center; }

/* context-frame chart */
.nf-svg { width: 100%; max-width: 760px; height: auto; display: block; font-family: var(--font); }
.nf-svg .grid { stroke: var(--line); stroke-width: 1; }
.nf-svg .tick { font-size: 12px; fill: var(--ink-3); }
.nf-svg .axis { font-size: 13px; fill: var(--ink-2); font-weight: 600; }
.nf-svg .note { font-size: 11px; fill: var(--ink-3); }
.nf-svg .train { fill: var(--accent); }
.nf-svg .line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; }
.nf-svg .pt { fill: #fff; stroke: var(--primary); stroke-width: 2; cursor: pointer; }
.nf-svg .pt.hot { fill: var(--primary); r: 6; }
.nf-svg .tip rect { fill: #231a12; opacity: .92; }
.nf-svg .tip text { fill: #fff; font-size: 12px; }
.nf-svg .tip .t1 { font-weight: 700; }

/* overview video */
.video-shell { margin-top: 24px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #1a1410; box-shadow: var(--shadow-float); }
.video-shell video { width: 100%; display: block; aspect-ratio: 1920 / 840; }

/* lightbox pairs */
.lb-body { display: flex; gap: 10px; align-items: center; justify-content: center; max-width: 96vw; }
.lb-body img { max-width: 96vw; max-height: 86vh; width: auto; height: auto; }
.lb-body.pair img { max-width: 47vw; }
.lb-body.triple img { max-width: 31vw; }

@media (max-width: 980px) {
  .archfig .arch-steps { grid-template-columns: repeat(2, 1fr); }
  .tz-grid { grid-template-columns: 1fr; }
  .tz-pad { max-width: 320px; }
  .ev-wrap { grid-template-columns: 1fr; }
  .cs-duo { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ifig { padding: 12px; }
  .wipe-ctrl button { font-size: .76rem; padding: 7px 4px; }
  .tz-panels { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sf-grid { grid-template-columns: 60px repeat(var(--n), 1fr); gap: 3px; }
  .sf-lab { font-size: .68rem; }
}
@media (min-width: 1100px) { .ifig[data-fig="teaser"] { width: min(1120px, calc(100vw - 232px - 48px)); } }
@media (max-width: 700px) { .gf-grid { grid-template-columns: 56px repeat(var(--n), 1fr); gap: 3px; } .gf-lab { font-size: .62rem; } .gf-axis { padding-left: 60px; } }
