/* ============================================================
   MAP4D × DiDongViet — Intent Commerce Engine
   Shared design system (premium refresh)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,500&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Neutrals — warm */
  --ink:        #101014;
  --ink-2:      #18181f;
  --ink-3:      #23232c;
  --paper:      #faf8f4;
  --paper-2:    #f2efe8;
  --surface:    #ffffff;
  --line:       #eae6dd;
  --line-2:     #ddd8cc;
  --muted:      #76767f;
  --muted-2:    #9a9aa2;

  /* On-dark */
  --d-line:     rgba(255,255,255,0.10);
  --d-line-2:   rgba(255,255,255,0.16);
  --d-muted:    rgba(255,255,255,0.56);
  --d-faint:    rgba(255,255,255,0.34);

  /* Brand */
  --red:        #da1f26;
  --red-deep:   #a8141a;
  --red-soft:   #fbeceb;
  --red-glow:   rgba(218,31,38,0.28);

  /* Signal */
  --live:       #15a04a;
  --live-soft:  #eaf6ee;
  --amber:      #c8821f;
  --gold:       #be9b4e;
  --gold-soft:  #f6f0e0;
  --blue:       #2563eb;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --shadow-sm: 0 1px 2px rgba(16,16,20,0.04), 0 2px 8px rgba(16,16,20,0.05);
  --shadow-md: 0 4px 14px rgba(16,16,20,0.07), 0 14px 40px rgba(16,16,20,0.08);
  --shadow-lg: 0 10px 30px rgba(16,16,20,0.10), 0 30px 80px rgba(16,16,20,0.14);

  --maxw: 1240px;
  --bar-h: 44px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--red); color: #fff; }

.mono { font-family: 'JetBrains Mono', monospace; font-feature-settings: "tnum"; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ---- Eyebrow / section labels ---- */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 9px;
}
.eyebrow::before {
  content: ''; width: 22px; height: 1px; background: var(--red);
}
.eyebrow.on-dark { color: var(--d-muted); }

/* ---- Headings ---- */
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.04; font-weight: 800; }
.display { font-size: clamp(40px, 6vw, 78px); font-weight: 900; letter-spacing: -0.04em; }
.h-xl { font-size: clamp(30px, 4vw, 46px); }
.h-lg { font-size: clamp(24px, 3vw, 34px); }
.text-red { color: var(--red); }
.text-muted { color: var(--muted); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 700; letter-spacing: -0.01em;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease, border-color .16s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 6px 18px var(--red-glow); }
.btn-red:hover { background: var(--red-deep); transform: translateY(-2px); box-shadow: 0 10px 26px var(--red-glow); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-3); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-on-dark { background: rgba(255,255,255,0.06); color: #fff; border: 1px solid var(--d-line-2); }
.btn-on-dark:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.btn-lg { padding: 17px 30px; font-size: 15px; }
.btn-sm { padding: 9px 15px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ============================================================
   CHIPS / TAGS / BADGES
   ============================================================ */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em;
  background: var(--paper-2); color: var(--ink);
}
.tag-red   { background: var(--red-soft); color: var(--red-deep); }
.tag-live  { background: var(--live-soft); color: var(--live); }
.tag-gold  { background: var(--gold-soft); color: #8a6d23; }
.tag-ink   { background: var(--ink); color: #fff; }
.tag-outline { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.tag .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); position: relative; }
.live-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--live); opacity: .6; animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.8); opacity: 0; } }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-dark {
  background: var(--ink-2); border: 1px solid var(--d-line);
  border-radius: var(--r-lg); color: #fff;
}

/* ============================================================
   INTENT SCORE — signature component
   ============================================================ */
.intent-ring {
  --val: 92; --size: 132px; --thick: 9px;
  width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background:
    radial-gradient(closest-side, var(--ring-bg, #fff) calc(100% - var(--thick) - 1px), transparent calc(100% - var(--thick))),
    conic-gradient(var(--red) calc(var(--val) * 1%), var(--ring-track, #ece8e0) 0);
}
.intent-ring.on-dark { --ring-bg: #18181f; --ring-track: rgba(255,255,255,0.10); }
.intent-ring .v {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: calc(var(--size) * 0.30); letter-spacing: -0.04em; line-height: 1;
}
.intent-ring .v small { font-size: 0.42em; color: var(--muted); font-weight: 600; }
.intent-ring.on-dark .v small { color: var(--d-muted); }
.intent-ring .cap {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin-top: 3px;
}
.intent-ring.on-dark .cap { color: var(--d-faint); }

/* score pill */
.score-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  background: var(--red); color: #fff; padding: 5px 12px 5px 8px;
  border-radius: 999px; font-size: 13px; letter-spacing: -0.02em;
}
.score-pill .lab {
  font-family: 'Be Vietnam Pro', sans-serif; font-size: 9.5px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
  background: rgba(255,255,255,0.22); padding: 3px 7px; border-radius: 999px;
}

/* progress bars (intent factors / demand) */
.bar { height: 7px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--red); }
.bar.on-dark { background: rgba(255,255,255,0.09); }

/* ============================================================
   DEMO NAVIGATOR (top bar, injected by nav.js)
   ============================================================ */
.demo-bar {
  position: sticky; top: 0; z-index: 9000;
  height: var(--bar-h);
  background: var(--ink); color: #fff;
  display: flex; align-items: center; gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
}
.demo-bar .db-brand {
  display: flex; align-items: center; gap: 9px;
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
  letter-spacing: .04em; white-space: nowrap; color: #fff;
}
.demo-bar .db-brand b { color: var(--red); }
.demo-bar .db-brand .sq {
  width: 16px; height: 16px; border-radius: 4px; background: var(--red);
  display: grid; place-items: center; font-family: 'Be Vietnam Pro'; font-weight: 900;
  font-size: 11px; color: #fff;
}
.demo-bar .db-steps {
  display: flex; align-items: center; gap: 2px; margin-left: auto;
  overflow-x: auto; scrollbar-width: none;
}
.demo-bar .db-steps::-webkit-scrollbar { display: none; }
.demo-bar .db-step {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  color: rgba(255,255,255,0.62); font-weight: 600; transition: all .15s;
}
.demo-bar .db-step:hover { color: #fff; background: rgba(255,255,255,0.07); }
.demo-bar .db-step .n {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: rgba(255,255,255,0.4);
}
.demo-bar .db-step.active { background: var(--red); color: #fff; }
.demo-bar .db-step.active .n { color: rgba(255,255,255,0.7); }
.demo-bar .db-group { display: flex; align-items: center; gap: 2px; }
.demo-bar .db-rolelabel {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 9px 0 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,0.38);
  white-space: nowrap;
}
.demo-bar .db-rolelabel.active { color: var(--red); }
.demo-bar .db-rolelabel svg { opacity: .85; }
.demo-bar .db-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.14); margin: 0 8px; flex-shrink: 0; }
.demo-bar .db-viewing {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 12px; border-radius: 999px;
}
body[data-current-role="business"] .demo-bar .db-viewing { color: #fff; background: rgba(218,31,38,0.18); border-color: rgba(218,31,38,0.4); }
.demo-bar .db-viewing svg { opacity: .9; }
@media (max-width: 1100px) { .demo-bar .db-viewing { display: none; } }
@media (max-width: 820px) {
  .demo-bar .db-step .lbl, .demo-bar .db-rolelabel { display: none; }
  .demo-bar .db-step { padding: 7px 9px; }
}

/* image-slot fill helper */
image-slot { display: block; background-color: var(--paper-2); background-image: repeating-linear-gradient(135deg, rgba(16,16,20,0.05) 0 11px, transparent 11px 22px); }
image-slot[data-filled] { background-image: none; }
.slot-fill { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ============================================================
   SITE HEADER (shared by storefront pages)
   ============================================================ */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: var(--bar-h); z-index: 800; }
.site-header .topline {
  background: var(--ink); color: rgba(255,255,255,0.82);
  font-size: 12px; text-align: center; padding: 7px 0; letter-spacing: .01em;
}
.site-header .topline b { color: #fff; }
.site-header .topline .hot { color: #ff6b6b; font-weight: 700; }
.site-header .hmain {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; gap: 30px;
}
.site-header .logo img { height: 40px; }
.site-header nav.main { display: flex; gap: 4px; }
.site-header nav.main a {
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  padding: 9px 13px; border-radius: 999px; transition: all .15s;
}
.site-header nav.main a:hover { background: var(--paper-2); }
.site-header nav.main a.active { color: var(--red); }
.site-header .hsearch { flex: 1; max-width: 340px; margin-left: auto; position: relative; }
.site-header .hsearch input {
  width: 100%; padding: 11px 16px 11px 42px; border: 1px solid var(--line-2);
  border-radius: 999px; font-family: inherit; font-size: 13.5px; background: var(--paper);
  transition: border-color .15s, background .15s;
}
.site-header .hsearch input:focus { outline: none; border-color: var(--ink); background: #fff; }
.site-header .hsearch svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.site-header .hicons { display: flex; align-items: center; gap: 6px; }
.site-header .hicon {
  position: relative; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2); transition: background .15s;
}
.site-header .hicon:hover { background: var(--paper-2); }
.site-header .hicon svg { width: 20px; height: 20px; }
.site-header .hicon .bdg {
  position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--red); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}
@media (max-width: 980px) {
  .site-header nav.main { display: none; }
  .site-header .hmain { gap: 16px; padding: 12px 18px; }
}

/* wordmark for dark surfaces (logo is on white bg) */
.wordmark { font-weight: 900; letter-spacing: -0.04em; font-size: 21px; color: #fff; }
.wordmark .v { color: var(--red); }
.wordmark .vn { font-size: 0.62em; font-weight: 700; color: var(--muted-2); vertical-align: super; margin-left: 1px; }

/* ============================================================
   FOOTER (engine signature)
   ============================================================ */
.engine-foot {
  background: var(--ink); color: var(--d-muted);
  padding: 18px 0; font-size: 12px;
}
.engine-foot .wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.engine-foot .m4d { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; }
.engine-foot .m4d .badge {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
  background: rgba(255,255,255,0.08); border: 1px solid var(--d-line);
  padding: 3px 9px; border-radius: 999px; color: var(--d-muted);
}
.engine-foot .ep {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: rgba(255,255,255,0.06); padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--d-line); color: var(--d-muted);
}

/* ============================================================
   IMAGE PLACEHOLDER (striped) — drop real product shots later
   ============================================================ */
.ph {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  background-color: var(--paper-2);
  background-image: repeating-linear-gradient(135deg, rgba(16,16,20,0.04) 0 10px, transparent 10px 20px);
  display: grid; place-items: center;
}
.ph .ph-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  background: rgba(255,255,255,0.78); padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line);
}
.ph.on-dark { background-color: #1d1d25; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.045) 0 10px, transparent 10px 20px); }
.ph.on-dark .ph-tag { background: rgba(0,0,0,0.4); color: var(--d-muted); border-color: var(--d-line); }

/* utility */
.divider { height: 1px; background: var(--line); border: 0; }
.divider.on-dark { background: var(--d-line); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.muted { color: var(--muted); }
