/* =========================================================
   Multimodal Interaction Estimation for Contact-Aware
   Adaptive Impedance Control — project page styles.
   Editorial flow, cards used sparingly for emphasis.
   ========================================================= */
:root {
  --bg: #ffffff;
  --card: #ffffff;

  --ink: #14181f;
  --ink-muted: #6b7280;
  --ink-invert: #fbfbfd;

  /* Theme colors: blue + green, sampled from the framework diagram. */
  --accent: #4c6594;        /* blue  — Force Encoder */
  --accent-navy: #0d1f38;   /* very dark blue, for the title gradient */
  --accent-green: #4d934d;  /* green — Prediction Token / Transformer */

  /* Gradient systems */
  --grad-cta:    linear-gradient(92deg, #4c6594 0%, #4d934d 100%);
  --grad-title:  linear-gradient(92deg, #0d1f38 0%, #4c6594 55%, #4d934d 100%);

  --radius:    22px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow:    0 1px 2px rgba(20,24,31,.04), 0 10px 30px rgba(20,24,31,.07);
  --shadow-lg: 0 1px 2px rgba(20,24,31,.04), 0 10px 24px rgba(20,24,31,.07);
  --max-w: 1040px;
  --gap: 26px;
  --gap-sm: 14px;

  --hairline: 1px solid rgba(20,24,31,.09);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Section primitives -------------------------------------- */
.section { position: relative; }
.section--divided { margin-top: 8px; padding-top: 30px; border-top: var(--hairline); }

/* Card primitive (used sparingly) -------------------------- */
.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Kicker label ---------------------------------------------- */
.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 18px; height: 1px;
  background: currentColor;
  vertical-align: middle;
  margin: 0 8px 2px 0;
  opacity: .55;
}

/* Typography -------------------------------------------------- */
h1, h2, h3 { margin: 0; line-height: 1.15; color: var(--ink); letter-spacing: -.022em; }
h1 { font-size: 44px; font-weight: 800; }
h2 { font-size: 26px; font-weight: 700; margin-bottom: 10px; }
h3 { font-size: 18px; font-weight: 700; }
p  { margin: 0 0 10px; color: var(--ink); }
p.muted, .muted { color: var(--ink-muted); }
.num { font-variant-numeric: tabular-nums; }

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

/* Pill buttons ------------------------------------------------ */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: #fff;
  padding: 9px 8px 9px 18px;
  border-radius: 999px;
  background: var(--grad-cta);
  border: none;
  box-shadow: 0 6px 18px rgba(76,101,148,.28);
  transition: transform .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(76,101,148,.34); text-decoration: none; color: #fff; }
.btn__arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--accent-navy);
  color: #fff;
  font-size: 14px; line-height: 1;
}
.btn--ghost {
  background: rgba(255,255,255,.75);
  color: var(--ink);
  border: 1px solid rgba(20,24,31,.12);
  box-shadow: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn--ghost:hover { box-shadow: 0 10px 24px rgba(20,24,31,.08); color: var(--ink); background: #fff; }
.btn--ghost .btn__arrow { background: #eef0fb; color: var(--ink); }
.btn--inactive { opacity: .6; cursor: not-allowed; pointer-events: none; }
.btn__tag {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(20,24,31,.08);
  color: var(--ink-muted);
}

/* Grid helpers -------------------------------------------------- */
.row { display: grid; gap: var(--gap-sm); }
.row > * { min-width: 0; }
.row--hero { grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px; }
.row--split { grid-template-columns: 1.3fr 1fr; align-items: center; gap: 32px; }

code, pre, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ============ HERO (editorial, no card) ==================== */
.hero { padding: 0; }
.hero h1 {
  font-size: 32px;
  background: var(--grad-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 4px;
}
.hero__subtitle { font-size: 18px; color: var(--ink-muted); margin-top: 14px; max-width: 48ch; }

.hero__visual {
  position: relative;
  width: 100%;
}
.hero__visual img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius);
  background: #fff;
  padding: 22px;
  border: none;
  box-shadow: none;
}

/* ============ ABSTRACT (editorial, no card) ================ */
.abstract h2 { max-width: none; }
.abstract__body { max-width: none; text-align: justify; }
.abstract__body p { font-size: 14px; color: var(--ink); }
.abstract__video { max-width: 620px; margin: 0 auto 24px; }
.abstract__video video {
  width: 100%; height: auto; display: block;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

/* ============ EXPERIMENTS ==================================== */
.lede {
  font-size: 19px; font-weight: 500; color: var(--ink-muted);
  max-width: 60ch; margin: 0;
}

.experiments__nav {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 20px;
}
.experiments__nav a {
  font-size: 13px; font-weight: 600; color: var(--ink-muted);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(20,24,31,.14);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.experiments__nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
  background: #f4f6fa;
}

.experiments__tasks {
  display: flex; flex-direction: column;
  margin-top: 40px;
}

/* ============ RESULT TASKS (nested inside Experiments) ======= */
.task { margin-top: 56px; scroll-margin-top: 24px; }
.task:first-child { margin-top: 0; }
.task h3 { font-size: 22px; color: var(--accent); margin-bottom: 8px; }
.task__head { margin-bottom: 4px; }

.task__media { margin-top: 16px; }
.task__media img,
.task__media video {
  width: 100%; height: auto; display: block;
}
.task__media img { max-width: 760px; margin: 0 auto; background: #fff; border: none; padding: 6px; border-radius: 0; box-shadow: none; }
.task__media video { max-width: 760px; margin: 0 auto; border-radius: 0; background: #fff; box-shadow: none; }

/* Side-by-side video comparison (e.g. Fixed Gain vs Adaptive) */
.compare {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 64px; flex-wrap: wrap;
}
.compare__item {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin: 0;
}
.task__media .compare video {
  width: auto; height: 340px; max-width: 100%;
  display: block; margin: 0; border-radius: 0; background: #fff; box-shadow: none;
}
.compare__item figcaption {
  font-size: 16px; font-weight: 700; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: .06em;
}

@media (max-width: 640px) {
  .task__media .compare video { height: 220px; }
}

.task__body { margin-top: 16px; }
.task__body img {
  width: 100%; height: auto; display: block;
  margin-bottom: 16px;
  background: #fff; border-radius: 0; box-shadow: none;
}
.task__body p { font-size: 14px; color: var(--ink); text-align: justify; margin: 0; }

.task__placeholder {
  margin-top: 16px;
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed rgba(20,24,31,.2);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: 14px;
  background: #fafbfc;
}
.task__placeholder p { margin: 0; }

.trial-picker { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
.trial-picker__btn {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-muted);
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(20,24,31,.14);
  background: #fff; cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.trial-picker__btn:hover { color: var(--accent); border-color: var(--accent); background: #f4f6fa; }
.trial-picker__btn.is-active { color: #fff; border-color: var(--accent); background: var(--accent); }

.placeholder-row { display: flex; gap: 60px; align-items: flex-start; justify-content: center; }
.placeholder-row .task__placeholder { flex: 1 1 0; min-width: 0; margin-top: 0; }
.placeholder-row .compare__item { flex: 0 1 240px; min-width: 0; gap: 8px; }
.placeholder-row .compare__item video {
  width: 100%; height: auto; aspect-ratio: 1 / 1; max-width: none;
  display: block; margin: 0; border-radius: 0; background: #fff; box-shadow: none;
}

@media (max-width: 640px) {
  .placeholder-row { flex-direction: column; }
}

/* Split layout: text + video side-by-side (Intent Estimation) */
.task--split .row--split { margin-top: 16px; grid-template-columns: 1.7fr 1fr; gap: 20px; }
.task--split .task__media { margin-top: 0; }
.task--split .task__body { margin-top: 0; }
.task--split .task__media video { max-width: 320px; }

/* ============ IMPLEMENTATION DETAILS AND PROOFS ============== */
.implementation__grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.implementation__col-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  margin-bottom: 8px;
}
.implementation__col h3 { font-size: 15px; color: var(--accent); margin-bottom: 0; }
.implementation__col p { font-size: 14px; color: var(--ink); margin: 0; text-align: justify; }
.implementation__cta { margin-top: 28px; }

.col-link {
  display: inline-flex; align-items: center; gap: 4px;
  flex: 0 0 auto;
  padding: 3px 10px 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(20,24,31,.16);
  color: var(--accent);
  font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.col-link span { font-size: 10px; }
.col-link:hover { background: #eef1f6; border-color: var(--accent); text-decoration: none; }

@media (max-width: 820px) {
  .implementation__grid { grid-template-columns: 1fr; gap: 22px; }
}

/* ============ FOOTER ========================================= */
.page-footer {
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; text-align: center;
  margin-top: 12px;
  font-size: 12.5px; color: var(--ink-muted);
  padding: 22px 6px 0;
  border-top: var(--hairline);
}
.page-footer a { color: var(--ink-muted); text-decoration: underline; text-underline-offset: 2px; }
.page-footer a:hover { color: var(--accent); }

/* Scroll-reveal -------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease-out, transform .7s ease-out; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Responsive ------------------------------------------------------ */
@media (max-width: 820px) {
  .page { padding: 40px 18px 56px; gap: 34px; }
  h1 { font-size: 34px; }
  .hero h1 { font-size: 26px; }
  h2 { font-size: 22px; }
  .row--hero, .row--split, .task--split .row--split { grid-template-columns: 1fr; }
  .task--split .task__media { order: -1; }
}
