/* ============================================================
   UI-Mate project page — Tencent Hunyuan visual language
   ============================================================ */

:root {
  /* Tencent / Hunyuan blues sampled from the brand mark */
  --hy-blue: #0052d9;
  --hy-blue-600: #0043b3;
  --hy-blue-400: #2b7cff;
  --hy-cyan: #4ecbff;
  --hy-cyan-soft: #a5e4ff;

  --ink: #0a0e18;
  --ink-2: #1c2333;
  --body: #4a5568;
  --muted: #7b869b;
  --line: #e6eaf2;
  --line-soft: #eff2f8;
  --bg: #ffffff;
  --tint: #f6f8fc;
  --dark: #070b16;

  --grad: linear-gradient(120deg, var(--hy-blue) 0%, var(--hy-blue-400) 48%, var(--hy-cyan) 100%);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;

  --shadow-s: 0 1px 2px rgba(10, 14, 24, 0.05), 0 4px 14px rgba(10, 14, 24, 0.04);
  --shadow-m: 0 2px 6px rgba(10, 14, 24, 0.05), 0 18px 44px rgba(10, 14, 24, 0.08);
  --shadow-blue: 0 10px 30px rgba(0, 82, 217, 0.24);

  --nav-h: 64px;
  --wrap: 1160px;

  /* Control heights — every pill picks one of these so edges line up */
  --ctl-nav: 34px;
  --ctl-sm: 32px;
  --ctl-md: 38px;
  --ctl-lg: 44px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  max-width: 100%;
}

/* Chinese copy reads better slightly looser and less tight */
html[lang="zh"] body { line-height: 1.85; }
html[lang="zh"] .hero-title .hero-sub { letter-spacing: 0; }

h1, h2, h3, h4 { color: var(--ink); font-weight: 700; margin: 0; line-height: 1.25; }
p { margin: 0; }
a { color: var(--hy-blue); text-decoration: none; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.36em;
  color: var(--ink-2);
}
.mono { font-family: var(--mono); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  min-width: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-m);
}
.skip-link:focus { left: 16px; }

/* icon defaults ------------------------------------------------ */
svg { width: 100%; height: 100%; display: block; fill: currentColor; }
svg .stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   NAV
   ============================================================ */
/* The height lives on .nav-inner so the 1px border does not eat into it and
   push every control half a pixel off the bar's centre. */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.nav.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 20px rgba(10, 14, 24, 0.05);
}

.nav-inner {
  height: var(--nav-h);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-brand { display: flex; align-items: center; gap: 12px; flex: none; }
.nav-brand img { height: 22px; width: auto; display: block; }
.nav-divider { width: 1px; height: 18px; background: var(--line); }
.nav-product {
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
/* Control heights are fixed and line-height is reset, so a pill is the same
   size in both languages — the body line-height differs between them. */
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--ctl-nav);
  padding: 0 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--body);
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); background: var(--tint); }
.nav-links a.is-active { color: var(--hy-blue); background: rgba(0, 82, 217, 0.07); }

.nav-actions { display: flex; align-items: center; gap: 12px; flex: none; }

.lang-switch {
  display: flex;
  padding: 3px;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.lang-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 3px track padding plus a 1px track border on each side, so the whole
     group ends up exactly --ctl-nav tall like the nav pills beside it */
  height: calc(var(--ctl-nav) - 8px);
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  padding: 0 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.is-active {
  color: #fff;
  background: var(--hy-blue);
  box-shadow: 0 2px 8px rgba(0, 82, 217, 0.3);
}

.nav-burger {
  display: none;
  width: var(--ctl-nav);
  height: var(--ctl-nav);
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}
.nav-burger span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.22s, opacity 0.22s;
}
/* 7.25px is the exact distance from an outer bar's centre to the middle bar
   at this height and padding, so the two strokes cross cleanly. */
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.25px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.25px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 96px;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.orb-a {
  width: 620px; height: 620px;
  top: -280px; left: 50%;
  transform: translateX(-58%);
  background: radial-gradient(circle at 35% 35%, rgba(0, 82, 217, 0.5), rgba(0, 82, 217, 0) 68%);
}
.orb-b {
  width: 520px; height: 520px;
  top: -150px; right: -140px;
  background: radial-gradient(circle at 50% 50%, rgba(78, 203, 255, 0.55), rgba(78, 203, 255, 0) 68%);
}
.orb-c {
  width: 440px; height: 440px;
  top: 60px; left: -180px;
  background: radial-gradient(circle at 50% 50%, rgba(43, 124, 255, 0.35), rgba(43, 124, 255, 0) 70%);
}
.grid-mask {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(10, 14, 24, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10, 14, 24, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 62% at 50% 26%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 62% at 50% 26%, #000 0%, transparent 78%);
}

.hero-inner { text-align: center; }

.hero-name {
  display: block;
  font-size: clamp(52px, 9vw, 96px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  display: block;
  max-width: 38ch;
  margin: 18px auto 0;
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.28;
  color: var(--ink);
}

.hero-tagline {
  max-width: 60ch;
  margin: 24px auto 0;
  font-size: 17.5px;
  color: var(--body);
  overflow-wrap: anywhere;
}

.hero-team { margin-top: 34px; }
.team-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-2);
}
.team-note { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: var(--ctl-lg);
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-2);
  box-shadow: var(--shadow-s);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s, background 0.18s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); border-color: #d5dcea; }
.btn svg { width: 17px; height: 17px; flex: none; color: var(--hy-blue); }
.btn-primary {
  /* A gradient is sized to the padding box but painted across the border box, so
     under a border the tile wraps and lays a 1px ring of the gradient's opposite
     end around the shape. The trailing border-box sizes it to the painted area.
     Every gradient that sits under a border needs it. */
  background: var(--grad) border-box;
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover { box-shadow: 0 14px 38px rgba(0, 82, 217, 0.34); }
.btn-primary svg { color: #fff; }
.btn-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--tint);
  border: 1px solid var(--line);
  color: var(--hy-blue);
}
.btn-logo { width: 18px; height: 18px; flex: none; }
.btn-logo-wide { width: auto; height: 15px; }
.btn.is-pending { border-style: dashed; }
.btn.is-pending:not(.btn-primary) { color: var(--muted); }
.btn.is-pending::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--hy-cyan);
  box-shadow: 0 0 0 3px rgba(78, 203, 255, 0.22);
}

/* ============================================================
   SECTION SHELL
   ============================================================ */
.section { padding: 96px 0; }
.section-tint { background: var(--tint); border-block: 1px solid var(--line); }
.section-dark { background: var(--dark); }

.sec-head { max-width: none; margin-bottom: 48px; }
.sec-kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hy-blue);
  padding-bottom: 12px;
}
html[lang="zh"] .sec-kicker { text-transform: none; letter-spacing: 0.08em; }
.sec-title {
  font-size: clamp(30px, 4.2vw, 44px);
  letter-spacing: -0.028em;
  line-height: 1.14;
  overflow-wrap: anywhere;
}
.sec-lede {
  margin-top: 18px;
  font-size: 17px;
  color: var(--body);
  max-width: 54rem;
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: anywhere;
  word-break: normal;
}
.sec-head-dark .sec-title { color: #fff; }
.sec-head-dark .sec-lede { color: rgba(255, 255, 255, 0.66); }
.sec-head-dark .sec-kicker { color: var(--hy-cyan); }

.mini-title { font-size: 18px; letter-spacing: -0.012em; }
.prose { margin-top: 12px; margin-bottom: 30px; }
.prose:last-child { margin-bottom: 0; }
.side-note { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.note-mark { margin-left: 1px; font-size: 0.75em; color: var(--muted); }

/* ============================================================
   OVERVIEW
   ============================================================ */
.abstract {
  max-width: 78ch;
  display: grid;
  gap: 18px;
  font-size: 17px;
  color: var(--body);
  padding-left: 22px;
  border-left: 2px solid;
  border-image: var(--grad) 1;
}
.abstract strong { color: var(--ink); font-weight: 650; }
.abstract em { color: var(--hy-blue); font-style: normal; font-weight: 600; }

.highlight-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.highlight-row li {
  background: #fff;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hl-num {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hl-num small { font-size: 0.5em; font-weight: 500; }
.hl-num-pair {
  font-size: 26px;
  letter-spacing: -0.04em;
}
.hl-arrow {
  display: inline-block;
  margin: 0 0.18em;
  font-weight: 500;
  opacity: 0.85;
}
.hl-label { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* ============================================================
   FIGURES
   ============================================================ */
.fig {
  margin: 28px 0 0;
  padding: 0;
}
.fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-s);
}
.fig figcaption {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.fig-teaser { margin-top: 40px; }
.fig-wide { margin-top: 40px; }
.fig-sm {
  max-width: 920px;
  margin-inline: auto;
}
.pillar .fig { margin-top: 20px; }
.pillar .fig img { box-shadow: none; }

/* ============================================================
   APPROACH PILLARS
   ============================================================ */
.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.pillar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 28px 30px;
  box-shadow: var(--shadow-s);
}
.pillar-idx {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--hy-blue);
  margin-bottom: 10px;
}
.pillar h3 {
  font-size: 20px;
  letter-spacing: -0.016em;
}
.pillar > p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--body);
  max-width: none;
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: anywhere;
}

/* ============================================================
   DEMO FLOW ANIMATION
   ============================================================ */
.flow {
  margin-top: 22px;
  display: grid;
  gap: 10px;
  padding: 18px 0 4px;
  border-top: 1px solid var(--line);
  background: transparent;
}
.flow-phase-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.flow-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hy-blue);
  background: rgba(0, 82, 217, 0.08);
  border: 1px solid rgba(0, 82, 217, 0.14);
}
html[lang="zh"] .flow-badge { text-transform: none; letter-spacing: 0.04em; }
.flow-badge-on {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.16);
}
.flow-phase-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

/* --- Offline cards --- */
.flow-offline {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.flow-card {
  flex: 1 1 0;
  min-width: 132px;
  position: relative;
  padding: 14px 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  opacity: 0.62;
  transform: translateY(4px);
  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.22, 0.8, 0.28, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}
.flow-card.is-done { opacity: 0.88; transform: none; }
.flow-card.is-active {
  opacity: 1;
  transform: none;
  border-color: rgba(0, 82, 217, 0.28);
  box-shadow: 0 10px 26px rgba(0, 82, 217, 0.12);
}
.flow-card-out.is-active {
  border-color: rgba(15, 118, 110, 0.32);
  box-shadow: 0 10px 26px rgba(15, 118, 110, 0.12);
}
.flow-card-n {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--hy-blue);
  background: rgba(0, 82, 217, 0.08);
}
.flow-card h4 {
  font-size: 13.5px;
  letter-spacing: -0.01em;
  padding-right: 18px;
}
.flow-card > p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--body);
}
.flow-chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}
.flow-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--tint);
  border: 1px solid var(--line);
}
.flow-chip-rec {
  color: #fff;
  background: #e11d48;
  border-color: #e11d48;
}
.flow-chip-ok {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.18);
}
.flow-mini-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.flow-mini-pair span {
  height: 28px;
  border-radius: 7px;
  border: 1px dashed #c9d4e8;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: linear-gradient(180deg, #f4f7fc, #fff);
}
.flow-mini-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.flow-mini-list li {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  text-align: center;
}

.flow-arrow {
  width: 16px;
  flex: 0 0 16px;
  align-self: center;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 82, 217, 0.15), rgba(0, 82, 217, 0.55));
  position: relative;
  opacity: 0.3;
  transition: opacity 0.35s ease;
}
.flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid rgba(0, 82, 217, 0.55);
  border-top: 2px solid rgba(0, 82, 217, 0.55);
  transform: translateY(-50%) rotate(45deg);
}
.flow-arrow.is-lit { opacity: 1; }

.flow-bridge {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 6px 0 4px;
  padding: 0 8px;
}
.flow-bridge-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 118, 110, 0.35), transparent);
  grid-column: 1 / -1;
  grid-row: 1;
}
.flow-bridge-label {
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0f766e;
  background: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.18);
}
.flow.is-bridging .flow-bridge-label {
  animation: flow-pulse 1.1s ease-in-out infinite;
  border-color: rgba(15, 118, 110, 0.4);
}

/* --- Online graph --- */
.flow-online {
  display: grid;
  grid-template-columns: minmax(168px, 1.45fr) auto minmax(170px, 1.25fr) auto minmax(100px, 0.8fr) auto minmax(100px, 0.8fr);
  grid-template-rows: auto auto;
  gap: 10px 6px;
  align-items: center;
  padding: 4px 0 0;
}
.flow-node {
  position: relative;
  z-index: 1;
  align-self: stretch;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  opacity: 0.48;
  transition:
    opacity 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    background 0.35s ease;
}
.flow-node.is-active {
  opacity: 1;
  border-color: rgba(0, 82, 217, 0.3);
  box-shadow: 0 10px 26px rgba(0, 82, 217, 0.12);
}
.flow-node.is-finished {
  opacity: 1;
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 10px 26px rgba(15, 118, 110, 0.12);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.06), #fff 60%);
}
.flow-node-harness.is-active {
  background: linear-gradient(180deg, rgba(0, 82, 217, 0.05), #fff 55%);
}
.flow-node h4 {
  font-size: 13.5px;
  letter-spacing: -0.01em;
}
.flow-node > p {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--body);
}
.flow-node-shot { grid-column: 1; grid-row: 1; }
.flow-node-harness { grid-column: 3; grid-row: 1; }
.flow-node-agent { grid-column: 5; grid-row: 1; }
.flow-node-desk { grid-column: 7; grid-row: 1; }

.flow-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  opacity: 0.28;
  transition: opacity 0.3s ease;
}
.flow-link > span {
  position: relative;
  display: inline-block;
  max-width: 7.5rem;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: var(--muted);
  padding: 0 2px;
}
.flow-link > span::before,
.flow-link > span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 1.5px;
  background: rgba(0, 82, 217, 0.35);
}
.flow-link > span::before { left: -12px; }
.flow-link > span::after {
  right: -14px;
  width: 6px;
  height: 6px;
  background: transparent;
  border-right: 1.5px solid rgba(0, 82, 217, 0.45);
  border-top: 1.5px solid rgba(0, 82, 217, 0.45);
  transform: translateY(-50%) rotate(45deg);
}
.flow-link.is-lit { opacity: 1; }
.flow-link.is-lit > span { color: var(--hy-blue); }
.flow-online > .flow-link[data-edge="obs"] { grid-column: 2; grid-row: 1; }
.flow-online > .flow-link[data-edge="guide"] { grid-column: 4; grid-row: 1; }
.flow-online > .flow-link[data-edge="act"] { grid-column: 6; grid-row: 1; }

.flow-feedback {
  grid-column: 3 / 8;
  grid-row: 2;
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 2px 0 4px;
}
.flow-link-back { opacity: 0.22; }
.flow-link-back > span::before,
.flow-link-back > span::after { display: none; }
.flow-link-back > span {
  max-width: none;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}
.flow-link-back.is-lit { opacity: 1; }
.flow-link-back[data-edge="done"].is-lit > span {
  color: #c2410c;
  border-color: rgba(194, 65, 12, 0.3);
}
.flow-link-back[data-edge="next"].is-lit > span {
  color: var(--hy-blue);
  border-color: rgba(0, 82, 217, 0.28);
}

.flow-screen {
  margin-top: 10px;
  height: 84px;
  border-radius: 10px;
  border: 1px solid #c9d3e4;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 6px 16px rgba(28, 45, 78, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.flow-screen-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 16px;
  padding: 0 8px;
  background: linear-gradient(180deg, #f6f7f9, #e8ebf0);
  border-bottom: 1px solid #d5dbe6;
}
.flow-screen-bar .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}
.flow-screen-body {
  flex: 1;
  display: grid;
  grid-template-columns: 28px 1fr;
  min-height: 0;
  background: #f4f7fb;
}
.flow-screen-side {
  background: #e8eef6;
  border-right: 1px solid #d7e0ef;
}
.flow-screen-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px 8px;
}
.flow-screen-main i {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(0, 82, 217, 0.45), rgba(78, 203, 255, 0.35));
}
.flow-screen-main i:nth-child(1) { width: 78%; }
.flow-screen-main i:nth-child(2) { width: 52%; }
.flow-screen-main i:nth-child(3) { width: 64%; }
.flow-node-shot.is-active .flow-screen {
  animation: flow-pulse 1.1s ease-in-out infinite;
}

.flow-check {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
}
.flow-check li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.55;
  transition: opacity 0.3s ease, color 0.3s ease;
}
.flow-check li span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #c5d0e2;
  flex: 0 0 auto;
  background: #fff;
}
.flow-check li.is-done {
  opacity: 0.85;
  color: #0f766e;
}
.flow-check li.is-done span {
  border-color: #0f766e;
  background: #0f766e;
  box-shadow: inset 0 0 0 2px #fff;
}
.flow-check li.is-current {
  opacity: 1;
  color: var(--hy-blue);
  font-weight: 600;
}
.flow-check li.is-current span {
  border-color: var(--hy-blue);
  background: rgba(0, 82, 217, 0.15);
  animation: flow-pulse 1.1s ease-in-out infinite;
}
.flow-status {
  margin-top: 10px !important;
  font-size: 11.5px !important;
  font-weight: 600;
  color: var(--hy-blue) !important;
}
.flow-node-harness.is-finished .flow-status {
  color: #0f766e !important;
}

.flow-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.flow-note code { font-size: 0.9em; }

@keyframes flow-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .flow-card, .flow-node, .flow-link, .flow-arrow { transition: none; animation: none !important; }
  .flow-card, .flow-node { opacity: 1; transform: none; }
  .flow-link { opacity: 0.75; }
  .flow-check li { opacity: 1; }
}

/* ============================================================
   RESULTS METRICS
   ============================================================ */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.metric {
  background: linear-gradient(180deg, rgba(0, 82, 217, 0.035), #fff 62%);
  border: 1px solid rgba(0, 82, 217, 0.12);
  border-radius: var(--r);
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-s);
  min-width: 0;
  overflow: hidden;
}
.metric-hi {
  border-color: rgba(0, 82, 217, 0.32);
  box-shadow: 0 0 0 1px rgba(0, 82, 217, 0.1), 0 10px 28px rgba(0, 82, 217, 0.1);
  background: linear-gradient(155deg, rgba(78, 203, 255, 0.16) 0%, rgba(0, 82, 217, 0.08) 42%, #fff 78%);
}
.metric-k {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--hy-blue);
  overflow-wrap: anywhere;
}
.metric-n {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
  /* These labels run just past one line in a quarter-width card, so the default
     greedy wrap drops a single word onto line two. Balancing evens the two lines,
     which lands the break on the separator instead. */
  text-wrap: balance;
}
.metric-v {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.metric-dim {
  font-size: 0.72em;
  font-weight: 600;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  background: none;
}

/* ============================================================
   CAPABILITY CARDS (legacy; unused on lean page)
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 28px 32px;
  box-shadow: var(--shadow-s);
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.22s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); border-color: #dbe3f0; }
.card:hover::before { opacity: 1; }
.card-accent { border-color: rgba(0, 82, 217, 0.22); background: linear-gradient(180deg, rgba(0, 82, 217, 0.035), #fff 44%) border-box; }
.card-accent::before { opacity: 1; }

.card-ico {
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 13px;
  background: linear-gradient(140deg, rgba(0, 82, 217, 0.1), rgba(78, 203, 255, 0.16));
  color: var(--hy-blue);
  margin-bottom: 18px;
}
.card h3 { font-size: 18px; letter-spacing: -0.014em; }
.card p { margin-top: 10px; font-size: 15px; color: var(--body); }
.card code { font-size: 0.84em; }

/* ============================================================
   METHOD — pipeline
   ============================================================ */
.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  gap: 0;
  margin-bottom: 64px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow-s);
  overflow: hidden;
}
.pipe-step {
  position: relative;
  padding: 26px 22px 28px;
  border-right: 1px solid var(--line-soft);
}
.pipe-step:last-child { border-right: 0; }
.pipe-step-final { background: linear-gradient(180deg, rgba(0, 82, 217, 0.045), rgba(78, 203, 255, 0.05)); }
.pipe-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--grad);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.pipe-step h4 { font-size: 15.5px; letter-spacing: -0.01em; }
.pipe-step p { margin-top: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.pipe-arrow { display: none; }

/* method split */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.split-main .prose { font-size: 16px; }

.split-side {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 26px 30px;
  box-shadow: var(--shadow-s);
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.stack { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; }
.stack li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tint);
}
.stack-n {
  flex: none;
  width: 48px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.stack-t { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.stack-hi {
  background: linear-gradient(120deg, rgba(0, 82, 217, 0.07), rgba(78, 203, 255, 0.09)) border-box;
  border-color: rgba(0, 82, 217, 0.22);
}
.stack-hi .stack-n { color: var(--hy-blue); }
.side-note-b { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

/* ============================================================
   RESULTS
   ============================================================ */
.subsets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.subset {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 22px 24px;
}
.subset-n {
  display: block;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--hy-blue);
  margin-bottom: 6px;
}
.subset h4 { font-size: 15.5px; }
.subset p { margin-top: 7px; font-size: 13.5px; color: var(--muted); line-height: 1.58; }

.table-card, .chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-s);
  max-width: 100%;
  min-width: 0;
}
.table-card + .chart-card { margin-top: 24px; }
.chart-card { margin-top: 24px; }
.table-card { margin-top: 0; }
.table-head { margin-bottom: 20px; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -6px;
  padding: 0 6px;
  max-width: 100%;
}
.rtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 720px;
}
.rtable th, .rtable td { text-align: left; padding: 14px 12px; }
.rtable thead th {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.rtable thead th small { display: block; font-weight: 500; font-size: 10.5px; opacity: 0.75; }
.rtable tbody th { font-weight: 600; }
.rtable tbody tr { border-bottom: 1px solid var(--line-soft); }
.rtable tbody tr:last-child { border-bottom: 0; }
.rtable .num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  white-space: nowrap;
}
.rtable thead .num { text-align: right; }
.rtable .num small { color: var(--muted); font-size: 0.8em; }
.rtable .num.strong { font-weight: 600; color: var(--hy-blue); }
.row-best { background: linear-gradient(90deg, rgba(0, 82, 217, 0.05), rgba(78, 203, 255, 0.05)); }
.row-best td, .row-best th { padding-block: 16px; }

.mtag { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.mtag::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 3px;
  background: var(--hy-blue);
  flex: none;
}
.mtag-base { color: var(--body); font-weight: 500; }
.mtag-base::before { background: #c3ccdd; }
.mtag-hi::before { background: var(--grad); }

.table-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
}

/* chart */
.legend { display: flex; gap: 20px; margin-bottom: 22px; font-size: 13px; color: var(--body); }
.lg { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: block; }
.sw-a { background: #cdd6e6; }
.sw-b { background: var(--grad); }

.chart { display: grid; gap: 22px; }
.crow { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; align-items: center; }
.crow-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.crow-label small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.cbars { display: grid; gap: 8px; }
.cbar { display: flex; align-items: center; gap: 10px; }
.cbar-track {
  display: block;
  flex: 1;
  height: 20px;
  background: var(--tint);
  border-radius: 6px;
  overflow: hidden;
}
.cbar-fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  width: 0;
  transition: width 0.9s cubic-bezier(0.22, 0.8, 0.28, 1);
}
.cbar-a .cbar-fill { background: #cdd6e6; }
.cbar-b .cbar-fill { background: var(--grad); }
.cbar-val {
  flex: none;
  width: 52px;
  text-align: right;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--body);
}
.cbar-b .cbar-val { color: var(--hy-blue); font-weight: 600; }

.takeaways {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}
/* The accent bar is a pseudo-element rather than a gradient border, because
   border-image makes the browser drop border-radius and square the corners. */
.take {
  position: relative;
  overflow: hidden;
  padding: 27px 24px 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.take::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--grad);
}
.take h4 { font-size: 16px; }
.take p { margin-top: 9px; font-size: 14.5px; color: var(--body); }

/* ============================================================
   DEMOS
   ============================================================ */
.demo-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  /* Negative inline/top margin keeps the active pill's glow from being clipped
     by the scroll container. */
  margin: -6px -2px 18px;
  padding: 6px 2px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.demo-tabs::-webkit-scrollbar { display: none; }
.demo-tab {
  display: inline-flex;
  flex: 0 0 auto;
  scroll-snap-align: start;
  align-items: center;
  height: var(--ctl-md);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: var(--body);
  cursor: pointer;
  transition: all 0.18s;
}
.demo-tab:hover { border-color: #d3dbea; color: var(--ink); }
.demo-tab.is-active {
  background: var(--grad) border-box;
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-blue);
}

.demo-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.demo-player {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-m);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.browser-title {
  margin-left: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-pane-tabs {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  max-width: min(78%, 640px);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.demo-pane-tabs::-webkit-scrollbar { display: none; }
.demo-pane-tabs[hidden] { display: none !important; }
.demo-pane-tab {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}
.demo-pane-tab:hover { color: var(--hy-blue); background: rgba(0, 82, 217, 0.06); }
.demo-pane-tab.is-active {
  color: var(--hy-blue);
  background: rgba(0, 82, 217, 0.08);
  border-color: rgba(0, 82, 217, 0.16);
}

.demo-video-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0d1220;
}
.demo-pane {
  position: absolute;
  inset: 0;
}
.demo-pane[hidden] { display: none !important; }
.demo-pane video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.demo-pane-subtasks {
  background: #fff;
  overflow: auto;
  padding: 10px;
}
.demo-pane-subtasks .demo-subtasks {
  height: 100%;
}

.demo-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0, 82, 217, 0.3), transparent 62%),
    #0d1220;
}
.demo-empty svg { width: 40px; height: 40px; color: rgba(255, 255, 255, 0.5); }
.demo-empty p { font-size: 13.5px; color: rgba(255, 255, 255, 0.62); max-width: 34ch; }
.demo-empty code {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.demo-empty.is-hidden { display: none; }

.demo-player-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, transparent, rgba(8, 12, 22, 0.82) 35%);
  color: #fff;
}
.demo-player-bar[hidden] { display: none !important; }
.demo-player-play {
  appearance: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.demo-player-play:hover { background: rgba(255, 255, 255, 0.26); }
.demo-player-play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.demo-player-play.is-playing .icon-play { display: none; }
.demo-player-play.is-playing .icon-pause { display: block; }
.demo-player-play:not(.is-playing) .icon-pause { display: none; }
.demo-player-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0.92;
  min-width: 7.5em;
}
.demo-player-seek {
  width: 100%;
  accent-color: #fff;
  cursor: pointer;
  height: 4px;
}
.demo-player-speed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.demo-player-speed-label {
  opacity: 0.72;
}
.demo-player-speed select {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  padding: 5px 24px 5px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 12px) 11px, calc(100% - 8px) 11px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.demo-player-speed select:hover {
  background-color: rgba(255, 255, 255, 0.2);
}
.demo-player-speed option {
  color: #111;
  background: #fff;
}

.demo-meta {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 24px 28px;
  background: #fff;
  box-shadow: var(--shadow-s);
}
.demo-title { font-size: 20px; letter-spacing: -0.016em; }
.demo-title-accent { color: var(--hy-blue); font-weight: 700; }
.demo-desc { margin-top: 10px; font-size: 14.5px; color: var(--body); text-wrap: pretty; }
.demo-score {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
.demo-score[hidden] { display: none !important; }
.demo-guide {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hy-blue);
}
.demo-guide[hidden] { display: none !important; }
/* Mode and Platform are one word each, so they share a row; the instruction spans both. */
/* Zero column gap keeps the per-cell top rules touching, so each row reads as one hairline. */
.demo-facts { margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 0; }
.demo-facts > div { display: grid; gap: 3px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.demo-facts > div:nth-child(odd) { padding-right: 20px; }
.demo-facts > div:last-child { grid-column: 1 / -1; padding-right: 0; }
.demo-facts dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
html[lang="zh"] .demo-facts dt { text-transform: none; letter-spacing: 0.04em; font-size: 12px; }
.demo-facts dd { margin: 0; font-size: 14px; color: var(--ink-2); }
.demo-facts dd.mono { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }

.demo-panel { display: grid; gap: 20px; }

.demo-extra-h {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--hy-blue);
  letter-spacing: 0.02em;
}
.demo-empty-mini {
  padding: 20px;
  gap: 10px;
}
.demo-empty-mini svg { width: 28px; height: 28px; }
.demo-empty-mini p { font-size: 12.5px; max-width: 28ch; }

.demo-subtasks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  align-content: start;
}
.demo-subtasks li { margin: 0; }
.demo-subtask-jump {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: #fff;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.35;
}
.demo-subtask-jump:hover {
  border-color: rgba(0, 82, 217, 0.28);
  color: var(--hy-blue);
}
.demo-subtasks li.is-active .demo-subtask-jump,
.demo-subtasks li.is-open .demo-subtask-jump {
  border-color: rgba(0, 82, 217, 0.35);
  background: rgba(0, 82, 217, 0.05);
  box-shadow: inset 3px 0 0 var(--hy-blue);
  color: var(--hy-blue);
}
.demo-subtask-detail {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--tint);
  border: 1px solid var(--line-soft);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--body);
  overflow-wrap: anywhere;
}
.demo-subtask-detail[hidden] { display: none !important; }

.demo-viewer-link {
  margin-top: 18px;
  width: 100%;
  justify-content: center;
}
.demo-viewer-link[hidden] { display: none !important; }

.demo-step-viewer {
  border: 1px solid rgba(0, 82, 217, 0.14);
  border-radius: var(--r-lg);
  padding: 18px 18px 20px;
  background: linear-gradient(180deg, rgba(0, 82, 217, 0.04), #fff 55%);
  box-shadow: var(--shadow-s);
  outline: none;
}
.demo-step-viewer[hidden] { display: none !important; }
.demo-step-viewer:focus-visible {
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.28), var(--shadow-s);
}
.demo-step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}
.demo-step-head .demo-extra-h { margin: 0; }
.demo-step-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.demo-step-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0, 82, 217, 0.2);
  background: #fff;
  color: var(--hy-blue);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.demo-step-btn:hover:not(:disabled) {
  background: rgba(0, 82, 217, 0.06);
}
.demo-step-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.demo-step-count {
  min-width: 11ch;
  text-align: center;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
}
.demo-step-hint {
  width: 100%;
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.demo-step-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.demo-video-wrap-step {
  aspect-ratio: 16 / 10;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.demo-step-meta {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.demo-step-field {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: #fff;
}
.demo-step-k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hy-blue);
}
html[lang="zh"] .demo-step-k {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 12px;
}
.demo-step-v {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.demo-step-v.mono {
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
}
.demo-step-scroll {
  height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  overscroll-behavior: contain;
}

/* ============================================================
   STEP VIEWER PAGE
   ============================================================ */
.viewer-page .viewer-main {
  padding: calc(var(--nav-h) + 28px) 0 64px;
}
.viewer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 20px;
  margin-bottom: 10px;
}
.viewer-heading { flex: 1 1 280px; min-width: 0; }
.viewer-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em;
}
.viewer-lede {
  margin: 8px 0 0;
  color: var(--body);
  font-size: 15px;
}
.viewer-step-nav { margin-left: auto; }
.viewer-demo-tabs {
  margin: 14px 0 8px;
}
.viewer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: 20px;
  margin-top: 18px;
  align-items: start;
}
.viewer-shot-wrap { min-width: 0; }
.viewer-shot {
  position: relative;
  width: 100%;
  background: #0d1220;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-s);
  display: flex;
  justify-content: center;
  align-items: center;
}
.viewer-shot-media {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: #0d1220;
}
.viewer-shot-media[hidden] { display: none !important; }
.viewer-shot .demo-empty {
  position: absolute;
  inset: 0;
}
.viewer-fields {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-self: start;
}
.viewer-page #demoStepSubtask {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.viewer-page #demoStepThinking {
  height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  color: var(--body);
  white-space: pre-wrap;
  overscroll-behavior: contain;
}
.viewer-page .demo-step-v.mono {
  max-height: 140px;
  overflow: auto;
}

@media (max-width: 1080px) {
  .viewer-grid { grid-template-columns: 1fr; }
  .viewer-shot-media { max-height: none; }
}

/* ============================================================
   APP — download, usage, deploy
   ============================================================ */
.app-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.app-dl-note {
  font-size: 13px;
  color: var(--muted);
}
.app-links .app-dl-note {
  flex: 1 1 100%;
  margin: 0;
}

.app-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 22px;
  flex-wrap: wrap;
}
.app-tab {
  height: var(--ctl-md);
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.app-tab:hover { color: var(--ink-2); border-color: #d5dcea; }
.app-tab.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--grad) border-box;
  box-shadow: var(--shadow-blue);
}

.app-panel[hidden] { display: none !important; }
.app-panel { display: grid; gap: 22px; }

.app-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 24px 28px;
  box-shadow: var(--shadow-s);
  min-width: 0;
}
.app-block h3 {
  font-size: 20px;
  letter-spacing: -0.016em;
  margin-bottom: 14px;
}
.app-block h4 {
  font-size: 15.5px;
  margin-bottom: 10px;
}
.app-block > p {
  font-size: 14.5px;
  color: var(--body);
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}
.app-table { min-width: 0; }
.app-table tbody th {
  width: 28%;
  vertical-align: top;
  color: var(--ink-2);
}
.app-steps {
  margin: 12px 0 0;
  padding-left: 1.2em;
  display: grid;
  gap: 8px;
  font-size: 14.5px;
  color: var(--body);
}
.app-steps li { overflow-wrap: anywhere; }
.app-callout {
  margin-top: 16px !important;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--tint);
  border: 1px solid var(--line);
  font-size: 13.5px !important;
  color: var(--ink-2) !important;
}
.app-callout a,
.app-table a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.app-callout a:hover,
.app-table a:hover {
  color: var(--hy-blue-600);
}
.app-fig { margin-top: 18px; }
.app-fig + .app-fig { margin-top: 16px; }
.app-fig img {
  max-width: min(100%, 560px);
  max-height: 420px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-inline: auto;
}
.app-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 12px;
}

.app-routes {
  display: grid;
  gap: 18px;
}
.app-route {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 24px 28px;
  box-shadow: var(--shadow-s);
  position: relative;
  min-width: 0;
}
.app-route-k {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--hy-blue);
  background: rgba(0, 82, 217, 0.08);
  margin-bottom: 12px;
}
.app-route h3 {
  font-size: 18px;
  letter-spacing: -0.014em;
  margin-bottom: 8px;
}
.app-route h4 {
  font-size: 15px;
  margin: 16px 0 8px;
}
.app-route > p {
  font-size: 14.5px;
  color: var(--body);
  margin-bottom: 14px;
}
.app-code {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--dark);
  color: #e8eefc;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
}
.app-bullets {
  margin: 0;
  padding-left: 1.15em;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--body);
}
.app-bullets li { overflow-wrap: anywhere; }

/* ============================================================
   CITATION (dark)
   ============================================================ */
.section-dark { position: relative; overflow: hidden; }
.section-dark::before {
  content: "";
  position: absolute;
  width: 700px; height: 700px;
  top: -420px; right: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 82, 217, 0.4), transparent 66%);
  filter: blur(50px);
}
.section-dark .wrap { position: relative; }

.cite-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.cite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.cite-label {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--hy-cyan-soft);
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--ctl-sm);
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); }
.copy-btn svg { width: 14px; height: 14px; color: var(--hy-cyan-soft); }
.copy-btn.is-done { border-color: rgba(78, 203, 255, 0.5); color: var(--hy-cyan-soft); }

.bib {
  margin: 0;
  padding: 24px 22px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.28);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: #eaf1ff;
  white-space: pre;
  tab-size: 2;
}
.cite-note { margin-top: 18px; font-size: 13px; color: rgba(255, 255, 255, 0.5); }

/* ============================================================
   FOOTER
   ============================================================ */
.foot { padding: 48px 0; background: var(--dark); border-top: 1px solid rgba(255, 255, 255, 0.08); }
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
}
.foot-brand { display: flex; align-items: center; gap: 14px; }
.foot-brand img { height: 20px; width: auto; filter: brightness(0) invert(1); opacity: 0.9; }
.foot-brand p { font-size: 13.5px; color: rgba(255, 255, 255, 0.62); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.foot-links a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  padding: 5px 10px;
  border-radius: 8px;
  transition: color 0.18s, background 0.18s;
}
.foot-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.foot-legal { width: 100%; font-size: 12px; color: rgba(255, 255, 255, 0.3); }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 0.8, 0.28, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cbar-fill { transition: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipe-step { border-bottom: 1px solid var(--line-soft); }
  .pipe-step:nth-child(2n) { border-right: 0; }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split-side { position: static; }
  .takeaways { grid-template-columns: 1fr; }
  .highlight-row { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .subsets { grid-template-columns: repeat(2, 1fr); }
  .demo-stage { grid-template-columns: 1fr; }
  .demo-step-body { grid-template-columns: 1fr; }
  .demo-pane-tabs { max-width: 62%; }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    inset: calc(var(--nav-h) + 1px) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 18px 20px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-m);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
  }
  .nav-links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
  .nav-burger { display: flex; }
  .nav-actions { margin-left: auto; }

  .hero { padding: 60px 0 72px; }
  .section { padding: 68px 0; }
  .sec-head { margin-bottom: 34px; }
  .cards { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .pipe-step:nth-child(n) { border-right: 0; }
  .pipe-step:last-child { border-bottom: 0; }
  .highlight-row { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .subsets { grid-template-columns: 1fr; }
  .table-card, .chart-card { padding: 22px 18px 20px; }
  .crow { grid-template-columns: 1fr; gap: 10px; }
  .crow-label small { display: inline; margin-left: 8px; }
  .abstract { font-size: 16px; padding-left: 18px; }
  .pillar { padding: 22px 20px 24px; }
  .flow { padding: 14px 0 4px; }
  .flow-offline { flex-wrap: wrap; gap: 8px; }
  .flow-arrow { display: none; }
  .flow-card { flex: 1 1 calc(50% - 8px); min-width: 140px; }
  .flow-online {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .flow-node-shot,
  .flow-node-harness,
  .flow-node-agent,
  .flow-node-desk,
  .flow-online > .flow-link,
  .flow-feedback {
    grid-column: 1;
    grid-row: auto;
  }
  .flow-link > span::before,
  .flow-link > span::after { display: none; }
  .flow-link > span {
    max-width: none;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
  }
  .flow-feedback { justify-content: flex-start; flex-wrap: wrap; }
  .metric-v {
    font-size: clamp(18px, 5.5vw, 22px);
    white-space: normal;
  }
  .metric { padding: 18px 16px 20px; }
  .metric-n { font-size: 12px; overflow-wrap: anywhere; }
  .sec-lede { font-size: 16px; max-width: none; }
  .hero-tagline { overflow-wrap: anywhere; }
  .fig img { max-width: 100%; height: auto; }
  .app-two { grid-template-columns: 1fr; }
  .foot-links { margin-left: 0; }
  /* The window title is decorative; drop it so the pane tabs keep the whole bar. */
  .browser-title { display: none; }
  .demo-pane-tabs { max-width: none; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 18px; }
  .nav-inner { padding: 0 18px; gap: 12px; }
  .hero-sub { max-width: none; overflow-wrap: anywhere; }
  .btn { height: 42px; padding: 0 16px; font-size: 14px; }
  .hero-links { gap: 8px; }
  .rtable { min-width: 560px; font-size: 13px; }
}
