/* ============================================================
   PRAXIS — A Capability-Factored Dataset and Benchmark for Robot Learning
   Theme tokens. Light is the base; the dark block redefines only
   colour, so every rule below is written once.
   ============================================================ */
:root {
  --bg:            #ffffff;
  --bg-soft:       #f7f8fb;
  --bg-sunk:       #eef1f7;
  --surface:       #ffffff;
  --surface-2:     #f7f8fb;
  --line:          #e3e7ef;
  --line-strong:   #cbd3e1;

  --ink:           #141a24;
  --ink-2:         #47536a;
  --ink-3:         #7b8699;

  --brand:         #0f766e;
  --brand-2:       #14958b;
  --brand-ink:     #ffffff;
  --accent:        #b45309;
  --warn:          #b4530a;
  --danger:        #b02a2f;

  --brand-wash:    rgba(15, 118, 110, 0.09);
  --accent-wash:   rgba(180, 83, 9, 0.10);

  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-2: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-3: 0 14px 40px rgba(15, 23, 42, 0.12);

  --r-sm: 8px;
  --r:    13px;
  --r-lg: 20px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t:    0.22s var(--ease);

  --nav-h: 62px;
  --wrap:  1140px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  /* Native controls (select, scrollbars, form fields) follow the theme. */
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #0c1017;
  --bg-soft:       #11161f;
  --bg-sunk:       #080b11;
  --surface:       #141a25;
  --surface-2:     #1a2130;
  --line:          #232c3c;
  --line-strong:   #33405a;

  --ink:           #e8ecf4;
  --ink-2:         #a3b0c6;
  --ink-3:         #6f7d95;

  --brand:         #2dd4bf;
  --brand-2:       #5eead4;
  --brand-ink:     #0c1017;
  --accent:        #f0a04b;
  --warn:          #f0a04b;
  --danger:        #f0716f;

  --brand-wash:    rgba(45, 212, 191, 0.13);
  --accent-wash:   rgba(240, 160, 75, 0.14);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 16px 44px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 14px); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t), color var(--t);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4 { line-height: 1.22; margin: 0; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding-left: 1.15rem; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 800px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Skip link --- */
.skip {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brand); color: var(--brand-ink);
  padding: 0.6rem 1rem; border-radius: 0 0 var(--r-sm) 0; font-weight: 700;
}
.skip:focus { left: 0; color: var(--brand-ink); }

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem;
  height: var(--nav-h); display: flex; align-items: center; gap: 1rem;
}

.nav__brand {
  font-weight: 900; font-size: 1.12rem; letter-spacing: -0.03em;
  color: var(--ink); display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto;
}
.nav__brand:hover { color: var(--ink); }
.nav__mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 0.95rem; font-weight: 800; letter-spacing: 0;
}
.nav__brand em { font-style: normal; color: var(--ink-3); font-weight: 600; font-size: 0.9rem; }

.nav__links { display: flex; gap: 0.15rem; margin-left: auto; align-items: center; }

.nav__links a {
  padding: 0.42rem 0.7rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
  color: var(--ink-2); white-space: nowrap;
}
.nav__links a:hover { color: var(--ink); background: var(--surface-2); }
.nav__links a.is-active { color: var(--brand); background: var(--brand-wash); }

.nav__tools { display: flex; gap: 0.4rem; align-items: center; margin-left: 0.6rem; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  cursor: pointer; font-size: 0.92rem; transition: var(--t); flex: 0 0 auto;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }

.nav__burger { display: none; }

.progress {
  height: 2px; background: linear-gradient(90deg, var(--brand), var(--accent));
  width: 0; transition: width 0.1s linear;
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; overflow: hidden; padding: 5rem 0 3.5rem; }

.hero::before {
  content: ''; position: absolute; inset: -40% 0 auto -20%;
  height: 620px; pointer-events: none;
  background:
    radial-gradient(46% 46% at 22% 40%, var(--brand-wash), transparent 70%),
    radial-gradient(40% 40% at 78% 26%, var(--accent-wash), transparent 70%);
}

.hero__inner { position: relative; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-wash);
  padding: 0.36rem 0.8rem; border-radius: 999px; margin-bottom: 1.2rem;
}

.hero h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); letter-spacing: -0.045em; }
.hero h1 .pi { color: var(--brand); }

.hero__lead {
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  color: var(--ink-2); max-width: 720px; margin: 1.1rem 0 1.6rem; line-height: 1.6;
}

.hero__chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 2rem; }

.chip {
  font-size: 0.78rem; font-weight: 600; padding: 0.32rem 0.72rem;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 0.65rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.66rem 1.15rem; border-radius: 11px;
  font-size: 0.9rem; font-weight: 700; font-family: inherit;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: var(--t);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); color: var(--ink); }
.btn--primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color: #fff;
}
.btn--primary:hover { color: #fff; }

/* --- Stat band --- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  margin-top: 3rem;
}

.stat {
  padding: 1.3rem 1.2rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  transition: var(--t);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }

.stat__val {
  font-size: 2.1rem; font-weight: 900; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat__label { font-size: 0.8rem; color: var(--ink-2); margin-top: 0.2rem; line-height: 1.45; }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: 4.5rem 0; }
.section--soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section__head { max-width: 760px; margin-bottom: 2.4rem; }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }

.section__kicker {
  font-size: 0.73rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.55rem;
}
.section h2 { font-size: clamp(1.7rem, 3.6vw, 2.35rem); letter-spacing: -0.035em; }
.section__sub { color: var(--ink-2); margin-top: 0.85rem; font-size: 1.02rem; }

/* ============================================================
   Research area cards
   ============================================================ */
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.1rem; }

.area {
  position: relative; text-align: left; width: 100%; font-family: inherit;
  padding: 1.5rem 1.5rem 1.35rem; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; transition: var(--t); overflow: hidden;
}
.area::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.area:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.area:hover::after, .area.is-open::after { transform: scaleX(1); }
.area.is-open { border-color: var(--brand); box-shadow: var(--shadow-2); }

.area__icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-wash); color: var(--brand); font-size: 1.05rem; margin-bottom: 0.9rem;
}
.area h3 { font-size: 1.05rem; margin-bottom: 0.45rem; }
.area__blurb { font-size: 0.9rem; color: var(--ink-2); margin: 0; line-height: 1.6; }

.area__meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1rem; font-size: 0.78rem; font-weight: 700; color: var(--ink-3);
}
.area__count { color: var(--brand); }
.area__chev { transition: transform 0.3s var(--ease); }
.area.is-open .area__chev { transform: rotate(180deg); }

.area__more {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s var(--ease);
}
.area.is-open .area__more { grid-template-rows: 1fr; }
.area__more > div { overflow: hidden; }

.area__detail {
  padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--line);
  font-size: 0.87rem; color: var(--ink-2); line-height: 1.62;
}
.area__detail ul { margin: 0.6rem 0 0; padding-left: 1.1rem; }
.area__detail li { margin-bottom: 0.3rem; }
.area__cta {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.9rem;
  font-size: 0.82rem; font-weight: 700; color: var(--brand);
}

/* ============================================================
   Pipeline walkthrough
   ============================================================ */
.pipe { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; align-items: start; }

.pipe__rail { display: flex; flex-direction: column; gap: 0.5rem; position: sticky; top: calc(var(--nav-h) + 20px); }

.pipe__step {
  display: flex; gap: 0.85rem; align-items: center; text-align: left; width: 100%;
  padding: 0.85rem 1rem; border-radius: var(--r); font-family: inherit;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; transition: var(--t);
}
.pipe__step:hover { border-color: var(--step-c); transform: translateX(3px); }
.pipe__step.is-active {
  border-color: var(--step-c);
  background: color-mix(in srgb, var(--step-c) 9%, var(--surface));
  box-shadow: var(--shadow-1);
}

.pipe__num {
  width: 27px; height: 27px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--step-c); color: #fff;
  font-size: 0.76rem; font-weight: 800;
}
.pipe__name { font-size: 0.94rem; font-weight: 700; display: block; }
.pipe__sub { font-size: 0.76rem; color: var(--ink-3); display: block; margin-top: 0.06rem; }

.pipe__panel {
  padding: 1.9rem; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.pipe__eyebrow {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--step-c, var(--brand));
}
.pipe__panel h3 { font-size: 1.4rem; margin: 0.4rem 0 0.7rem; }
.pipe__lead { font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: 0.7rem; }
.pipe__body { font-size: 0.92rem; color: var(--ink-2); margin: 0; }

.pipe__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.2rem; }
.pipe__tag {
  font-size: 0.75rem; font-weight: 700; padding: 0.28rem 0.62rem; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}

/* ============================================================
   Publication explorer
   ============================================================ */
.pub-tools {
  display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center;
  margin-bottom: 1.5rem;
}

.search {
  position: relative; flex: 1 1 240px; min-width: 200px;
}
.search input {
  width: 100%; padding: 0.6rem 0.9rem 0.6rem 2.3rem;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 0.88rem; transition: var(--t);
}
.search input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-wash); }
.search i { position: absolute; left: 0.82rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 0.85rem; }

.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.pill {
  padding: 0.42rem 0.85rem; border-radius: 999px; font-family: inherit;
  font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: var(--t);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.pill:hover { border-color: var(--brand); color: var(--brand); }
.pill.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.pub-count { font-size: 0.82rem; color: var(--ink-3); font-weight: 600; margin-left: auto; }

.pub-list { display: flex; flex-direction: column; gap: 0.85rem; }

.pub {
  display: grid; grid-template-columns: 152px 1fr; gap: 1.3rem;
  padding: 1.2rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  transition: var(--t);
}
.pub:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.pub.is-hidden { display: none; }
.pub.is-lead { border-left: 3px solid var(--brand); }

.pub__fig {
  border-radius: 9px; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface-2); aspect-ratio: 16 / 10;
  display: grid; place-items: center; cursor: zoom-in;
}
.pub__fig img { width: 100%; height: 100%; object-fit: cover; }
.pub__fig--ph {
  cursor: default; font-size: 0.72rem; font-weight: 800; color: var(--ink-3);
  text-align: center; padding: 0.5rem; letter-spacing: 0.02em;
}

.pub__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }

.tag {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.tag--venue { background: var(--brand-wash); border-color: transparent; color: var(--brand); }
.tag--rank  { background: var(--accent-wash); border-color: transparent; color: var(--accent); }
.tag--q1    { background: rgba(180, 83, 9, 0.12); border-color: transparent; color: var(--warn); }
.tag--ok    { background: rgba(14, 138, 138, 0.14); border-color: transparent; color: var(--accent); }
.tag--wip   { background: var(--surface-2); color: var(--ink-3); }

.pub h3 { font-size: 1rem; line-height: 1.4; margin-bottom: 0.35rem; }
.pub h3 a { color: var(--ink); }
.pub h3 a:hover { color: var(--brand); }

.pub__authors { font-size: 0.83rem; color: var(--ink-2); margin: 0 0 0.3rem; }
.pub__authors .me { color: var(--ink); font-weight: 700; }
.pub__venue { font-size: 0.81rem; color: var(--ink-3); margin: 0 0 0.7rem; }

.pub__links { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.link-btn {
  display: inline-flex; align-items: center; gap: 0.34rem;
  font-size: 0.76rem; font-weight: 700; padding: 0.3rem 0.62rem;
  border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); transition: var(--t);
}
.link-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-wash); }

.empty {
  padding: 3rem 1rem; text-align: center; color: var(--ink-3);
  border: 1px dashed var(--line-strong); border-radius: var(--r);
}
.empty i { font-size: 1.6rem; display: block; margin-bottom: 0.7rem; opacity: 0.5; }

/* ============================================================
   Project cards
   ============================================================ */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }

.project {
  display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); transition: var(--t);
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); border-color: var(--line-strong); }
.project__img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.project__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.project:hover .project__img img { transform: scale(1.04); }
.project__body { padding: 1.2rem 1.3rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.project h3 { font-size: 1.02rem; margin-bottom: 0.4rem; }
.project p { font-size: 0.87rem; color: var(--ink-2); flex: 1; margin-bottom: 0.9rem; }

/* ============================================================
   PI card
   ============================================================ */
.pi { display: grid; grid-template-columns: 260px 1fr; gap: 2.4rem; align-items: start; }

.pi__card {
  padding: 1.5rem; border-radius: var(--r-lg); text-align: center;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  position: sticky; top: calc(var(--nav-h) + 20px);
}
.pi__photo {
  width: 132px; height: 132px; border-radius: 50%; margin: 0 auto 1rem;
  object-fit: cover; border: 3px solid var(--surface); box-shadow: var(--shadow-2);
}
.pi__name { font-size: 1.12rem; margin-bottom: 0.2rem; }
.pi__role { font-size: 0.82rem; color: var(--brand); font-weight: 700; }
.pi__aff { font-size: 0.79rem; color: var(--ink-3); margin-top: 0.35rem; line-height: 1.5; }
.pi__social { display: flex; justify-content: center; gap: 0.4rem; margin-top: 1.1rem; }

.pi__bio p { font-size: 0.96rem; color: var(--ink-2); }
.pi__bio p strong { color: var(--ink); }

.cv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.1rem; margin-top: 2rem; }

.cv-block {
  padding: 1.25rem 1.35rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
}
.cv-block h4 {
  font-size: 0.72rem; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.85rem;
}
.cv-item { padding-bottom: 0.85rem; margin-bottom: 0.85rem; border-bottom: 1px solid var(--line); }
.cv-item:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.cv-item strong { display: block; font-size: 0.9rem; color: var(--ink); }
.cv-item span { display: block; font-size: 0.8rem; color: var(--ink-2); margin-top: 0.1rem; }
.cv-item em { display: block; font-style: normal; font-size: 0.74rem; color: var(--ink-3); margin-top: 0.15rem; }

/* ============================================================
   Timeline
   ============================================================ */
.timeline { position: relative; padding-left: 1.9rem; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--brand), var(--accent), transparent);
}

.tl-item { position: relative; padding-bottom: 1.5rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -1.9rem; top: 0.42rem;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--brand);
}
.tl-item.is-new::before { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash); }

.tl-date { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.tl-text { font-size: 0.92rem; color: var(--ink-2); margin: 0.2rem 0 0; }
.tl-text strong { color: var(--ink); }

.tl-more { display: none; }
.timeline.is-expanded .tl-more { display: block; }

/* ============================================================
   Contact / join
   ============================================================ */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }

.contact-card {
  padding: 1.5rem; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); transition: var(--t);
}
.contact-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.contact-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.contact-card p { font-size: 0.88rem; color: var(--ink-2); margin-bottom: 1rem; }

.mail-row {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.62rem 0.8rem;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
  margin-bottom: 0.5rem; font-size: 0.85rem;
}
.mail-row a { flex: 1; font-family: var(--mono); font-size: 0.8rem; word-break: break-all; }
.mail-row .icon-btn { width: 30px; height: 30px; font-size: 0.78rem; }
.mail-row .icon-btn.is-copied { color: var(--accent); border-color: var(--accent); }

.join-list { list-style: none; padding: 0; margin: 0; }
.join-list li {
  display: flex; gap: 0.6rem; align-items: flex-start;
  font-size: 0.88rem; color: var(--ink-2); margin-bottom: 0.6rem;
}
.join-list i { color: var(--accent); margin-top: 0.25rem; font-size: 0.8rem; flex: 0 0 auto; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 2.5rem 0; border-top: 1px solid var(--line);
  background: var(--bg-sunk); font-size: 0.84rem; color: var(--ink-3);
}
.footer__inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--brand); }

/* ============================================================
   Lightbox, to-top, reveal
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; flex-direction: column;
  gap: 1rem; padding: 2rem; background: rgba(6, 9, 14, 0.93);
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 80vh; object-fit: contain; border-radius: 10px; background: #fff; }
.lightbox p { color: #d9dee8; font-size: 0.86rem; max-width: 780px; text-align: center; margin: 0; }
.lightbox__close {
  position: absolute; top: 1.2rem; right: 1.4rem; background: none; border: none;
  color: #fff; font-size: 2.1rem; line-height: 1; cursor: pointer; opacity: 0.75;
}
.lightbox__close:hover { opacity: 1; }

.to-top {
  position: fixed; bottom: 1.6rem; right: 1.6rem; z-index: 90;
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  cursor: pointer; box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: var(--t);
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

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

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .pipe { grid-template-columns: 1fr; }
  .pipe__rail { position: static; }
  .pi { grid-template-columns: 1fr; }
  .pi__card { position: static; max-width: 320px; margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav__burger { display: grid; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.15rem;
    padding: 0.7rem 1.2rem 1.1rem; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2); display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__tools { margin-left: auto; }
  .pub { grid-template-columns: 1fr; }
  .pub__fig { max-width: 260px; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .hero { padding-top: 3.2rem; }
  .section { padding: 3.2rem 0; }
  .pub-count { margin-left: 0; width: 100%; }
}

@media print {
  .nav, .to-top, .pub-tools, .lightbox { display: none !important; }
  .pub.is-hidden { display: grid !important; }
}

/* ============================================================
   PRAXIS-specific components
   ============================================================ */

/* --- Callouts --- */
.callout {
  padding: 1.3rem 1.5rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); font-size: 0.94rem; line-height: 1.65;
  color: var(--ink-2); margin-top: 1.8rem;
}
.callout strong { color: var(--ink); }
.callout--brand { border-left-color: var(--brand); }

/* --- Radar chart --- */
.radar { display: grid; grid-template-columns: 1fr 250px; gap: 2rem; align-items: start; }

.radar__plot {
  padding: 1rem; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); position: relative;
}
.radar__plot svg { width: 100%; height: auto; display: block; overflow: visible; }

.radar__axis-label { font-size: 10.5px; font-weight: 700; fill: var(--ink-2); }
.radar__grid { fill: none; stroke: var(--line); stroke-width: 1; }
.radar__spoke { stroke: var(--line); stroke-width: 1; }
.radar__tick { font-size: 9px; fill: var(--ink-3); }

.radar__side { display: flex; flex-direction: column; gap: 0.45rem; }
.radar__side h4 {
  font-size: 0.72rem; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.3rem;
}

.agent-toggle {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  padding: 0.55rem 0.75rem; border-radius: 10px; font-family: inherit;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; transition: var(--t); text-align: left;
}
.agent-toggle:hover { border-color: var(--agent-c); }
.agent-toggle.is-on { border-color: var(--agent-c); background: color-mix(in srgb, var(--agent-c) 9%, var(--surface)); }

.agent-swatch {
  width: 13px; height: 13px; border-radius: 4px; flex: 0 0 auto;
  background: var(--surface-2); border: 2px solid var(--agent-c); transition: var(--t);
}
.agent-toggle.is-on .agent-swatch { background: var(--agent-c); }

.agent-name { font-size: 0.86rem; font-weight: 700; color: var(--ink); }
.agent-score { font-size: 0.74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: auto; }
.agent-toggle.is-priv .agent-name::after {
  content: 'privileged'; display: inline-block; margin-left: 0.4rem;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); vertical-align: 1px;
}

/* --- Mean explorer --- */
.mean-lab {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: center;
  padding: 1.7rem; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}

.mean-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.mean-row { display: grid; grid-template-columns: 6.5rem 1fr 3rem; align-items: center; gap: 0.7rem; }
.mean-row span:first-child { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); text-align: right; }
.mean-track { height: 1.15rem; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.mean-fill { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--brand); transition: width 0.2s var(--ease); }
.mean-row.is-dragged .mean-fill { background: var(--accent); }
.mean-row > span:last-child { font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

.mean-out { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.2rem; }
.mean-card {
  padding: 1rem; border-radius: var(--r); text-align: center;
  border: 1px solid var(--line); background: var(--surface-2);
}
.mean-card.is-key { border-color: var(--brand); background: var(--brand-wash); }
.mean-card em { display: block; font-style: normal; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
.mean-card.is-key em { color: var(--brand); }
.mean-card b { display: block; font-size: 1.9rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; margin-top: 0.2rem; }

.slider-row { margin-top: 1rem; }
.slider-row label { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--ink-2); margin-bottom: 0.35rem; }
.slider-row label b { color: var(--accent); font-variant-numeric: tabular-nums; }
.slider-row input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }

/* --- Family explorer --- */
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 0.9rem; }

.fam {
  padding: 1.1rem 1.2rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); transition: var(--t);
}
.fam:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.fam.is-hidden { display: none; }

.fam__top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.fam__tier {
  font-size: 0.66rem; font-weight: 900; letter-spacing: 0.04em;
  padding: 0.15rem 0.42rem; border-radius: 5px; color: #fff; background: var(--tier-c);
}
.fam__id { font-family: var(--mono); font-size: 0.79rem; font-weight: 700; color: var(--ink); word-break: break-all; }
.fam__desc { font-size: 0.85rem; color: var(--ink-2); margin: 0 0 0.7rem; line-height: 1.55; }
.fam__axes { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.fam__axis {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 0.16rem 0.44rem; border-radius: 5px;
  background: var(--brand-wash); color: var(--brand);
}

/* --- Data tables --- */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }

table.data { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 640px; }

table.data th, table.data td {
  padding: 0.7rem 0.85rem; text-align: right; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2);
  border-bottom: 2px solid var(--line-strong); white-space: nowrap;
}
table.data th.txt, table.data td.txt { text-align: left; }
table.data tbody th { text-align: left; font-weight: 700; color: var(--ink); white-space: nowrap; }
table.data tbody tr:last-child th, table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr.is-priv { background: var(--accent-wash); }
table.data tr.is-priv:hover { background: var(--accent-wash); }
table.data tr.is-best th { color: var(--brand); }

th.sortable { cursor: pointer; user-select: none; transition: var(--t); }
th.sortable:hover { color: var(--brand); }
th.sortable i { margin-left: 0.25rem; opacity: 0.35; font-size: 0.65rem; }
th.sortable.is-sorted i { opacity: 1; color: var(--brand); }

.zero { color: var(--danger); font-weight: 800; }
.na { color: var(--ink-3); }

.table-note { font-size: 0.82rem; color: var(--ink-3); margin-top: 1rem; line-height: 1.6; }
.table-note strong { color: var(--ink-2); }

/* --- Chunking ablation bars --- */
.chunk { display: flex; flex-direction: column; gap: 0.75rem; }
.chunk__row { display: grid; grid-template-columns: 11rem 1fr 1fr 4.2rem; gap: 0.8rem; align-items: center; }
.chunk__name { font-size: 0.85rem; font-weight: 700; color: var(--ink-2); text-align: right; }
.chunk__row.is-flag .chunk__name { color: var(--accent); }
.chunk__pair { display: flex; flex-direction: column; gap: 0.22rem; }
.chunk__bar { height: 0.72rem; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.chunk__fill { display: block; height: 100%; width: 0; border-radius: 4px; transition: width 0.6s var(--ease); }
.chunk__fill.is-control { background: var(--brand); }
.chunk__fill.is-recovery { background: var(--accent); }
.chunk__ret { font-size: 0.86rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.chunk__ret.is-low { color: var(--danger); }
.chunk__key { display: flex; gap: 1.2rem; justify-content: center; margin-top: 1rem; font-size: 0.78rem; color: var(--ink-3); }
.chunk__key i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 0.35rem; }

/* --- Pair diagram --- */
.pair {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.2rem; align-items: center;
  padding: 1.6rem; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.pair__side { text-align: center; }
.pair__tag {
  display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em;
  text-transform: uppercase; padding: 0.2rem 0.55rem; border-radius: 5px; margin-bottom: 0.7rem;
}
.pair__tag.is-base { background: var(--brand-wash); color: var(--brand); }
.pair__tag.is-twin { background: var(--accent-wash); color: var(--accent); }
.pair__side svg { width: 100%; max-width: 230px; height: auto; margin: 0 auto; display: block; }
.pair__side p { font-size: 0.82rem; color: var(--ink-2); margin: 0.7rem 0 0; }
.pair__delta { text-align: center; color: var(--ink-3); }
.pair__delta b { display: block; font-size: 1.5rem; color: var(--brand); font-weight: 900; }
.pair__delta span { font-size: 0.74rem; }

@media (max-width: 980px) {
  .radar { grid-template-columns: 1fr; }
  .mean-lab { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .pair__delta { padding: 0.6rem 0; }
}
@media (max-width: 640px) {
  .chunk__row { grid-template-columns: 6.5rem 1fr 3.4rem; }
  .chunk__pair:nth-of-type(2) { display: none; }
  .mean-out { grid-template-columns: 1fr; }
}
