/* ============================================
   TOKENS
   ============================================ */
:root {
  --bg:            #0E1117;
  --surface:       #171B24;
  --surface-2:     #1F2430;
  --border:        #2A2F3C;

  --text:          #EDEFF4;
  --text-muted:    #8890A0;
  --text-faint:    #565D6E;

  --loss:          #FF4757;
  --loss-dim:      #4A2229;
  --gain:          #2ED9A0;
  --gain-dim:      #1B3B34;
  --amber:         #FFB020;
  --violet:        #8C7CF0;

  --zalo:          #0068FF;

  --font-display:  'Space Grotesk', sans-serif;
  --font-body:     'Inter', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --max-w: 560px;
}

/* ============================================
   RESET / BASE
   ============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right));
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { position: relative; z-index: 2; }

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 6vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 100px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { box-shadow: 0 0 0 1px var(--text), 0 8px 24px -8px rgba(237,239,244,0.35); }
.btn-primary svg { transition: transform 0.15s ease; flex-shrink: 0; }
.btn-primary:hover svg { transform: translateX(2px); }

/* Zalo — primary conversion action for this market: bigger, brighter, first */
.btn-zalo {
  background: var(--zalo);
  color: #fff;
  flex: 1.3;
  box-shadow: 0 4px 16px -6px rgba(0, 104, 255, 0.5);
}
.btn-zalo:hover { filter: brightness(1.08); }

/* Secondary action — outline style, visually quieter than Zalo */
.btn-secondary-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  flex: 0.8;
}
.btn-secondary-outline:hover { color: var(--text); border-color: var(--text-faint); }

.cta-buttons {
  display: flex;
  gap: 10px;
}

/* ============================================
   BRAND BAR — wordmark only, no nav links (keeps single-CTA focus)
   ============================================ */
.brand-bar { padding: 18px 0 0; }
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ============================================
   HERO
   ============================================ */
.hero { padding: clamp(28px, 8vw, 48px) 0 28px; }

.pain-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.pain-tag {
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 12px;
  white-space: nowrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--gain);
  background: var(--gain-dim);
  border: 1px solid rgba(46,217,160,0.25);
  padding: 7px 14px 7px 10px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gain); box-shadow: 0 0 8px var(--gain); flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 8.5vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.strike { color: var(--loss); }

.hero-sub {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 42ch;
  margin-bottom: 24px;
}

.hero-meta { margin-top: 12px; font-size: 12.5px; color: var(--text-faint); }

/* ============================================
   TRUST STRIP
   ============================================ */
.trust-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
  background: var(--surface);
}

.trust-grid { display: flex; flex-direction: column; gap: 16px; }
.trust-item { display: flex; flex-direction: column; gap: 3px; }

.trust-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.trust-label { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }

/* Track record — real numbers, its own compact band */
.track-record {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.track-record-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.track-record-stats {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 6vw, 40px);
  margin-bottom: 14px;
}

.track-stat { display: flex; flex-direction: column; gap: 2px; }
.track-stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(22px, 6vw, 28px);
  color: var(--gain);
}
.track-stat-label { font-size: 11px; color: var(--text-faint); }

.track-record-caption {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
  max-width: 40ch;
  margin: 0 auto;
}
.track-record-caption a {
  color: var(--gain);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================
   CALCULATOR — single compact card, fits one mobile screen
   ============================================ */
.calc-flow { padding: 28px 0 36px; }

.calc-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
}

.budget-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.budget-row-label { font-size: 12px; color: var(--text-muted); }
.budget-row-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.calc-pain {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 8px;
}

.calc-bridge {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 10px;
}

.calc-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.calc-check {
  font-size: 11px;
  color: var(--gain);
  background: var(--gain-dim);
  border: 1px solid rgba(46,217,160,0.25);
  border-radius: 100px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* Compact sidebars — where the loss comes from, inline on the main card.
   No descriptions, no full source badges — just label, one-word source,
   value, and a thin bar. Full detail still lives in the methodology modal. */
.mini-factors {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.mini-factor-row { display: flex; flex-direction: column; gap: 3px; }

.mini-factor-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.mini-factor-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.mini-factor-source {
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 400;
  margin-left: 4px;
}

.mini-factor-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
  flex-shrink: 0;
}

/* Slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--gain) 0%, var(--gain) var(--fill, 33%), var(--surface) var(--fill, 33%), var(--surface) 100%);
  outline: none;
  cursor: pointer;
  margin: 6px 0 16px;
  touch-action: pan-x;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--text); border: 5px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border), 0 4px 10px rgba(0,0,0,0.4);
  cursor: grab;
}
.slider::-webkit-slider-thumb:active { cursor: grabbing; }
.slider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--text); border: 5px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border), 0 4px 10px rgba(0,0,0,0.4);
  cursor: grab;
}
.slider::-moz-range-progress { background: var(--gain); height: 6px; border-radius: 100px; }

/* Result — one flowing visual instead of two separate bordered boxes */
.result-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.result-block { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.result-label { font-size: 11px; color: var(--text-faint); }

.result-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(24px, 7vw, 30px);
  color: var(--loss);
  line-height: 1.1;
  transition: transform 0.15s ease;
}
.result-value-sm {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(19px, 5.5vw, 23px);
  color: var(--gain);
  line-height: 1.1;
  transition: transform 0.15s ease;
}
.result-value.pulse, .result-value-sm.pulse { transform: scale(1.06); }

.result-sub { font-size: 10.5px; color: var(--text-faint); line-height: 1.3; }

.result-arrow { color: var(--text-faint); flex-shrink: 0; transform: rotate(-90deg); }

.response-time {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.5;
  margin: 12px 0 4px;
}

/* Methodology trigger — a text link, not a full-width button; must not
   compete for space with the actual conversion buttons above it. */
.methodology-trigger-compact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-family: var(--font-body);
  font-size: 11.5px;
  padding: 6px 0 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.methodology-trigger-compact svg { opacity: 0.7; }

/* ============================================
   MODAL — methodology overlay, out of normal flow
   ============================================ */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal-overlay[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }

.modal-sheet {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--max-w); max-height: 80vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface-2);
  border: 1px solid var(--border); border-bottom: none;
  border-top-left-radius: 20px; border-top-right-radius: 20px;
  padding: 8px 20px max(20px, env(safe-area-inset-bottom));
}

.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: 100px; margin: 8px auto 14px; }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text); }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}

@media (min-width: 720px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { max-width: 480px; border-radius: 20px; border-bottom: 1px solid var(--border); max-height: 85vh; }
  .modal-handle { display: none; }
}

.methodology-disclaimer {
  font-size: 11px; color: var(--text-faint); line-height: 1.4;
  margin: 10px 0 14px; padding: 8px 10px;
  background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border);
}

.waste-stack-wrap { margin-bottom: 14px; }
.waste-stack { display: flex; width: 100%; height: 14px; border-radius: 100px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.stack-seg { height: 100%; transition: width 0.35s cubic-bezier(0.4,0,0.2,1); min-width: 0; }
.seg-base { background: var(--text-faint); }
.seg-network { background: var(--loss); }
.seg-fraud { background: var(--amber); }
.seg-region { background: var(--violet); }

.stack-total-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.stack-total-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.stack-total-value { font-family: var(--font-mono); font-weight: 700; font-size: 17px; color: var(--loss); }

.factor-list { display: flex; flex-direction: column; gap: 12px; }
.factor-row { padding-top: 12px; border-top: 1px solid var(--border); }
.factor-list .factor-row:first-child { padding-top: 0; border-top: none; }

.factor-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.factor-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-base { background: var(--text-faint); }
.dot-network { background: var(--loss); }
.dot-fraud { background: var(--amber); }
.dot-region { background: var(--violet); }

.factor-label { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
.factor-value { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--text); flex-shrink: 0; }

.factor-bar-track { width: 100%; height: 4px; border-radius: 100px; background: var(--surface); overflow: hidden; margin-bottom: 6px; }
.factor-bar-fill { height: 100%; border-radius: 100px; transition: width 0.35s cubic-bezier(0.4,0,0.2,1); }
.fill-base { background: var(--text-faint); }
.fill-network { background: var(--loss); }
.fill-fraud { background: var(--amber); }
.fill-region { background: var(--violet); }

.factor-desc { font-size: 12px; color: var(--text-muted); line-height: 1.42; margin-bottom: 8px; }
.factor-source {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--text-faint);
  background: var(--surface); border: 1px solid var(--border); border-radius: 100px;
  padding: 3px 9px 3px 7px;
}
.factor-source svg { flex-shrink: 0; opacity: 0.7; }

/* ============================================
   COMPARISON TABLE
   ============================================ */
.compare { padding: 44px 0 48px; border-top: 1px solid var(--border); }

.compare-table { border: 1px solid var(--border); border-radius: var(--radius-md); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-row { display: grid; grid-template-columns: 0.9fr 1.1fr 1.1fr; min-width: 300px; border-bottom: 1px solid var(--border); }
.compare-row:last-child { border-bottom: none; }
.compare-row > div { padding: 12px 8px; font-size: 12px; line-height: 1.4; }

.compare-head { background: var(--surface-2); font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint); }
.compare-head .col-meta, .compare-head .col-yt { display: flex; flex-direction: column; gap: 2px; }
.compare-head span { font-size: 9.5px; color: var(--text-faint); text-transform: none; font-family: var(--font-body); }

.row-label { font-weight: 500; color: var(--text-muted); background: var(--surface); }
.compare-row:not(.compare-head) > div:nth-child(2) { color: var(--text-faint); }
.compare-row .col-yt { color: var(--gain); font-weight: 500; background: rgba(46,217,160,0.05); }

.compare-source {
  font-size: 10.5px;
  color: var(--text-faint);
  line-height: 1.5;
  margin-top: 10px;
}

/* ============================================
   FINAL CTA — repeat the offer, no new content
   ============================================ */
.final-cta { padding: 40px 0 44px; text-align: center; border-top: 1px solid var(--border); background: var(--surface); }

.final-cta-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 6vw, 27px);
  line-height: 1.3;
  margin-bottom: 20px;
}

.final-cta .cta-buttons { max-width: 380px; margin: 0 auto 16px; }

.final-cta-note { font-size: 12px; color: var(--text-faint); max-width: 34ch; margin: 0 auto; line-height: 1.5; }

/* ============================================
   FOOTER
   ============================================ */
.footer { border-top: 1px solid var(--border); padding: 20px 0 max(28px, env(safe-area-inset-bottom)); }
.footer .wrap { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-faint); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 360px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
}

@media (min-width: 720px) {
  .trust-grid { flex-direction: row; }
  .trust-item { flex: 1; }
}

a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--gain); outline-offset: 3px; }
