/* ===== Layout and components shared by all three styles. Colors, fonts and radii come from theme-*.css ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
sup { font-size: .62em; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 13px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.narrow-wrap { max-width: 820px; }
.section { padding: var(--sec-pad) 0; background: var(--bg); }
.section-alt { background: var(--bg-alt); }

/* ---- nav ---- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid transparent; transition: border-color .2s; }
body.scrolled .nav { border-bottom-color: var(--border); }
.nav-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--nav-text); font-family: var(--font-head); font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 22px; height: 22px; object-fit: contain; }
.nav-links { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--nav-muted); font-size: 13px; padding: 6px 10px; border-radius: 999px; white-space: nowrap; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--nav-text); text-decoration: none; }
.nav-links a.active { color: var(--nav-text); background: var(--nav-active); }
.nav-cta { font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: var(--btn-radius); background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.nav-cta:hover { text-decoration: none; filter: brightness(1.06); }

/* ---- hero ---- */
.hero { background: var(--hero-bg); color: var(--hero-text); padding: var(--hero-pad-top) 0 var(--sec-pad); position: relative; overflow: hidden; }
.hero-inner { text-align: var(--hero-align); position: relative; z-index: 1; }
.hero-badge { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em; padding: 5px 12px; border-radius: 999px; background: var(--badge-bg); color: var(--badge-text); margin-bottom: 20px; }
.hero-logo { width: 84px; margin: 0 auto 8px; display: var(--hero-logo-display); }
.hero-title { font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(52px, 9vw, var(--hero-size)); line-height: 1.02; letter-spacing: var(--hero-tracking); margin: 0 0 14px; background: var(--hero-title-fill); -webkit-background-clip: text; background-clip: text; color: var(--hero-title-color); }
.hero-sub { font-family: var(--font-head); font-size: clamp(20px, 2.6vw, 30px); line-height: 1.3; font-weight: var(--sub-weight); color: var(--hero-sub); margin: 0 auto 28px; max-width: 860px; letter-spacing: -.01em; }
.authors { display: flex; flex-wrap: wrap; justify-content: var(--hero-justify); gap: 4px 18px; font-size: 15px; margin: 0 auto 10px; max-width: 900px; color: var(--hero-text); }
.affils { display: flex; flex-wrap: wrap; justify-content: var(--hero-justify); gap: 4px 18px; font-size: 14px; color: var(--hero-muted); margin: 0 0 6px; }
.affils.small { font-size: 12.5px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: var(--hero-justify); margin: 30px 0 48px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; padding: 10px 20px; border-radius: var(--btn-radius); background: var(--btn-bg); color: var(--btn-text); border: 1px solid var(--btn-border); transition: transform .15s, background .15s, filter .15s; }
.btn:hover { text-decoration: none; background: var(--btn-bg-hover); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-primary svg path { fill: none; }

/* ---- stats ---- */
.stats-band { background: var(--stats-bg); border-top: 1px solid var(--stats-border); border-bottom: 1px solid var(--stats-border); }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding-top: 44px; padding-bottom: 44px; }
.stat { padding: 0 18px; text-align: var(--stat-align); border-left: 1px solid var(--stats-border); }
.stat:first-child { border-left: 0; }
.stat-num { font-family: var(--font-head); font-size: clamp(34px, 4vw, 48px); font-weight: var(--head-weight); letter-spacing: -.03em; line-height: 1.05; color: var(--stat-num); font-variant-numeric: tabular-nums; }
.stat-num span { font-size: .55em; margin-left: 2px; color: var(--stat-unit); }
.stat-label { font-size: 13.5px; line-height: 1.45; margin-top: 8px; color: var(--text); font-weight: 500; }
.stat-label em { font-style: normal; color: var(--muted); font-weight: 400; }

/* ---- section heads ---- */
.sec-head { text-align: var(--head-align); max-width: var(--head-max); margin: 0 var(--head-margin-x) 48px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: var(--eyebrow-tracking); text-transform: var(--eyebrow-case); color: var(--eyebrow); margin-bottom: 12px; font-family: var(--font-eyebrow); }
.sec-head h2 { font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(30px, 4.4vw, var(--h2-size)); line-height: 1.1; letter-spacing: var(--head-tracking); margin: 0 0 18px; color: var(--text); }
.sec-head h2 .hl { color: var(--accent); font-style: var(--hl-style); }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--text-2); margin: 0; }
.subhead { margin: 64px 0 18px; }
.subhead h3 { font-family: var(--font-head); font-size: 24px; font-weight: var(--h3-weight); letter-spacing: -.01em; margin: 0 0 4px; }
.subhead p { margin: 0; font-size: 15px; }

/* ---- figures ---- */
.figure { margin: 40px 0; background: var(--surface); border-radius: var(--radius-lg); padding: var(--fig-pad); border: 1px solid var(--fig-border); box-shadow: var(--shadow); }
.figure img { width: 100%; border-radius: calc(var(--radius-lg) - 8px); }
.figure figcaption { font-size: 14px; line-height: 1.55; color: var(--text-2); margin: 18px auto 0; max-width: 880px; text-align: var(--cap-align); }
.figure figcaption b { color: var(--text); }
.figure-flat { padding: 12px; }
.figure.narrow { max-width: 820px; margin-left: auto; margin-right: auto; }

/* ---- cards ---- */
.cards { display: grid; gap: 20px; margin: 40px 0; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.card-icon { width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); font-size: 18px; margin-bottom: 16px; }
.card h3 { font-family: var(--font-head); font-size: 20px; font-weight: var(--h3-weight); margin: 0 0 8px; letter-spacing: -.01em; }
.card p { margin: 0; font-size: 15px; color: var(--text-2); line-height: 1.55; }

.abstract { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 0 28px; max-width: 880px; margin: 0 auto; }
.abstract summary { cursor: pointer; padding: 20px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.abstract summary::-webkit-details-marker { display: none; }
.abstract summary::after { content: "+"; font-size: 22px; color: var(--accent); transition: transform .2s; }
.abstract[open] summary::after { transform: rotate(45deg); }
.abstract p { color: var(--text-2); font-size: 16px; margin: 0 0 16px; }
.abstract p:last-child { padding-bottom: 12px; }

/* ---- segmented control ---- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--seg-bg); border-radius: var(--seg-radius); margin-bottom: 20px; }
.seg button { font: inherit; font-size: 14px; font-weight: 500; border: 0; background: transparent; color: var(--text-2); padding: 8px 16px; border-radius: calc(var(--seg-radius) - 3px); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--seg-on); color: var(--seg-on-text); box-shadow: var(--seg-shadow); font-weight: 600; }
.seg-sm { margin: 0; }
.seg-sm button { font-size: 12.5px; padding: 6px 11px; }

/* ---- panels & charts ---- */
.panel { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 24px 24px 20px; box-shadow: var(--shadow); margin: 24px 0; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h3 { font-family: var(--font-head); font-size: 18px; font-weight: var(--h3-weight); margin: 0 0 2px; letter-spacing: -.01em; }
.panel-head p { margin: 0; font-size: 13.5px; }
.chart-box { position: relative; width: 100%; }
.h-320 { height: 320px; } .h-380 { height: 380px; }
.note { font-size: 13.5px; color: var(--text-2); margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-2 > .panel { margin: 24px 0 0; }
.grid-2-wide { grid-template-columns: 1.35fr 1fr; }
.callout { margin: 24px 0 0; padding: 18px 22px; border-radius: var(--radius); background: var(--accent-tint); color: var(--text); font-size: 15.5px; border-left: 3px solid var(--accent); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--border-soft); }
.tbl tr.grp td { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-top: 14px; border-bottom: 0; }
.tbl td.best { font-weight: 700; color: var(--text); }
.tbl td.second { text-decoration: underline; text-underline-offset: 3px; }
.tbl tr.ours td { background: var(--accent-tint); font-weight: 600; }
.tbl tr.ours td:first-child { border-radius: 8px 0 0 8px; color: var(--accent); }
.tbl tr.ours td:last-child { border-radius: 0 8px 8px 0; }
.tbl tr.ours td.best { color: var(--accent); }

/* ---- explorer ---- */
.explorer { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); --ex-color: var(--accent); }
.explorer .seg { margin-bottom: 24px; }
.explorer-body { display: grid; grid-template-columns: 1fr 1.15fr; gap: 36px; align-items: start; }
.explorer-role { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: var(--ex-color); background: color-mix(in srgb, var(--ex-color) 14%, transparent); }
.explorer-info h3 { font-family: var(--font-head); font-size: 28px; font-weight: var(--head-weight); letter-spacing: -.02em; margin: 10px 0 8px; }
.explorer-info p { color: var(--text-2); font-size: 15.5px; margin: 0 0 18px; min-height: 72px; }
.kv { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-soft); font-size: 13.5px; }
.kv > span { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ex-color) 16%, transparent); color: var(--text); font-family: var(--font-mono); }
.chip-shared { background: var(--seg-bg); color: var(--text-2); }
.explorer-masks { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mask-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; text-align: center; }
.mgrid { display: grid; gap: 5px; align-items: center; }
.mh { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); text-align: center; }
.mc { aspect-ratio: 1; border-radius: 6px; transition: background .25s; }
.mc.v { background: var(--mask-v); }
.mc.a { background: var(--mask-a); }
.mc.z { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
.mask-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); justify-content: center; }
.lg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg-v { background: var(--mask-v); } .lg-a { background: var(--mask-a); } .lg-0 { box-shadow: inset 0 0 0 1.5px var(--border); }
.caps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 0; }
.cap { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.cap b { font-family: var(--font-mono); font-size: 15px; color: var(--accent); }
.cap span { font-size: 13px; color: var(--text-2); }

/* ---- tasks ---- */
.tasks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 8px; }
.task { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--card-border); box-shadow: var(--shadow); }
.task-img { aspect-ratio: 4 / 3; overflow: hidden; }
.task-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.task:hover .task-img img { transform: scale(1.04); }
.task-meta { padding: 16px 20px 18px; }
.task-meta h3 { font-family: var(--font-head); font-size: 19px; font-weight: var(--h3-weight); margin: 6px 0 2px; }
.task-meta p { margin: 0; font-size: 13.5px; color: var(--muted); }
.tag { font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--accent); }

/* ---- WorldArena EWM ---- */
.ewm-task { padding: 12px 0; border-top: 1px solid var(--border-soft); }
.ewm-task:first-child { border-top: 0; padding-top: 0; }
.ewm-name { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.ewm-row { display: grid; grid-template-columns: 128px 1fr 48px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 5px 0; }
.ewm-row b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.ewm-bar { height: 8px; background: var(--seg-bg); border-radius: 99px; overflow: hidden; }
.ewm-bar i { display: block; height: 100%; background: var(--c-base); border-radius: 99px; }
.ewm-row.ours { color: var(--text); font-weight: 600; }
.ewm-row.ours b { color: var(--accent); font-weight: 700; }
.ewm-row.ours .ewm-bar i { background: var(--accent); }
.qual { align-items: center; }
.qual .figure { margin: 0; }

/* ---- video slots ---- */
.vslot { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--vph-bg); }
.vslot video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vslot-hero { border-radius: var(--radius-xl); box-shadow: var(--hero-shadow); }
.vslot-sq { aspect-ratio: 1; }
.vslot-sm.vslot { aspect-ratio: 4 / 3; }
.vslot-sm.vslot-sq { aspect-ratio: 1; }
.vph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; gap: 6px; color: var(--vph-text); border: 1.5px dashed var(--vph-border); border-radius: inherit; }
.has-poster .vph { border: 0; color: #fff; background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.55)), var(--poster) center / cover; }
.has-poster .vph .vph-file { background: rgba(255,255,255,.18); color: #fff; }
.vph-play { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--vph-play-bg); margin-bottom: 4px; }
.vph-play svg { width: 18px; height: 18px; fill: var(--vph-play-fg); margin-left: 2px; }
.vslot-hero .vph-play { width: 72px; height: 72px; } .vslot-hero .vph-play svg { width: 28px; height: 28px; }
.vph-label { font-weight: 600; font-size: 14px; }
.vslot-hero .vph-label { font-size: 20px; }
.vph-spec { font-size: 12px; opacity: .8; max-width: 480px; line-height: 1.4; }
.vph-file { font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--seg-bg); margin-top: 4px; word-break: break-all; }
.vslot-sm .vph-spec { display: none; }
.vslot-sm .vph-play { width: 34px; height: 34px; } .vslot-sm .vph-play svg { width: 14px; height: 14px; }
.vslot-sm .vph-label { font-size: 12.5px; }
.vslot-sm .vph-file { font-size: 9.5px; }
.vk-joint { box-shadow: inset 0 3px 0 var(--c-joint); } .vk-idm { box-shadow: inset 0 3px 0 var(--c-idm); }
.vk-ac { box-shadow: inset 0 3px 0 var(--c-ac); } .vk-ao { box-shadow: inset 0 3px 0 var(--c-ao); }
.vid-pane { display: none; }
.vid-pane.on { display: block; animation: fade .35s ease; }
.vid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.vgrid { display: grid; gap: 14px; }
.vgrid-4 { grid-template-columns: repeat(4, 1fr); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- bibtex & footer ---- */
.bib { position: relative; background: var(--code-bg); border-radius: var(--radius-lg); border: 1px solid var(--card-border); }
.bib pre { margin: 0; padding: 24px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.65; color: var(--code-text); }
.copy { position: absolute; top: 12px; right: 12px; font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.footer { padding: 36px 0 90px; font-size: 13px; color: var(--muted); background: var(--bg); border-top: 1px solid var(--border); }
.footer p { display: flex; align-items: center; gap: 8px; margin: 0; flex-wrap: wrap; }
.foot-logo { width: 18px; }


/* ---- reveal ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---- responsive ---- */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }
  .stat:nth-child(4) { border-left: 0; }
  .explorer-body, .grid-2, .grid-2-wide { grid-template-columns: 1fr; }
  .caps-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap, .wrap-wide { padding: 0 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: 0; padding: 0 8px; }
  .cards-3, .tasks, .vid-main { grid-template-columns: 1fr; }
  .vgrid-4 { grid-template-columns: repeat(2, 1fr); }
  .explorer { padding: 16px; }
  .explorer-masks { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kv { grid-template-columns: 1fr; gap: 6px; }
  .panel { padding: 18px 14px 14px; }
  .figure { padding: 12px; }
  .br-lg { display: none; }
  .vslot-hero .vph-spec { display: none; }
}
.vid-side { display: grid; gap: 16px; }
@media (max-width: 720px) { .vid-side { grid-template-columns: 1fr 1fr; gap: 12px; } }

/* ---- real video clips ---- */
.hero-video { border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--hero-shadow); background: #141413; aspect-ratio: 16 / 9; }
.hero-video video { width: 100%; height: 100%; display: block; object-fit: cover; }
.vclip { margin: 0; min-width: 0; }
.vwrap { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--vph-bg); aspect-ratio: 4 / 3; }
.vwrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vclip-main .vwrap { aspect-ratio: 2 / 1; border-radius: var(--radius-lg); }
.vclip-main { margin-bottom: 16px; }
.vclip-sq .vwrap { aspect-ratio: 1; }
.vclip figcaption { font-size: 13px; color: var(--text-2); margin-top: 8px; line-height: 1.4; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.vclip-main figcaption { font-size: 14.5px; color: var(--text); }
.vtag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.vbadge { position: absolute; right: 10px; top: 10px; font: 600 12px var(--font-mono); color: #fff; background: rgba(20,20,19,.62); padding: 3px 8px; border-radius: 6px; backdrop-filter: blur(4px); }
.vgrid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .vgrid-3 { grid-template-columns: repeat(2, 1fr); } .vclip-main .vwrap { aspect-ratio: 2 / 1; } }
