/* Phần mềm Hiệp — design tokens from design/phanmem.figcraft (HiepFigma). */
:root {
  --paper: #eef1f5;
  --surface: #ffffff;
  --ink: #141b2d;
  --muted: #5b6578;
  --line: #d8dee7;
  --night: #161d2b;
  --night-2: #222b3d;
  --mist: #aeb7c7;
  --signal: #ffc233;
  --signal-ink: #141b2d;
  --radius-card: 18px;
  --radius-pill: 999px;
  --container: 1200px;
  --gutter: 24px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  /* Content protection: no text selection outside form fields. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
img { max-width: 100%; height: auto; display: block; -webkit-user-drag: none; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -0.015em; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 6px; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--signal); color: var(--signal-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand svg { flex: none; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 10px; color: var(--ink); }
.nav a:hover { background: var(--paper); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.search { position: relative; }
.search input {
  width: 240px; height: 40px; border: 1px solid transparent; border-radius: var(--radius-pill);
  background: var(--paper); padding: 0 16px 0 40px; font: inherit; font-size: 14px; color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.search svg { position: absolute; left: 14px; top: 12px; color: var(--muted); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 10px; cursor: pointer; color: var(--ink); }

/* Hero */
.hero { background: var(--night); color: var(--surface); overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-block: 72px 80px; }
.hero-kicker { color: var(--signal); font-weight: 600; font-size: 15px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.08; max-width: 15ch; }
.hero-lead { color: var(--mist); font-size: 18px; max-width: 46ch; margin-top: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: var(--radius-pill); font-weight: 700; font-size: 16px; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-signal { background: var(--signal); color: var(--signal-ink); }
.btn-signal:hover { background: #ffcf5c; }
.btn-ink { background: var(--ink); color: var(--surface); }
.btn-ink:hover { background: #26304a; }
.btn-ghost { border-color: var(--mist); color: var(--surface); font-weight: 600; }
.btn-ghost:hover { background: var(--night-2); }
.btn small { font-weight: 500; opacity: .75; font-size: 13px; }

/* The shelf: the one memorable element. */
.shelf { display: grid; gap: 20px; }
.shelf-row { display: flex; justify-content: center; gap: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--night-2); }
.shelf a { display: block; width: clamp(56px, 6.4vw, 92px); border-radius: 22%; transition: transform .18s ease; }
.shelf a:hover, .shelf a:focus-visible { transform: translateY(-6px); }
.shelf img { width: 100%; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); }
@media (prefers-reduced-motion: no-preference) {
  .shelf a { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 45ms + 120ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
}

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 40px 8px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line); font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer; }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip .count { margin-left: 8px; font-weight: 500; opacity: .6; }

/* Sections and cards */
.section { padding-block: 40px; }
.section-head { margin-bottom: 26px; max-width: 70ch; }
.section-head h2 { font-size: 30px; font-weight: 800; }
.section-head p { color: var(--muted); margin-top: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 28px 24px 22px; }
.card::before { content: ""; position: absolute; top: -1px; left: 24px; width: 48px; height: 4px; border-radius: 0 0 3px 3px; background: var(--accent); }
.card:hover { border-color: var(--ink); }
.card img { width: 64px; height: 64px; }
.card h3 { font-size: 20px; font-weight: 700; margin-top: 18px; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-card); }
.card .kind { color: var(--accent-text); font-size: 13px; font-weight: 600; margin-top: 4px; }
.card .short { color: var(--muted); font-size: 15px; margin-top: 12px; flex: 1; }
.card-foot span { display: grid; line-height: 1.45; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 500; }
.pill { position: relative; z-index: 1; flex: none; white-space: nowrap; display: inline-flex; align-items: center; min-height: 34px; padding: 0 18px; border-radius: var(--radius-pill); background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 600; text-decoration: none; }
.pill:hover { background: #26304a; }
.empty { display: none; padding: 40px 0; color: var(--muted); }
.empty.show { display: block; }

/* Category page */
.page-head { padding-block: 48px 8px; }
.page-head h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 12px; max-width: 64ch; font-size: 18px; }

/* Breadcrumb */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 28px; font-size: 14px; color: var(--muted); list-style: none; margin: 0; padding-left: 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .6; }

/* Detail */
.app-head { display: grid; grid-template-columns: 112px 1fr; gap: 28px; align-items: center; padding-block: 28px 8px; }
.app-head img { width: 112px; height: 112px; }
.app-head h1 { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 800; }
.app-head .sub { color: var(--muted); font-size: 20px; font-weight: 500; margin-top: 6px; }
.app-head .rule { width: 70px; height: 4px; border-radius: 2px; background: var(--accent); margin-top: 16px; }
.app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 24px; }
.app-actions .note { color: var(--muted); font-size: 14px; }
.shot { margin: 40px 0 0; background: var(--night); border-radius: 20px; padding: 20px; }
.shot img { border-radius: 10px; width: 100%; }
.shot figcaption { color: var(--mist); font-size: 14px; padding: 14px 4px 0; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 64px; align-items: start; padding-block: 56px 24px; }
.article { max-width: 72ch; }
.article h2 { font-size: 32px; font-weight: 800; margin: 56px 0 18px; scroll-margin-top: 96px; }
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 19px; font-weight: 700; }
.article p { font-size: 18px; line-height: 1.7; margin-bottom: 18px; }
.article p.lead { font-size: 20px; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 26px; }
.features li { display: grid; grid-template-columns: 14px 1fr; gap: 14px; }
.features li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); margin-top: 9px; }
.features p { font-size: 16px; color: var(--muted); margin: 6px 0 0; line-height: 1.6; }
.figure { margin: 28px 0; }
.figure img { border-radius: 14px; border: 1px solid var(--line); }
.figure figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }
.who { padding-left: 22px; margin: 0; }
.who li { margin-bottom: 8px; }
.spec { width: 100%; border-collapse: collapse; font-size: 16px; background: var(--surface); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.spec th, .spec td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { width: 34%; font-weight: 600; background: #f6f8fb; }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; font-size: 17px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--surface); font-weight: 700; font-size: 15px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 20px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 18px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { font-size: 16px; color: var(--muted); padding-bottom: 18px; margin: 0; }

.download { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; scroll-margin-top: 96px; }
.download h2 { font-size: 22px; font-weight: 700; }
.download .ver { color: var(--muted); font-size: 14px; margin-top: 4px; }
.dl-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.dl-list a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 14px 18px; border-radius: 14px; background: var(--paper); text-decoration: none; border: 1px solid transparent; }
.dl-list a:hover { border-color: var(--ink); background: var(--surface); }
.dl-list b { font-size: 15px; }
.dl-list span { grid-column: 1; color: var(--muted); font-size: 13px; }
.dl-list i { grid-row: 1 / span 2; grid-column: 2; font-style: normal; font-weight: 700; color: var(--accent-text); }
.download .hint { font-size: 13px; color: var(--muted); margin-top: 18px; line-height: 1.55; }
.cta-band { margin-top: 48px; background: var(--night); color: var(--surface); border-radius: 20px; padding: 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.cta-band h2 { margin: 0; font-size: 26px; color: var(--surface); }
.cta-band p { color: var(--mist); margin: 8px 0 0; font-size: 16px; }

/* AI page */
.code { background: var(--night); color: #e6ebf5; border-radius: 14px; padding: 18px 20px; font-size: 14px; overflow-x: auto; white-space: pre; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Footer */
.site-footer { background: var(--night); color: var(--mist); margin-top: 72px; padding-block: 56px 40px; font-size: 15px; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.site-footer .brand { color: var(--surface); }
.site-footer h2 { color: var(--surface); font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; color: var(--mist); }
.site-footer a:hover { color: var(--surface); }
.site-footer .legal { border-top: 1px solid var(--night-2); margin-top: 40px; padding-top: 24px; font-size: 13px; line-height: 1.6; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 12px 20px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 90; }
.toast.show { opacity: 1; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; gap: 40px; }
  .download { position: static; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .site-header .container { gap: 12px; }
  .nav, .search { display: none; }
  .site-header.open .nav { display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .site-header.open .search { display: block; position: absolute; top: calc(72px + 260px); left: 16px; right: 16px; }
  .site-header.open .search input { width: 100%; }
  .hero .container { grid-template-columns: 1fr; padding-block: 48px 56px; }
  .shelf { order: 2; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .app-head { grid-template-columns: 72px 1fr; gap: 18px; align-items: start; }
  .app-head img { width: 72px; height: 72px; }
  .shot { padding: 10px; border-radius: 14px; }
  .article h2 { font-size: 26px; }
  .article p { font-size: 17px; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .shelf-row { gap: 12px; }
}
@media print { body { display: none !important; } }
