/* Website công khai tracuu.info (trang giới thiệu, /tai-lieu-api, 404). Không JavaScript, không phông tải ngoài.
   CSP của máy chủ (style-src 'self') cấm kiểu viết trong thẻ: mọi kiểu nằm ở tệp này. Lớp .doc / .meta / .draft-note giữ cho
   hai trang pháp lý đang ẩn (docs/nhap-phap-ly/). Thiết kế lại 2026-11-28 (D54). */

:root {
  --bg: #fbfcfe;
  --surface: #ffffff;
  --ink: #0a0f1c;
  --muted: #566074;
  --faint: #8a93a6;
  --line: #e6e9f0;
  --line-strong: #cfd5e1;
  --hover: rgba(10, 15, 28, 0.05);
  --header-bg: rgba(251, 252, 254, 0.78);
  --link: #2457f5;
  --brand: #2457f5;
  --g1: #2457f5;
  --g2: #0891b2;
  --glow-1: rgba(36, 87, 245, 0.17);
  --glow-2: rgba(8, 145, 178, 0.14);
  --grid: rgba(10, 15, 28, 0.06);
  --chip: rgba(255, 255, 255, 0.72);
  --dot: #0ea5b7;
  --dot-ring: rgba(14, 165, 183, 0.18);
  --btn-bg: #0a0f1c;
  --btn-ink: #ffffff;
  --btn-shadow: 0 10px 28px -10px rgba(10, 15, 28, 0.55);
  --code-bg: #0b1020;
  --code-border: rgba(10, 15, 28, 0.9);
  --code-line: rgba(255, 255, 255, 0.07);
  --code-text: #d6deeb;
  --code-dim: #7d889e;
  --code-key: #93b4ff;
  --code-str: #7fe0c4;
  --code-ok: #4ade80;
  --cta-bg: #0a0f1c;
  --cta-ink: #f4f6fb;
  --cta-muted: #a7b0c2;
  --warn: #8a4b00;
  --warn-soft: #fff3dd;
  --shadow-sm: 0 1px 2px rgba(10, 15, 28, 0.06), 0 4px 14px -6px rgba(10, 15, 28, 0.14);
  --shadow-lg: 0 1px 2px rgba(10, 15, 28, 0.06), 0 30px 70px -20px rgba(10, 15, 28, 0.35);
  --radius: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070a12;
    --surface: #0d1220;
    --ink: #edf1f8;
    --muted: #9aa4b8;
    --faint: #6d778c;
    --line: #1b2234;
    --line-strong: #2b3550;
    --hover: rgba(255, 255, 255, 0.06);
    --header-bg: rgba(7, 10, 18, 0.72);
    --link: #7b9dff;
    --brand: #3366ff; /* ô logo: cùng màu với trang quản trị / nhân viên (--primary tối) */
    --g1: #7b9dff;
    --g2: #2dd4e8;
    --glow-1: rgba(58, 107, 255, 0.22);
    --glow-2: rgba(34, 184, 214, 0.13);
    --grid: rgba(255, 255, 255, 0.05);
    --chip: rgba(13, 18, 32, 0.7);
    --dot: #2dd4e8;
    --dot-ring: rgba(45, 212, 232, 0.16);
    --btn-bg: #edf1f8;
    --btn-ink: #070a12;
    --btn-shadow: 0 10px 30px -10px rgba(123, 157, 255, 0.45);
    --code-bg: #0a0f1d;
    --code-border: rgba(255, 255, 255, 0.09);
    --cta-bg: #0d1426;
    --cta-ink: #edf1f8;
    --cta-muted: #9aa4b8;
    --warn: #f3b552;
    --warn-soft: #33260f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px -6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 30px 80px -20px rgba(0, 0, 0, 0.75);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.02em; }
code { font-family: var(--mono); font-size: 0.92em; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--btn-bg); color: var(--btn-ink); padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.skip:focus { top: 12px; text-decoration: none; }

/* Đầu trang */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: -0.025em;
}
.brand:hover { text-decoration: none; }
.brand-tld { color: var(--faint); font-weight: 600; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.bm-bg { fill: var(--brand); }
.bm-ring { fill: none; stroke: #fff; stroke-width: 2.6; }
.bm-handle { stroke: #fff; stroke-width: 2.8; stroke-linecap: round; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--muted); font-size: 15px; font-weight: 500; transition: color 0.15s, background-color 0.15s;
}
.nav a:not(.btn):hover { color: var(--ink); background: var(--hover); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); }
.nav .btn { margin-left: 6px; }

/* Nút */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s, border-color 0.18s, color 0.18s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible { border-radius: 999px; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn .arrow { transition: transform 0.18s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--btn-shadow); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn-light { background: #ffffff; color: #0a0f1c; }
.btn-light:hover { box-shadow: 0 12px 30px -10px rgba(255, 255, 255, 0.35); }

/* Nền lưới + vầng sáng (trang giới thiệu, /tai-lieu-api, 404) */
.backdrop { position: relative; isolation: isolate; overflow: hidden; }
.backdrop::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center -1px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, #000 35%, transparent 100%);
}
.backdrop::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 46% at 80% 28%, var(--glow-1), transparent 72%),
    radial-gradient(34% 40% at 14% 8%, var(--glow-2), transparent 72%);
}

/* Trang giới thiệu */
.hero { display: flex; align-items: center; min-height: min(calc(100svh - 64px), 860px); padding: clamp(48px, 8vw, 96px) 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(36px, 5vw, 72px); align-items: center; }

.badge {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--chip);
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 4px var(--dot-ring); }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(42px, 6.4vw, 76px); line-height: 1.08; letter-spacing: -0.04em; font-weight: 700;
  margin: 22px 0 22px;
}
.hero h1 .line { display: block; }
.grad {
  background: linear-gradient(100deg, var(--g1) 10%, var(--g2) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.06em;
}
.lead { color: var(--muted); font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6; max-width: 32em; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* Cửa sổ dòng lệnh minh hoạ */
.terminal {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--code-bg); border: 1px solid var(--code-border); box-shadow: var(--shadow-lg);
  color: var(--code-text); font-family: var(--mono);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.terminal:hover { transform: translateY(-2px); }
.terminal::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(147, 180, 255, 0.55), rgba(127, 224, 196, 0.45), transparent);
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--code-line); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #262e40; }
.term-title { margin-left: 10px; color: var(--code-dim); font-family: var(--font); font-size: 12.5px; }
.term-body { margin: 0; padding: 20px 22px 24px; overflow-x: auto; font-size: 13.5px; line-height: 1.75; tab-size: 2; }
.term-body code { font-size: inherit; }
.c-dim { color: var(--code-dim); }
.c-key { color: var(--code-key); }
.c-str { color: var(--code-str); }
.c-ok {
  display: inline-block; padding: 0 8px; border-radius: 6px; line-height: 1.6;
  color: var(--code-ok); background: rgba(74, 222, 128, 0.1); font-weight: 600;
}

/* Liên hệ */
.cta { padding: clamp(24px, 4vw, 40px) 0 clamp(64px, 9vw, 112px); }
.cta-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding: clamp(32px, 5vw, 56px); border-radius: 24px;
  background: var(--cta-bg); color: var(--cta-ink); box-shadow: var(--shadow-lg);
}
.cta-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(45% 90% at 100% 0%, rgba(58, 107, 255, 0.38), transparent 70%),
    radial-gradient(35% 80% at 0% 100%, rgba(34, 184, 214, 0.22), transparent 70%);
}
.cta-card h2 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.035em; margin: 0 0 10px; }
.cta-card p { margin: 0; color: var(--cta-muted); font-size: 17px; max-width: 30em; }

/* Trang một khối giữa màn hình (/tai-lieu-api, 404) */
.center-page { display: flex; align-items: center; min-height: calc(100svh - 64px - 97px); padding: clamp(48px, 9vw, 112px) 0; }
.panel { max-width: 620px; margin: 0 auto; text-align: center; }
.panel-icon {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--link);
}
.panel-icon svg { width: 30px; height: 30px; }
.eyebrow { margin: 22px 0 10px; color: var(--link); font-size: 14px; font-weight: 600; letter-spacing: 0.02em; }
.panel h1 { font-family: var(--font-display); font-size: clamp(32px, 4.6vw, 48px); line-height: 1.12; letter-spacing: -0.035em; margin: 0 0 16px; }
.panel .lead { margin: 0 auto; }
.panel .actions { justify-content: center; }
.big-code {
  display: block; margin: 0 0 8px; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(88px, 16vw, 150px); line-height: 1; letter-spacing: -0.06em;
}

/* Chân trang */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 32px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.footer-inner .brand { font-size: 16px; }
.footer-inner .brand-mark { width: 24px; height: 24px; }
.disclaimer { margin: 0; color: var(--faint); font-size: 13.5px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--faint); font-size: 13.5px; }
.footer-links a { color: var(--muted); }

/* Trang văn bản (hai trang pháp lý đang ẩn – docs/nhap-phap-ly/) */
.doc { max-width: 780px; padding-top: 48px; padding-bottom: 72px; }
.doc h1 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 38px); letter-spacing: -0.03em; }
.doc h2 { font-size: 20px; margin-top: 32px; }
.doc .meta { color: var(--muted); font-size: 14px; }
.draft-note { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 12px 16px; font-size: 14px; margin: 16px 0 24px; }

/* Hiện dần một lần khi mở trang */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes show { from { opacity: 0; } to { opacity: 1; } }
.enter { animation: rise 0.7s var(--ease) both; }
.d1 { animation-delay: 0.06s; }
.d2 { animation-delay: 0.14s; }
.d3 { animation-delay: 0.22s; }
.d4 { animation-delay: 0.3s; }
.d5 { animation-delay: 0.42s; }
.ln { animation: show 0.35s ease-out both; }
.ln:nth-child(1) { animation-delay: 0.7s; }
.ln:nth-child(2) { animation-delay: 0.82s; }
.ln:nth-child(3) { animation-delay: 1.25s; }
.ln:nth-child(4) { animation-delay: 1.4s; }
.ln:nth-child(5) { animation-delay: 1.48s; }
.ln:nth-child(6) { animation-delay: 1.56s; }
.ln:nth-child(7) { animation-delay: 1.64s; }
.ln:nth-child(8) { animation-delay: 1.72s; }
.ln:nth-child(9) { animation-delay: 1.8s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enter, .ln { animation: none; }
  .btn, .terminal, .btn .arrow { transition: none; }
}

/* Máy tính bảng, điện thoại */
@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { max-width: 640px; }
}
@media (max-width: 640px) {
  .header-inner { height: 60px; }
  .brand { font-size: 17px; }
  .nav a.nav-docs { display: none; }
  .hero { padding: 40px 0 56px; }
  .hero h1 { margin: 18px 0; }
  .actions { margin-top: 28px; }
  .actions .btn { flex: 1 1 100%; }
  .term-body { padding: 16px 16px 20px; font-size: 12px; }
  .cta-card { flex-direction: column; align-items: flex-start; }
  .cta-card .btn { width: 100%; }
  .center-page { min-height: 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
