/* ==========================================================
   StreamGaze project page
   ========================================================== */

:root {
  --page: #f6f6f3;
  --page-alt: #eeeeea;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --border: rgba(11, 11, 11, 0.10);
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 30px rgba(0,0,0,.06);

  --brand-1: #667eea;
  --brand-2: #764ba2;
  --brand: #5b6be0;

  /* temporal families (from Figure 1) */
  --past: #3f8f5a;
  --past-bg: #e7f0df;
  --present: #a87400;
  --present-bg: #fbf1d6;
  --proactive: #c43d66;
  --proactive-bg: #f9e0e6;

  --good: #0ca30c;
  --bad: #d03b3b;

  /* chart series (validated reference palette, light) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-ft: #898781;
  --human: #0b0b0b;

  /* sequential heatmap (blue ramp) */
  --heat-lo: 205, 226, 251;   /* #cde2fb */
  --heat-hi: 37, 106, 191;    /* #256abf */

  --radius: 18px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --page: #0d0d0d;
  --page-alt: #131312;
  --surface: #1a1a19;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --border: rgba(255, 255, 255, 0.10);
  --grid: #2c2c2a;
  --axis: #383835;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);

  --brand: #8b98f5;
  --past: #7cc48f;
  --past-bg: #1d2a20;
  --present: #e7b840;
  --present-bg: #2c2615;
  --proactive: #f07a9c;
  --proactive-bg: #2f1a21;

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-ft: #898781;
  --human: #f0efec;

  --heat-lo: 24, 40, 64;
  --heat-hi: 57, 135, 229;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
b { font-weight: 600; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 880px; }
.muted { color: var(--muted); font-size: .92em; }

/* ---------- progress + nav ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, #00c853, #ffd54f, #ff4081);
  z-index: 200;
}
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 28px;
  transition: background .3s, box-shadow .3s, transform .35s;
  color: #fff;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  box-shadow: 0 1px 0 var(--border);
  color: var(--ink);
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: inherit; letter-spacing: .2px; }
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  color: inherit; opacity: .75; font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px; transition: opacity .2s, background .2s;
}
.nav-links a:hover { opacity: 1; text-decoration: none; background: rgba(127,127,127,.12); }
.nav-links a.active { opacity: 1; background: rgba(127,127,127,.16); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(127,127,127,.3);
  background: transparent; display: grid; place-items: center; flex-shrink: 0;
}
.icon-btn:hover { background: rgba(127,127,127,.14); }
#theme-toggle .fa-sun { display: none; }
[data-theme="dark"] #theme-toggle .fa-sun { display: inline; }
[data-theme="dark"] #theme-toggle .fa-moon { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #f2f3f8; text-align: center;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(102,126,234,.35), transparent 60%),
    radial-gradient(800px 500px at 90% 90%, rgba(255,64,129,.22), transparent 60%),
    radial-gradient(700px 400px at 70% 20%, rgba(0,200,83,.14), transparent 60%),
    #0a0c16;
}
#gaze-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 2; max-width: 1240px; padding: 110px 24px 90px; pointer-events: none; }
.hero-inner a, .hero-inner .btn { pointer-events: auto; }
.venue {
  display: inline-block; padding: 6px 18px; border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  font-size: 14px; font-weight: 700; letter-spacing: .6px;
  box-shadow: 0 6px 24px rgba(102,126,234,.45);
  animation: rise .8s both;
}
.title {
  font-size: clamp(28px, 3.5vw, 46px); line-height: 1.18; font-weight: 700;
  margin: 22px 0 26px; letter-spacing: -.5px; text-wrap: balance;
  animation: rise .8s .1s both;
}
.title-rest { color: #e7e9f3; }
.gradient-text {
  background: linear-gradient(90deg, #00c853, #ffeb3b, #ff4081, #00c853);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  animation: shimmer 8s linear infinite;
}
.authors {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px;
  font-size: 17px; max-width: 820px; margin: 0 auto;
  animation: rise .8s .2s both;
}
.authors a { color: #dfe3ff; font-weight: 500; border-bottom: 1px dashed rgba(223,227,255,.0); transition: color .2s, border-color .2s; }
.authors a:hover { color: #fff; text-decoration: none; border-bottom-color: rgba(223,227,255,.7); }
.authors sup, .affiliations sup { font-size: .65em; margin-left: 1px; color: #9fb0ff; }
.affiliations { margin-top: 10px; display: flex; gap: 22px; justify-content: center; color: #b8bdd4; font-size: 16px; animation: rise .8s .3s both; }
.links { margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; animation: rise .8s .4s both; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 22px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: #fff; font-weight: 600; font-size: 15px;
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .2s, background .2s, box-shadow .2s;
}
.btn:hover { text-decoration: none; background: rgba(255,255,255,.16); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(102,126,234,.35); }
.gaze-hint { margin-top: 38px; font-size: 13px; color: #8e94b0; display: inline-flex; align-items: center; gap: 8px; animation: rise .8s .6s both; }
.gaze-hint .dot { width: 9px; height: 9px; border-radius: 50%; background: #2ee87a; box-shadow: 0 0 0 4px rgba(46,232,122,.2); animation: pulse 1.6s infinite; }
.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2;
  color: #aab; font-size: 18px; animation: bob 2s infinite;
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(46,232,122,0); } }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ---------- sections ---------- */
.section { padding: 96px 0; }
.section.alt { background: var(--page-alt); }
#tldr { padding-bottom: 56px; }
.section-title {
  font-size: clamp(26px, 3vw, 36px); font-weight: 700; text-align: center;
  margin: 0 0 14px; letter-spacing: -.4px;
}
.section-sub { text-align: center; font-size: 17px; color: var(--ink-2); max-width: 760px; margin: 0 auto 40px; }
.section-foot { text-align: center; color: var(--ink-2); font-size: 16px; max-width: 760px; margin: 32px auto 0; }
.c-past { color: var(--past); } .c-present { color: var(--present); } .c-proactive { color: var(--proactive); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; position: relative;
}
.card + .card { margin-top: 24px; }

/* ---------- tldr / stats ---------- */
.tldr {
  position: relative; padding: 26px 30px 26px 34px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.tldr::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--brand-1), var(--brand-2)); }
.tldr-label { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--brand); letter-spacing: .3px; }
.tldr p { margin: 0; font-size: 18px; line-height: 1.65; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 16px; text-align: center; box-shadow: var(--shadow);
  transition: transform .25s;
}
.stat:hover { transform: translateY(-4px); }
.stat-num {
  font-size: 38px; font-weight: 800; letter-spacing: -1px; line-height: 1.1;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .stat-num { background: linear-gradient(135deg, #9fb0ff, #c79bff); -webkit-background-clip: text; background-clip: text; }
.stat-label { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

/* ---------- abstract ---------- */
.abstract { font-size: 18px; line-height: 1.85; color: var(--ink-2); text-align: justify; hyphens: auto; }
.abstract mark {
  color: var(--ink); font-weight: 600; background: linear-gradient(transparent 62%, rgba(102,126,234,.28) 0);
  background-size: 0% 100%; background-repeat: no-repeat;
  transition: background-size 1s ease;
}
.abstract.in mark { background-size: 100% 100%; }
.abstract.in mark:nth-of-type(2) { transition-delay: .15s; }
.abstract.in mark:nth-of-type(3) { transition-delay: .3s; }
.abstract.in mark:nth-of-type(4) { transition-delay: .45s; }
.abstract.in mark:nth-of-type(5) { transition-delay: .6s; }
.abstract.in mark:nth-of-type(6) { transition-delay: .75s; }
.abstract.in mark:nth-of-type(7) { transition-delay: .9s; }

/* ---------- task explorer ---------- */
.explorer {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
}
.timeline { position: relative; margin-bottom: 24px; }
.tl-track { position: relative; display: grid; grid-template-columns: 4fr 3fr 2fr; height: 34px; }
.tl-zone:first-child { border-radius: 10px 0 0 10px; }
.tl-zone:nth-child(3) { border-radius: 0 10px 10px 0; }
.tl-zone { display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; letter-spacing: .4px; }
.tl-zone.past { background: var(--past-bg); color: var(--past); }
.tl-zone.present { background: var(--present-bg); color: var(--present); }
.tl-zone.proactive { background: var(--proactive-bg); color: var(--proactive); }
.tl-now {
  position: absolute; top: -6px; bottom: -6px; left: 61.1%; width: 2px; background: var(--ink);
}
.tl-now span {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--ink);
}
.tl-tasks { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; margin-top: 14px; }
.pill {
  border: 1px solid var(--border); background: transparent; border-radius: 12px;
  padding: 10px 6px; text-align: center; transition: all .2s; position: relative;
}
.pill b { display: block; font-size: 15px; font-weight: 700; }
.pill small { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.pill:hover { transform: translateY(-2px); }
.pill.past b { color: var(--past); }
.pill.present b { color: var(--present); }
.pill.proactive b { color: var(--proactive); }
.pill.active.past { background: var(--past-bg); border-color: var(--past); }
.pill.active.present { background: var(--present-bg); border-color: var(--present); }
.pill.active.proactive { background: var(--proactive-bg); border-color: var(--proactive); }
.pill.active::after {
  content: ''; position: absolute; left: 50%; bottom: -9px; width: 12px; height: 12px;
  transform: translateX(-50%) rotate(45deg); background: inherit; border-right: 1px solid; border-bottom: 1px solid; border-color: inherit;
}

.task-panel {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px;
  border-radius: 14px; padding: 26px; border: 1px solid var(--border);
  animation: fadeIn .35s ease;
}
.task-panel.past { background: linear-gradient(135deg, var(--past-bg), transparent 70%); }
.task-panel.present { background: linear-gradient(135deg, var(--present-bg), transparent 70%); }
.task-panel.proactive { background: linear-gradient(135deg, var(--proactive-bg), transparent 70%); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tp-tag { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.tp-name { font-size: 22px; font-weight: 700; margin: 4px 0 14px; }
.tp-q { font-size: 16.5px; margin: 0 0 16px; }
.tp-q .gz { color: var(--bad); font-weight: 600; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.options.single { grid-template-columns: 1fr; }
.opt {
  text-align: left; padding: 11px 14px; border-radius: 10px; font-size: 14.5px;
  border: 1px solid var(--border); background: var(--surface); transition: all .2s;
  display: flex; gap: 10px; align-items: center;
}
.opt:hover:not(:disabled) { border-color: var(--brand); transform: translateX(2px); }
.opt .k { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.opt.correct { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); animation: shake .35s; }
.opt .res { margin-left: auto; }
.opt:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tp-feedback { min-height: 24px; margin-top: 12px; font-size: 14px; color: var(--ink-2); }

.sim { background: #0e1020; color: #e6e8f5; border-radius: 12px; padding: 16px; font-family: var(--mono); font-size: 13px; }
.sim-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sim-clock { font-size: 22px; font-weight: 500; color: #fff; }
.sim-live { color: #ff5f7e; font-size: 11px; letter-spacing: 1px; display: flex; align-items: center; gap: 6px; }
.sim-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #ff5f7e; animation: pulse 1.2s infinite; }
.sim-bar { height: 6px; border-radius: 3px; background: #23264a; overflow: hidden; margin-bottom: 12px; position: relative; }
.sim-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #667eea, #ff4081); }
.sim-log { min-height: 60px; }
.sim-log div { padding: 3px 0; animation: fadeIn .3s; }
.sim-log .u { color: #9fb0ff; }
.sim-log .a { color: #2ee87a; font-weight: 500; }
.sim-log .w { color: #6c7194; }
.sim-btn { margin-top: 12px; border: 1px solid #3a3f6e; background: #1a1d36; color: #fff; border-radius: 8px; padding: 7px 14px; font-family: var(--mono); font-size: 12px; }
.sim-btn:hover { background: #262a4d; }

.tp-side { display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.tp-side h4 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.mini-bar { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 10px; font-size: 13px; }
.mini-bar .lab { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bar .trk { display: block; height: 10px; background: var(--grid); border-radius: 0 5px 5px 0; overflow: hidden; }
.mini-bar .fill { display: block; height: 100%; width: 0; border-radius: 0 4px 4px 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.mini-bar .val { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.tp-gap { font-size: 13.5px; color: var(--ink-2); }
.tp-gap b { color: var(--bad); }

/* ---------- lightbox ---------- */
.zoomable { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(5,6,14,.86);
  display: flex; align-items: center; justify-content: center; padding: 4vw;
  opacity: 0; pointer-events: none; transition: opacity .25s; cursor: zoom-out;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-height: 92vh; border-radius: 12px; background: #fff; padding: 12px; transform: scale(.96); transition: transform .25s; }
.lightbox.open img { transform: none; }
.lb-close { position: absolute; top: 18px; right: 18px; color: #fff; }

/* ---------- contributions ---------- */
.contrib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 36px; }
.contrib {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .3s, box-shadow .3s;
  transform-style: preserve-3d;
}
.contrib::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(102,126,234,.14), transparent 50%);
}
.contrib:hover::after { opacity: 1; }
.contrib:hover { box-shadow: 0 20px 50px -15px rgba(60,70,160,.35); }
.contrib-num { position: absolute; top: 14px; right: 20px; font-size: 54px; font-weight: 800; color: var(--ink); opacity: .06; }
.contrib-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); color: #fff; font-size: 20px; margin-bottom: 18px;
  box-shadow: 0 8px 20px rgba(102,126,234,.35);
}
.contrib h3 { font-size: 18px; margin: 0 0 10px; font-weight: 700; line-height: 1.35; }
.contrib p { font-size: 15px; color: var(--ink-2); margin: 0; }

/* ---------- pipeline ---------- */
.pipeline { display: grid; grid-template-columns: 330px 1fr; gap: 28px; align-items: start; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step {
  display: flex; gap: 14px; text-align: left; padding: 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); transition: all .25s;
}
.step:hover { border-color: var(--brand); }
.step-n {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; border: 2px solid var(--border); color: var(--ink-2); transition: all .25s;
}
.step-body b { display: block; font-size: 15px; font-weight: 600; }
.step-body small { display: block; font-size: 13px; color: var(--ink-2); max-height: 0; overflow: hidden; opacity: 0; transition: all .35s; }
.step.active { border-color: var(--brand); box-shadow: 0 10px 30px -12px rgba(91,107,224,.5); }
.step.active .step-n { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); color: #fff; border-color: transparent; }
.step.active .step-body small { max-height: 80px; opacity: 1; margin-top: 4px; }
.pipe-figure { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 14px; box-shadow: var(--shadow); }
.pipe-stage { position: relative; border-radius: 8px; overflow: hidden; }
.spotlight {
  position: absolute; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(10,12,22,.55), 0 0 0 3px #667eea inset;
  transition: all .6s cubic-bezier(.65,0,.35,1);
}
.pipe-progress { height: 3px; background: #eee; border-radius: 2px; margin-top: 12px; overflow: hidden; }
.pipe-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); }

/* ---------- filters / chips / segmented ---------- */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filter-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; min-width: 70px; }
.chip {
  border: 1px solid var(--border); background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500;
  transition: all .2s; display: inline-flex; gap: 7px; align-items: center;
}
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.ghost { border-style: dashed; color: var(--ink-2); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--page-alt); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: all .2s;
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button.past.active { color: var(--past); }
.seg button.present.active { color: var(--present); }
.seg button.proactive.active { color: var(--proactive); }
.seg button .sep { opacity: .4; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: auto; cursor: pointer; }
.switch input { display: none; }
.switch span { width: 34px; height: 20px; border-radius: 10px; background: var(--axis); position: relative; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(14px); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 10px 10px; text-align: center; white-space: nowrap; }
.data-table th.left, .data-table td.left { text-align: left; }
.data-table thead th { font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--page-alt); border-bottom: 1px solid var(--border); }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: opacity .35s, background .2s; }
.data-table tbody tr:last-child { border-bottom: 0; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.data-table .group-row td { background: var(--page-alt); font-style: italic; font-size: 12.5px; color: var(--muted); text-align: left; padding: 6px 12px; }
.data-table tr.ours { background: color-mix(in srgb, var(--brand) 11%, transparent); font-weight: 600; }
.data-table tr.ours td:first-child { position: relative; }
.data-table tr.dim { opacity: .18; }
.data-table tr.hidden-row { display: none; }
.ok { color: var(--good); font-weight: 700; }
.no { color: var(--bad); font-weight: 700; }
.part { color: var(--good); }
.cmp-msg { text-align: center; min-height: 26px; margin: 14px 0 0; font-weight: 600; color: var(--brand); }
.legend-note { font-size: 12.5px; color: var(--muted); margin: 12px 2px 0; }

.results th.sortable { cursor: pointer; user-select: none; }
.results th.sortable:hover { color: var(--ink); }
.results th .arrow { font-size: 10px; margin-left: 3px; opacity: .35; }
.results th.sorted .arrow { opacity: 1; color: var(--brand); }
.results thead tr.fam th { font-size: 12px; font-weight: 700; padding: 6px; border-bottom: 0; }
.results thead tr.fam th.past { background: var(--past-bg); color: var(--past); }
.results thead tr.fam th.present { background: var(--present-bg); color: var(--present); }
.results thead tr.fam th.proactive { background: var(--proactive-bg); color: var(--proactive); }
.results td.cell { position: relative; }
.results td.best { font-weight: 800; }
.results tr.human td { font-weight: 600; background: var(--page-alt); }
.results td.overall { font-weight: 700; border-left: 1px solid var(--border); }
.results td.bl { border-left: 1px solid var(--border); }
.results .tag { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }

/* ---------- chart (HTML bars) ---------- */
.chart { position: relative; width: 100%; margin-top: 34px; }
.chart-plot { position: relative; margin-left: 150px; margin-right: 52px; }
.chart-grid { position: absolute; inset: 0 0 0 0; pointer-events: none; }
.chart-grid .gl { position: absolute; top: 0; bottom: 22px; width: 1px; background: var(--grid); }
.chart-grid .gl span {
  position: absolute; bottom: -20px; left: 0; transform: translateX(-50%);
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.chart-grid .gl.base { background: var(--axis); }
.chart-rows { position: relative; }
.bar-row {
  position: absolute; left: 0; right: 0; height: 26px;
  display: flex; align-items: center;
  transition: transform .65s cubic-bezier(.2,.8,.2,1);
  outline: none;
}
.bar-row::before { content: ''; position: absolute; inset: 0 -52px 0 -150px; border-radius: 6px; }
.bar-row:hover::before, .bar-row:focus-visible::before { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.bar-name {
  position: absolute; right: calc(100% + 12px); width: 140px; text-align: right;
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar {
  position: relative; height: 14px; width: 0; border-radius: 0 4px 4px 0;
  transition: width .65s cubic-bezier(.2,.8,.2,1);
}
.bar-val {
  position: relative; margin-left: 6px; font-size: 11.5px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .2s;
}
.bar-row.labeled .bar-val, .bar-row:hover .bar-val, .bar-row:focus-visible .bar-val { opacity: 1; }
.bar-row.labeled .bar-val { color: var(--ink); font-weight: 700; }
.bar-row.na .bar-val { opacity: 1; color: var(--muted); margin-left: 0; }
.human-line {
  position: absolute; top: -8px; bottom: 22px; width: 2px; margin-left: -1px; background: var(--human);
  transition: left .65s cubic-bezier(.2,.8,.2,1), opacity .3s; pointer-events: none; z-index: 2;
}
.human-line span {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 11.5px; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-left: auto; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { width: 14px; height: 2px; border-radius: 0; background: var(--human); }
.tooltip {
  position: absolute; pointer-events: none; z-index: 10; opacity: 0; transition: opacity .15s;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 10px 12px; font-size: 12.5px; min-width: 170px;
}
.tooltip.show { opacity: 1; }
.tooltip .tt-title { font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tooltip .tt-row b { color: var(--ink); }

/* ---------- takeaway ---------- */
.takeaway {
  margin-top: 28px; padding: 28px 32px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(102,126,234,.10), rgba(118,75,162,.10));
  border: 1px solid var(--border);
}
.takeaway p { margin: 0 0 14px; font-size: 17px; }
.takeaway ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.takeaway li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 14.5px; display: flex; gap: 12px; align-items: flex-start; }
.takeaway li i { color: var(--brand); margin-top: 4px; }

/* ---------- bibtex ---------- */
.bib { position: relative; }
.bib pre {
  margin: 0; background: #0e1020; color: #d8dcf5; border-radius: var(--radius);
  padding: 26px 28px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  border: 1px solid var(--border);
}
.copy-btn {
  position: absolute; top: 14px; right: 14px; display: inline-flex; gap: 8px; align-items: center;
  border: 1px solid #353a63; background: #1a1d36; color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 13px;
}
.copy-btn:hover { background: #262a4d; }
.copy-btn.done { border-color: var(--good); color: #7ff0a0; }

/* ---------- footer ---------- */
.footer { padding: 48px 0 56px; font-size: 13.5px; color: var(--muted); text-align: center; border-top: 1px solid var(--border); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-brand { margin-right: auto; }
  .pipeline { grid-template-columns: 1fr; }
  .task-panel { grid-template-columns: 1fr; }
  .takeaway ul { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .contrib-grid { grid-template-columns: 1fr; }
  .tl-tasks { grid-template-columns: repeat(3, 1fr); }
  .tl-track { display: none; }
  .options { grid-template-columns: 1fr; }
  .br-wide { display: none; }
  .section { padding: 72px 0; }
  .filter-label { min-width: 0; }
  .switch { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
