/* ============================================================================
 * LingoSub — hệ thống giao diện cho lingosub.fteam.vn
 *
 * Bản dịch từ thiết kế Stitch "LingoSub - Trang giới thiệu sản phẩm Android"
 * (projects/4311974762801272741/screens/cfcadf8bdbe340f08b8c7be798933ca4).
 * Thiết kế gốc dùng Tailwind CDN + JS + ảnh nóng từ Google; ở đây chuyển thành
 * CSS tĩnh, tự chứa, để trang vẫn đọc được khi JavaScript bị tắt và không phụ
 * thuộc CDN nào.
 *
 * Bảng màu và thang chữ lấy nguyên từ designMd "Paper Clay" của Stitch.
 * ========================================================================= */

/* ---------------------------------------------------------------- token màu */
:root {
  /* Nền giấy và các lớp bề mặt */
  --sand:            #faf9f5;   /* nền trang */
  --card:            #f5f4ef;   /* thẻ, ô phụ đề */
  --card-hover:      #edece5;
  --raised:          #ffffff;   /* lớp nổi hơn card (popover) */
  --sunken:          #faf9f5;   /* ô lồng trong card */

  /* Chữ */
  --text:            #3d3929;
  --text-soft:       #56423c;
  --muted:           #6e6d68;

  /* Đường kẻ */
  --border:          #dad9d4;
  --border-soft:     rgba(218, 217, 212, 0.6);

  /* Màu nhấn terracotta (đất nung) */
  --brand:           #c96442;
  --brand-hover:     #b55433;
  --brand-tint:      #f6ece8;   /* nền nhạt của nhãn/mục đang chọn */
  --brand-10:        rgba(201, 100, 66, 0.10);
  --brand-15:        rgba(201, 100, 66, 0.15);
  --brand-20:        rgba(201, 100, 66, 0.20);
  --brand-30:        rgba(201, 100, 66, 0.30);
  --brand-deep:      #9a4021;

  /* Trạng thái */
  --ok:              #059669;   /* xanh lá: đã xử lý, đúng */
  --ok-bg:           rgba(16, 185, 129, 0.10);
  --ok-border:       rgba(16, 185, 129, 0.20);
  --warn-bg:         #fffbeb;   /* nền ô nhại giọng */
  --warn-border:     #fde68a;
  --warn-text:       #b45309;
  --danger:          #dc2626;

  /* Thang xám cho khung điện thoại và màn hình video */
  --zinc-800:        #27272a;
  --zinc-900:        #18181b;
  --zinc-700:        #3f3f46;
  --zinc-400:        #a1a1aa;

  /* Bo góc */
  --r-sm:  0.5rem;
  --r-md:  0.75rem;
  --r-lg:  1rem;
  --r-xl:  1.5rem;
  --r-2xl: 2rem;
  --r-phone: 2.5rem;
  --r-full: 9999px;

  /* Đổ bóng — màu nâu ấm, không dùng đen xám */
  --sh-sm:    0 1px 3px rgba(61, 57, 41, 0.06);
  --sh-warm:  0 8px 30px rgba(61, 57, 41, 0.07);
  --sh-warm-lg: 0 14px 40px rgba(61, 57, 41, 0.12);
  --sh-brand: 0 10px 25px -3px rgba(201, 100, 66, 0.35);
  --sh-brand-sm: 0 4px 12px rgba(201, 100, 66, 0.25);

  /* Bố cục */
  --page:     80rem;   /* nội dung rộng nhất */
  --narrow:   64rem;
  --text-col: 56rem;
  --gutter:   1.5rem;

  color-scheme: light;
}

/* Chế độ tối.
 *
 * Hai đường vào, cùng một bảng màu nên phải sửa cả hai nếu đổi token:
 *   1. `html[data-theme="dark"]` — do nút đổi sáng/tối đặt, và script ở <head>
 *      đặt sẵn trước khi vẽ để không nháy trắng.
 *   2. `prefers-color-scheme: dark` — dùng khi JavaScript bị tắt. Tôn trọng lựa
 *      chọn đã lưu: data-theme="light" luôn thắng cài đặt hệ thống. */
:root[data-theme="dark"] { color-scheme: dark; }

:root[data-theme="dark"] {
  --sand:        #262624;
  --card:        #2c2c2b;
  --card-hover:  #363634;
  --raised:      #363634;
  --sunken:      #262624;

  --text:        #f1f1ef;
  --text-soft:   #e4e2dd;
  --muted:       #b7b5a9;

  --border:      #3e3e38;
  --border-soft: rgba(62, 62, 56, 0.6);

  --brand:       #d97757;
  --brand-hover: #c96442;
  --brand-tint:  #2c2c2b;
  --brand-deep:  #d97757;

  --ok:          #34d399;
  --ok-bg:       rgba(16, 185, 129, 0.14);
  --ok-border:   rgba(16, 185, 129, 0.30);
  --warn-bg:     #2e2b24;
  --warn-border: rgba(120, 53, 15, 0.5);
  --warn-text:   #fbbf24;

  --zinc-800:    #3f3f46;
  --zinc-400:    #d4d4d8;

  --sh-sm:    0 1px 3px rgba(0, 0, 0, 0.5);
  --sh-warm:  0 8px 30px rgba(0, 0, 0, 0.4);
  --sh-warm-lg: 0 14px 40px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --sand:        #262624;
    --card:        #2c2c2b;
    --card-hover:  #363634;
    --raised:      #363634;
    --sunken:      #262624;

    --text:        #f1f1ef;
    --text-soft:   #e4e2dd;
    --muted:       #b7b5a9;

    --border:      #3e3e38;
    --border-soft: rgba(62, 62, 56, 0.6);

    --brand:       #d97757;
    --brand-hover: #c96442;
    --brand-tint:  #2c2c2b;
    --brand-deep:  #d97757;

    --ok:          #34d399;
    --ok-bg:       rgba(16, 185, 129, 0.14);
    --ok-border:   rgba(16, 185, 129, 0.30);
    --warn-bg:     #2e2b24;
    --warn-border: rgba(120, 53, 15, 0.5);
    --warn-text:   #fbbf24;

    --zinc-800:    #3f3f46;
    --zinc-400:    #d4d4d8;

    --sh-sm:    0 1px 3px rgba(0, 0, 0, 0.5);
    --sh-warm:  0 8px 30px rgba(0, 0, 0, 0.4);
    --sh-warm-lg: 0 14px 40px rgba(0, 0, 0, 0.5);
  }
}

/* --------------------------------------------------------------- nền tảng */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; border-style: none; }
a { color: var(--brand); }

::selection { background: var(--brand-20); color: var(--brand); }

/* Nhảy tới #mục không bị thanh trên che mất */
section[id], footer[id] { scroll-margin-top: 6rem; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Chữ mono cho mốc thời gian, mã gói, phiên bản — canh cột không nhảy */
.mono {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-ligatures: none;
}

/* ------------------------------------------------------- khung và tiêu đề */
.container { width: 100%; max-width: var(--page);  margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: var(--narrow); }
.container--text   { max-width: var(--text-col); }

.section { padding: 5rem 0; }
.section--tint { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section--tint-top { background: var(--card); border-top: 1px solid var(--border); }

.eyebrow {
  display: inline-block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-10);
  padding: 0.25rem 0.75rem;
  border-radius: var(--r-full);
}

.section-head { max-width: 48rem; margin: 0 auto 4rem; text-align: center; }
.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 1rem 0 0.75rem;
}
.section-head p { margin: 0; color: var(--muted); font-size: 1rem; }

/* ------------------------------------------------------------ thanh trên */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--sand) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand__mark {
  width: 2.75rem; height: 2.75rem;
  flex: none;
  border-radius: var(--r-lg);
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.25rem;
  box-shadow: var(--sh-brand-sm);
}
.brand__text { display: flex; flex-direction: column; }
.brand__name {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.15; color: var(--text);
}
.brand__tag {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand);
}

.site-nav { display: none; align-items: center; gap: 2rem; font-size: 0.875rem; font-weight: 500; }
.site-nav a {
  color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.375rem;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--brand); }

/* Chấm nhấp nháy cạnh mục "Trải nghiệm thử" */
.live-dot { position: relative; display: inline-flex; width: 0.5rem; height: 0.5rem; }
.live-dot::before {
  content: ''; position: absolute; inset: 0;
  border-radius: var(--r-full); background: var(--brand);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.live-dot::after {
  content: ''; position: relative; width: 0.5rem; height: 0.5rem;
  border-radius: var(--r-full); background: var(--brand);
}

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

/* Nút đổi sáng/tối. Chỉ hiện khi JavaScript chạy được (script ở <head> đặt
 * data-js="1"); không có JS thì nút không làm gì được nên ẩn hẳn, và chế độ
 * tối vẫn hoạt động theo cài đặt hệ thống qua @media ở trên. */
.theme-toggle {
  display: none;
  padding: 0.625rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  align-items: center; justify-content: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
:root[data-js="1"] .theme-toggle { display: inline-flex; }
.theme-toggle:hover { border-color: var(--brand); }
.theme-toggle svg { width: 1.25rem; height: 1.25rem; display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Bộ chuyển ngôn ngữ VI | EN */
.lang-switch {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--card);
  font-size: 0.75rem; font-weight: 700;
  font-family: 'Geist Mono', ui-monospace, monospace;
}
.lang-switch a, .lang-switch span {
  padding: 0.5rem 0.625rem;
  text-decoration: none;
  color: var(--muted);
  line-height: 1;
}
.lang-switch a:hover { color: var(--brand); background: var(--brand-10); }
.lang-switch [aria-current="true"] { background: var(--brand); color: #fff; }

/* --------------------------------------------------------------- nút bấm */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.625rem;
  font-weight: 600; font-size: 1rem;
  border-radius: var(--r-lg);
  padding: 1rem 1.75rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.btn--primary:hover { background: var(--brand-hover); }

.btn--ghost {
  background: var(--card); color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--card-hover); }

.btn--sm { padding: 0.625rem 1.25rem; font-size: 0.875rem; border-radius: var(--r-lg); }

/* Nút tải APK ở thanh trên (ẩn ở màn hẹp) */
.btn--header { display: none; }

/* --------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; padding: 3rem 0 5rem; text-align: center; }
.hero::before {
  content: '';
  position: absolute; top: 22%; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 350px; max-width: 100%;
  background: linear-gradient(to top right, var(--brand-10), var(--brand-tint));
  border-radius: var(--r-full);
  filter: blur(64px);
  pointer-events: none;
  z-index: -1;
}

.badge-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: var(--r-full);
  border: 1px solid var(--brand-30);
  background: var(--brand-tint);
  color: var(--brand);
  font-size: 0.8125rem; font-weight: 600;
  margin-bottom: 1.5rem;
}
.badge-pill__dot { width: 0.375rem; height: 0.375rem; border-radius: var(--r-full); background: var(--brand); }
.badge-pill__id { font-size: 11px; color: var(--muted); }

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 1.5rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--brand);
  text-decoration: underline wavy var(--brand-30);
  text-underline-offset: 0.5rem;
}
.hero__lede {
  max-width: 48rem; margin: 0 auto 2.5rem;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--muted);
  line-height: 1.7;
}
.hero__cta {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1rem; margin-bottom: 3rem;
}
.hero__cta .btn { width: 100%; }
.hero__cta .btn--primary { flex-direction: column; gap: 0.25rem; padding: 1rem 2rem; }
.hero__cta .btn--primary strong { font-size: 1.0625rem; display: flex; align-items: center; gap: 0.625rem; }
.hero__cta .btn--primary small {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; font-weight: 400; color: rgba(255, 255, 255, 0.8);
}
.hero__cta .btn--ghost svg { width: 1rem; height: 1rem; color: var(--brand); }

.platforms {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  max-width: 42rem; margin: 0 auto;
}
.platforms p {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0 0 1rem;
}
.platforms ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem;
}
.platforms li {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--r-md);
  background: var(--card); border: 1px solid var(--border);
  font-size: 0.75rem; font-weight: 500;
  transition: transform 0.2s ease;
}
.platforms li:hover { transform: translateY(-2px); }
.platforms .dot { width: 0.625rem; height: 0.625rem; border-radius: var(--r-full); flex: none; }
.dot--youtube { background: #ef4444; }
.dot--douyin  { background: #ec4899; }
.dot--bilibili{ background: #38bdf8; }
.dot--tiktok  { background: #111111; }
.dot--file    { background: #10b981; }
:root[data-theme="dark"] .dot--tiktok { background: #ffffff; }

/* --------------------------------------------------- mô phỏng trình phát */
.simulator {
  background: var(--sand);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-warm-lg);
  overflow: hidden;
  text-align: left;
}
.sim-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 60%, transparent);
}
.sim-topbar__left { display: flex; align-items: center; gap: 0.75rem; }
.sim-topbar__mark {
  width: 2rem; height: 2rem; border-radius: var(--r-md);
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem;
}
.sim-topbar__title { font-weight: 700; font-size: 0.875rem; }
.sim-topbar__id {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px; color: var(--muted);
}
.chip-live {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--r-sm);
  background: var(--ok-bg); border: 1px solid var(--ok-border);
  color: var(--ok);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; font-weight: 600;
}
.chip-live .dot {
  width: 0.375rem; height: 0.375rem; border-radius: var(--r-full);
  background: var(--ok); animation: pulse 2s ease-in-out infinite;
}

/* Nút "Luyện nhại giọng" trên thẻ phụ đề — nền đặc màu thương hiệu */
.btn-shadow {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border: 0; border-radius: var(--r-md);
  background: var(--brand); color: #fff;
  font-family: inherit; font-size: 0.75rem; font-weight: 500;
  cursor: pointer; box-shadow: var(--sh-sm);
  transition: background-color 0.2s ease;
}
.btn-shadow:hover { background: var(--brand-hover); }

/* Màn hình video */
.sim-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--zinc-900);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.sim-screen__bg {
  position: absolute; inset: 0;
  background-image: url('shots/hero-bg.jpg');
  background-size: cover; background-position: center;
  opacity: 0.65;
}
.sim-screen::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.6));
}
.sim-screen__top {
  position: absolute; top: 1rem; left: 1rem; right: 1rem; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
}
.tag-source {
  background: #dc2626; color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.125rem 0.5rem; border-radius: 0.25rem;
}
.sim-screen__tools { display: flex; gap: 0.5rem; }
.sim-screen__tools button {
  padding: 0.375rem; border: 0; border-radius: var(--r-full);
  background: rgba(0, 0, 0, 0.4); color: rgba(255, 255, 255, 0.8);
  cursor: pointer; display: inline-flex;
}
.sim-screen__tools button:hover { background: rgba(0, 0, 0, 0.7); }
.sim-screen__tools svg { width: 1rem; height: 1rem; }

.sim-screen__controls {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
}
.sim-btn-round {
  width: 2.5rem; height: 2.5rem; border: 0; border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.2); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.15s ease, background-color 0.15s ease;
}
.sim-btn-round:hover { background: rgba(255, 255, 255, 0.3); }
.sim-btn-round:active { transform: scale(0.95); }
.sim-btn-round .mono { font-size: 0.75rem; font-weight: 700; }
.sim-btn-play {
  width: 4rem; height: 4rem; border: 0; border-radius: var(--r-full);
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--sh-brand);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.sim-btn-play:hover { background: var(--brand-hover); }
.sim-btn-play:active { transform: scale(0.9); }
.sim-btn-play svg { width: 2rem; height: 2rem; }

.sim-screen__bottom { position: absolute; bottom: 0.75rem; left: 1rem; right: 1rem; z-index: 2; }
.progress-track { width: 100%; height: 0.375rem; border-radius: var(--r-full); background: rgba(255,255,255,0.2); overflow: hidden; margin-bottom: 0.5rem; }
.progress-fill { height: 100%; width: 42%; border-radius: var(--r-full); background: var(--brand); }
.sim-screen__meta {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; color: rgba(255, 255, 255, 0.9);
  flex-wrap: wrap;
}
.sim-screen__meta span {
  background: rgba(0, 0, 0, 0.4); padding: 0.125rem 0.5rem; border-radius: 0.25rem;
}

/* Bảng lời thoại */
.transcript { padding: 1.5rem; }
.transcript__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.transcript__head h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.transcript__head-left { display: flex; align-items: center; gap: 0.5rem; }
.transcript__badge {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; color: var(--brand);
  background: var(--card); border: 1px solid var(--border);
  padding: 0.125rem 0.5rem; border-radius: 0.25rem;
}
.transcript__hint {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; color: var(--muted);
}

.cue {
  padding: 1.5rem;
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--border);
}
.cue__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  flex-wrap: wrap;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; color: var(--muted);
  margin-bottom: 0.75rem;
}
.cue__head-left { display: flex; align-items: center; gap: 0.5rem; }
.cue__head .playing { color: var(--brand); font-weight: 700; }
.cue__pulse { width: 0.5rem; height: 0.5rem; border-radius: var(--r-full); background: var(--brand); animation: pulse 2s ease-in-out infinite; }
.cue__actions { display: flex; align-items: center; gap: 0.75rem; }

.pinyin {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.9375rem; letter-spacing: 0.05em;
  color: var(--brand); margin-bottom: 0.5rem;
}
.tokens { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 1.875rem; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 0.75rem; }
.word-token {
  padding: 0.25rem 0.5rem;
  border-radius: var(--r-md);
  background: var(--raised);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.word-token:hover { background: var(--brand-10); border-color: var(--brand); }
.word-token.is-active { background: var(--brand-15); border-color: var(--brand); color: var(--brand); }
.word-token--plain { background: none; cursor: default; color: var(--zinc-400); padding-left: 0.25rem; padding-right: 0.25rem; }
.word-token--plain:hover { background: none; border-color: transparent; }

.cue__translation {
  font-size: 1rem; font-style: italic; font-weight: 500;
  color: var(--text-soft); margin: 0.25rem 0 0;
}

/* Thẻ tra từ */
.dict {
  margin-top: 1rem; padding: 1rem;
  border-radius: var(--r-xl);
  background: var(--raised);
  border: 1px solid var(--border);
  box-shadow: var(--sh-warm);
}
.dict__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dict__word { font-size: 1.5rem; font-weight: 700; }
.dict__pinyin {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.875rem; font-weight: 600; color: var(--brand);
  background: var(--brand-tint); padding: 0.125rem 0.625rem; border-radius: var(--r-sm);
}
.dict__hsk {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; font-weight: 600;
  background: rgba(245, 158, 11, 0.1); color: #b45309;
  padding: 0.125rem 0.5rem; border-radius: 0.25rem;
}
:root[data-theme="dark"] .dict__hsk { color: #fbbf24; }
.dict__row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.dict__hanviet { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.dict__hanviet strong { color: var(--text); }
.dict__save {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--r-md);
  background: var(--card); border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem; font-weight: 500; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.dict__save:hover, .dict__save.is-saved { background: var(--brand); border-color: var(--brand); color: #fff; }
.dict__def {
  font-size: 0.8125rem; line-height: 1.65;
  margin: 0.5rem 0 0; padding-top: 0.5rem;
  border-top: 1px solid var(--border-soft);
}

/* Ô nhại giọng */
.shadow-panel {
  margin-top: 1rem; padding: 1rem;
  border-radius: var(--r-xl);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
}
.shadow-panel__row { display: flex; flex-direction: column; gap: 1rem; }
.shadow-panel__left { display: flex; align-items: center; gap: 0.75rem; }
.mic-btn {
  width: 3rem; height: 3rem; flex: none;
  border: 0; border-radius: var(--r-full);
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--sh-brand);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mic-btn:hover { transform: scale(1.05); }
.mic-btn.is-recording { animation: pulse 1.5s ease-in-out infinite; box-shadow: 0 0 0 4px var(--brand-30); }
.mic-btn svg { width: 1.5rem; height: 1.5rem; }
.shadow-panel__title { font-weight: 700; font-size: 0.875rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.shadow-panel__sub { font-size: 0.75rem; color: var(--muted); }
.rec-badge {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px; padding: 0.125rem 0.5rem; border-radius: 0.25rem;
  background: var(--danger); color: #fff; animation: pulse 1.5s ease-in-out infinite;
}
.rec-badge[hidden] { display: none; }

.waveform {
  display: flex; align-items: center; gap: 0.25rem; height: 2rem;
  padding: 0.25rem 0.75rem;
  background: color-mix(in srgb, var(--raised) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.waveform i {
  width: 0.25rem; height: 0.375rem; border-radius: var(--r-full);
  background: var(--brand); animation: wave 1.1s ease-in-out infinite;
}
.waveform i:nth-child(2) { animation-delay: 0.1s; }
.waveform i:nth-child(3) { animation-delay: 0.2s; }
.waveform i:nth-child(4) { animation-delay: 0.3s; }
.waveform i:nth-child(5) { animation-delay: 0.4s; }
.waveform i:nth-child(6) { animation-delay: 0.5s; }
.waveform__score {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; font-weight: 700; color: var(--ok);
  margin-left: 0.5rem; white-space: nowrap;
}
.phonemes {
  margin-top: 0.75rem; padding-top: 0.5rem;
  border-top: 1px solid var(--warn-border);
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px; color: var(--ok); font-weight: 600;
}

/* ------------------------------------------------------- lưới tính năng */
.bento { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.feature-card {
  padding: 2rem;
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--sh-warm); }
.feature-card__icon {
  width: 3rem; height: 3rem;
  border-radius: var(--r-lg);
  background: var(--brand-10); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: 1.5rem;
}
.feature-card h3 { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.75rem; line-height: 1.3; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.7; }
.feature-card__box {
  padding: 1rem;
  border-radius: var(--r-xl);
  background: var(--sunken);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
}
.feature-card__box--row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.feature-card__box .mono { color: var(--brand); font-size: 0.75rem; }
.feature-card__box strong { font-weight: 600; }
.pill-note {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; font-weight: 700;
  color: var(--brand); background: var(--brand-tint);
  padding: 0.25rem 0.5rem; border-radius: var(--r-sm);
  white-space: nowrap;
}
.srs-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; text-align: center; }
.srs-scale div {
  padding: 0.5rem; border-radius: var(--r-md);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; font-weight: 700; line-height: 1.35;
}
.srs-scale span { display: block; font-size: 10px; font-weight: 400; }
.srs-again { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.srs-hard  { background: rgba(161, 161, 170, 0.22); color: var(--muted); }
.srs-good  { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.srs-easy  { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .srs-again { color: #fca5a5; }
:root[data-theme="dark"] .srs-good  { color: #fbbf24; }

/* ------------------------------------------------------- ảnh màn hình */
.shots { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.shot { display: flex; flex-direction: column; align-items: center; }
.phone {
  width: 100%; max-width: 300px;
  padding: 0.75rem;
  border-radius: var(--r-phone);
  background: var(--zinc-900);
  border: 4px solid var(--zinc-700);
  box-shadow: var(--sh-warm-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.shot:hover .phone { transform: translateY(-8px); box-shadow: var(--sh-warm-lg), 0 20px 40px rgba(61, 57, 41, 0.18); }
.phone__screen {
  border-radius: var(--r-2xl); overflow: hidden;
  background: #000; aspect-ratio: 9 / 19.5;
}
.phone__screen img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s ease;
}
.shot:hover .phone__screen img { transform: scale(1.04); }
.shot h4 { font-size: 1rem; font-weight: 700; margin: 1rem 0 0; text-align: center; }
.shot p {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; color: var(--muted); margin: 0.25rem 0 0; text-align: center;
}

/* --------------------------------------------------------------- cài đặt */
.install {
  padding: 2rem;
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--sh-warm-lg);
}
.install__top {
  display: flex; flex-direction: column; gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.install__brand { display: flex; align-items: center; gap: 1rem; }
.install__mark {
  width: 4rem; height: 4rem; flex: none;
  border-radius: var(--r-lg);
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.875rem;
  box-shadow: var(--sh-brand);
}
.install__brand h3 { font-size: clamp(1.375rem, 4vw, 1.875rem); font-weight: 700; margin: 0; }
.install__brand p {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.875rem; color: var(--muted); margin: 0.25rem 0 0;
}
.install__brand p strong { color: var(--brand); }
.install__meta { text-align: left; }
.install__version {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--r-full);
  border: 1px solid var(--brand-20);
  background: var(--brand-10); color: var(--brand);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; font-weight: 700;
}
.install__size {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem;
}
.install__download { margin: 2rem 0; text-align: center; }
.install__download .btn { width: 100%; padding: 1.25rem 2.5rem; font-size: 1.125rem; font-weight: 700; border-radius: var(--r-xl); }
.install__hash {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; color: var(--muted); margin: 0.5rem 0 0;
  word-break: break-all;
}
.install__steps { padding-top: 1rem; }
.install__steps h4 { font-size: 1.125rem; font-weight: 700; margin: 0 0 1rem; }
.steps { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.step {
  padding: 1rem;
  border-radius: var(--r-xl);
  background: var(--sunken);
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}
.step:hover { transform: translateY(-4px); }
.step__num {
  width: 2rem; height: 2rem; margin-bottom: 0.75rem;
  border-radius: var(--r-md);
  background: var(--brand-10); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem;
}
.step h5 { font-size: 0.875rem; font-weight: 700; margin: 0 0 0.25rem; }
.step p { font-size: 0.75rem; color: var(--muted); line-height: 1.6; margin: 0; }

/* --------------------------------------------------------------- chân trang */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 3.5rem 0;
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 3rem; }
.footer-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.footer-brand__mark {
  width: 2.5rem; height: 2.5rem; border-radius: var(--r-lg);
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.25rem;
}
.footer-brand span { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.footer-about { font-size: 0.875rem; color: var(--muted); line-height: 1.7; margin: 0 0 1rem; max-width: 24rem; }
.footer-contact {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; color: var(--muted);
}
.footer-contact a { color: var(--brand); font-weight: 700; text-decoration: none; }
.footer-contact a:hover { text-decoration: underline; }
.site-footer h4 {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 1rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.site-footer ul a { color: var(--muted); text-decoration: none; font-size: 0.875rem; }
.site-footer ul a:hover { color: var(--brand); }
.footer-meta {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.75rem; color: var(--muted);
}
.footer-meta li { display: block; }
.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  font-size: 0.75rem; color: var(--muted);
  text-align: center;
}
.footer-bottom__links {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  justify-content: center;
  font-family: 'Geist Mono', ui-monospace, monospace;
}
.footer-bottom__links a { color: var(--muted); text-decoration: none; }
.footer-bottom__links a:hover { color: var(--brand); }

/* ------------------------------------------------------- trang pháp lý */
.legal { padding: 2.5rem 0 4rem; }
.legal__head { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 1.5rem; }
.legal__mark {
  width: 2.75rem; height: 2.75rem; flex: none;
  border-radius: var(--r-lg);
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.375rem;
}
.legal h1 { font-size: 1.625rem; letter-spacing: -0.01em; margin: 0; }
.legal h2 { font-size: 1.1875rem; margin: 2rem 0 0.625rem; letter-spacing: -0.01em; }
.legal h3 { font-size: 1rem; margin: 1.25rem 0 0.375rem; }
.legal p, .legal li { margin: 0.5rem 0; line-height: 1.7; }
.legal ul { padding-left: 1.375rem; }
.legal .meta { color: var(--muted); font-size: 0.875rem; margin: 0.25rem 0 0; }
.legal code {
  font-family: 'Geist Mono', ui-monospace, monospace;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px; font-size: 0.875rem;
}
.legal hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.legal section { scroll-margin-top: 6rem; }
.legal table { border-collapse: collapse; width: 100%; margin: 0.75rem 0; font-size: 0.9375rem; }
.legal th, .legal td { border: 1px solid var(--border); padding: 0.5625rem 0.6875rem; text-align: left; vertical-align: top; }
.legal th { background: var(--card); font-weight: 600; }

/* Bảng bốn cột trên điện thoại: mỗi hàng xếp lại thành một khối, mỗi ô có nhãn
 * riêng. Bảng bốn cột không co vừa màn hình 360–390 px — cột hẹp tới mức chữ
 * gãy thành ba bốn dòng, và cuộn ngang thì người đọc thường không nhận ra.
 *
 * Chỉ bảng có gắn class `stackable` mới đổi kiểu; bảng của trang quyền riêng tư
 * giữ nguyên dạng bảng (nội dung trang đó đã được duyệt, không đụng vào).
 *
 * Nhãn nằm trong DOM dưới dạng <span class="lbl"> chứ không phải nội dung sinh
 * bằng CSS, để trình đọc màn hình đọc được — hàng tiêu đề bị ẩn ở khổ hẹp nên
 * nếu nhãn chỉ là ::before thì thông tin cột sẽ mất. */
.lbl { display: none; }

@media (max-width: 640px) {
  .legal table.stackable,
  .legal table.stackable tbody,
  .legal table.stackable tr,
  .legal table.stackable td { display: block; width: 100%; }

  .legal table.stackable tr:first-child { display: none; }

  .legal table.stackable tr {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 0.875rem;
    background: var(--sunken);
  }
  .legal table.stackable td { border: 0; border-top: 1px solid var(--border); }
  .legal table.stackable td:first-child {
    border-top: 0;
    background: var(--card);
    font-weight: 600;
  }
  .legal table.stackable .lbl {
    display: block;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.1875rem;
  }
  .legal table.stackable td:first-child .lbl { display: none; }
}
.legal__card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.125rem 1.375rem; margin: 1.125rem 0;
}
.legal__footer {
  margin-top: 2rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.875rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
}

/* ------------------------------------------------------------- hoạt ảnh */
@keyframes ping   { 75%, 100% { transform: scale(2); opacity: 0; } }
@keyframes pulse  { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes wave   { 0%, 100% { height: 0.375rem; } 50% { height: 1.75rem; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(1rem); } to { opacity: 1; transform: none; } }

.fade-up { animation: fadeUp 0.6s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .feature-card:hover, .shot:hover .phone, .step:hover { transform: none; }
  .btn:hover { transform: none; }
}

/* ------------------------------------------------------- màn hình hẹp */
/* Điện thoại 390px: nhãn phụ của logo phải nằm gọn một dòng, nếu không nó
 * xuống hai dòng và đội chiều cao thanh trên. */
@media (max-width: 520px) {
  .site-header__inner { gap: 0.5rem; padding: 0 1rem; }
  .brand { gap: 0.5rem; }
  .brand__name { font-size: 1.25rem; }
  .brand__tag { font-size: 9px; letter-spacing: 0.03em; }
  .header-actions { gap: 0.5rem; }
  .lang-switch { font-size: 0.6875rem; }
  .lang-switch a, .lang-switch span { padding: 0.5rem; }
  .theme-toggle { padding: 0.5rem; }
}

/* ------------------------------------------------------- màn hình rộng */
@media (min-width: 640px) {
  .hero { padding: 5rem 0 8rem; }
  .hero__cta { flex-direction: row; }
  .hero__cta .btn { width: auto; }
  .install__top { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .install__download { text-align: left; }
  .install__download .btn { width: auto; }
  .install__meta { text-align: right; }
  .shadow-panel__row { flex-direction: row; align-items: center; justify-content: space-between; }
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
  .btn--header { display: inline-flex; }
  .shots { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .site-nav { display: flex; }
  .section { padding: 7rem 0; }
  .install { padding: 3rem; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .bento { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .transcript { padding: 2rem; }
  .sim-screen { aspect-ratio: 21 / 9; }
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-brand-col { grid-column: span 2; }
}

@media (min-width: 1024px) {
  :root { --gutter: 2rem; }
  .shots { grid-template-columns: repeat(3, 1fr); }
}
