/* dbr.business — theo DBR Brand Guidelines v1.0
   Ink là chủ đạo (~80% bề mặt) · Paper cho chữ · Carbon bề mặt · Graphite viền
   Steel nhãn · Mist chữ phụ · Space Mono: logo, tiêu đề, số · Geist: nội dung · Geist Mono: nhãn nhỏ
   Steel (#6B6B70) chỉ dùng cho nhãn / viền; chữ đọc được dùng Mist trở lên. */
:root {
  --ink: #0a0a0b;
  --paper: #ededee;
  --carbon: #141416;
  --graphite: #2a2a2e;
  --steel: #6b6b70;
  --mist: #8a8a90;
  --display: 'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --text: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --max: 1120px;
  --gut: 16px;
  --head-h: 60px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
::selection { background: var(--paper); color: var(--ink); }

/* Lưới chấm nền (dots.js): canvas cố định nằm sau nội dung. */
.dots { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
main, .top, .foot { position: relative; z-index: 1; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: max(var(--gut), env(safe-area-inset-left)); padding-right: max(var(--gut), env(safe-area-inset-right)); }

.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--paper); color: var(--ink); padding: 8px 12px; font-family: var(--mono); font-size: 12px; }
.skip:focus { top: 8px; }

/* ── Logo: "DBR" Space Mono Bold + ô vuông kết thúc (không phải chấm tròn) ── */
.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
}
.wordmark i { display: inline-block; width: 0.24em; height: 0.24em; margin-left: 0.06em; background: currentColor; }
.wordmark.sm { font-size: 17px; }
.wordmark.xl { font-size: 36px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Nhãn / chữ phụ ── */
.label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mist); }
.label.sub { margin: 36px 0 14px; }
.mono-s { font-family: var(--mono); font-size: 12px; color: var(--mist); }

/* ── Đầu trang ── */
.top { position: sticky; top: 0; z-index: 50; background: rgba(10, 10, 11, 0.82); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--graphite); }
.top-in { max-width: var(--max); margin: 0 auto; height: var(--head-h); padding: 0 max(var(--gut), env(safe-area-inset-right)) 0 max(var(--gut), env(safe-area-inset-left)); display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; margin-right: auto; }
.nav { display: flex; gap: 2px; }
.nav a, .lang { min-height: 44px; display: inline-flex; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--mist); padding: 8px 12px; border: 1px solid transparent; transition: color 0.15s, border-color 0.15s; }
.nav a:hover, .lang:hover { color: var(--paper); }
.lang { border-color: var(--graphite); padding: 6px 12px; margin-left: 8px; }
.lang:hover { border-color: var(--steel); }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--graphite); color: var(--mist); place-items: center; }
.menu-btn:hover { color: var(--paper); border-color: var(--steel); }
.ic { width: 18px; height: 18px; flex: none; }
.menu-btn .m-close, .menu-btn[aria-expanded='true'] .m-open { display: none; }
.menu-btn[aria-expanded='true'] .m-close { display: block; }

/* ── Nút nhỏ, xám, không màu mè ── */
.btn { display: inline-flex; align-items: center; min-height: 44px; gap: 8px; font-family: var(--mono); font-size: 13px; padding: 10px 16px; border: 1px solid var(--graphite); color: var(--paper); transition: border-color 0.15s, background 0.15s, color 0.15s; }
.btn:hover { border-color: var(--steel); background: var(--carbon); }
.btn.primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn.primary:hover { background: #fff; border-color: #fff; }

/* ── Hero ── */
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 48px; align-items: center; padding-top: 88px; padding-bottom: 96px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.14; letter-spacing: -0.03em; margin: 18px 0 22px; }
.hero > * { min-width: 0; }
.hero h1 span { display: block; text-wrap: balance; }
.hero h1 span + span { color: var(--mist); }
.lead { color: var(--mist); font-size: 17px; max-width: 56ch; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

/* Cửa sổ lệnh: gợi code & hệ thống; ô vuông cuối là dấu kết thúc của brand */
.term { background: var(--carbon); border: 1px solid var(--graphite); font-family: var(--mono); font-size: 13px; min-width: 0; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--graphite); color: var(--steel); font-size: 12px; }
.term-bar i { width: 7px; height: 7px; background: var(--graphite); }
.term-bar span { margin-left: 8px; }
.term-body { padding: 18px 16px 20px; color: var(--paper); overflow-x: auto; }
.term .cmd { color: var(--paper); margin-bottom: 12px; white-space: nowrap; }
.term .ps { color: var(--steel); }
.term ul { display: grid; gap: 4px; }
.tl { display: flex; gap: 10px; white-space: nowrap; }
.tk { color: var(--paper); }
.ta { color: var(--steel); }
.tv { color: var(--mist); }
.term .done { margin-top: 14px; color: var(--mist); display: flex; align-items: center; gap: 8px; }
.cur { display: inline-block; width: 8px; height: 8px; background: var(--paper); }

/* ── Khu nội dung ── */
.sec { padding-top: 72px; padding-bottom: 72px; border-top: 1px solid var(--graphite); }
.sec h2 { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; letter-spacing: -0.02em; margin: 14px 0 14px; max-width: 24ch; }
.sec-lead { color: var(--mist); max-width: 64ch; }

/* nguyên tắc */
.prs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 40px; background: var(--graphite); border: 1px solid var(--graphite); }
.pr { background: var(--ink); padding: 24px 22px 26px; }
.pr-ic { width: 22px; height: 22px; color: var(--paper); margin-bottom: 16px; }
.pr h3 { font-family: var(--display); font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.pr p { color: var(--mist); font-size: 15px; }

/* sản phẩm: lưới 6 cột, 3 + 2 thẻ */
.apps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 40px; }
.app { grid-column: span 2; background: var(--carbon); border: 1px solid var(--graphite); padding: 24px; display: flex; flex-direction: column; gap: 16px; transition: border-color 0.2s; }
.app:nth-child(n + 4) { grid-column: span 3; }
.app:has(.app-link):hover { border-color: var(--steel); }
.app-head { display: flex; align-items: center; gap: 14px; }
.app-icon { width: 48px; height: 48px; border-radius: 11px; flex: none; background: var(--ink); }
.app-title h3 { font-size: 18px; font-weight: 500; line-height: 1.25; }
.app-title .mono-s { margin-top: 2px; }
.app-desc { color: var(--mist); font-size: 15px; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-family: var(--mono); font-size: 12px; color: var(--mist); border: 1px solid var(--graphite); padding: 3px 8px; }
.app-link { display: inline-flex; align-items: center; min-height: 44px; gap: 6px; align-self: flex-start; font-family: var(--mono); font-size: 12px; color: var(--paper); border-bottom: 1px solid var(--steel); padding-bottom: 2px; }
.app-link:hover { border-color: var(--paper); }
.app-link .ic { width: 14px; height: 14px; }

/* đội ngũ */
.ceo { display: flex; align-items: center; gap: 18px; margin-top: 36px; padding: 20px; background: var(--carbon); border: 1px solid var(--graphite); max-width: 560px; }
.ceo-name { font-family: var(--display); font-weight: 700; font-size: 20px; }
.ceo-name .mono-s { font-weight: 400; }
.ceo-note { color: var(--mist); font-size: 14px; margin-top: 2px; }
.mem-mono { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 1px solid var(--graphite); background: var(--ink); font-family: var(--display); font-weight: 700; font-size: 16px; }
.mem-mono.big { width: 56px; height: 56px; font-size: 24px; }
.mems { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--graphite); border: 1px solid var(--graphite); }
.mem { background: var(--ink); padding: 18px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mem .mem-mono { margin-bottom: 12px; }
.mem-name { font-weight: 500; }
.mem-role { color: var(--mist); font-size: 13px; line-height: 1.4; }

/* liên hệ */
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }
.mail-link { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: clamp(18px, 4.6vw, 26px); letter-spacing: -0.02em; border-bottom: 1px solid var(--steel); padding-bottom: 4px; word-break: break-all; }
.mail-link:hover { border-color: var(--paper); }
.mail-link .ic { width: 24px; height: 24px; color: var(--mist); }
.todo { font-family: var(--mono); font-size: 11px; color: var(--mist); border: 1px dashed var(--steel); padding: 3px 8px; letter-spacing: 0.04em; }

/* ── Chân trang ── */
.foot { border-top: 1px solid var(--graphite); background: var(--ink); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 36px; }
.foot-brand { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot-copy { font-family: var(--mono); font-size: 12px; color: var(--mist); }
.foot-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--mono); font-size: 12px; color: var(--mist); padding: 6px 10px; }
.foot-nav a:hover { color: var(--paper); }

/* ── Trang chính sách / điều khoản ── */
.doc { padding-top: 64px; padding-bottom: 88px; max-width: 800px; background: rgba(10, 10, 11, 0.88); }
.doc-h1 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4.6vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 14px 0 32px; }
.prose { color: #cfcfd2; }
.prose h2 { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--paper); margin: 40px 0 12px; line-height: 1.3; }
.prose h3 { font-size: 16px; font-weight: 500; color: var(--paper); margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose ul { list-style: square; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--paper); border-bottom: 1px solid var(--steel); }
.prose a:hover { border-color: var(--paper); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14px; overflow-wrap: anywhere; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border: 1px solid var(--graphite); vertical-align: top; }
.prose th { color: var(--paper); font-weight: 500; background: var(--carbon); }
.prose .ph { color: var(--paper); border: 1px dashed var(--steel); padding: 0 4px; }
.note { border: 1px dashed var(--steel); padding: 16px; color: var(--mist); }
.doc-back { margin-top: 48px; }

/* ── 404 ── */
.nf { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; max-width: 640px; margin: 0 auto; padding: 32px max(var(--gut), env(safe-area-inset-right)) 32px max(var(--gut), env(safe-area-inset-left)); }
.nf .brand { margin-bottom: 24px; }
.nf-code { font-family: var(--display); font-weight: 700; font-size: clamp(64px, 18vw, 120px); line-height: 1; letter-spacing: -0.04em; }
.nf-h { font-family: var(--display); font-weight: 700; font-size: 24px; }
.nf-p { color: var(--mist); }
.nf-en { color: var(--mist); font-family: var(--mono); font-size: 12px; margin-bottom: 12px; }

/* ── Chuyển động (chỉ khi JS bật và người dùng không chọn "giảm chuyển động") ── */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .js .rv.in { opacity: 1; transform: none; }
  .tl, .term .done, .term .cmd { opacity: 0; animation: tin 0.35s ease forwards; }
  .term .cmd { animation-delay: 0.3s; }
  .tl[data-i='0'] { animation-delay: 0.8s; }
  .tl[data-i='1'] { animation-delay: 1.0s; }
  .tl[data-i='2'] { animation-delay: 1.2s; }
  .tl[data-i='3'] { animation-delay: 1.4s; }
  .tl[data-i='4'] { animation-delay: 1.6s; }
  .term .done { animation-delay: 2.0s; }
  .cur { animation: blink 1.1s steps(1) infinite 2.4s; }
  @keyframes tin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  @keyframes blink { 50% { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 56px; padding-bottom: 64px; }
  .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app, .app:nth-child(n + 4) { grid-column: span 1; }
  .app:last-child { grid-column: 1 / -1; }
  .mems { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .menu-btn { display: grid; }
  .lang { margin-left: 0; }
  .nav { display: none; position: absolute; top: var(--head-h); left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px var(--gut) 16px; background: var(--ink); border-bottom: 1px solid var(--graphite); }
  .nav.open { display: flex; }
  .nav a { font-size: 14px; padding: 14px 4px; border-bottom: 1px solid var(--graphite); }
  .nav a:last-child { border-bottom: 0; }
  .sec { padding-top: 56px; padding-bottom: 56px; }
  .prs { grid-template-columns: minmax(0, 1fr); }
  .apps { grid-template-columns: minmax(0, 1fr); }
  .app:last-child { grid-column: auto; }
  .mems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead { font-size: 16px; }
}
@media (max-width: 380px) {
  .term { font-size: 12px; }
  .tl { gap: 6px; }
}

/* ── In ra giấy / PDF: nền trắng, chữ đen ── */
@media print {
  :root { --ink: #fff; --paper: #000; --carbon: #fff; --graphite: #ccc; --steel: #555; --mist: #333; color-scheme: light; }
  body { background: #fff; color: #000; }
  .dots, .top, .menu-btn, .skip, .cta, .term { display: none !important; }
  .js .rv { opacity: 1 !important; transform: none !important; }
  .sec { break-inside: avoid; border-color: #ccc; }
  .prose { color: #000; }
  a { color: #000; }
  .btn.primary { background: #fff; color: #000; border-color: #000; }
}
