/* Dùng chung cho các trang con (/posts/...). Trang chủ index.html có CSS riêng inline;
   các biến màu, header, nút, FAQ ở đây là bản sao rút gọn -- sửa giao diện chung thì sửa cả hai nơi. */
:root {
  --bg: #05070c;
  --surface: #0c1119;
  --surface-2: #131a26;
  --border: #1d2634;
  --border-strong: #2a3546;
  --text: #f4f5f7;
  --text-muted: #9aa4b5;
  --text-faint: #5c6577;
  --cyan: #22d3ee;
  --blue: #4d8fef;
  --amber: #e8a13c;
  --font-display: "Anton", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(50rem 34rem at 50% -8%, color-mix(in srgb, var(--blue) 16%, transparent), transparent 70%),
    radial-gradient(36rem 26rem at 90% 100%, color-mix(in srgb, var(--amber) 8%, transparent), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; }
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 20px; }

header.site {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-inner { display: flex; align-items: center; gap: 10px; padding-block: 12px; padding-inline: 20px; }
.brand-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.site-inner img { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.site-brand { display: flex; flex-direction: column; line-height: 1.2; }
.site-brand b { font-size: 13px; font-weight: 800; letter-spacing: 0.02em; }
.site-brand span { font-size: 11px; color: var(--text-faint); }
.site-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-link { font-size: 13px; font-weight: 700; color: var(--text-muted); text-decoration: none; padding: 6px 8px; border-radius: 8px; }
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.lang { display: flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; flex: none; }
.lang-btn {
  font-family: var(--font-body); font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  padding: 6px 10px; border: 0; background: transparent; color: var(--text-faint); cursor: pointer;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--border-strong); }
.lang-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); }
.lang-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }

.actions { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 200px; padding: 13px 22px; border-radius: 10px;
  font-family: var(--font-body); font-size: 14px; font-weight: 700; text-decoration: none;
  transition: transform 120ms cubic-bezier(0.16,1,0.3,1), border-color 120ms cubic-bezier(0.16,1,0.3,1);
}
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #04070d; background: linear-gradient(135deg, var(--cyan), var(--blue)); }
.btn-outline { color: var(--text); background: color-mix(in srgb, var(--surface-2) 70%, transparent); border: 1px solid var(--border-strong); }
.btn-outline:hover { border-color: color-mix(in srgb, var(--cyan) 60%, transparent); }
.site-tools .btn { min-width: 0; padding: 8px 16px; font-size: 12px; white-space: nowrap; }

footer.site { text-align: center; padding-block: 24px 32px; padding-inline: 20px; font-size: 12px; color: var(--text-faint); }

/* ---- danh sách bài viết ---- */
.posts-head { text-align: center; padding: 44px 20px 24px; }
.posts-head h1 { font-size: 44px; line-height: 1; margin: 0 0 10px; }
.posts-head p { color: var(--text-muted); font-size: 15px; margin: 0; }
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding-bottom: 48px; }
.post-card {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px;
  transition: border-color 120ms ease, transform 120ms ease;
}
.post-card:hover { border-color: color-mix(in srgb, var(--cyan) 55%, transparent); transform: translateY(-2px); }
.post-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.post-card h3 { font-size: 21px; line-height: 1.15; margin: 0; }
.post-card p { font-size: 13.5px; line-height: 1.6; color: var(--text-muted); margin: 0; }
.tag {
  align-self: flex-start; font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 32%, transparent); padding: 4px 11px; border-radius: 999px;
}
.post-date { font-size: 12px; color: var(--text-faint); }

/* ---- bài viết ---- */
.post { max-width: 760px; padding-block: 28px 56px; }
.crumbs { margin-bottom: 18px; font-size: 13px; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.post-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.post h1 { font-size: 40px; line-height: 1.05; margin: 0 0 16px; text-wrap: balance; }
.post .lead { font-size: 16px; line-height: 1.7; color: var(--text-muted); margin: 0 0 22px; }
.post p { font-size: 14.5px; line-height: 1.7; color: var(--text-muted); margin: 0 0 12px; }
.post b { color: var(--text); font-weight: 700; }
.post ul, .post ol { margin: 8px 0 14px; padding-left: 22px; color: var(--text-muted); font-size: 14.5px; line-height: 1.7; }
.post li { margin-bottom: 6px; }
.post a { color: var(--cyan); }
.post a.btn { color: #04070d; }
.post a.btn-outline { color: var(--text); }
.callout {
  background: color-mix(in srgb, var(--surface-2) 75%, transparent); border: 1px solid var(--border);
  border-left: 3px solid var(--cyan); border-radius: 12px; padding: 16px 20px; margin: 0 0 28px;
}
.callout h3 { font-size: 16px; margin: 0 0 6px; letter-spacing: 0.04em; }
.callout ul { margin-bottom: 0; }
.step {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding-block: 22px;
  border-top: 1px solid var(--border);
}
.step-n {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 22px; color: #04070d;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}
.step h2 { font-size: 24px; margin: 6px 0 10px; }
.step-main > :last-child { margin-bottom: 0; }
.tip { background: color-mix(in srgb, var(--amber) 8%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 28%, transparent); border-radius: 10px; padding: 10px 14px; }
.faq-title { font-size: 28px; margin: 34px 0 10px; }
.faq-list { border-top: 1px solid var(--border); }
.faq { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; padding: 16px 0; font-size: 14.5px; font-weight: 700; color: var(--text); }
.faq summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.faq-body { padding-bottom: 14px; }
.cta-section {
  text-align: center; margin-top: 40px; padding: 34px 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 10%, transparent), color-mix(in srgb, var(--cyan) 6%, transparent));
  border: 1px solid var(--border); border-radius: 20px;
}
.cta-section h2 { font-size: 24px; margin: 0 0 16px; }
.join-steps {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  font-size: 13px; color: var(--text-muted); background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  border: 1px solid var(--border); border-radius: 999px; padding: 9px 20px; margin: 4px 0 14px;
}
.join-steps .key { color: var(--text); font-weight: 800; }
.join-steps .sep { color: var(--text-faint); }

/* ---- hình minh hoạ, phím, khối code ---- */
.shot { margin: 16px 0 6px; }
.shot svg { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--border); background: #0c0c0c; }
.shot figcaption { font-size: 12.5px; line-height: 1.5; color: var(--text-faint); margin-top: 8px; text-align: center; }
.post kbd {
  font-family: inherit; font-size: 12px; font-weight: 800; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}
.post code {
  font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere;
}
.post pre.code {
  margin: 10px 0 14px; padding: 14px 18px; background: #0a0e15; border: 1px solid var(--border-strong);
  border-left: 3px solid var(--cyan); border-radius: 10px; overflow-x: auto; user-select: all;
  font-family: Consolas, "Cascadia Mono", monospace; font-size: 13.5px; line-height: 1.7; color: #e6e6e6;
}

@media (max-width: 520px) {
  .post h1 { font-size: 30px; }
  .step { grid-template-columns: 1fr; gap: 10px; }
  .site-tools .btn { display: none; }
  .site-brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .post-card:hover { transform: none; }
}
