:root {
  --bg: #f7f5ef;
  --paper: #fffdf8;
  --ink: #1f2933;
  --muted: #667085;
  --line: #e8e1d5;
  --soft: #f0eadf;
  --dark: #111827;
  --blue: #e8f1ff;
  --green: #e7f5ec;
  --amber: #fff2d8;
  --rose: #ffe8e8;
  --purple: #efe9ff;
  --cyan: #e9fbff;
  --teal: #e3f7f1;

  /* Accent - mỗi trang ghi đè 5 biến này */
  --accent: #3ecf8e;
  --accent-deep: #1d8f63;
  --accent-soft: #e3f7f1;
  --accent-line: #b7e8d4;
  --brand-dark: #0f1f1a;

  --shadow: 0 18px 50px rgba(31, 41, 51, 0.08);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 242, 216, 0.9), transparent 34%),
    radial-gradient(circle at top right, var(--accent-soft), transparent 32%),
    linear-gradient(180deg, var(--bg), #f3efe7);
  line-height: 1.55;
}

.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 74px; }

.nav {
  position: sticky; top: 14px; z-index: 20;
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center; justify-content: center;
  padding: 10px; margin: 0 auto 30px;
  width: fit-content; max-width: 100%;
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid rgba(232, 225, 213, 0.9);
  backdrop-filter: blur(16px);
  border-radius: 999px;
  box-shadow: 0 10px 35px rgba(31, 41, 51, 0.06);
}
.nav a {
  color: var(--ink); text-decoration: none; font-size: 14px;
  padding: 8px 13px; border-radius: 999px; transition: 0.2s ease; white-space: nowrap;
}
.nav a:hover { background: var(--soft); }
.nav a.home { background: var(--brand-dark); color: #fff; font-weight: 700; }
.nav a.home:hover { opacity: 0.9; }

.card {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 24px; align-items: stretch; }
.hero-copy { padding: clamp(28px, 5vw, 58px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  background: var(--dark); color: white; font-size: 13px; margin-bottom: 24px;
}
.eyebrow .leaf { color: var(--accent); font-weight: 800; }

h1 { font-size: clamp(38px, 6.2vw, 72px); line-height: 0.97; letter-spacing: -0.06em; margin: 0 0 22px; }
h2 { font-size: clamp(28px, 4vw, 50px); line-height: 1; letter-spacing: -0.045em; margin: 0 0 14px; }
h3 { font-size: 21px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 9px; }
p { margin: 0; }

.lead { color: var(--muted); font-size: clamp(17px, 2vw, 21px); max-width: 680px; }

.rule {
  margin-top: 26px; padding: 18px 20px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: 22px; font-weight: 700; font-size: 17.5px;
}

/* HERO VISUAL */
.hero-visual { padding: 26px; display: grid; place-items: center; min-height: 520px; position: relative; overflow: hidden; }
.hero-visual::before {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: var(--accent-soft); right: -110px; top: -90px; opacity: 0.8;
}
.wire { position: relative; z-index: 1; width: min(100%, 470px); display: grid; gap: 14px; }

.node { border-radius: 22px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.node.front { background: white; border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(31,41,51,0.08); }
.node.front .tag { background: #5b8def; }
.node.brand { background: var(--brand-dark); color: white; box-shadow: 0 26px 60px rgba(17, 24, 39, 0.22); }
.node .label strong { display: block; font-size: 15px; }
.node .label span { font-size: 12.5px; color: var(--muted); }
.node.brand .label span { color: rgba(255,255,255,0.6); }
.node .tag { color: white; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.node.brand .tag { background: var(--accent); color: var(--brand-dark); }

.wire-mid { display: grid; justify-items: center; gap: 4px; color: var(--muted); }
.wire-mid .k { font-size: 12.5px; background: var(--soft); padding: 4px 10px; border-radius: 999px; font-weight: 700; text-align: center; }
.wire-mid .ar { font-size: 22px; line-height: 1; }

.brand-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.brand-chip { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 10px 6px; text-align: center; box-shadow: 0 8px 20px rgba(31,41,51,0.05); }
.brand-chip .ic { font-size: 18px; display: block; margin-bottom: 2px; }
.brand-chip span { font-size: 11px; color: var(--muted); }

/* SECTIONS */
.section { margin-top: 28px; padding: clamp(24px, 4vw, 44px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-head p { max-width: 540px; color: var(--muted); font-size: 17px; }

.kicker {
  display: inline-flex; font-size: 12px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-deep); background: var(--accent-soft);
  border: 1px solid var(--accent-line); padding: 5px 11px; border-radius: 999px; margin-bottom: 14px;
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.intro-card { border: 1px solid var(--line); border-radius: 24px; padding: 24px; background: white; }
.intro-card h3 { display: flex; align-items: center; gap: 10px; }
.intro-card p { color: var(--muted); font-size: 15.5px; margin-top: 8px; }
.intro-card ul { padding-left: 18px; margin: 12px 0 0; color: var(--muted); }
.intro-card li { margin: 7px 0; font-size: 15px; }
.intro-card.brand-bg { background: var(--brand-dark); color: white; border-color: rgba(255,255,255,0.12); }
.intro-card.brand-bg p, .intro-card.brand-bg li { color: rgba(255,255,255,0.82); }
.intro-card.brand-bg .hl { color: var(--accent); font-weight: 800; }

.metaphor { margin-top: 18px; padding: 16px 18px; background: var(--soft); border-radius: 18px; font-size: 15px; color: #5a5343; }
.metaphor strong { color: var(--ink); }

/* TERM GRID */
.term-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.term {
  background: white; border: 1px solid var(--line); border-radius: 24px;
  padding: 20px; min-height: 188px; display: flex; flex-direction: column; gap: 11px;
  transition: 0.2s ease; position: relative; overflow: hidden;
}
.term:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(31, 41, 51, 0.09); }
.term::after {
  content: attr(data-label); position: absolute; right: 14px; bottom: -12px;
  font-size: 44px; font-weight: 900; color: rgba(31, 41, 51, 0.045); letter-spacing: -0.06em;
}
.icon { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: var(--soft); font-size: 22px; }
.term p { color: var(--muted); font-size: 15.5px; position: relative; z-index: 1; }
.term strong { color: var(--ink); }

/* DEPLOY MAP */
.deploy-map { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.map-box { border-radius: 24px; padding: 24px; border: 1px solid var(--line); min-height: 200px; }
.map-box.front { background: var(--blue); }
.map-box.brand { background: var(--brand-dark); color: white; border-color: rgba(255,255,255,0.12); }
.map-box h3 { font-size: 19px; }
.map-box .where { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; display: block; }
.map-box.brand .where { color: var(--accent); }
.map-box p { font-size: 14.5px; color: #4b5565; margin-top: 8px; }
.map-box.brand p { color: rgba(255,255,255,0.82); }
.map-box ul { padding-left: 16px; margin: 10px 0 0; }
.map-box li { font-size: 14px; margin: 6px 0; }
.map-box.brand li { color: rgba(255,255,255,0.82); }
.map-link { display: grid; justify-items: center; gap: 6px; color: var(--muted); }
.map-link .ar { font-size: 28px; }
.map-link .k { font-size: 12px; background: var(--soft); padding: 5px 9px; border-radius: 999px; font-weight: 700; text-align: center; }

/* ROADMAP */
.roadmap { display: grid; gap: 0; position: relative; }
.rstep { display: grid; grid-template-columns: 54px 1fr; gap: 18px; align-items: start; padding-bottom: 18px; position: relative; }
.rstep:not(:last-child)::before {
  content: ""; position: absolute; left: 26px; top: 50px; bottom: -4px; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-line));
}
.rnum {
  width: 52px; height: 52px; border-radius: 16px; background: var(--brand-dark); color: var(--accent);
  display: grid; place-items: center; font-weight: 900; font-size: 19px; position: relative; z-index: 1;
}
.rbody { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; margin-bottom: 2px; }
.rbody h3 { font-size: 18px; }
.rbody p { color: var(--muted); font-size: 15px; margin-top: 5px; }
.rbody .why { display: inline-block; margin-top: 9px; font-size: 13px; color: var(--accent-deep); background: var(--accent-soft); border-radius: 999px; padding: 4px 11px; font-weight: 700; }
.rbody.optional { border-style: dashed; }

/* KEYS */
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.keycard { border-radius: 22px; padding: 20px; border: 1px solid var(--line); }
.keycard.ok { background: var(--green); }
.keycard.secret { background: var(--rose); }
.keycard .pill { display: inline-flex; font-size: 12px; font-weight: 800; padding: 5px 11px; border-radius: 999px; margin-bottom: 12px; }
.keycard.ok .pill { background: #c9ecd5; color: #1e6b3a; }
.keycard.secret .pill { background: #f6cccc; color: #9b2c2c; }
.keycard h3 { font-size: 18px; }
.keycard p { color: #4b5565; font-size: 14.5px; margin-top: 6px; }
.env-note { margin-top: 14px; background: var(--dark); color: white; border-radius: 18px; padding: 16px 18px; font-size: 15px; }
.env-note strong { color: #ffd99a; }
.env-note code { background: rgba(255,255,255,0.12); padding: 2px 7px; border-radius: 6px; font-size: 13px; }

/* TRADE-OFF */
.tradeoff { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.to { border-radius: 24px; padding: 22px; border: 1px solid var(--line); }
.to.good { background: var(--green); }
.to.bad { background: var(--rose); }
.to h3 { font-size: 19px; display: flex; align-items: center; gap: 9px; }
.to ul { padding-left: 18px; margin: 12px 0 0; }
.to li { margin: 8px 0; font-size: 15px; color: #4b5565; }

/* WHEN TO CHOOSE pill list */
.choose-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.choose-item {
  background: white; border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
}
.choose-item .mk { font-size: 22px; }
.choose-item p { font-size: 14.5px; color: var(--muted); }
.choose-item strong { color: var(--ink); }

/* AI */
.ai-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ai-card { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 20px; min-height: 160px; }
.ai-card .ic { font-size: 24px; }
.ai-card h3 { font-size: 17px; margin: 9px 0 6px; }
.ai-card p { color: var(--muted); font-size: 14.5px; }
.prompt-demo { margin-top: 16px; background: var(--brand-dark); color: rgba(255,255,255,0.9); border-radius: 18px; padding: 18px; font-size: 14.5px; line-height: 1.5; }
.prompt-demo .who { color: var(--accent); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 7px; }

/* ERRORS */
.err-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.err { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 20px; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.err .face { font-size: 26px; }
.err h3 { font-size: 17px; }
.err p { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.err .fix { margin-top: 9px; font-size: 13.5px; background: var(--green); color: #1e6b3a; border-radius: 12px; padding: 7px 11px; font-weight: 700; }

/* FINAL */
.final-box {
  text-align: center; padding: clamp(30px, 6vw, 70px);
  background: var(--brand-dark); color: white; border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(17, 24, 39, 0.18); margin-top: 28px;
}
.final-box h2 { max-width: 860px; margin: 0 auto 18px; }
.final-box h2 .hl { color: var(--accent); }
.final-box p { color: rgba(255,255,255,0.82); max-width: 720px; margin: 0 auto; font-size: 19px; }

.foot { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 24px; }
.foot a { color: var(--accent-deep); text-decoration: none; font-weight: 700; }

.reveal { opacity: 0; transform: translateY(18px); transition: 0.6s ease; }
.reveal.show { opacity: 1; transform: none; }

/* ===== HUB HOME ===== */
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hub-card {
  display: flex; flex-direction: column; gap: 10px;
  background: white; border: 1px solid var(--line); border-radius: 24px;
  padding: 24px; text-decoration: none; color: var(--ink);
  transition: 0.2s ease; min-height: 210px; position: relative; overflow: hidden;
}
.hub-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(31,41,51,0.1); }
.hub-card .hc-ic { font-size: 30px; }
.hub-card h3 { font-size: 21px; }
.hub-card p { color: var(--muted); font-size: 14.5px; }
.hub-card .when { margin-top: auto; font-size: 13px; font-weight: 800; border-radius: 999px; padding: 6px 12px; align-self: flex-start; }
.hub-card .go { color: var(--accent-deep); font-weight: 800; font-size: 14px; }
.hub-card .num { position: absolute; right: 16px; top: 14px; font-size: 13px; font-weight: 800; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 3px 10px; }

/* SQL vs NoSQL + spectrum + decision (dùng ở hub) */
.sqlnosql { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.db-type { border-radius: 24px; padding: 22px; border: 1px solid var(--line); }
.db-type.sql { background: var(--blue); }
.db-type.nosql { background: var(--purple); }
.db-type h3 { font-size: 20px; }
.db-type p { color: #4b5565; font-size: 15px; margin-top: 6px; }
.db-type .ex { margin-top: 12px; font-size: 13.5px; color: var(--muted); font-weight: 700; }

.spectrum-title { font-weight: 800; margin: 6px 0 14px; font-size: 18px; }
.spectrum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; position: relative; }
.stage { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 18px; min-height: 170px; }
.stage .step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-dark); color: white; display: grid; place-items: center; font-weight: 800; font-size: 14px; margin-bottom: 12px; }
.stage h3 { font-size: 17px; }
.stage p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.stage .tools { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.stage .tool { background: var(--soft); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: #5a5343; }
.scale-bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #74d39b, #7aa7f5, #c4a3f5, #f0936f); margin-bottom: 4px; }
.scale-labels { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }

@media (max-width: 980px) {
  .hero, .two-col, .keys, .deploy-map, .tradeoff, .sqlnosql { grid-template-columns: 1fr; }
  .term-grid, .ai-grid, .err-grid, .hub-grid, .choose-list { grid-template-columns: repeat(2, 1fr); }
  .spectrum { grid-template-columns: repeat(2, 1fr); }
  .scale-bar, .scale-labels { grid-column: 1 / -1; }
  .deploy-map .map-link { transform: rotate(90deg); }
}
@media (max-width: 640px) {
  .page { width: min(100% - 22px, 1180px); padding-top: 14px; }
  .nav { display: none; }
  .term-grid, .ai-grid, .err-grid, .hub-grid, .choose-list, .spectrum { grid-template-columns: 1fr; }
  .hero-copy, .section { padding: 24px; }
  h1 { font-size: 38px; }
  .rstep { grid-template-columns: 44px 1fr; gap: 13px; }
  .rnum { width: 42px; height: 42px; font-size: 16px; }
  .rstep:not(:last-child)::before { left: 21px; top: 46px; }
}
@media print {
  .nav { display: none; }
  body { background: white; }
  .card, .section, .final-box { box-shadow: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== COMPARE PAGE ===== */
.plat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.plat { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.plat .logo { font-size: 26px; }
.plat h3 { font-size: 17px; margin: 8px 0 4px; }
.plat .tldr { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; min-height: 38px; }
.plat .attr { font-size: 13px; margin: 7px 0; color: #4b5565; display: flex; gap: 7px; }
.plat .attr b { color: var(--ink); }

.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; -webkit-overflow-scrolling: touch; }
.cmp { width: 100%; border-collapse: collapse; min-width: 660px; background: white; }
.cmp th, .cmp td { padding: 13px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.cmp thead th { background: var(--brand-dark); color: #fff; font-weight: 800; font-size: 13px; }
.cmp thead th:first-child { border-top-left-radius: 0; }
.cmp td.row-h, .cmp th.row-h { font-weight: 800; color: var(--ink); background: #fbfaf6; white-space: nowrap; }
.cmp td { color: var(--muted); }
.cmp tbody tr:last-child td { border-bottom: none; }
.cmp .best { color: var(--accent-deep); font-weight: 800; }
.cmp-hint { color: var(--muted); font-size: 13px; margin-top: 10px; text-align: center; }

.callout {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: 20px; padding: 18px 22px; margin-top: 6px;
}
.callout p { font-size: 15px; color: #4b5565; }
.callout a { background: var(--brand-dark); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 11px 18px; border-radius: 999px; white-space: nowrap; }

@media (max-width: 980px) {
  .plat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .plat-grid { grid-template-columns: 1fr; }
}

/* ===== CAPSTONE: CHECKLIST ===== */
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.check-item {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
  background: white; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
}
.check-item .box {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent-deep); display: grid; place-items: center; font-weight: 900; font-size: 15px;
}
.check-item .ct strong { display: block; font-size: 15px; }
.check-item .ct p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

@media (max-width: 640px) {
  .checklist { grid-template-columns: 1fr; }
}
