:root {
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --green-500: #10b981;
  --green-400: #34d399;
  --orange-500: #f97316;
  --orange-400: #fb923c;
  --font-sans: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --nav-height: 72px;
  --radius: 16px;
  --radius-lg: 24px;
}

[data-theme="dark"] {
  --bg-base: #060d1f;
  --bg-surface: #0a1628;
  --bg-surface-alt: #0f2240;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-heading: #ffffff;
  --text-body: #cbd5e1;
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --nav-scrolled-bg: #060d1f;
  --grid-line: rgba(255, 255, 255, 0.03);
  --glow-blue: rgba(59, 130, 246, 0.12);
  --glow-green: rgba(16, 185, 129, 0.08);
  --shadow-glow: 0 0 80px rgba(59, 130, 246, 0.15);
  --panel-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  --panel-inner: rgba(255, 255, 255, 0.04);
  --toolbar-bg: rgba(0, 0, 0, 0.3);
  --overlay-bg: rgba(6, 13, 31, 0.92);
  --icon-bg: rgba(0, 0, 0, 0.3);
  --detail-gradient: linear-gradient(135deg, #0a1628, #0f2240);
  --impact-bg: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.06), transparent);
  --metric-gradient: linear-gradient(135deg, #ffffff, #cbd5e1);
  --card-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  --btn-primary-shadow: 0 4px 24px rgba(59, 130, 246, 0.35);
  --btn-primary-shadow-hover: 0 8px 32px rgba(59, 130, 246, 0.45);
}

[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-heading: #0a1628;
  --text-body: #334155;
  --border: rgba(15, 23, 42, 0.1);
  --glass: rgba(15, 23, 42, 0.04);
  --glass-hover: rgba(15, 23, 42, 0.08);
  --nav-scrolled-bg: #f8fafc;
  --grid-line: rgba(15, 23, 42, 0.06);
  --glow-blue: rgba(59, 130, 246, 0.08);
  --glow-green: rgba(16, 185, 129, 0.06);
  --shadow-glow: 0 0 80px rgba(59, 130, 246, 0.1);
  --panel-shadow: 0 24px 64px rgba(15, 23, 42, 0.08);
  --panel-inner: rgba(15, 23, 42, 0.04);
  --toolbar-bg: rgba(241, 245, 249, 0.9);
  --overlay-bg: rgba(248, 250, 252, 0.95);
  --icon-bg: rgba(241, 245, 249, 0.8);
  --detail-gradient: linear-gradient(135deg, #ffffff, #f1f5f9);
  --impact-bg: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.04), transparent);
  --metric-gradient: linear-gradient(135deg, #0a1628, #475569);
  --card-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
  --btn-primary-shadow: 0 4px 24px rgba(59, 130, 246, 0.25);
  --btn-primary-shadow-hover: 0 8px 32px rgba(59, 130, 246, 0.35);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
}

[data-theme="dark"] { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s;
}

[data-theme="light"] .bg-grid {
  opacity: 0.6;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow--blue {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -100px;
  background: var(--glow-blue);
  transition: background 0.3s;
}

.bg-glow--green {
  width: 500px;
  height: 500px;
  bottom: 20%;
  left: -150px;
  background: var(--glow-green);
  transition: background 0.3s;
}

/* ── Navigation ── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

.nav--scrolled {
  background: var(--nav-scrolled-bg);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-heading);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand-wordmark {
  background: linear-gradient(90deg, #0074ec 0%, #0048b8 42%, #002050 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .brand-wordmark,
[data-theme="dark"] .hero__brand {
  background: linear-gradient(90deg, #8ec8ff 0%, #4f8ff0 48%, #2f6fd4 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background: var(--glass-hover);
  color: var(--text-heading);
}

.theme-toggle__icon {
  width: 18px;
  height: 18px;
}

.theme-toggle__icon--sun {
  display: none;
}

.theme-toggle__icon--moon {
  display: block;
}

[data-theme="light"] .theme-toggle__icon--sun {
  display: block;
}

[data-theme="light"] .theme-toggle__icon--moon {
  display: none;
}

.nav__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nav__links {
  display: flex;
  gap: 32px;
}

.nav__links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav__links a:hover {
  color: var(--text-heading);
}

.nav__cta {
  padding: 10px 20px;
  background: var(--blue-500);
  color: #ffffff;
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}

.nav__cta:hover {
  background: var(--blue-400);
  transform: translateY(-1px);
}

/* ── Hero ── */

.hero {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 72px) 32px 96px;
  text-align: center;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 22px);
  margin-bottom: 16px;
}

.hero__logo {
  width: min(22vw, 108px);
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(var(--shadow-glow));
}

.hero__brand {
  margin: 0;
  background: linear-gradient(90deg, #0074ec 0%, #0048b8 42%, #002050 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.hero__partners {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px 22px;
  margin-bottom: 32px;
  padding: 14px 20px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.hero__partner-logo {
  width: 140px;
  height: 46px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero__partner-logo--bytedance {
  width: 180px;
}

.hero__partner-logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-500);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero__title {
  max-width: 16ch;
  margin: 0 auto 18px;
  color: var(--text-heading);
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.hero__title-accent {
  background: linear-gradient(135deg, var(--blue-400), var(--green-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  max-width: 38em;
  margin: 0 auto 28px;
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--blue-500), #2563eb);
  color: #ffffff;
  box-shadow: var(--btn-primary-shadow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-primary-shadow-hover);
}

.btn--ghost {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-body);
}

.btn--ghost:hover {
  background: var(--glass-hover);
  color: var(--text-heading);
}

.hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px 32px;
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
  width: min(100%, 720px);
}

.stat {
  text-align: center;
}

.stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

.stat__label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat__divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ── Sections ── */

.section-header {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-header--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-400);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.7;
}


/* ── What Is Op ── */

.what-is-op-section {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 120px;
}

.what-is-op-accent {
  color: #2563eb;
}

.what-is-op-diagram {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(320px, 1fr);
  gap: 48px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 0;
}

.what-is-op-guides {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}

.what-is-op-guides line,
.what-is-op-guides path {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.model-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.model-stack__io {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 600;
}

.model-stack__arrow {
  width: 100%;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
}

.model-stack__arrow--inner {
  margin: 0;
}

.model-stack__node {
  width: 100%;
  padding: 14px 20px;
  border-radius: 10px;
  text-align: center;
  color: #1f2937;
  font-size: 1.05rem;
  font-weight: 700;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.model-stack__node--embed {
  background: #faf3e8;
}

.model-stack__node--layer {
  background: #f4dcc8;
}

.model-stack__block {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  padding: 16px 18px 14px;
  border: 2px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .model-stack__block {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.model-stack__repeat {
  position: absolute;
  top: 50%;
  right: -34px;
  transform: translateY(-50%);
  color: var(--text-heading);
  font-size: 1.35rem;
  font-weight: 800;
}

.op-detail {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 32px 32px;
  border: 2px solid #2563eb;
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: var(--panel-shadow);
}

.op-detail__connectors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

.op-detail__connectors path,
.op-detail__connectors line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.op-detail__inputs {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 28px;
  width: 100%;
}

.op-matrices {
  display: flex;
  align-items: center;
}

.op-matrices--stack {
  position: relative;
  width: 86px;
  height: 86px;
}

.op-matrices--stack .op-matrix {
  position: absolute;
  width: 58px;
  height: 58px;
  padding: 4px;
  font-size: 0.62rem;
}

.op-matrices--stack .op-matrix--yellow {
  top: 0;
  left: 0;
  z-index: 3;
}

.op-matrices--stack .op-matrix--green {
  top: 14px;
  left: 14px;
  z-index: 2;
}

.op-matrices--stack .op-matrix--pink {
  top: 28px;
  left: 28px;
  z-index: 1;
}

.op-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  border-radius: 6px;
  font-weight: 700;
  color: #1f2937;
}

.op-matrix--blue,
.op-matrix--out {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(2, 1fr);
  width: 58px;
  height: 58px;
  padding: 6px;
  font-size: 0.75rem;
}

.op-matrix--yellow { background: #f5d76e; }
.op-matrix--green { background: #9fd89f; }
.op-matrix--pink { background: #f5b4b4; }
.op-matrix--blue { background: #b3d4f0; }
.op-matrix--out { background: #7eb0e8; color: #ffffff; }

.op-matrices--stack .op-matrix:hover {
  z-index: 10;
}

.op-matrix__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  user-select: text;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.op-matrix__cell:hover {
  background: rgba(255, 255, 255, 0.45);
}

.op-matrix__cell:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.op-matrix__cell--selected {
  background: rgba(37, 99, 235, 0.22);
  box-shadow: inset 0 0 0 2px #2563eb;
  transform: scale(1.06);
}

.op-matrix--out .op-matrix__cell:hover {
  background: rgba(255, 255, 255, 0.18);
}

.op-matrix--out .op-matrix__cell--selected {
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 2px #ffffff;
}

.op-detail__merge {
  display: none;
}

.op-detail__op {
  position: relative;
  z-index: 1;
  min-width: 88px;
  padding: 10px 24px;
  border: 2px solid #2563eb;
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-heading);
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
}

.op-detail__arrow {
  position: relative;
  z-index: 1;
  color: #2563eb;
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 700;
}

/* ── Bitwise Alignment ── */

/* ── Bitwise Alignment ── */

.bitwise-section {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 120px;
}

.ba-deck {
  max-width: 980px;
  margin: 0 auto;
}

.ba-deck__headings {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 3.2em;
  margin: 0 0 18px;
  text-align: center;
}

.ba-heading {
  display: none;
  margin: 0;
  max-width: 42rem;
  color: var(--text-heading);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  animation: ba-in 0.35s ease;
}

.ba-heading.is-on {
  display: block;
}

.ba {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px 20px;
  align-items: stretch;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--card-shadow);
  overflow-x: auto;
}

.ba__side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 0 28px;
}

.ba__run-label {
  color: var(--text-heading);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.ba__run-label--ref {
  margin-top: auto;
}

.ba__stages {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 18px 28px;
  min-width: 640px;
  padding: 8px 8px 12px;
}

.ba__timeline {
  position: absolute;
  left: 4%;
  right: 2%;
  top: 50%;
  height: 4px;
  border-radius: 999px;
  background: #9ca3af;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
}

.ba__timeline::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 14px solid #9ca3af;
  transform: translateY(-50%);
}

.ba-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  align-items: center;
  gap: 14px;
  min-height: 280px;
}

.ba-status {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  z-index: 2;
}

.ba-status svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.18));
}

.ba-tensor {
  position: relative;
  width: 78px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 5px;
  border: 1.5px solid rgba(15, 23, 42, 0.18);
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  z-index: 1;
}

.ba-tensor::before,
.ba-tensor::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  z-index: -1;
}

.ba-tensor::before {
  transform: translate(4px, 4px);
  opacity: 0.7;
}

.ba-tensor::after {
  transform: translate(8px, 8px);
  opacity: 0.45;
}

.ba-tensor--col {
  width: 34px;
  grid-template-columns: 1fr;
}

.ba-tensor--col::before { transform: translate(3px, 3px); }
.ba-tensor--col::after { transform: translate(6px, 6px); }

.ba-tensor--pink,
.ba-tensor--pink::before,
.ba-tensor--pink::after {
  background: #f3c1c6;
  border-color: rgba(127, 29, 29, 0.18);
}

.ba-tensor--blue,
.ba-tensor--blue::before,
.ba-tensor--blue::after {
  background: #3b6ea8;
  border-color: rgba(15, 23, 42, 0.28);
}

.ba-tensor i {
  display: block;
  aspect-ratio: 1;
  min-height: 16px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.ba-tensor--pink i {
  background: rgba(255, 255, 255, 0.35);
}

.ba-tensor--blue i {
  background: rgba(255, 255, 255, 0.16);
}

.ba-tensor i[data-bad] {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
  transition: background 0.35s, box-shadow 0.35s;
}

.ba-dtype {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 3px 8px;
  border: 1.5px dashed rgba(255, 255, 255, 0.95);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.28);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}

.ba-status,
.ba-callout {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ba-callout {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-35%) scale(0.9);
  padding: 6px 10px;
  border: 1px solid rgba(185, 28, 28, 0.35);
  border-radius: 8px;
  background: #fff;
  color: #b91c1c;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.12);
  z-index: 3;
}

.ba-callout::after {
  content: '';
  position: absolute;
  left: 28%;
  bottom: -10px;
  width: 12px;
  height: 12px;
  border-right: 2px solid #dc2626;
  border-bottom: 2px solid #dc2626;
  transform: rotate(45deg);
  background: #fff;
}

/* Progressive reveal */
.ba-deck[data-step="1"] .ba-tensor {
  animation: ba-in 0.45s ease both;
}

.ba-deck[data-step="2"] .ba-status,
.ba-deck[data-step="3"] .ba-status {
  opacity: 1;
  transform: scale(1);
}

.ba-deck[data-step="2"] .ba-tensor i[data-bad],
.ba-deck[data-step="3"] .ba-tensor i[data-bad] {
  background: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(127, 29, 29, 0.35);
}

.ba-deck[data-step="3"] .ba-callout {
  opacity: 1;
  transform: translateX(-35%) scale(1);
}

.ba-deck[data-step="3"] .ba-stage--hot {
  outline: 2px solid rgba(220, 38, 38, 0.28);
  outline-offset: 8px;
  border-radius: 16px;
}

.ba-deck__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.ba-deck__btn,
.ba-deck__play,
.ba-deck__dot {
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text-heading);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ba-deck__btn,
.ba-deck__play {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
}

.ba-deck__btn:hover,
.ba-deck__play:hover,
.ba-deck__dot:hover {
  background: var(--glass-hover);
}

.ba-deck__play[aria-pressed="true"] {
  background: var(--blue-500);
  border-color: var(--blue-500);
  color: #fff;
}

.ba-deck__dots {
  display: flex;
  gap: 8px;
}

.ba-deck__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
}

.ba-deck__dot.is-active {
  width: 24px;
  background: var(--blue-500);
  border-color: var(--blue-500);
}

@keyframes ba-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ── Trace Panel ── */

.trace-section {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 32px 120px;
}

.trace-panel {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--panel-inner),
    var(--panel-shadow),
    var(--shadow-glow);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Keep panel clipped; tour overlay is fixed to the viewport instead. */
body.trace-tour-open .nav {
  z-index: 1;
}

.trace-panel__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.trace-panel__toolbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.trace-tour-launch {
  padding: 8px 14px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue-400);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.trace-tour-launch:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.trace-panel__status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.trace-panel__status--ready {
  color: var(--green-400);
}

.trace-panel__status--error {
  color: #f87171;
}

.trace-panel__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--blue-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.trace-panel__status--ready .trace-panel__spinner,
.trace-panel__status--error .trace-panel__spinner {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.trace-panel__meta {
  display: flex;
  gap: 8px;
}

.trace-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-400);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.trace-chip--muted {
  background: var(--glass);
  color: var(--text-muted);
  border-color: var(--border);
}

.trace-panel__viewer {
  position: relative;
  height: min(72vh, 780px);
  min-height: 480px;
  background: #1a1a1a;
}

.trace-panel__viewer iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.trace-panel__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, visibility 0.5s, background 0.3s;
  z-index: 2;
}

.trace-panel__overlay--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.trace-source {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  max-height: min(42%, 320px);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: #0f172a;
  box-shadow: 0 18px 40px rgba(2, 8, 23, 0.45);
  overflow: hidden;
  pointer-events: auto;
}

.trace-source[hidden] {
  display: none;
}

.trace-source__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: #111827;
}

.trace-source__heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.trace-source__label {
  color: #93c5fd;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trace-source__title {
  color: #e2e8f0;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trace-source__path {
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trace-source__code {
  margin: 0;
  padding: 10px 0 14px;
  overflow: auto;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  background: transparent;
}

.trace-source__line {
  display: block;
  padding: 0 14px;
  white-space: pre;
}

.trace-source__line.is-target {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  box-shadow: inset 3px 0 0 #f87171;
}

.trace-diff__body {
  padding: 12px 14px 16px;
  overflow: auto;
  color: #cbd5e1;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.trace-diff__row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.trace-diff__row:last-child {
  border-bottom: none;
}

.trace-diff__key {
  color: #93c5fd;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trace-diff__val {
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  word-break: break-word;
}

.trace-diff__summary {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
}

.trace-diff__summary strong {
  color: #fff;
  font-weight: 700;
}

.trace-panel__overlay-inner {
  text-align: center;
}

.trace-panel__overlay-ring {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-400);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.trace-panel__overlay p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 20px;
}

.trace-panel__progress {
  width: 240px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}

.trace-panel__progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-500), var(--green-500));
  border-radius: 2px;
  transition: width 0.3s;
}

.trace-tour {
  position: fixed;
  inset: 0;
  z-index: 500;
  /* Pass clicks through to Perfetto; only the card captures input. */
  pointer-events: none;
}

.trace-tour__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.trace-tour__spotlight {
  position: absolute;
  border: 2px solid #60a5fa;
  border-radius: 12px;
  box-shadow:
    0 0 0 9999px rgba(6, 13, 31, 0.58),
    0 0 0 4px rgba(96, 165, 250, 0.25);
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
  pointer-events: none;
}

[data-theme="light"] .trace-tour__spotlight {
  box-shadow:
    0 0 0 9999px rgba(15, 23, 42, 0.45),
    0 0 0 4px rgba(96, 165, 250, 0.28);
}

.trace-tour__card {
  position: absolute;
  z-index: 12;
  width: min(360px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: var(--card-shadow);
  transition: top 0.25s ease, left 0.25s ease, right 0.25s ease, bottom 0.25s ease;
  pointer-events: auto;
}

.trace-tour__progress {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--blue-400);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trace-tour__title {
  margin-bottom: 10px;
  color: var(--text-heading);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.trace-tour__body {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.trace-tour__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.trace-tour__btn {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.trace-tour__btn--primary {
  border: none;
  background: var(--blue-500);
  color: #ffffff;
}

.trace-tour__btn--primary:hover {
  background: var(--blue-400);
}

.trace-tour__btn--ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
}

.trace-tour__btn--ghost:hover {
  color: var(--text-heading);
  border-color: color-mix(in srgb, var(--blue-500) 35%, var(--border));
}

.trace-tour__btn--skip {
  margin-left: auto;
}

.trace-tour__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

[data-trace-tour].trace-tour-target {
  position: relative;
  z-index: 5;
}

/* ── Workflow ── */

.workflow {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 32px 120px;
}

/* ── How it works native deck ── */

.wf {
  --wf-blue: #0650fd;
  --wf-suspect: #96b9e8;
  --wf-suspect-label: #c8dcff;
  --wf-ref: #ffc8c8;
  --wf-v: #fdf2d2;
  --wf-k: #0f9ed5;
  --wf-attn: #4ea72e;
  --wf-other: #e8e8e8;
  --wf-guard: #c00000;
  margin: 0 0 64px;
}

.wf__canvas {
  padding: 24px 24px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: #0f172a;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.wf__headings {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 2.6em;
  margin: 0 0 20px;
}

.wf-heading {
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35em 0.5em;
  margin: 0;
  color: var(--wf-blue);
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  animation: wf-in 0.3s ease;
}

.wf-heading.is-on {
  display: inline-flex;
}

.wf-heading__n {
  min-width: 1.1em;
}

.wf-heading__icon {
  width: 1.35em;
  height: 1.25em;
  object-fit: contain;
  vertical-align: middle;
}

.wf__diagram {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(720px, 100%);
  margin: 0 auto;
}

.wf-run {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 2.5px solid transparent;
  border-radius: 14px;
}

.wf-run--suspect {
  border-color: var(--wf-suspect);
  background: linear-gradient(180deg, #eaf2fc, #fff);
}

.wf-run--ref {
  border-color: var(--wf-ref);
  background: linear-gradient(180deg, #fff, #fff1f1);
}

.wf-run__row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}

.wf-run__shield {
  width: 52px;
  height: 50px;
  object-fit: contain;
}

.wf-run__ops {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr 0.85fr 1.35fr;
  gap: 8px;
}

.wf-op {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  border: 2px solid #1e293b;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  transition: border-color 0.35s, box-shadow 0.35s;
}

.wf-op--v {
  background:
    repeating-linear-gradient(-45deg, var(--wf-v), var(--wf-v) 5px, #f7e4b0 5px, #f7e4b0 10px);
}

.wf-op--other {
  background: var(--wf-other);
  color: #475569;
  font-weight: 600;
  font-size: 0.75rem;
}

.wf-op--k {
  background:
    repeating-linear-gradient(-45deg, #d7f1fb, #d7f1fb 5px, #9fd8ef 5px, #9fd8ef 10px);
}

.wf-op--attn {
  background:
    repeating-linear-gradient(-45deg, #d8f0d0, #d8f0d0 5px, #a8d89a 5px, #a8d89a 10px);
}

.wf-op__badge {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s, transform 0.35s;
}

.wf-run__label {
  align-self: center;
  min-width: 160px;
  margin-left: 68px;
  padding: 6px 18px;
  border: 1px solid #000;
  border-radius: 4px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
}

.wf-run--suspect .wf-run__label { background: var(--wf-suspect-label); }
.wf-run--ref .wf-run__label { background: var(--wf-ref); }

.wf-fps {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  justify-content: center;
  gap: 22px;
  margin-left: 68px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(6px);
  transition: opacity 0.4s, transform 0.4s, max-height 0.4s, margin 0.4s;
}

.wf-fp {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1.5px solid rgba(15, 23, 42, 0.18);
  border-radius: 8px;
}

.wf-fp::after {
  content: '';
  position: absolute;
  inset: 8px;
  background: currentColor;
  -webkit-mask: url('../assets/images/workflow/native/fingerprint.svg') center / contain no-repeat;
  mask: url('../assets/images/workflow/native/fingerprint.svg') center / contain no-repeat;
}

.wf-fp--v { color: #ca8a04; background: #fef9c3; border-color: #eab308; }
.wf-fp--k { color: #0284c7; background: #e0f2fe; border-color: #0ea5e9; }
.wf-fp--attn { color: #15803d; background: #dcfce7; border-color: #22c55e; }

.wf-align {
  display: block;
  width: 100%;
  height: 0;
  margin: 0;
  opacity: 0;
  overflow: visible;
  pointer-events: none;
  transition: height 0.35s, opacity 0.35s, margin 0.35s;
}

.wf-align path {
  fill: none;
  stroke: #c00000;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wf-align path.wf-align__match {
  stroke: #15803d;
}

.wf__banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(720px, 100%);
  margin: 16px auto 0;
  padding: 14px 20px;
  border-radius: 12px;
  background: #0e2841;
  color: #fff;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 600;
  animation: wf-in 0.4s ease;
}

.wf__banner img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.wf__banner strong {
  color: #93c5fd;
  font-weight: 800;
}

@keyframes wf-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Progressive reveal */
.wf[data-step="2"] .wf-op[data-guard],
.wf[data-step="3"] .wf-op[data-guard],
.wf[data-step="4"] .wf-op[data-guard] {
  border-color: var(--wf-guard);
  border-width: 3px;
  box-shadow: inset 0 0 0 1px rgba(192, 0, 0, 0.12);
}

.wf[data-step="2"] .wf-op[data-guard] .wf-op__badge,
.wf[data-step="3"] .wf-op[data-guard] .wf-op__badge,
.wf[data-step="4"] .wf-op[data-guard] .wf-op__badge {
  opacity: 1;
  transform: scale(1);
}

.wf[data-step="3"] .wf-fps,
.wf[data-step="4"] .wf-fps {
  opacity: 1;
  max-height: 56px;
  margin-top: 2px;
  transform: none;
}

.wf[data-step="4"] .wf-align {
  height: 56px;
  opacity: 1;
  margin: 2px 0;
}

.wf[data-step="4"] .wf__banner {
  display: flex;
}

.wf__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.wf__btn,
.wf__play,
.wf__dot {
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text-heading);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.wf__btn,
.wf__play {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
}

.wf__btn:hover,
.wf__play:hover,
.wf__dot:hover {
  background: var(--glass-hover);
}

.wf__play[aria-pressed="true"] {
  background: var(--blue-500);
  border-color: var(--blue-500);
  color: #fff;
}

.wf__dots {
  display: flex;
  gap: 8px;
}

.wf__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
}

.wf__dot.is-active {
  width: 24px;
  background: var(--blue-500);
  border-color: var(--blue-500);
}

.workflow__detail {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  align-items: center;
  padding: 64px;
  background: var(--detail-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background 0.3s, border-color 0.3s;
}

.workflow__detail-text h3 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.workflow__detail-text p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.7;
}

.workflow__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workflow__list li {
  position: relative;
  padding-left: 24px;
  color: var(--text-body);
  font-size: 0.9375rem;
}

.workflow__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-500);
}

.workflow__detail-visual {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s;
}

.workflow__detail-visual img {
  width: 100%;
  display: block;
}

/* ── Impact ── */

.impact {
  position: relative;
  z-index: 1;
  padding: 100px 32px;
  background: var(--impact-bg);
  transition: background 0.3s;
}

.impact__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}

.impact__content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.impact__content h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.impact__content p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.impact-panel--timing {
  width: 100%;
}

.impact-timing__legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
}

.impact-timing__swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.impact-timing__swatch--manual {
  background: #2563eb;
  margin-left: 4px;
}

.impact-timing__swatch--opguard {
  background: #16a34a;
  margin-left: 14px;
}

.impact-timing__svg {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
  overflow: visible;
}

.impact-timing__chart {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
}

.impact-timing__grid {
  stroke: color-mix(in srgb, var(--text-muted) 28%, transparent);
  stroke-width: 1;
}

.impact-timing__tick,
.impact-timing__axis,
.impact-timing__xlabel,
.impact-timing__threshold-label {
  fill: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
}

.impact-timing__axis {
  font-size: 12px;
}

.impact-timing__xlabel {
  fill: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.impact-timing__threshold {
  stroke: color-mix(in srgb, var(--text-muted) 55%, transparent);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.impact-timing__threshold-label {
  fill: var(--text-secondary);
  font-size: 11px;
}

.impact-timing__bar--manual {
  fill: #2563eb;
}

.impact-timing__bar--opguard {
  fill: #16a34a;
}

.impact-timing__caption {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
}

.impact__evidence {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.impact-panel {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  box-shadow: var(--card-shadow);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.impact-panel h3 {
  position: relative;
  margin-bottom: 26px;
  color: var(--text-heading);
  font-size: clamp(1.35rem, 2.3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-align: center;
}

.impact-panel h3::after {
  content: '';
  display: block;
  width: 76px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: var(--blue-500);
}

.impact-panel h3 span {
  color: var(--blue-500);
}

.impact-quote {
  position: relative;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 20px;
}

.impact-quote--b {
  grid-template-columns: 1fr 74px;
  margin-top: 28px;
}

.impact-quote__avatar {
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #0f2c45;
  background: #b7d5ee;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.impact-quote--b .impact-quote__avatar {
  color: #4c1d5b;
  background: #e8d5c7;
}

.impact-quote__avatar svg {
  width: 44px;
  height: 44px;
}

.impact-quote__body {
  position: relative;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--text-heading) 28%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, #b7d5ee 42%, var(--bg-surface));
}

.impact-quote--b .impact-quote__body {
  background: color-mix(in srgb, #e8d5c7 34%, var(--bg-surface));
}

.impact-quote__body strong {
  display: block;
  margin-bottom: 10px;
  color: var(--blue-500);
  font-size: 1rem;
  font-weight: 800;
}

.impact-quote--b .impact-quote__body strong {
  color: #7c3aed;
  text-align: left;
}

.impact-quote__body p {
  color: var(--text-heading);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.02rem;
  line-height: 1.55;
}

.impact-cases {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  align-items: center;
}

.impact-cases__legend {
  display: grid;
  gap: 14px;
}

.impact-category {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-surface-alt) 78%, transparent);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.impact-category span {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.impact-category strong {
  color: var(--text-heading);
  font-size: 0.95rem;
  font-weight: 700;
}

.impact-category em {
  grid-column: 2;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: normal;
}

.impact-category--logic span { background: #2c7fb8; }
.impact-category--race span { background: #f57c00; }
.impact-category--drift span { background: #d62828; }
.impact-category--hardware span { background: #2ca02c; }

.impact-cases__chart {
  text-align: center;
}

.impact-cases__chart h4 {
  margin-bottom: 18px;
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.impact-pie {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  border-radius: 50%;
  background:
    conic-gradient(
      #2c7fb8 0deg 126deg,
      #f57c00 126deg 216deg,
      #d62828 216deg 324deg,
      #2ca02c 324deg 360deg
    );
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.85),
    0 18px 36px rgba(15, 23, 42, 0.16);
}

.impact-pie::after {
  content: '';
  position: absolute;
  inset: 47%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
}

.impact-pie__label {
  position: absolute;
  z-index: 1;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
}

.impact-pie__label--logic {
  top: 74px;
  right: 32px;
}

.impact-pie__label--race {
  right: 72px;
  bottom: 38px;
}

.impact-pie__label--drift {
  left: 30px;
  top: 114px;
}

.impact-pie__label--hardware {
  top: 38px;
  left: 88px;
}

.impact-panel--stacks {
  grid-column: 1 / -1;
}

.impact-panel--workflow,
.impact-panel--broader {
  grid-column: 1 / -1;
}

.impact-workflow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 18px 20px;
  max-width: 920px;
  margin: 0 auto;
}

.impact-workflow__before,
.impact-workflow__after {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-surface-alt) 78%, transparent);
}

.impact-workflow__before {
  flex: 0 1 240px;
  max-width: 260px;
}

.impact-workflow__after {
  flex: 0 1 420px;
  max-width: 460px;
  border-color: color-mix(in srgb, var(--blue-500) 45%, var(--border));
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.08), transparent 42%),
    color-mix(in srgb, var(--bg-surface) 90%, transparent);
}

.impact-workflow__eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.impact-workflow__eyebrow--opguard {
  color: var(--blue-500);
}

.impact-workflow__before ul {
  display: grid;
  gap: 12px;
  padding-left: 1.1rem;
  color: var(--text-heading);
  font-size: 0.95rem;
  line-height: 1.5;
}

.impact-workflow__arrow {
  align-self: center;
  color: #dc2626;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.impact-workflow__runs {
  position: relative;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.impact-workflow__run {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: center;
}

.impact-workflow__run-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
}

.impact-workflow__cells {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.impact-workflow__cells span {
  height: 24px;
  border: 1.5px solid color-mix(in srgb, var(--blue-500) 55%, var(--border));
  border-radius: 5px;
  background: color-mix(in srgb, var(--blue-500) 8%, transparent);
}

.impact-workflow__cells .is-mismatch {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.16);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.impact-workflow__cells .is-match {
  border-color: var(--green-500);
  background: rgba(16, 185, 129, 0.16);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.16);
}

.impact-workflow__pivot {
  margin-left: 102px;
  margin-top: 2px;
  padding: 7px 10px;
  border: 1px dashed rgba(220, 38, 38, 0.55);
  border-radius: 10px;
  color: #dc2626;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
}

.impact-workflow__note {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}

.impact-broader {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px 40px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
}

.impact-broader__lead {
  margin-bottom: 10px;
  color: var(--text-heading);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.impact-broader__copy p:last-child {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 36em;
}

.impact-broader__viz h4 {
  margin-bottom: 16px;
  color: var(--text-heading);
  font-size: 0.9rem;
  font-weight: 700;
}

.impact-broader__viz-row {
  display: flex;
  align-items: center;
  gap: 22px;
}

.impact-ref-pie {
  --ref-self: #2563eb;
  --ref-config: #0d9488;
  --ref-cross: #dc2626;
  --ref-commit: #ea580c;
  position: relative;
  flex: 0 0 auto;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    var(--ref-self) 0 45%,
    var(--ref-config) 45% 70%,
    var(--ref-cross) 70% 90%,
    var(--ref-commit) 90% 100%
  );
}

.impact-ref-pie::after {
  content: '';
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: var(--bg-surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.impact-ref-legend {
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  list-style: none;
}

.impact-ref-legend__item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.impact-ref-legend__item span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.impact-ref-legend__item em {
  font-style: normal;
  font-weight: 600;
  color: var(--text-heading);
}

.impact-ref-legend__item strong {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.impact-ref-legend__item--self span { background: #2563eb; }
.impact-ref-legend__item--config span { background: #0d9488; }
.impact-ref-legend__item--cross span { background: #dc2626; }
.impact-ref-legend__item--commit span { background: #ea580c; }

.impact-ref-legend__item--cross {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.06);
}

.impact-ref-legend__item--cross em,
.impact-ref-legend__item--cross strong {
  color: #dc2626;
}

.impact-stacks {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  align-items: center;
}

.impact-stack-notes {
  display: grid;
  gap: 14px;
}

.impact-stack-note {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-surface-alt) 82%, transparent);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.impact-stack-note__icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue-500);
  font-size: 1.2rem;
  font-weight: 900;
}

.impact-stack-note--warning .impact-stack-note__icon {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.impact-stack-note p {
  color: var(--text-heading);
  font-size: 1rem;
  line-height: 1.5;
}

.impact-stack-note strong {
  color: var(--blue-500);
  font-weight: 800;
}

.impact-stack-note--warning strong {
  color: #dc2626;
}

.impact-stack-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 24px;
  border: 3px solid var(--blue-500);
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.12), transparent 30%),
    color-mix(in srgb, var(--bg-surface) 88%, transparent);
}

.impact-stack-card span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--blue-500) 22%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-surface-alt) 86%, transparent);
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

/* ── Footer ── */

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 48px 32px;
  transition: border-color 0.3s;
}

.footer__inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.footer__brand {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer__logo {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}

.footer__brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer__credits {
  text-align: center;
}

.footer__partners {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px 24px;
  margin-bottom: 20px;
}

.footer__partner-logo {
  width: 130px;
  height: 42px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  opacity: 1;
  transition: transform 0.2s;
}

.footer__partner-logo--bytedance {
  width: 165px;
}

.footer__partner-logo:hover {
  transform: translateY(-1px);
}

.footer__credits p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer__credits p:first-child {
  color: var(--text-secondary);
  font-weight: 500;
}

.footer__seed {
  width: 100%;
  max-width: 640px;
  margin-top: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.footer__seed-logo-link {
  display: inline-flex;
  line-height: 0;
}

.footer__seed-logo {
  width: min(220px, 70vw);
  height: auto;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 12px;
}

.footer__seed-title {
  margin: 0 0 8px;
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer__seed-copy {
  max-width: 560px;
}

.footer__seed-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* ── Cite ── */

.cite {
  position: relative;
  z-index: 1;
  padding: 80px 32px 100px;
}

.cite__inner {
  max-width: 920px;
  margin: 0 auto;
}

.cite__card {
  margin-top: 36px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  box-shadow: var(--card-shadow);
}

.cite__title {
  margin-bottom: 10px;
  color: var(--text-heading);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.cite__authors,
.cite__venue {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.cite__venue {
  margin-top: 8px;
  color: var(--text-muted);
}

.cite__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.cite__pdf {
  padding: 12px 22px;
  font-size: 0.875rem;
}

.cite__bib {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-surface-alt) 88%, transparent);
}

.cite__bib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cite__copy {
  padding: 6px 12px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue-400);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cite__copy:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
}

.cite__copy.is-copied {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.14);
  color: var(--green-400);
}

.cite__code {
  margin: 0;
  padding: 16px 18px 18px;
  overflow-x: auto;
  color: var(--text-body);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre;
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  .hero {
    padding-bottom: 64px;
  }

  .hero__logo {
    width: min(28vw, 88px);
  }

  .hero__stats {
    gap: 16px 24px;
  }

  .stat__divider {
    display: none;
  }

  .what-is-op-diagram {
    grid-template-columns: 1fr;
    gap: 36px;
    max-width: 520px;
  }

  .model-stack__repeat {
    right: 10px;
    top: 8px;
    transform: none;
    font-size: 1rem;
  }

  .what-is-op-guides {
    display: none;
  }

  .wf__diagram {
    overflow-x: auto;
  }

  .ba {
    grid-template-columns: 1fr;
  }

  .ba__side {
    flex-direction: row;
    justify-content: space-between;
    padding: 0 0 8px;
    gap: 12px;
  }

  .ba__run-label--ref {
    margin-top: 0;
  }

  .wf-run__ops {
    min-width: 360px;
  }

  .workflow__detail {
    grid-template-columns: 1fr;
    padding: 40px;
  }

  .impact__inner {
    grid-template-columns: 1fr;
  }

  .impact__evidence {
    grid-template-columns: 1fr;
  }

  .impact-workflow {
    flex-direction: column;
    align-items: stretch;
    max-width: none;
  }

  .impact-workflow__before,
  .impact-workflow__after {
    flex: 1 1 auto;
    max-width: none;
  }

  .impact-workflow__arrow {
    justify-self: center;
    align-self: center;
    transform: rotate(90deg);
  }

  .impact-workflow__run {
    grid-template-columns: 1fr;
  }

  .impact-workflow__pivot {
    margin-left: 0;
  }

  .impact-broader {
    grid-template-columns: 1fr;
  }

  .impact-broader__viz-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .impact-stacks {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    flex-direction: column;
  }

  .footer__credits {
    text-align: center;
  }

  .footer__partners {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .nav__links {
    display: none;
  }

  .hero__stats {
    flex-direction: column;
    gap: 20px;
  }

  .stat__divider {
    width: 40px;
    height: 1px;
  }

  .impact-panel {
    padding: 22px;
  }

  .impact-quote,
  .impact-quote--b {
    grid-template-columns: 1fr;
  }

  .impact-quote--b .impact-quote__avatar {
    order: -1;
  }

  .impact-quote--b .impact-quote__body strong {
    text-align: left;
  }

  .impact-cases {
    grid-template-columns: 1fr;
  }

  .impact-stack-note {
    grid-template-columns: 1fr;
  }

  .impact-stack-card {
    justify-content: flex-start;
    padding: 18px;
  }

  .impact-pie {
    width: min(240px, 72vw);
    height: min(240px, 72vw);
  }

  .trace-panel__viewer {
    min-height: 360px;
    height: 60vh;
  }

  .trace-panel__toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .trace-panel__toolbar-end {
    width: 100%;
    justify-content: space-between;
  }

  .trace-tour__card {
    width: calc(100% - 24px);
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 12px !important;
  }
}
