/* ============================================================
   Guzheng 古筝 — Shared Stylesheet
   Design language: Á Đông cổ điển (ink · wood · gold · cinnabar)
   Palette lấy từ app icon: gỗ nâu đỏ, cầu nhạn vàng kim, dây teal.
   ============================================================ */

:root {
  /* --- Nền: mực & gỗ --- */
  --ink: #0b0807;
  --ink-2: #140e0b;
  --ink-3: #1d1410;
  --wood: #4a1f14;
  --wood-lit: #7a3520;

  /* --- Accent --- */
  --gold: #d9a441;
  --gold-soft: #eccb86;
  --gold-dim: rgba(217, 164, 65, 0.28);
  --jade: #46a89b;
  --cinnabar: #b23a32;
  --cinnabar-lit: #d2554a;

  /* --- Chữ: giấy tuyên --- */
  --paper: #f4e9d6;
  --paper-muted: rgba(244, 233, 214, 0.66);
  --paper-dim: rgba(244, 233, 214, 0.42);

  /* --- Bề mặt --- */
  --surface: rgba(255, 240, 214, 0.035);
  --surface-2: rgba(255, 240, 214, 0.06);
  --line: rgba(217, 164, 65, 0.18);
  --line-soft: rgba(244, 233, 214, 0.09);

  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --shadow-gold: 0 18px 50px rgba(217, 164, 65, 0.16);

  --radius: 18px;
  --radius-sm: 12px;

  --serif: "Cormorant Garamond", "Noto Serif SC", "Songti SC", Georgia, serif;
  --serif-cn: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
  --brush: "Ma Shan Zheng", "Noto Serif SC", "Songti SC", serif;

  --shell: 1180px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--paper);
  line-height: 1.75;
  background-color: var(--ink);
  background-image:
    radial-gradient(ellipse 70% 55% at 50% -10%, rgba(122, 53, 32, 0.55), transparent 62%),
    radial-gradient(ellipse 50% 40% at 88% 8%, rgba(217, 164, 65, 0.14), transparent 60%),
    radial-gradient(ellipse 60% 45% at 6% 42%, rgba(70, 168, 155, 0.08), transparent 62%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Vân giấy tuyên rất nhẹ phủ toàn trang */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(0deg, rgba(244, 233, 214, 0.014) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(244, 233, 214, 0.012) 0 1px, transparent 1px 4px);
}

.container {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 26px;
  position: relative;
  z-index: 1;
}

img {
  max-width: 100%;
  height: auto; /* bỏ qua attribute height để ảnh không bị kéo giãn */
  display: block;
}

/* ============================================================
   Song ngữ EN / 中文
   ============================================================ */
html[data-lang="en"] .zh,
html[data-lang="zh"] .en {
  display: none;
}

html[data-lang="zh"] body {
  font-family: var(--serif-cn);
}

html[data-lang="zh"] h1,
html[data-lang="zh"] h2,
html[data-lang="zh"] h3 {
  font-family: var(--serif-cn);
  letter-spacing: 0.02em;
}

/* ============================================================
   Typography
   ============================================================ */
h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.9rem, 7vw, 5.1rem);
}

h2 {
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
}

h3 {
  font-size: 1.35rem;
  letter-spacing: 0.005em;
}

p {
  font-size: 1rem;
}

a {
  color: inherit;
}

.accent {
  color: var(--gold);
}

.accent-jade {
  color: var(--jade);
}

/* Con dấu son — dùng cho brand & trang trí */
.seal {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: linear-gradient(160deg, var(--cinnabar-lit), var(--cinnabar) 55%, #8e241c);
  color: #ffe9c8;
  font-family: var(--serif-cn);
  font-size: 19px;
  line-height: 1;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(178, 58, 50, 0.4), inset 0 0 0 1px rgba(255, 220, 180, 0.28);
  flex: none;
}

/* Nhãn nhỏ kiểu triện */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 7px 17px 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(217, 164, 65, 0.07);
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cinnabar-lit);
  box-shadow: 0 0 10px var(--cinnabar-lit);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease,
    border-color 0.25s ease, color 0.25s ease;
}

.btn-primary {
  background: linear-gradient(140deg, #f0cf8c 0%, var(--gold) 48%, #b57f22 100%);
  color: #2a1206;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(217, 164, 65, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(217, 164, 65, 0.4);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--paper);
  background: rgba(255, 240, 214, 0.03);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(217, 164, 65, 0.08);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.87rem;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 8, 7, 0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line-soft);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--paper);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(217, 164, 65, 0.4);
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name b {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-name span {
  font-family: var(--serif-cn);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  color: var(--gold);
  text-transform: none;
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
  margin-left: auto;
}

.nav-links a {
  color: var(--paper-muted);
  text-decoration: none;
  font-size: 0.93rem;
  letter-spacing: 0.02em;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.22s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.28s ease;
}

.nav-links a:hover {
  color: var(--paper);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Nút chuyển ngôn ngữ */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 240, 214, 0.03);
}

.lang-switch button {
  border: none;
  background: transparent;
  color: var(--paper-dim);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 7px 14px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.lang-switch button[aria-pressed="true"] {
  background: rgba(217, 164, 65, 0.16);
  color: var(--gold);
}

.lang-switch button:hover {
  color: var(--paper);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 72px);
  overflow: hidden;
}

/* Núi non thuỷ mặc phía sau */
.hero-mountains {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  width: 100%;
  height: min(52vh, 460px);
  z-index: 0;
  opacity: 0.75;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(30px, 5vw, 68px);
  align-items: center;
}

.hero h1 {
  margin: 24px 0 20px;
}

.hero h1 .line-2 {
  display: block;
  font-style: italic;
  color: var(--gold);
}

html[data-lang="zh"] .hero h1 .line-2 {
  font-style: normal;
}

.lead {
  font-size: 1.08rem;
  color: var(--paper-muted);
  max-width: 46ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  color: var(--paper-dim);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-meta span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.8;
}

/* --- Khung điện thoại --- */
.device {
  position: relative;
  width: min(300px, 78vw);
  margin: 0 auto;
  padding: 10px;
  border-radius: 46px;
  background: linear-gradient(160deg, #3a2a1d, #120c09 45%, #2c1e15);
  box-shadow: var(--shadow), 0 0 0 1px rgba(217, 164, 65, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.device::after {
  /* tai thỏ */
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 22px;
  background: #0b0807;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.device img {
  width: 100%;
  border-radius: 37px;
  display: block;
}

.device-glow {
  position: absolute;
  inset: -18% -12%;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(217, 164, 65, 0.28), transparent 65%);
  filter: blur(18px);
}

.device-seal {
  position: absolute;
  right: -18px;
  bottom: 52px;
  width: 62px;
  height: 78px;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--cinnabar-lit), #8e241c);
  color: #ffe9c8;
  font-family: var(--serif-cn);
  font-size: 20px;
  line-height: 1.28;
  letter-spacing: 0.1em;
  display: grid;
  place-items: center;
  writing-mode: vertical-rl;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 220, 180, 0.3);
}

/* ============================================================
   Dải 21 dây tương tác
   ============================================================ */
.strings-band {
  position: relative;
  z-index: 1;
  margin-top: clamp(36px, 6vw, 60px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(122, 53, 32, 0.5), rgba(20, 14, 11, 0.85) 60%),
    var(--ink-2);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.strings-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 16px 22px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.strings-head h3 {
  font-size: 1.1rem;
}

.strings-head p {
  font-size: 0.84rem;
  color: var(--paper-dim);
  letter-spacing: 0.04em;
}

.strings {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 168px;
  padding: 0 6px;
  cursor: pointer;
  /* vuốt ngang = glissando, vuốt dọc vẫn cuộn trang được trên mobile */
  touch-action: pan-y;
}

.string {
  position: relative;
  flex: 1;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.string::before {
  /* thân dây */
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 50%;
  width: 1.5px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(244, 233, 214, 0.55) 12%,
    rgba(244, 233, 214, 0.75) 50%, rgba(244, 233, 214, 0.55) 88%, transparent);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.string[data-jade="1"]::before {
  background: linear-gradient(180deg, transparent, rgba(70, 168, 155, 0.7) 12%,
    rgba(96, 214, 198, 0.95) 50%, rgba(70, 168, 155, 0.7) 88%, transparent);
}

.string::after {
  /* ký âm giản phổ */
  content: attr(data-jianpu);
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  font-family: var(--serif-cn);
  font-size: 0.72rem;
  color: var(--paper-dim);
  transition: color 0.25s ease;
}

.string:hover::before,
.string.plucked::before {
  box-shadow: 0 0 14px rgba(236, 203, 134, 0.85);
  background: linear-gradient(180deg, transparent, var(--gold-soft) 12%, #fff3d6 50%,
    var(--gold-soft) 88%, transparent);
}

.string:hover::after,
.string.plucked::after {
  color: var(--gold);
}

.string.plucked {
  animation: vibrate 0.42s ease-out;
}

@keyframes vibrate {
  0% { transform: translateX(0); }
  20% { transform: translateX(-2.5px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1.2px); }
  80% { transform: translateX(0.6px); }
  100% { transform: translateX(0); }
}

/* cầu nhạn (雁柱) — xếp chéo như trên cây đàn thật */
.string .bridge {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 15px;
  z-index: 0;
  background: linear-gradient(175deg, #f6e3b4 0%, #d9a441 45%, #8d6118 100%);
  clip-path: polygon(50% 0%, 74% 52%, 100% 100%, 66% 100%, 50% 58%, 34% 100%, 0 100%, 26% 52%);
  opacity: 0.75;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.55));
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.string:hover .bridge,
.string.plucked .bridge {
  opacity: 1;
}

.string::before {
  z-index: 1;
}

/* ============================================================
   Section chung
   ============================================================ */
section {
  position: relative;
  padding: clamp(64px, 9vw, 118px) 0;
}

.section-head {
  max-width: 720px;
  margin: 0 auto clamp(38px, 5vw, 62px);
  text-align: center;
}

.section-head h2 {
  margin: 18px 0 16px;
}

.section-head p {
  color: var(--paper-muted);
}

/* Đường phân cách hoa văn */
.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--gold);
  opacity: 0.65;
}

.rule::before,
.rule::after {
  content: "";
  height: 1px;
  width: clamp(50px, 12vw, 130px);
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.rule span {
  font-family: var(--serif-cn);
  font-size: 0.9rem;
  letter-spacing: 0.3em;
}

/* Hoa văn mây 祥云 trang trí nền section */
.section-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  color: var(--gold);
  opacity: 0.16;
}

.section-decor svg {
  position: absolute;
  width: min(460px, 46vw);
  height: auto;
}

.section-decor .cloud-tl {
  top: 6%;
  left: -6%;
}

.section-decor .cloud-br {
  bottom: 4%;
  right: -6%;
  transform: scaleX(-1);
}

section > .container {
  position: relative;
  z-index: 1;
}

/* ============================================================
   Cards
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  padding: 30px 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.card::before {
  /* góc hoa văn 回 */
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-top: 1px solid var(--gold-dim);
  border-right: 1px solid var(--gold-dim);
  border-top-right-radius: 6px;
  opacity: 0.7;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  background: var(--surface-2);
}

.card .card-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  background: linear-gradient(150deg, rgba(217, 164, 65, 0.22), rgba(122, 53, 32, 0.35));
  border: 1px solid var(--line);
  color: var(--gold);
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  color: var(--paper-muted);
  font-size: 0.95rem;
}

/* ============================================================
   Split (ảnh + nội dung)
   ============================================================ */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.split.reverse .split-visual {
  order: 2;
}

.split-body h2 {
  margin: 16px 0 18px;
}

.split-body p {
  color: var(--paper-muted);
}

.feature-list {
  list-style: none;
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

.feature-list li {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  font-size: 0.97rem;
  color: var(--paper-muted);
}

.feature-list li b {
  color: var(--paper);
  font-weight: 500;
}

.feature-list .tick {
  flex: none;
  margin-top: 7px;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold-dim);
}

/* Danh sách âm sắc (7 nhạc cụ) */
.voice-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.voice-list li {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(217, 164, 65, 0.06);
  font-size: 0.92rem;
  color: var(--paper-muted);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.voice-list li:hover {
  border-color: var(--gold);
  background: rgba(217, 164, 65, 0.12);
}

.voice-list li b {
  color: var(--paper);
  font-weight: 500;
}

.voice-list li span {
  font-family: var(--serif-cn);
  font-size: 0.84rem;
  color: var(--gold);
  opacity: 0.85;
}

/* ============================================================
   Waterfall (nốt rơi)
   ============================================================ */
.waterfall {
  position: relative;
  height: 380px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(20, 14, 11, 0.4), rgba(11, 8, 7, 0.9)),
    linear-gradient(150deg, rgba(70, 168, 155, 0.12), rgba(122, 53, 32, 0.3));
  overflow: hidden;
  box-shadow: var(--shadow);
}

.waterfall .lane {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(244, 233, 214, 0.16), transparent);
}

.waterfall .hitline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 62px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--jade), transparent);
  box-shadow: 0 0 18px rgba(70, 168, 155, 0.6);
}

.waterfall .fnote {
  position: absolute;
  width: 30px;
  height: 15px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff4dd, var(--gold));
  box-shadow: 0 0 16px rgba(217, 164, 65, 0.55);
  animation: fall linear infinite;
}

.waterfall .fnote.jade {
  background: linear-gradient(180deg, #d8fff8, var(--jade));
  box-shadow: 0 0 16px rgba(70, 168, 155, 0.55);
}

@keyframes fall {
  0% { transform: translateY(-40px); opacity: 0; }
  10% { opacity: 1; }
  84% { opacity: 1; }
  100% { transform: translateY(320px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .waterfall .fnote {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ============================================================
   Gallery ảnh app
   ============================================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
}

.gallery-pair {
  max-width: 720px;
  margin: 0 auto;
  gap: clamp(24px, 5vw, 56px);
}

.shot {
  text-align: center;
}

.shot .device {
  width: 100%;
  max-width: 250px;
  padding: 8px;
  border-radius: 36px;
}

.shot .device img {
  border-radius: 29px;
}

.shot .device::after {
  width: 42%;
  height: 18px;
}

.shot h4 {
  margin-top: 20px;
  font-size: 1.05rem;
  color: var(--paper);
}

.shot p {
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--paper-dim);
}

/* ============================================================
   Toolkit grid nhỏ
   ============================================================ */
.tools {
  display: grid;
  /* 3 cột × 2 hàng trên desktop để lưới không bị khuyết ô */
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.tool {
  padding: 26px 24px;
  background: rgba(11, 8, 7, 0.86);
  transition: background 0.3s ease;
}

.tool:hover {
  background: rgba(122, 53, 32, 0.22);
}

.tool .k {
  font-family: var(--serif-cn);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  opacity: 0.8;
}

.tool h4 {
  font-size: 1.08rem;
  margin: 10px 0 8px;
}

.tool p {
  font-size: 0.89rem;
  color: var(--paper-dim);
  line-height: 1.6;
}

/* ============================================================
   CTA banner
   ============================================================ */
.cta-banner {
  position: relative;
  text-align: center;
  padding: clamp(46px, 7vw, 84px) 28px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(ellipse 70% 120% at 50% 0%, rgba(217, 164, 65, 0.18), transparent 62%),
    linear-gradient(160deg, rgba(122, 53, 32, 0.55), rgba(11, 8, 7, 0.9));
  box-shadow: var(--shadow-gold);
  overflow: hidden;
}

.cta-banner h2 {
  margin-bottom: 14px;
}

.cta-banner p {
  color: var(--paper-muted);
  max-width: 52ch;
  margin: 0 auto;
}

.cta-banner .hero-cta {
  justify-content: center;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 60px 0 34px;
  background: rgba(6, 4, 4, 0.6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  padding-bottom: 34px;
}

.footer-brand p {
  margin-top: 16px;
  color: var(--paper-dim);
  font-size: 0.92rem;
  max-width: 38ch;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.footer-col h4 {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  font-weight: 600;
}

.footer-col ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.footer-col a {
  color: var(--paper-muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  color: var(--paper-dim);
  font-size: 0.84rem;
}

/* ============================================================
   Trang tài liệu (privacy)
   ============================================================ */
.doc-hero {
  padding: clamp(50px, 7vw, 86px) 0 26px;
  text-align: center;
}

.doc-hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.5rem);
  margin-bottom: 14px;
}

.doc-hero .meta {
  color: var(--paper-dim);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.doc-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 52px;
  padding: 30px 0 90px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 96px;
  padding: 24px 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.toc h4 {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  font-weight: 600;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 9px;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: flex;
  gap: 10px;
  color: var(--paper-muted);
  text-decoration: none;
  font-size: 0.89rem;
  line-height: 1.45;
  transition: color 0.2s ease;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--gold);
  opacity: 0.55;
  font-size: 0.78rem;
  flex: none;
}

.toc a:hover {
  color: var(--paper);
}

.doc-body section {
  padding: 0 0 42px;
}

.doc-body h2 {
  font-size: 1.7rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.doc-body h3 {
  font-size: 1.12rem;
  margin: 24px 0 10px;
  color: var(--gold-soft);
}

.doc-body p,
.doc-body li {
  color: var(--paper-muted);
  font-size: 0.98rem;
}

.doc-body p + p {
  margin-top: 14px;
}

.doc-body ul {
  margin: 14px 0 0 20px;
  display: grid;
  gap: 9px;
}

.doc-body ul li::marker {
  color: var(--gold);
}

.doc-body a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-body strong {
  color: var(--paper);
  font-weight: 600;
}

.callout {
  margin: 20px 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  background: rgba(217, 164, 65, 0.06);
}

.callout strong {
  display: block;
  margin-bottom: 10px;
  color: var(--gold-soft);
}

.callout ul {
  margin: 0 0 0 18px;
}

.definition {
  padding: 14px 18px;
  margin-top: 12px;
  border-left: 2px solid var(--line);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.96rem;
  color: var(--paper-muted);
}

.definition strong {
  color: var(--gold-soft);
}

/* ============================================================
   404
   ============================================================ */
.error-page {
  min-height: 68vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 60px 24px;
}

.error-code {
  font-family: var(--serif);
  font-size: clamp(5rem, 18vw, 10rem);
  line-height: 1;
  background: linear-gradient(160deg, var(--gold-soft), var(--gold) 45%, var(--cinnabar));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page p {
  color: var(--paper-muted);
  margin: 12px 0 30px;
}

/* ============================================================
   Reveal on scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .split.reverse .split-visual {
    order: 0;
  }

  .hero-visual {
    order: -1;
  }

  .doc-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }

  .nav {
    gap: 12px;
  }

  .strings {
    height: 132px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    gap: 8px 18px;
    font-size: 0.8rem;
  }
}

@media (max-width: 560px) {
  /* Header phải vừa trong 360–414px: thu gọn brand, nút và lang switch */
  .brand-name b {
    font-size: 1.08rem;
  }

  .brand-name span {
    letter-spacing: 0.3em;
    font-size: 0.66rem;
  }

  .seal,
  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .nav-actions {
    gap: 8px;
  }

  .lang-switch button {
    padding: 6px 10px;
    font-size: 0.74rem;
  }

  .nav-actions .btn-sm {
    padding: 8px 13px;
    font-size: 0.8rem;
  }

  .container {
    padding: 0 18px;
  }
}

@media (max-width: 520px) {
  .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .hero-cta .btn {
    flex: 1 1 100%;
  }

  .device-seal {
    right: -10px;
    width: 52px;
    height: 66px;
    font-size: 17px;
  }
}
