/* MacroLens — Webflow Scrollytelling & Framer Scroll-Transform Design System (60fps GPU-only animations) */

:root {
  --bg: #03050a;
  --panel: rgba(12, 18, 32, 0.78);
  --panel-solid: #0b1120;
  --panel-2: #111b31;
  --border: rgba(148, 163, 184, 0.14);
  --border-hi: rgba(56, 189, 248, 0.55);
  --text: #f1f5f9;
  --muted: #8b9bb4;
  --cyan: #38bdf8;
  --indigo: #818cf8;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

/* Scroll progress hairline */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%; z-index: 100;
  background: linear-gradient(90deg, var(--cyan), var(--indigo), var(--green));
  transition: width 0.08s linear;
}

/* Minimal Floating Navbar */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: rgba(3, 5, 10, 0.76);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 24px;
  height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #03050a;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.35);
}
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -0.3px; }
.brand-tag { font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; margin-left: 6px; }

.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 500; transition: color 0.15s; }
.nav-links a:hover { color: #fff; }

.nav-cta { display: flex; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none; font-weight: 700; font-size: 13px; border-radius: 999px;
  padding: 9px 18px; cursor: pointer; border: none; transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #6366f1); color: #03050a;
  box-shadow: 0 6px 26px rgba(56, 189, 248, 0.28);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.04); color: #e2e8f0; border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--cyan); color: #fff; }

/* FULL-VIEWPORT APPLE/FRAMER HERO */
.hero {
  min-height: 94vh; padding: 110px 24px 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  position: relative;
  background:
    radial-gradient(ellipse 65% 45% at 50% 18%, rgba(56, 189, 248, 0.14), transparent 70%),
    radial-gradient(ellipse 45% 35% at 70% 75%, rgba(99, 102, 241, 0.10), transparent 70%);
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.4px;
  background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35);
  margin-bottom: 24px;
}
.hero-pill.calm { background: rgba(34, 197, 94, 0.12); color: #4ade80; border-color: rgba(34, 197, 94, 0.35); }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.5rem);
  font-weight: 800; letter-spacing: -0.04em; line-height: 1.06;
  max-width: 900px; margin-bottom: 18px;
  background: linear-gradient(180deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.2rem); color: var(--muted);
  max-width: 600px; margin-bottom: 34px; font-weight: 400;
}
.hero-metrics {
  display: flex; align-items: center; justify-content: center; gap: 36px; flex-wrap: wrap;
  padding: 18px 34px; border-radius: 20px;
  background: rgba(11, 17, 32, 0.65); border: 1px solid var(--border);
  backdrop-filter: blur(12px); margin-bottom: 36px;
}
.hm-stat { text-align: center; }
.hm-stat-val { font-size: 30px; font-weight: 800; line-height: 1.1; color: #fff; }
.hm-stat-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; margin-top: 4px; }
.hm-div { width: 1px; height: 38px; background: var(--border); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* STICKY SCROLLYTELLING STAGE */
.story-section {
  max-width: 1320px; margin: 0 auto; padding: 40px 24px 100px;
  display: grid; grid-template-columns: 0.78fr 1.22fr; gap: 48px; align-items: start;
}

/* Left Narrative Steps (strict <= 30 words each!) */
.story-steps { display: flex; flex-direction: column; padding-bottom: 120px; }
.step-item {
  min-height: 78vh; display: flex; flex-direction: column; justify-content: center;
  padding: 24px 0;
  opacity: 0.28; transform: translateY(10px);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}
.step-item.is-active { opacity: 1; transform: translateY(0); }
.step-num {
  font-size: 11.5px; font-weight: 800; color: var(--cyan); letter-spacing: 1.4px;
  text-transform: uppercase; margin-bottom: 12px;
}
.step-title {
  font-size: clamp(1.7rem, 2.7vw, 2.45rem); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.14; color: #fff; margin-bottom: 14px;
}
.step-desc { font-size: 16px; color: var(--muted); line-height: 1.55; max-width: 400px; }
.step-dots { display: flex; gap: 6px; margin-top: 22px; }
.step-dot { width: 22px; height: 3px; border-radius: 99px; background: rgba(148, 163, 184, 0.22); transition: 0.3s; }
.step-item.is-active .step-dot.on { background: var(--cyan); width: 38px; }

/* Right Sticky Visual Stage */
.stage-col { position: sticky; top: 88px; height: calc(100vh - 124px); min-height: 540px; max-height: 680px; }
.stage-frame {
  position: relative; width: 100%; height: 100%;
  background: radial-gradient(circle at 80% 10%, rgba(56, 189, 248, 0.10), transparent 55%),
              linear-gradient(180deg, #0d1527 0%, #070c17 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}
.stage-topbar {
  height: 44px; padding: 0 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted);
}
.win-dots { display: flex; gap: 6px; }
.win-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(148, 163, 184, 0.25); }

.scene {
  position: absolute; inset: 44px 0 0 0; padding: 26px;
  opacity: 0; pointer-events: none;
  transform: scale(0.96) translateY(14px);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column; justify-content: space-between;
}
.stage-frame[data-step="1"] .scene[data-scene="1"],
.stage-frame[data-step="2"] .scene[data-scene="2"],
.stage-frame[data-step="3"] .scene[data-scene="3"],
.stage-frame[data-step="4"] .scene[data-scene="4"] {
  opacity: 1; pointer-events: auto; transform: scale(1) translateY(0);
}

/* SCENE 1: FOMO Candlestick + Stress Counter */
.s1-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 22px; align-items: center; flex: 1; }
.candle-box {
  background: rgba(3, 5, 10, 0.65); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; height: 100%; display: flex; flex-direction: column; justify-content: space-between;
}
.svg-draw { stroke-dasharray: 420; stroke-dashoffset: 420; transition: stroke-dashoffset 1.3s cubic-bezier(0.22, 1, 0.36, 1); }
.stage-frame[data-step="1"] .svg-draw { stroke-dashoffset: 0; }
.clash-card {
  background: rgba(3, 5, 10, 0.65); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
.big-counter { font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--amber); }
.bar-row { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.bar-track { height: 8px; background: rgba(148, 163, 184, 0.14); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1); }

/* SCENE 2: Interactive Hover Flow Map */
.s2-compass {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: 12px; background: rgba(3, 5, 10, 0.6); border: 1px solid var(--border);
  margin-bottom: 14px; font-size: 12px;
}
.s2-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; flex: 1; align-content: center; }
.m-tile {
  background: rgba(17, 27, 49, 0.72); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.m-tile:hover, .m-tile.active {
  transform: translateY(-3px); border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 10px 24px rgba(56, 189, 248, 0.18);
}
.m-tile.inflow { background: linear-gradient(160deg, rgba(34, 197, 94, 0.18), rgba(11, 17, 32, 0.92)); }
.m-tile.outflow { background: linear-gradient(160deg, rgba(239, 68, 68, 0.16), rgba(11, 17, 32, 0.92)); }
.m-sym { font-weight: 800; font-size: 13px; color: #fff; }
.m-score { font-size: 11px; font-weight: 700; }
.m-spark { width: 100%; height: 26px; display: block; }
.s2-spotlight {
  margin-top: 14px; padding: 13px 16px; border-radius: 14px;
  background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.32);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
}

/* SCENE 3: Sequential Vietnam Transmission Chain */
.s3-chain { display: flex; flex-direction: column; justify-content: center; gap: 22px; flex: 1; }
.s3-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(3, 5, 10, 0.6); border: 1px solid var(--border);
  font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.5px;
}
.chain-nodes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; position: relative; }
.chain-svg-line { width: 100%; height: 32px; display: block; }
.chain-path { stroke-dasharray: 600; stroke-dashoffset: 600; transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1); }
.stage-frame[data-step="3"] .chain-path { stroke-dashoffset: 0; }
.vn-node {
  background: rgba(3, 5, 10, 0.68); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 14px; cursor: pointer; transition: 0.2s;
  display: flex; flex-direction: column; gap: 6px;
}
.vn-node:hover, .vn-node.active { border-color: var(--cyan); transform: translateY(-3px); background: rgba(17, 27, 49, 0.9); }
.vn-node-k { font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.vn-node-v { font-size: 22px; font-weight: 800; color: #fff; }
.vn-node-s { font-size: 11px; font-weight: 700; }
.s3-detail {
  padding: 15px 18px; border-radius: 14px; background: rgba(3, 5, 10, 0.68);
  border: 1px solid var(--border); font-size: 13.5px; color: #e2e8f0;
}

/* SCENE 4: 5 Ultra-Short Signal Headlines (Shared Component with /brief!) */
.brief5-list { display: flex; flex-direction: column; gap: 10px; justify-content: center; flex: 1; }
.b5-row {
  display: grid; grid-template-columns: 36px 54px 1fr auto; align-items: center; gap: 12px;
  padding: 13px 15px; border-radius: 13px;
  background: rgba(3, 5, 10, 0.68); border: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: 0.16s;
}
.b5-row:hover { border-color: var(--cyan); transform: translateX(4px); }
.b5-arrow {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 900; font-size: 15px;
}
.b5-arrow.bear { background: rgba(239, 68, 68, 0.16); color: #f87171; }
.b5-arrow.bull { background: rgba(34, 197, 94, 0.16); color: #4ade80; }
.b5-arrow.warn { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.b5-arrow.info { background: rgba(56, 189, 248, 0.16); color: #38bdf8; }
.b5-num { font-size: 18px; font-weight: 800; text-align: center; color: #fff; }
.b5-headline { font-size: 13.5px; font-weight: 600; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b5-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* CLOSING CONVERSION SECTION */
.closing {
  max-width: 1040px; margin: 0 auto; padding: 70px 24px 90px; text-align: center;
}
.closing h2 {
  font-size: clamp(2rem, 3.8vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 14px;
}
.closing p { color: var(--muted); font-size: 16px; max-width: 540px; margin: 0 auto 30px; }
.tier-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 780px; margin: 0 auto 36px; text-align: left; }
.tier-box {
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 18px; padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.tier-box.featured { border-color: rgba(56, 189, 248, 0.45); background: linear-gradient(160deg, rgba(56, 189, 248, 0.08), var(--panel-solid)); }
.tier-price { font-size: 26px; font-weight: 800; color: #fff; }
.tier-note { font-size: 13px; color: var(--muted); }
.legal-foot { font-size: 11.5px; color: var(--muted); max-width: 760px; margin: 0 auto; opacity: 0.78; }

/* /brief SINGLE-SCREEN 15-SECOND TERMINAL (NO SCROLL ON DESKTOP!) */
body.brief-mode { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.brief-shell {
  flex: 1; max-width: 1400px; width: 100%; margin: 62px auto 0; padding: 14px 20px 14px;
  display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: auto 1fr; gap: 12px;
  overflow: hidden;
}
.brief-banner {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; border-radius: 12px;
  background: var(--panel-solid); border: 1px solid var(--border);
}
.brief-col {
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px; overflow: hidden;
}
.brief-col-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--cyan); }

.pos { color: #4ade80; }
.neg { color: #f87171; }
.warn { color: #fbbf24; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scene, .step-item, .svg-draw, .chain-path, .bar-fill { transition: none !important; }
}

@media (max-width: 980px) {
  .story-section { grid-template-columns: 1fr; }
  .stage-col { position: relative; top: 0; height: auto; max-height: none; }
  .scene { position: relative; inset: auto; opacity: 1; pointer-events: auto; transform: none; display: none; }
  .stage-frame[data-step="1"] .scene[data-scene="1"],
  .stage-frame[data-step="2"] .scene[data-scene="2"],
  .stage-frame[data-step="3"] .scene[data-scene="3"],
  .stage-frame[data-step="4"] .scene[data-scene="4"] { display: flex; }
  .step-item { min-height: auto; opacity: 1; transform: none; padding: 18px 0; }
  .s2-tiles { grid-template-columns: repeat(2, 1fr); }
  .chain-nodes { grid-template-columns: repeat(2, 1fr); }
  .tier-cards { grid-template-columns: 1fr; }
  body.brief-mode { height: auto; overflow: auto; }
  .brief-shell { grid-template-columns: 1fr; grid-template-rows: auto; overflow: visible; }
}
