/* ═══════════════════════════════════════════════════════════════
   Hands in Motion — Project Showcase Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
  --bg:           #f8fafc;
  --surface:      #ffffff;
  --hero-bg:      #0f172a;
  --hero-mid:     #1e1b4b;
  --accent:       #6366f1;
  --accent-light: #818cf8;
  --accent-glow:  rgba(99, 102, 241, 0.15);
  --text:         #0f172a;
  --text-muted:   #64748b;
  --border:       #e2e8f0;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.14);
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono:         'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --transition:   0.2s ease;
}

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

html { scroll-behavior: smooth; }

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

img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--hero-bg);
  color: #fff;
  text-align: center;
  padding: 90px 24px 80px;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Layered radial-gradient orbs for depth */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 40%, rgba(99,102,241,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 60%, rgba(139,92,246,0.14) 0%, transparent 70%),
    linear-gradient(135deg, var(--hero-bg) 0%, var(--hero-mid) 100%);
  pointer-events: none;
}

/* Subtle noise texture via SVG data-uri */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.hero-badge {
  display: inline-block;
  background: rgba(99,102,241,0.25);
  border: 1px solid rgba(129,140,248,0.4);
  color: var(--accent-light);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: #94a3b8;
  font-weight: 400;
  margin-bottom: 18px;
}

.hero-value {
  font-size: 0.95rem;
  color: #cbd5e1;
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}

.hero-team {
  font-size: 0.85rem;
  color: #64748b;
  letter-spacing: 0.02em;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  text-decoration: none !important;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.45);
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(99,102,241,0.5);
}

.btn-outline {
  background: transparent;
  color: #c7d2fe;
  border: 1.5px solid rgba(99,102,241,0.5);
}
.btn-outline:hover {
  background: rgba(99,102,241,0.15);
  border-color: var(--accent-light);
  color: #fff;
  transform: translateY(-2px);
}

/* ─── Layout ─────────────────────────────────────────────────── */
main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px;
  border: 1px solid var(--border);
}

/* ─── Section Typography ─────────────────────────────────────── */
.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 3px solid var(--accent);
  padding-bottom: 10px;
  margin-bottom: 8px;
  display: inline-block;
}

.section-lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  margin-top: 6px;
}

/* ─── Demo Video ─────────────────────────────────────────────── */
.video-wrapper video {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #000;
}

.video-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
  font-style: italic;
}

.video-placeholder {
  background: #1e293b;
  border-radius: var(--radius-sm);
  padding: 56px 24px;
  text-align: center;
  border: 2px dashed #334155;
}

.placeholder-icon svg {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
}

.placeholder-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 10px;
}

.placeholder-hint {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.7;
}

.placeholder-hint code {
  background: #0f172a;
  color: var(--accent-light);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.82rem;
}

/* ─── Pipeline ───────────────────────────────────────────────── */
.pipeline-track {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-top: 4px;
}

.pipeline-step {
  flex: 1;
  min-width: 148px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  cursor: default;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  outline: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pipeline-step:hover,
.pipeline-step:focus {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.pipeline-step--accent {
  background: linear-gradient(135deg, #ede9fe, #f0f9ff);
  border-color: var(--accent-light);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-body h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}

.step-body p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.step-file {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: #ede9fe;
  color: var(--accent);
  padding: 3px 7px;
  border-radius: 4px;
  display: inline-block;
  word-break: break-all;
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  padding: 0 6px;
  color: var(--accent-light);
  font-size: 1.4rem;
  flex-shrink: 0;
  user-select: none;
}

/* ─── Dataset ────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: linear-gradient(135deg, #f0f4ff, #faf5ff);
  border: 1.5px solid #e0e7ff;
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.chip {
  background: var(--accent);
  color: #fff;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dataset-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  background: #f8fafc;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ─── Results ────────────────────────────────────────────────── */
.result-img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  margin-top: 8px;
}

.interpretation {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 20px;
  padding: 14px 20px;
  background: #fafafa;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ─── Performance Table ──────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.perf-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

.perf-table td {
  padding: 13px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.row-alt { background: #f8fafc; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tag-fast  { background: #ecfdf5; color: #059669; }
.tag-slow  { background: #fff7ed; color: #d97706; }
.tag-best  { background: #ede9fe; color: var(--accent); }

/* ─── Tabs ───────────────────────────────────────────────────── */
.tab-group { margin-bottom: 16px; }

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  font-family: var(--font);
}

.tab-btn:hover { color: var(--accent); background: var(--accent-glow); }

.tab-btn.tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.tab-panel-active { display: block; }

/* ─── Insight Card ───────────────────────────────────────────── */
.insight-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(135deg, #ede9fe22, #e0f2fe22);
  border: 1.5px solid #c7d2fe;
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-top: 16px;
}

.insight-icon { flex-shrink: 0; line-height: 1.4; }
.insight-icon svg { width: 1.4rem; height: 1.4rem; stroke: var(--accent); vertical-align: middle; }

.insight-card p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
}

/* ─── Live System ────────────────────────────────────────────── */
.live-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  align-items: start;
}

.live-description p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 14px;
}

.live-description p:last-child { margin-bottom: 0; }

.live-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

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

.flow-step {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  text-align: center;
  animation: flow-in 0.4s ease both;
  animation-delay: calc(var(--i) * 0.09s);
}

.flow-step--accent {
  background: linear-gradient(135deg, #ede9fe, #f0f9ff);
  border-color: var(--accent-light);
}

.flow-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.flow-connector {
  width: 2px;
  height: 20px;
  background: repeating-linear-gradient(
    to bottom,
    var(--accent-light) 0px,
    var(--accent-light) 4px,
    transparent 4px,
    transparent 8px
  );
  margin: 0 auto;
  flex-shrink: 0;
}

/* ─── Meta Glasses ───────────────────────────────────────────── */
.glasses-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.glasses-status {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
}

.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.status-current { background: #dcfce7; color: #15803d; }
.status-future  { background: #ede9fe; color: var(--accent); }

.glasses-status p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 12px;
}

.future-list {
  padding-left: 18px;
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ─── Key Insights Grid ──────────────────────────────────────── */
.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.insight-tile {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.insight-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.insight-tile-icon {
  margin-bottom: 10px;
  line-height: 1;
}
.insight-tile-icon svg { width: 1.8rem; height: 1.8rem; stroke: var(--accent); }

.insight-tile h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.insight-tile p {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── Team ───────────────────────────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.team-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
}

.team-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.team-info ul {
  padding-left: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ─── References ─────────────────────────────────────────────── */
.ref-list {
  padding-left: 24px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.75;
}

.ref-list li {
  margin-bottom: 14px;
  padding-left: 6px;
}

.ref-list em { color: var(--text-muted); }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 28px 20px;
  font-size: 0.82rem;
  color: #94a3b8;
  border-top: 1px solid var(--border);
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 800px) {
  .card { padding: 24px 20px; }

  .pipeline-track { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); padding: 2px 0; }

  .live-layout { grid-template-columns: 1fr; }
  .live-flow { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .flow-connector { width: 20px; height: 2px; margin: auto 0; align-self: center;
    background: repeating-linear-gradient(to right, var(--accent-light) 0, var(--accent-light) 4px, transparent 4px, transparent 8px);
  }

  .glasses-layout { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .hero { padding: 64px 16px 56px; min-height: 0; }
  .hero-nav { flex-direction: column; align-items: center; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Print ──────────────────────────────────────────────────── */
@media print {
  html { font-size: 13px; }

  body { background: white; }

  .hero {
    background: #0f172a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 40px 24px;
    min-height: 0;
  }

  .hero-nav { display: none; }

  main { padding: 20px 0; gap: 18px; }

  .card {
    box-shadow: none;
    border: 1px solid #d1d5db;
    page-break-inside: avoid;
    padding: 20px 24px;
  }

  .tab-btn:not(.tab-active) { display: none; }
  .tab-panel { display: block !important; }

  .pipeline-track { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); }

  .live-layout,
  .glasses-layout,
  .insight-grid,
  .team-grid { grid-template-columns: 1fr; }

  .result-img { max-width: 80%; margin: 8px auto; }

  .site-footer { border-top: 1px solid #e5e7eb; }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #6b7280;
  }

  .btn::after { content: none !important; }
}

/* ─── Hero additions ──────────────────────────────────────────── */
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  justify-content: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  margin: 0.6rem 0 1.2rem;
}
.hero-meta strong { color: rgba(255,255,255,0.9); }
.hero-meta-sep { color: rgba(255,255,255,0.3); }

.hero-abstract {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  max-width: 720px;
  margin: 0 auto 1.6rem;
  text-align: left;
}
.abstract-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #818cf8;
  margin: 0 0 0.5rem;
}
.hero-abstract p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.78);
  line-height: 1.7;
  margin: 0;
}

.honor-pledge {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: rgba(129,140,248,0.12);
  border: 1px solid rgba(129,140,248,0.3);
  border-radius: 8px;
  padding: 0.9rem 1.2rem;
  max-width: 680px;
  margin: 1.4rem auto 0;
  text-align: left;
}
.honor-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.honor-pledge p { font-size: 0.85rem; color: rgba(255,255,255,0.8); margin: 0; line-height: 1.6; }
.honor-pledge strong { color: #a5b4fc; }

/* ─── Introduction / subsections ─────────────────────────────── */
.subsection-title {
  font-size: 1rem;
  font-weight: 700;
  color: #3730a3;
  margin: 1.2rem 0 0.4rem;
  padding-left: 0.75rem;
  border-left: 3px solid #818cf8;
}
.section-body {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.75;
  margin: 0 0 0.6rem;
}
.inline-link { color: #4f46e5; text-decoration: underline; text-underline-offset: 2px; }

/* ─── Model cards ─────────────────────────────────────────────── */
.model-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}
.model-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.model-card-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  color: #fff;
}
.model-card-knn  { background: #1c4e80; }
.model-card-lstm { background: #1c7293; }
.model-card-gru  { background: #00875a; }
.model-name { font-size: 1.1rem; font-weight: 700; }
.model-ref  { font-size: 0.78rem; opacity: 0.8; }
.model-card-body { padding: 0.9rem 1rem; }
.model-card-body p { font-size: 0.9rem; color: #475569; line-height: 1.7; margin: 0; }

/* ─── Reference superscripts in table ────────────────────────── */
.ref-sup {
  font-size: 0.72rem;
  color: #818cf8;
  vertical-align: super;
  margin-left: 2px;
  font-weight: 600;
}

/* ─── Role statement ──────────────────────────────────────────── */
.role-statement {
  font-size: 0.88rem;
  color: #64748b;
  font-style: italic;
  border-left: 3px solid #818cf8;
  padding-left: 0.9rem;
  margin-bottom: 1.4rem;
  line-height: 1.6;
}
