/* ===== MidiChat landing — design system ===== */
:root {
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --bg: #ffffff;
  --soft: #f8fafc;
  --softer: #f1f5f9;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --accent: #7c3aed;
  --success: #059669;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-ink: #92400e;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 48px -16px rgba(79, 70, 229, 0.18);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section-soft { background: var(--soft); }
.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: 34px; line-height: 1.25; color: var(--ink); letter-spacing: -0.02em; }
.section-head p { margin-top: 12px; font-size: 17px; color: var(--muted); }
.eyebrow {
  display: inline-block; margin-bottom: 14px; padding: 5px 14px;
  border-radius: 999px; background: var(--primary-soft); color: var(--primary);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all 0.15s ease; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--faint); background: var(--soft); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { background: var(--softer); }
.btn-lg { padding: 15px 30px; font-size: 16px; border-radius: 12px; }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: var(--primary-soft); transform: translateY(-1px); }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 17px;
}
.nav-links { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav-links a { padding: 8px 13px; border-radius: 8px; color: var(--body); font-size: 14.5px; font-weight: 500; }
.nav-links a:hover { background: var(--softer); color: var(--ink); text-decoration: none; }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; color: var(--ink); }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden; text-align: center; padding: 96px 0 88px;
  background:
    radial-gradient(56% 60% at 50% 0%, #eef2ff 0%, rgba(238, 242, 255, 0) 100%),
    var(--bg);
}
.hero h1 {
  max-width: 800px; margin: 0 auto; font-size: 52px; line-height: 1.12;
  letter-spacing: -0.03em; color: var(--ink); font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 620px; margin: 22px auto 0; font-size: 18.5px; color: var(--muted); }
.hero-cta { margin-top: 36px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--faint); }
.hero-note b { color: var(--muted); font-weight: 600; }

/* Mock chat window in hero */
.hero-visual { max-width: 720px; margin: 56px auto 0; }
.chat-mock {
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow-lg); text-align: left;
}
.chat-mock-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  background: linear-gradient(120deg, var(--primary), var(--accent)); color: #fff;
}
.chat-mock-head .dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; }
.chat-mock-head span { font-weight: 600; font-size: 14.5px; }
.chat-mock-body { padding: 22px 18px; display: flex; flex-direction: column; gap: 12px; background: var(--soft); }
.bubble { max-width: 78%; padding: 11px 15px; border-radius: 14px; font-size: 14.5px; line-height: 1.55; }
.bubble-user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble-bot { align-self: flex-start; background: #fff; border: 1px solid var(--border); color: var(--body); border-bottom-left-radius: 4px; }
.bubble-label { font-size: 11.5px; color: var(--faint); margin: -6px 0 -6px 4px; }

/* ===== Channels strip ===== */
.channels { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.channel-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 20px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  font-size: 14.5px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-sm);
}
.channel-pill span { font-size: 18px; }

/* ===== Feature grid ===== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.feature {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: all 0.2s ease;
}
.feature:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  background: var(--primary-soft); font-size: 21px; margin-bottom: 16px;
}
.feature h3 { font-size: 17.5px; color: var(--ink); margin-bottom: 8px; }
.feature p { font-size: 14.5px; color: var(--muted); }

/* ===== Steps ===== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step { position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 26px 26px; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  font-weight: 700; font-size: 15px; margin-bottom: 16px;
}
.step h3 { font-size: 17px; color: var(--ink); margin-bottom: 8px; }
.step p { font-size: 14.5px; color: var(--muted); }

/* ===== Pricing ===== */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.price-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 30px 28px; display: flex; flex-direction: column; position: relative;
}
.price-card.popular { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.popular-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(120deg, var(--primary), var(--accent)); color: #fff;
  font-size: 12.5px; font-weight: 700; padding: 5px 16px; border-radius: 999px;
}
.price-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.price-desc { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.price-amount { margin: 18px 0 4px; font-size: 40px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.price-amount small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-features { list-style: none; margin: 20px 0 26px; display: grid; gap: 10px; flex: 1; }
.price-features li { display: flex; gap: 10px; font-size: 14.5px; color: var(--body); }
.price-features li::before { content: "✓"; color: var(--success); font-weight: 700; flex-shrink: 0; }
.price-features li.no { color: var(--faint); }
.price-features li.no::before { content: "—"; color: var(--faint); }

/* Compare table */
.compare { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 14.5px; }
.compare th, .compare td { padding: 13px 18px; text-align: center; border-bottom: 1px solid var(--border); }
.compare th { background: var(--soft); color: var(--ink); font-size: 14px; }
.compare td:first-child, .compare th:first-child { text-align: left; color: var(--body); }
.compare tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ===== FAQ ===== */
.faq { max-width: 720px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 0; overflow: hidden; }
.faq summary {
  cursor: pointer; padding: 17px 20px; font-weight: 600; color: var(--ink);
  font-size: 15.5px; list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-size: 20px; font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 20px 18px; font-size: 14.5px; color: var(--muted); }

/* ===== CTA band ===== */
.cta-band {
  background: linear-gradient(115deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 22px; padding: 60px 40px; text-align: center; color: #fff;
}
.cta-band h2 { font-size: 32px; letter-spacing: -0.02em; }
.cta-band p { margin: 12px auto 30px; max-width: 520px; opacity: 0.9; font-size: 16.5px; }

/* ===== Footer ===== */
.footer { background: #0f172a; color: #cbd5e1; padding: 64px 0 0; margin-top: 0; }
.footer a { color: #cbd5e1; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; padding-bottom: 44px; }
.footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
.footer ul { list-style: none; display: grid; gap: 9px; font-size: 14px; }
.footer-about p { font-size: 14px; margin-top: 14px; color: #94a3b8; }
.footer .brand { color: #fff; }
.footer-contact li { display: flex; gap: 9px; align-items: flex-start; }
.footer-legal {
  border-top: 1px solid #1e293b; padding: 22px 0; font-size: 13px; color: #64748b;
}
.footer-legal p { margin: 3px 0; }

/* ===== Page hero (subpages) ===== */
.page-hero { background: linear-gradient(180deg, var(--primary-soft), rgba(238,242,255,0)); padding: 64px 0 48px; text-align: center; }
.page-hero h1 { font-size: 38px; color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; }
.page-hero p { margin-top: 12px; color: var(--muted); font-size: 16.5px; max-width: 620px; margin-left: auto; margin-right: auto; }

/* ===== Prose (chính sách, blog, hướng dẫn) ===== */
.prose { max-width: 780px; margin: 0 auto; font-size: 15.5px; }
.prose h2 { font-size: 24px; color: var(--ink); margin: 40px 0 14px; letter-spacing: -0.01em; }
.prose h3 { font-size: 18.5px; color: var(--ink); margin: 28px 0 10px; }
.prose p { margin: 12px 0; }
.prose ul, .prose ol { margin: 12px 0 12px 24px; display: grid; gap: 7px; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.prose th { background: var(--soft); color: var(--ink); }
.prose code {
  background: var(--softer); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; font-size: 13.5px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}
.prose pre {
  background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 18px 20px;
  overflow-x: auto; margin: 16px 0; font-size: 13.5px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}
.prose pre code { background: none; border: none; padding: 0; color: inherit; }
.prose .note {
  background: var(--warning-bg); border: 1px solid var(--warning-border);
  color: var(--warning-ink); border-radius: 12px; padding: 14px 18px; margin: 16px 0; font-size: 14.5px;
}
.prose .info {
  background: var(--primary-soft); border: 1px solid #c7d2fe; color: #3730a3;
  border-radius: 12px; padding: 14px 18px; margin: 16px 0; font-size: 14.5px;
}
.updated { text-align: center; font-size: 13.5px; color: var(--faint); margin-top: 10px; }

/* ===== Blog cards ===== */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: all 0.2s ease;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-thumb { height: 140px; display: grid; place-items: center; font-size: 44px; background: linear-gradient(135deg, var(--primary-soft), #f5f3ff); }
.post-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-body .meta { font-size: 12.5px; color: var(--faint); }
.post-body h3 { font-size: 16.5px; line-height: 1.4; }
.post-body h3 a { color: var(--ink); }
.post-body p { font-size: 14px; color: var(--muted); flex: 1; }

/* ===== TOC (hướng dẫn) ===== */
.toc {
  background: var(--soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin: 0 auto 40px; max-width: 780px;
}
.toc strong { color: var(--ink); display: block; margin-bottom: 10px; font-size: 14.5px; }
.toc ol { margin-left: 20px; display: grid; gap: 6px; font-size: 14.5px; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .grid-3, .steps, .pricing, .post-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 40px; }
}
@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .grid-3, .grid-2, .steps, .pricing, .post-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding: 64px 0 56px; }
  .hero h1 { font-size: 31px; }
  .hero-sub { font-size: 16px; }
  .section-head h2 { font-size: 26px; }
  .page-hero h1 { font-size: 28px; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: #fff; border-bottom: 1px solid var(--border);
    padding: 12px 16px 16px; gap: 2px; box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: grid; place-items: center; }
  .nav-cta .btn-ghost { display: none; }
  .cta-band { padding: 44px 24px; }
  .cta-band h2 { font-size: 25px; }
}
