/* =====================================================================
   Action Jets -- project page
   One stylesheet, no framework. Edit the tokens below to retheme.
   ===================================================================== */

:root {
  --ink:     #0b0b0b;
  --ink2:    #52514e;
  --muted:   #8f8d87;
  --rule:    #e6e5e1;
  --card:    #f7f6f3;
  --bg:      #ffffff;
  --accent:  #2a78d6;
  --accent2: #eb6834;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
           Roboto, Helvetica, Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
           Consolas, monospace;

  --maxw: 880px;
  --gut:  20px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2f1ee; --ink2: #b8b6b0; --muted: #86847e;
    --rule: #2b2b2e; --card: #16161a; --bg: #0d0d10;
    --accent: #6ba6f0; --accent2: #f28a5e;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.section { padding: 46px 0 8px; }
.section-teaser { padding-top: 10px; }

h2 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin: 38px 0 12px;
}

.prose p { margin: 0 0 16px; }
.prose em { font-style: italic; }

/* ------------------------------------------------------------- nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
  height: 52px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
}
.nav-links {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: auto;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  font-size: 13.5px;
  color: var(--ink2);
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ------------------------------------------------------------ hero */
.hero {
  text-align: center;
  padding: 56px 0 8px;
  border-bottom: 1px solid var(--rule);
}
.venue {
  font-size: 12.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}
.title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}
.title-sep { color: var(--muted); }
.subtitle {
  display: block;
  font-size: 0.62em;
  font-weight: 400;
  color: var(--ink2);
  margin-top: 10px;
  line-height: 1.3;
}
.authors {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  justify-content: center;
  font-size: 17px;
}
.authors a { color: var(--ink); }
.affil {
  margin: 0 0 26px;
  color: var(--ink2);
  font-size: 15px;
}

.btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding-bottom: 34px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: transform .12s ease, opacity .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); opacity: .9; }
.btn-ico { font-size: 12px; opacity: .8; }
.btn-soon { background: transparent; color: var(--ink); border-color: var(--rule); }
.tag {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--rule);
  padding-left: 8px;
  margin-left: 2px;
}

/* ----------------------------------------------------------- stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}
.stat { background: var(--bg); padding: 20px 18px; }
.stat-n {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-u { font-size: 0.5em; color: var(--muted); margin-left: 2px; }
.stat-l {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink2);
}

/* ----------------------------------------------------------- media */
.media { margin: 26px 0 30px; }
.media img, .media video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--rule);
}
figcaption {
  margin-top: 11px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink2);
}
figcaption b { color: var(--ink); }

.gallery {
  display: grid;
  gap: 18px;
  margin: 26px 0 30px;
}
.gallery-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.gallery-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.gallery .media { margin: 0; }
.gallery figcaption { font-size: 13px; margin-top: 8px; }

/* placeholder shown when a figure/video file is not there yet */
.ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 16 / 9;
  max-height: 320px;
  border: 1.5px dashed var(--rule);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  text-align: center;
  padding: 16px;
}
.ph-title { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.ph-path { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }

/* ---------------------------------------------------------- tables */
.tablewrap { margin: 24px 0 30px; overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
th, td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; }
thead th {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink2);
  border-bottom: 1.5px solid var(--ink2);
}
tbody tr.rule td { border-top: 1px solid var(--ink2); }
tbody tr.best td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
tr.grouprow td {
  text-align: left;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
  padding-top: 14px;
  border-bottom: none;
}
.tcap { font-size: 13.5px; color: var(--ink2); margin: 12px 0 0; line-height: 1.55; }

/* ----------------------------------------------------------- misc */
.more {
  margin: 8px 0 24px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0 16px;
}
.more[open] { padding-bottom: 8px; }
.more summary {
  cursor: pointer;
  padding: 13px 0;
  font-size: 14.5px;
  font-weight: 500;
  list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "＋  "; color: var(--muted); }
.more[open] summary::before { content: "－  "; }

.bib {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px;
  overflow-x: auto;
  min-height: 92px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  color: var(--ink2);
  margin: 0;
}

.footer {
  margin-top: 56px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}
.footer p { margin: 5px 0; }


@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 34px 0 4px; }
  h2 { font-size: 25px; }
  .nav-brand { display: none; }
  .nav-links { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ------------------------------------------------ equations (KaTeX) */
/* The math is pre-rendered into index.html by tools/render_math.mjs, so
   all that is needed here is the card the display equations sit in and
   a size that matches the body text. */
.eq {
  margin: 22px 0;
  padding: 16px 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: hidden;
}
.eq .katex-display { margin: 0; }
.eq .katex { font-size: 1.10em; }
.prose .katex { font-size: 1.04em; }          /* inline, beside 17px text */
.katex { color: var(--ink); }
.tex-error { color: var(--accent2); font-family: var(--mono); font-size: .9em; }

.btn-ico { width: 15px; height: 15px; opacity: .85; flex: 0 0 auto; }

@media (max-width: 640px) {
  .eq { padding: 13px 10px; }
  .eq .katex { font-size: 1.0em; }
}

/* ------------------------------------------------------------ charts */
/* Categorical slots, fixed order, never cycled. Both modes are chosen
   steps of the same hues, each validated against its own surface. */
.viz {
  --s1: #2a78d6;  /* blue   -- Action Jet, fine-tuned decoder */
  --s2: #eb6834;  /* orange -- Action Jet                     */
  --s3: #1baf7a;  /* aqua   -- IRASim                         */
  --s4: #eda100;  /* yellow -- WorldGym                       */
  --s0: #a9a7a1;  /* muted  -- copy-frame control, dashed     */
  margin: 24px 0 26px;
  position: relative;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .viz {
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --s4: #c98500; --s0: #6f6d68;
  }
}

.lgrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--ink2);
}
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg i {
  width: 17px; height: 0;
  border-top: 2.5px solid var(--c);
  border-radius: 2px;
  flex: 0 0 auto;
}
.lg-dash i { border-top-style: dashed; border-top-width: 2px; }

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px 22px;
}
.panel { min-width: 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }

.chart .grid line { stroke: var(--rule); stroke-width: 1; }
.chart .ylab text,
.chart .xlab text {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.chart .axtitle { fill: var(--ink2); font-size: 10.5px; }
.chart .ln { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .pt { stroke: var(--bg); stroke-width: 2; }
.chart .xhair {
  stroke: var(--ink2);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  transition: opacity .1s ease;
  pointer-events: none;
}
.chart .hit rect { fill: transparent; cursor: crosshair; }

.viz .tip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .13);
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.viz .tip b { display: block; margin-bottom: 4px; font-size: 11.5px; color: var(--ink2); font-weight: 600; }
.viz .tip .r { display: flex; align-items: center; gap: 7px; }
.viz .tip .r i { width: 11px; height: 0; border-top: 2.5px solid var(--c); flex: 0 0 auto; }
.viz .tip .r span { margin-left: auto; padding-left: 14px; }

/* -------------------------------------------- full-width media rows */
/* Escapes the 880px text column. Capped at the viewport minus a gutter
   so it can never introduce a horizontal scrollbar. */
.bleed {
  width: min(calc(100vw - 32px), 1500px);
  max-width: calc(100vw - 32px);
  margin-left: 50%;
  transform: translateX(-50%);
}
@media (max-width: 720px) {
  .bleed { width: 100%; max-width: 100%; margin-left: 0; transform: none; }
}

/* -------------------------------------------------------- lightbox */
.zoomable { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  background: color-mix(in srgb, #0b0b0b 94%, transparent);
  opacity: 0;
  transition: opacity .18s ease;
  cursor: zoom-out;
}
.lightbox.on { opacity: 1; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; }
.lightbox img {
  display: block;
  max-width: min(1600px, 96vw);
  max-height: 84vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  background: #fff;
  cursor: default;
}
.lightbox figcaption {
  margin: 12px auto 0;
  max-width: 820px;
  color: #dcdad5;
  font-size: 13.5px;
  line-height: 1.55;
  text-align: center;
}
.lb-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.lb-close:hover { background: rgba(255, 255, 255, .22); }
