/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --surface: #ffffff;
  --border: #e5e8ed;
  --border-strong: #d0d5dd;
  --accent: #2563eb;
  --accent-light: #eff4ff;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --red-light: #fef2f2;
  --text: #111827;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 10px;
  --radius-sm: 6px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ───────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 28px; }
.container.narrow { max-width: 760px; }

.section { padding: 72px 0; }
.section.bg-subtle { background: var(--bg-subtle); }

/* ─── Hero ─────────────────────────────────────────────────────── */
.hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 80px 0 64px;
  text-align: center;
}

.tag {
  display: inline-block;
  background: var(--accent-light);
  border: 1px solid #bfdbfe;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 18px;
}

.subtitle {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--text-muted);
  font-size: 1rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Section titles ───────────────────────────────────────────── */
.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.section-sub { color: var(--text-muted); margin-bottom: 32px; margin-top: -8px; font-size: 0.92rem; }

/* ─── Overview text ────────────────────────────────────────────── */
.section p { color: #374151; font-size: 0.96rem; line-height: 1.75; }

/* ─── Method cards ─────────────────────────────────────────────── */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.method-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.method-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 12px rgba(37,99,235,0.07);
}

.method-icon { font-size: 1.6rem; margin-bottom: 12px; }
.method-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.method-card p { color: var(--text-muted); font-size: 0.87rem; margin-bottom: 14px; line-height: 1.65; }

.formula {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #1e40af;
}

/* ─── Pipeline ──────────────────────────────────────────────────── */
.pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pipe-block {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  min-width: 88px;
}
.pipe-block small {
  font-size: 0.7rem;
  font-weight: 400;
  display: block;
  font-family: var(--mono);
  opacity: 0.8;
}

.pipe-block.sensor     { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.pipe-block.controller { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.pipe-block.data       { background: #fff7ed; border: 1px solid #fed7aa; color: #c2410c; }
.pipe-block.rl         { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.pipe-block.output     { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.pipe-block.robot      { background: #f5f3ff; border: 1px solid #ddd6fe; color: #6d28d9; }
.pipe-arrow            { color: var(--text-dim); font-size: 1rem; }

/* ─── Architecture ──────────────────────────────────────────────── */
.model-overview {
  padding-top: 48px;
  padding-bottom: 48px;
}

.model-figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.05);
}
.model-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.model-caption {
  margin: 0;
  padding: 14px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.arch-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.arch-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.audio-header { background: #eff6ff; }
.face-header  { background: #f0fdf4; }
.dec-header   { background: #fff7ed; }

.arch-icon { font-size: 1.4rem; flex-shrink: 0; }
.arch-title { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.arch-io { font-size: 0.75rem; color: var(--text-muted); font-family: var(--mono); margin-top: 2px; }

.arch-layers { padding: 12px 0; }

.arch-layer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px;
  font-size: 0.8rem;
  border-bottom: 1px solid #f1f3f5;
  transition: background 0.1s;
}
.arch-layer:last-child { border-bottom: none; }
.arch-layer:hover { background: var(--bg-subtle); }
.arch-layer.accent-layer { background: var(--accent-light); }

.layer-name {
  font-weight: 600;
  color: var(--text);
  width: 80px;
  flex-shrink: 0;
}
.layer-shape {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #1e40af;
  flex: 1;
}
.layer-note {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: right;
  width: 90px;
  flex-shrink: 0;
}

.fusion-note {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.fusion-note strong { color: var(--text); }

/* ─── Training Phases ────────────────────────────────────────────── */
.phase-list { display: flex; flex-direction: column; gap: 14px; }

.phase-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color 0.15s;
}
.phase-item:hover { border-color: #93c5fd; }

.phase-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  margin-top: 2px;
}
.phase-1 { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.phase-2 { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.phase-3 { background: var(--accent-light); color: var(--accent); border: 1px solid #bfdbfe; }

.phase-body { flex: 1; }
.phase-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.phase-range {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono);
  font-weight: 400;
}
.phase-desc { font-size: 0.84rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 10px; }

/* ─── Preprocessing Steps ─────────────────────────────────────────── */
.preprocess-grid {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.pp-step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: center;
  min-width: 130px;
  max-width: 150px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pp-step:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 10px rgba(37,99,235,0.07);
}
.pp-step.ready {
  background: var(--accent-light);
  border-color: #bfdbfe;
}

.pp-num {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.pp-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.pp-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.pp-arrow {
  color: var(--text-dim);
  font-size: 1rem;
  flex-shrink: 0;
}

/* ─── Tech Stack ────────────────────────────────────────────────── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.tech-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color 0.15s;
}
.tech-item:hover { border-color: #93c5fd; }
.tech-name { font-weight: 600; font-size: 0.88rem; margin-bottom: 3px; color: var(--text); }
.tech-role { color: var(--text-muted); font-size: 0.76rem; }

/* ─── Table ──────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 12px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 18px;
  font-size: 0.87rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }

code {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #1e40af;
  background: #eff6ff;
  padding: 2px 6px;
  border-radius: 3px;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: 36px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}
.footer-note { font-size: 0.76rem; color: var(--text-dim); margin-top: 5px; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .pipeline { gap: 6px; padding: 16px; }
  .pipe-block { min-width: 68px; padding: 8px 10px; font-size: 0.73rem; }
  .hero { padding: 60px 0 48px; }
  .section { padding: 52px 0; }
  .preprocess-grid { gap: 6px; }
  .pp-step { min-width: 110px; padding: 12px 12px; }
  .pp-arrow.mobile-hide { display: none; }
  .arch-grid { grid-template-columns: 1fr; }
  .phase-item { flex-direction: column; gap: 10px; }
  .layer-note { display: none; }
}
