/* base.css - reset, landmark, accessibility, layout chung. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-page);
  color: var(--ink-bone);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.15; }
p { margin: 0 0 1em; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #3a2f27; border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

/* Vùng chạm tối thiểu 44px (WCAG 2.5.5) */
.tap { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* Focus rõ ràng - không bao giờ outline:none trần */
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; border-radius: 3px; }

/* Skip-link */
.skip-link {
  position: absolute; left: 12px; top: -56px; z-index: 100;
  background: var(--blood); color: var(--ink-bone);
  padding: 10px 16px; border-radius: var(--radius-md); font-weight: 600;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

/* sr-only */
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* App shell */
#app { display: block; min-height: 60vh; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(12, 10, 11, 0.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .wordmark { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: .1em; color: var(--gold-soft); }
.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.site-nav a { padding: 9px 13px; border-radius: var(--radius-md); color: var(--ink-ash); font-size: 14px; }
.site-nav a:hover { color: var(--ink-bone); background: rgba(194,161,77,.06); }
.site-nav a[aria-current='page'] { color: var(--gold-soft); }

.site-footer { border-top: 1px solid var(--line); margin-top: 64px; }
.site-footer .wrap { padding: 26px 20px; color: var(--ink-faint); font-size: 13.5px; text-align: center; line-height: 1.7; }

/* Emblem hover "linh khí" - chỉ khi có con trỏ tinh */
.emblem { display: block; transition: filter .3s ease; }
.emblem-glow { transition: opacity .3s ease; }
@media (hover: hover) and (pointer: fine) {
  a:hover .emblem-sigil, button:hover .emblem-sigil { filter: drop-shadow(0 0 7px rgba(194,161,77,.4)); }
  a:hover .emblem-sigil .emblem-glow, button:hover .emblem-sigil .emblem-glow { opacity: .26; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-ui); font-weight: 600; font-size: 14.5px; padding: 13px 18px; border-radius: var(--radius-md); transition: transform .15s ease, background .2s ease, box-shadow .2s ease; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blood); color: var(--ink-bone); box-shadow: 0 0 24px -8px rgba(192,57,43,.55); }
.btn-primary:hover { background: var(--blood-bright); }
.btn-ghost { background: transparent; color: var(--gold-soft); border: 1px solid var(--gold); }
.btn-ghost:hover { background: rgba(194,161,77,.08); }

/* Tag pill */
.tag { border: 1px solid var(--line-gold); color: var(--gold-soft); font-size: 12.5px; padding: 5px 11px; border-radius: 20px; }

/* JS-gating: scroll-reveal chỉ ẩn khi JS bật (no-JS vẫn đọc được).
   Reveal bằng CSS transition + IntersectionObserver (KHÔNG phụ thuộc rAF/GSAP -> nội dung không bao giờ kẹt ẩn). */
.js-enabled [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; will-change: opacity, transform; }
.js-enabled [data-reveal].revealed { opacity: 1; transform: none; will-change: auto; }

/* GIẢM CHUYỂN ĐỘNG - lớp phòng thủ cuối, đặt cuối file để !important thắng */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js-enabled [data-reveal] { opacity: 1 !important; transform: none !important; }
}
