/* SignCSL — Warm accessible theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  --bg: #faf9f6;
  --card: #ffffff;
  --primary: #2d5a27;
  --primary-light: #bbf7d0;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --text: #1a1a1a;
  --muted: #6b7280;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
}

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

html { font-size: 16px; }
body {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

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

/* ── Header ──────────────────────────── */
.site-header {
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.site-header nav a {
  margin-left: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Footer ──────────────────────────── */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid #e5e7eb;
  margin-top: 40px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }

/* ── Buttons ─────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.btn:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #245020; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #d97706; }
.btn-lg { padding: 14px 28px; font-size: 1.1rem; }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.btn-back { background: none; box-shadow: none; color: var(--muted); font-weight: 500; padding: 8px 12px; }
.btn-back:hover { color: var(--text); box-shadow: none; }

/* ── Landing ─────────────────────────── */
.landing { max-width: 680px; margin: 0 auto; padding: 20px; }

.hero {
  text-align: center;
  padding: 40px 0 24px;
}
.hero-icon { font-size: 4rem; margin-bottom: 8px; }
.hero h1 { font-size: 2.2rem; color: var(--primary); font-weight: 700; }
.hero-sub { font-size: 1.1rem; color: var(--muted); margin-top: 4px; }
.hero-desc { font-size: 0.95rem; color: var(--muted); margin-top: 12px; max-width: 400px; margin-left: auto; margin-right: auto; }

.stats-bar {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 12px;
  background: var(--accent-light);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

/* ── Category Cards ──────────────────── */
.category-cards { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.15s;
}
.category-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.cat-icon { font-size: 2.5rem; }
.cat-info { flex: 1; }
.cat-info h3 { font-size: 1.1rem; margin-bottom: 4px; }
.cat-info p { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.cat-progress { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.cat-progress-bar { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s; }
.cat-count { font-size: 0.8rem; color: var(--muted); }

.mode-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Category Menu ───────────────────── */
.category-menu { max-width: 680px; margin: 0 auto; padding: 20px; }
.category-menu h2 { text-align: center; margin: 16px 0 24px; font-size: 1.5rem; }

.gesture-list { margin-top: 24px; display: flex; flex-direction: column; gap: 8px; }
.gesture-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.gesture-item.done { border-left: 4px solid var(--primary); }
.gesture-check { font-size: 1.1rem; }
.gesture-name { font-weight: 600; min-width: 60px; }
.gesture-desc { color: var(--muted); font-size: 0.9rem; }

/* ── Camera View ─────────────────────── */
.camera-view { max-width: 960px; margin: 0 auto; padding: 12px; }

.camera-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.ref-panel { flex: 0 0 220px; }
.cam-panel { flex: 1; min-width: 0; }

.ref-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}
.ref-card canvas { display: block; margin: 0 auto 12px; }
.ref-card h3 { font-size: 1.3rem; margin-bottom: 4px; }
.ref-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }
.ref-progress { font-size: 0.85rem; color: var(--muted); }
.quiz-score { font-size: 1rem; color: var(--accent); font-weight: 700; margin-top: 8px; }

.cam-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a1a1a;
  aspect-ratio: 4 / 3;
}
.cam-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}
.cam-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.feedback-text {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 12px;
  min-height: 48px;
  color: var(--primary);
}

.mode-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 0;
}

/* ── Free Practice ───────────────────── */
.free-result {
  text-align: center;
  padding: 16px;
  font-size: 1.2rem;
}
.free-match { font-size: 1.5rem; font-weight: 700; color: var(--primary); display: block; }
.free-cat { font-size: 0.85rem; color: var(--muted); }
.free-close { color: var(--accent); }

/* ── Quiz Result ─────────────────────── */
.quiz-result {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
  padding: 40px 20px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.quiz-result h2 { font-size: 1.8rem; margin-bottom: 16px; }
.result-score { font-size: 3rem; font-weight: 700; color: var(--primary); }
.result-pct { font-size: 1.2rem; color: var(--muted); margin-bottom: 16px; }

/* ── Static Pages ────────────────────── */
.static-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px;
}
.static-page h1 { font-size: 1.8rem; margin-bottom: 20px; color: var(--primary); }
.static-page h2 { font-size: 1.3rem; margin: 24px 0 12px; }
.static-page p { margin-bottom: 12px; }
.static-page ul { margin: 12px 0 12px 24px; }
.static-page li { margin-bottom: 8px; }

/* ── Mobile ──────────────────────────── */
@media (max-width: 640px) {
  .camera-layout {
    flex-direction: column-reverse;
  }
  .ref-panel { flex: none; width: 100%; }
  .ref-card { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; }
  .ref-card canvas { width: 80px; height: 96px; margin: 0; flex-shrink: 0; }
  .ref-card h3 { font-size: 1.1rem; }

  .hero h1 { font-size: 1.8rem; }
  .hero-icon { font-size: 3rem; }

  .cam-wrapper { aspect-ratio: 3 / 4; }

  .site-header nav a { margin-left: 10px; font-size: 0.8rem; }
}
