/* Tùng AI Thực Chiến — shared design tokens & components (redesign 2026-09) */
:root {
  --paper: #f6f3ee;
  --card: #fffdf9;
  --alt: #ece6db;
  --ink: #16140f;
  --red: #d9432a;
  --red-light: #ff8a6b;
  --zalo: #0068ff;
  --zalo-dark: #0052cc;
  --body: #4a463e;
  --muted: #6b665c;
  --faint: #8a8478;
  --line: #e3ddd2;
  --control: #d6cfc2;
  --rule: #ebe5da;
  --dark-line: #3a372f;
  --dark-muted: #a8a194;
  --dark-soft: #cfc8bb;
  --paid-bg: #e2eedd;
  --paid-fg: #2f6a2a;
  --pending-bg: #f8e6d9;
  --pending-fg: #8a3a1c;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad-x: clamp(20px, 4vw, 40px);
  /* Motion: enter slower than exit, ease-out for things arriving */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--red); }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; }
.mono { font-family: var(--mono); }
.ico { width: 18px; height: 18px; flex-shrink: 0; display: block; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 243, 238, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px rgba(22, 20, 15, .07); }
.site-header .wrap {
  padding: 14px var(--pad-x);
  display: flex; align-items: center; gap: 24px; white-space: nowrap;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--red); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.brand b { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.site-nav { display: none; gap: 24px; font-size: 14px; font-weight: 500; margin-left: auto; }
.site-nav a[aria-current="page"], .site-nav a.is-current { color: var(--red); font-weight: 700; }
.header-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-left: auto; flex-shrink: 0;
  transition: background-color .2s, transform .15s var(--ease-out);
  font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--paper);
}
.header-cta:hover { color: var(--paper); background: #2a2720; }
@media (max-width: 439px) { .header-cta .num { display: none; } }
@media (min-width: 900px) {
  .site-nav { display: flex; }
  .site-nav + .header-cta { margin-left: 0; }
  .site-nav a { position: relative; transition: color .2s; }
  .site-nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--red);
    transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out);
  }
  .site-nav a:hover::after, .site-nav a.is-current::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
}

/* Mobile menu (pages whose header has .has-menu + .nav-toggle) */
.nav-toggle { display: none; }
@media (max-width: 899px) {
  .has-menu .wrap { gap: 10px; }
  .has-menu .nav-toggle {
    position: relative; display: block; width: 44px; height: 44px; flex-shrink: 0; padding: 0; cursor: pointer;
    border: 1px solid var(--control); border-radius: 12px; background: transparent; color: var(--ink);
  }
  .nav-toggle span {
    position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform .3s var(--ease-out), opacity .2s;
  }
  .nav-toggle span:nth-child(1) { top: 14px; }
  .nav-toggle span:nth-child(2) { top: 20px; }
  .nav-toggle span:nth-child(3) { top: 26px; }
  .has-menu.is-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .has-menu.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .has-menu.is-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .has-menu .site-nav {
    position: absolute; left: 0; right: 0; top: 100%; display: flex; flex-direction: column; gap: 0; margin: 0;
    padding: 4px var(--pad-x) 14px; background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 32px rgba(22, 20, 15, .12);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .15s var(--ease-in), transform .15s var(--ease-in), visibility 0s .15s;
  }
  .has-menu.is-open .site-nav {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .2s, transform .3s var(--ease-out), visibility 0s;
  }
  .has-menu .site-nav a { padding: 14px 2px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--rule); }
  .has-menu .site-nav a:last-child { border-bottom: 0; }
  .has-menu .header-cta .num { display: none; }
}
@media (max-width: 439px) {
  .has-menu .header-cta { padding: 7px 9px; }
  .has-menu .header-cta .lbl { display: none; }
}

/* Typography */
.h1 {
  margin: 0; font-size: clamp(42px, 6.6vw, 88px); line-height: 1; letter-spacing: -.04em;
  font-weight: 800; text-wrap: balance;
}
.h2 { margin: 0; font-size: clamp(32px, 4.2vw, 52px); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
.accent { color: var(--red); }
.lead { margin: 0; font-size: 19px; line-height: 1.5; color: var(--body); }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.kicker.red { color: var(--red); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 24px; border-radius: 999px; font-weight: 700; font-size: 16px;
  border: 1px solid transparent; background: transparent; cursor: pointer; text-align: center;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s var(--ease-out);
}
.btn:active, .header-cta:active, .pill:active { transform: scale(.97); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { color: #fff; background: #c23a23; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { color: var(--paper); background: #2a2720; }
.btn-outline { border-color: var(--ink); font-weight: 600; }
.btn-soft { border-color: var(--control); font-weight: 600; }
.btn-soft:hover { border-color: var(--ink); color: var(--ink); }
/* Zalo brand: blue #0068FF + white speech-bubble mark with the Zalo wordmark */
.btn-zalo, .header-cta.is-zalo { background: var(--zalo); border-color: var(--zalo); color: #fff; }
.btn-zalo:hover, .header-cta.is-zalo:hover { background: var(--zalo-dark); border-color: var(--zalo-dark); color: #fff; }
.zalo-mark {
  position: relative; flex-shrink: 0; display: inline-grid; place-items: center;
  width: 30px; height: 22px; border-radius: 8px; background: #fff;
}
.zalo-mark::after {
  content: ""; position: absolute; left: 4px; bottom: -4px; width: 8px; height: 8px;
  background: inherit; clip-path: polygon(0 0, 100% 0, 0 100%);
}
.zalo-mark .ico { width: 24px; height: 24px; fill: var(--zalo); }
.zalo-mark.is-blue { background: var(--zalo); }
.zalo-mark.is-blue .ico { fill: #fff; }

/* Pills (filters) */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font-size: 14px; font-weight: 500; padding: 10px 16px; min-height: 44px; border-radius: 999px;
  border: 1px solid var(--control); background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s var(--ease-out);
}
.pill:hover { border-color: var(--ink); }
.pill.is-active { font-weight: 600; border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* Section label row */
.sec-label { display: flex; align-items: center; gap: 14px; }
.sec-label .num {
  width: 48px; height: 48px; border-radius: 12px; background: var(--red); color: #fff;
  display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 17px; flex-shrink: 0;
}
.sec-label .num.ink { background: var(--ink); }
.sec-label .name { font-size: 15px; font-weight: 800; letter-spacing: .14em; white-space: nowrap; }
.sec-label .bar { flex: 1; height: 2px; background: var(--ink); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px var(--pad-x) 40px; }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 13.5px; color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

/* Modal shell */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(22, 20, 15, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(0px, 3vw, 32px); overflow: auto; overscroll-behavior: contain;
}
.overlay > [role="dialog"] { min-width: 0; }
.close-btn {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ink);
  background: transparent; font-size: 18px; cursor: pointer; display: grid; place-items: center;
}
.close-btn { transition: background-color .2s, color .2s, transform .2s var(--ease-out); }
.close-btn:hover { background: var(--ink); color: var(--paper); transform: rotate(90deg); }
.close-btn .ico { width: 18px; height: 18px; }

/* Motion primitives */
@keyframes reveal-up { from { opacity: 0; transform: translateY(16px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
body.is-locked { overflow: hidden; }
