/* Design tokens. Mọi màu trong các file CSS khác đều tham chiếu tới đây, nên đổi theme chỉ cần sửa file này.
   Theme tối bật theo hệ điều hành, hoặc theo lựa chọn lưu ở <html data-theme="dark|light">. */
:root {
  color-scheme: light;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Nền, bề mặt, viền */
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #f8faf8;
  --surface-3: #eef3ef;
  --line: #e2e8e3;
  --line-strong: #cbd6ce;

  /* Chữ: 4 cấp đậm → nhạt */
  --ink: #18261f;
  --ink-2: #33473d;
  --ink-3: #5c6f65;
  --ink-4: #879990;

  /* Màu thương hiệu (xanh rêu) */
  --brand: #1c5a43;
  --brand-strong: #133f2f;
  --brand-ink: #1b6b4c;
  --brand-soft: #e5f2ea;
  --brand-line: #a8cfb9;
  --accent: #3d936a;
  --on-brand: #ffffff;

  /* Họ màu ngữ nghĩa: soft (nền) · line (viền) · base (điểm nhấn) · ink (chữ) */
  --amber-soft: #fdf5e4;
  --amber-line: #eed6a2;
  --amber-base: #d4962a;
  --amber-ink: #82580c;
  --red-soft: #fdebe8;
  --red-line: #f0b8af;
  --red-base: #cc4632;
  --red-ink: #93301f;
  --blue-soft: #edf3fb;
  --blue-line: #bed2ea;
  --blue-base: #3a6ca6;
  --blue-ink: #2a4f7c;
  --violet-soft: #f6eef6;
  --violet-line: #dcc3d8;
  --violet-base: #8a4f7d;
  --violet-ink: #6c3961;

  --ok-bg: var(--brand-soft);
  --ok-line: #2f8a4c;
  --ok-ink: #17582f;
  --bad-bg: var(--red-soft);
  --bad-line: var(--red-base);
  --bad-ink: var(--red-ink);

  /* Màu theo kỹ năng */
  --speaking: #2f8a5f;
  --writing: #3a6ca6;
  --reading: #b8801c;
  --listening: #8a4f7d;

  /* Hình khối */
  --shadow: #10261d;
  --shadow-sm: 0 1px 2px color-mix(in srgb, var(--shadow) 6%, transparent);
  --shadow-md: 0 1px 2px color-mix(in srgb, var(--shadow) 5%, transparent), 0 6px 20px -6px color-mix(in srgb, var(--shadow) 14%, transparent);
  --shadow-lg: 0 24px 60px -16px color-mix(in srgb, var(--shadow) 30%, transparent);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-w: 272px;
  --topbar-h: 60px;

  /* Tên cũ, vẫn được vài chỗ dùng */
  --green: var(--brand);
  --muted: var(--ink-3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1411;
    --surface: #151d19;
    --surface-2: #19221e;
    --surface-3: #1e2a24;
    --line: #26322c;
    --line-strong: #36453d;
    --ink: #e5ede8;
    --ink-2: #c4d1c9;
    --ink-3: #93a59a;
    --ink-4: #6b7c73;
    --brand: #5cbd92;
    --brand-strong: #7fd0aa;
    --brand-ink: #7fd0aa;
    --brand-soft: #1a3128;
    --brand-line: #2e5745;
    --accent: #5cbd92;
    --on-brand: #0b1a13;
    --amber-soft: #2a2213;
    --amber-line: #5b4720;
    --amber-base: #e0a94a;
    --amber-ink: #efc77c;
    --red-soft: #2d1815;
    --red-line: #693027;
    --red-base: #e66f5b;
    --red-ink: #f3a395;
    --blue-soft: #152131;
    --blue-line: #2c4565;
    --blue-base: #6f9fd8;
    --blue-ink: #a9c7ee;
    --violet-soft: #261a26;
    --violet-line: #553a51;
    --violet-base: #c487b6;
    --violet-ink: #ddb3d3;
    --ok-line: #5cbd92;
    --ok-ink: #9be0bf;
    --speaking: #5cbd92;
    --writing: #6f9fd8;
    --reading: #e0a94a;
    --listening: #c487b6;
    --shadow: #000000;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1411;
  --surface: #151d19;
  --surface-2: #19221e;
  --surface-3: #1e2a24;
  --line: #26322c;
  --line-strong: #36453d;
  --ink: #e5ede8;
  --ink-2: #c4d1c9;
  --ink-3: #93a59a;
  --ink-4: #6b7c73;
  --brand: #5cbd92;
  --brand-strong: #7fd0aa;
  --brand-ink: #7fd0aa;
  --brand-soft: #1a3128;
  --brand-line: #2e5745;
  --accent: #5cbd92;
  --on-brand: #0b1a13;
  --amber-soft: #2a2213;
  --amber-line: #5b4720;
  --amber-base: #e0a94a;
  --amber-ink: #efc77c;
  --red-soft: #2d1815;
  --red-line: #693027;
  --red-base: #e66f5b;
  --red-ink: #f3a395;
  --blue-soft: #152131;
  --blue-line: #2c4565;
  --blue-base: #6f9fd8;
  --blue-ink: #a9c7ee;
  --violet-soft: #261a26;
  --violet-line: #553a51;
  --violet-base: #c487b6;
  --violet-ink: #ddb3d3;
  --ok-line: #5cbd92;
  --ok-ink: #9be0bf;
  --speaking: #5cbd92;
  --writing: #6f9fd8;
  --reading: #e0a94a;
  --listening: #c487b6;
  --shadow: #000000;
}
