/* ============================================================
   Bafe — Public sentiment intelligence
   ============================================================ */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090b;
  --bg-alt: #0b0d10;
  --panel: #0e1114;
  --panel-2: #12161a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f0eb;
  --muted: #9297a1;
  --faint: #6a707a;
  --pos: #7d9478;
  --neg: #c45c4a;
  --neu: #565e69;
  --mild: #a39a6a;
  --accent: #c8c2b6;
  --pos-rgb: 125, 148, 120;
  --accent-rgb: 200, 194, 182;
  --btn-fg: #0a0b0d;
  --btn-hover: #ffffff;
  --ghost-hover-border: rgba(255, 255, 255, 0.32);
  --ghost-hover-bg: rgba(255, 255, 255, 0.03);
  --hero-bg: #151515;
  --nav-bg: #151515;
  --overlay-bg: rgba(8, 9, 11, 0.96);
  --grid-line: rgba(255, 255, 255, 0.025);
  --grid-glow: rgba(200, 194, 182, 0.05);
  --panel-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  --stat-bg: rgba(255, 255, 255, 0.015);
  --meter-track: rgba(255, 255, 255, 0.05);
  --msg-user-bg: rgba(255, 255, 255, 0.06);
  --snapshot-bg: rgba(8, 9, 11, 0.6);
  --snapshot-grid: rgba(255, 255, 255, 0.018);
  --logo-filter: none;
  --chart-grid: rgba(255, 255, 255, 0.06);
  --chart-event: rgba(255, 255, 255, 0.14);
  --chip-neg: #f08a77;
  --font-sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --nav-h: 72px;
  --radius: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --page-w: 1520px;
  --page-gutter: clamp(24px, 5vw, 80px);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f2ec;
  --bg-alt: #eceae3;
  --panel: #ffffff;
  --panel-2: #faf9f5;
  --border: rgba(18, 16, 12, 0.08);
  --border-strong: rgba(18, 16, 12, 0.16);
  --text: #141311;
  --muted: #5a5e66;
  --faint: #7a7f87;
  --pos: #4d6b4a;
  --neg: #b04a3c;
  --neu: #8a9199;
  --mild: #7a7040;
  --accent: #3d3b36;
  --pos-rgb: 77, 107, 74;
  --accent-rgb: 61, 59, 54;
  --btn-fg: #f4f2ec;
  --btn-hover: #000000;
  --ghost-hover-border: rgba(18, 16, 12, 0.32);
  --ghost-hover-bg: rgba(18, 16, 12, 0.04);
  --hero-bg: #f4f2ec;
  --nav-bg: rgba(244, 242, 236, 0.86);
  --overlay-bg: rgba(244, 242, 236, 0.97);
  --grid-line: rgba(18, 16, 12, 0.05);
  --grid-glow: rgba(61, 59, 54, 0.06);
  --panel-shadow: 0 24px 80px rgba(20, 18, 12, 0.08);
  --stat-bg: rgba(18, 16, 12, 0.02);
  --meter-track: rgba(18, 16, 12, 0.06);
  --msg-user-bg: rgba(18, 16, 12, 0.05);
  --snapshot-bg: rgba(255, 255, 255, 0.72);
  --snapshot-grid: rgba(18, 16, 12, 0.04);
  --logo-filter: invert(1);
  --chart-grid: rgba(18, 16, 12, 0.07);
  --chart-event: rgba(18, 16, 12, 0.16);
  --chip-neg: #c94a38;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
.logo { filter: var(--logo-filter); }

.mono {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.container {
  width: min(var(--page-w), calc(100% - var(--page-gutter) * 2));
  margin-inline: auto;
}

.center { text-align: center; }
.pos { color: var(--pos); }
.em { color: var(--text); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -48px;
  background: var(--text); color: var(--bg);
  padding: 8px 14px; border-radius: 6px;
  font-size: 14px; z-index: 100;
  transition: top 0.15s;
}
.skip-link:focus { top: 12px; }

/* ---------- typography ---------- */

h1 {
  font-size: clamp(2.5rem, 6vw, 4.15rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 650;
}

h2 {
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.kicker {
  color: var(--accent);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.kicker-reticle {
  position: relative;
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}
.kicker-reticle::before,
.kicker-reticle::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.kicker-reticle::before {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
}
.kicker-reticle::after {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
}

.section-sub {
  color: var(--muted);
  max-width: 560px;
  margin-top: 18px;
  font-size: 1.06rem;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 550;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease), opacity 0.18s;
  font-family: var(--font-sans);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--text);
  color: var(--btn-fg);
}
.btn-primary:hover { background: var(--btn-hover); }

.btn-ghost {
  color: var(--text);
  border-color: var(--border-strong);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--ghost-hover-border); background: var(--ghost-hover-bg); }

.btn-sm { padding: 8px 16px; font-size: 14px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: transparent;
}

.nav.is-scrolled {
  background: var(--hero-bg);
}

.nav-inner {
  width: min(var(--page-w), calc(100% - var(--page-gutter) * 2));
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo img { height: 36px; width: auto; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 10px 0;
}
.nav-toggle:hover { color: var(--text); opacity: 0.7; }
.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 28px;
}
.nav-toggle-icon span {
  display: block;
  width: 100%;
  height: 1px;
  background: currentColor;
  transition: transform 0.22s var(--ease);
}
.nav.is-open .nav-toggle-icon span:first-child { transform: translateY(4px) rotate(45deg); }
.nav.is-open .nav-toggle-icon span:last-child { transform: translateY(-4px) rotate(-45deg); }

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--overlay-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 24px) 0 64px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-overlay-inner {
  width: min(var(--page-w), calc(100% - var(--page-gutter) * 2));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.menu-overlay-inner a:not(.btn) {
  display: flex;
  align-items: baseline;
  gap: 22px;
  color: var(--text);
  text-decoration: none;
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  padding: 10px 0;
  transform: translateY(12px);
  opacity: 0;
  transition: color 0.18s, transform 0.45s var(--ease), opacity 0.45s var(--ease);
}
.menu-overlay-inner a:not(.btn):hover { color: var(--accent); }
.menu-overlay.is-open .menu-overlay-inner a:not(.btn) { transform: none; opacity: 1; }
.menu-overlay.is-open .menu-overlay-inner a:nth-child(1) { transition-delay: 0.06s; }
.menu-overlay.is-open .menu-overlay-inner a:nth-child(2) { transition-delay: 0.12s; }
.menu-overlay.is-open .menu-overlay-inner a:nth-child(3) { transition-delay: 0.18s; }

.menu-index {
  font-size: 0.32em;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--faint);
  min-width: 2.2em;
}

.menu-cta {
  margin-top: 28px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), background 0.18s var(--ease);
}
.menu-overlay.is-open .menu-cta {
  opacity: 1;
  transform: none;
  transition-delay: 0.24s;
}

body.menu-open { overflow: hidden; }

/* ---------- shared panel ---------- */

.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-label { color: var(--faint); margin-bottom: 4px; }
.panel-title { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 11px;
  white-space: nowrap;
}

.demo-note {
  color: var(--faint);
  margin-top: 14px;
  text-transform: none;
  letter-spacing: 0.03em;
}
.demo-note.center { text-align: center; margin-top: 28px; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  margin-top: calc(var(--nav-h) * -1);
  padding: calc(var(--nav-h) + clamp(72px, 10vw, 128px)) 0 clamp(64px, 8vw, 110px);
  overflow: hidden;
  background: var(--hero-bg);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.hero-scan {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 80px;
  background: linear-gradient(180deg, transparent, rgba(242, 240, 235, 0.05), transparent);
  animation: heroScan 9s var(--ease) infinite;
}

@keyframes heroScan {
  0% { top: 8%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 0.4; }
  100% { top: 78%; opacity: 0; }
}

[data-theme="light"] .hero-field { opacity: 0.4; }

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.15rem;
  margin-top: 24px;
  max-width: 460px;
}

.hero-points {
  list-style: none;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--muted);
}
.hero-points li { display: flex; align-items: center; gap: 10px; }
.hero-points li::before {
  content: "";
  width: 14px; height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}
.hero-ctas.center { justify-content: center; }

/* hero panel */

.hero-panel-wrap { position: relative; }

.hero-panel {
  box-shadow: var(--panel-shadow);
}

.split-bar {
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  gap: 3px;
  margin-bottom: 12px;
}
.split-bar .seg {
  width: var(--w);
  border-radius: 99px;
  transform-origin: left;
  transition: width 1s var(--ease) 0.3s;
}
.seg-pos { background: var(--pos); }
.seg-neu { background: var(--neu); }
.seg-neg { background: var(--neg); }

.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--muted);
  margin-bottom: 22px;
}
.split-legend .dot,
.result-legend .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
}
.dot-pos { background: var(--pos); }
.dot-neu { background: var(--neu); }
.dot-neg { background: var(--neg); }

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}

.stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 15px;
  background: var(--stat-bg);
}
.stat-value { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.stat-label { color: var(--faint); margin-top: 3px; }

.spark-wrap { margin-bottom: 22px; }
.spark { width: 100%; height: 92px; }

.spark-line {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
}
.spark-area { opacity: 0; transition: opacity 0.9s ease 1s; }

.charts-on .spark-line { animation: draw 1.6s var(--ease) 0.35s forwards; }
.charts-on .spark-area { opacity: 1; }

@keyframes draw { to { stroke-dashoffset: 0; } }

.spark-axis {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  margin-top: 8px;
  font-size: 10.5px;
}

.narrative-card {
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
  background: rgba(var(--accent-rgb), 0.03);
}
.narrative-text { font-size: 0.95rem; color: var(--text); margin: 6px 0 10px; }
.momentum { color: var(--muted); }

/* ---------- clients ---------- */

.clients {
  padding: 28px 0 48px;
  background: var(--hero-bg);
}

.clients-kicker {
  color: var(--faint);
  margin-bottom: 22px;
}

.clients-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.clients-track {
  display: flex;
  width: max-content;
  animation: clientsScroll 36s linear infinite;
}

.clients-marquee:hover .clients-track {
  animation-play-state: paused;
}

.clients-set {
  display: flex;
  align-items: center;
  gap: clamp(48px, 7vw, 96px);
  padding-inline: clamp(24px, 3.5vw, 48px);
}

.client-logo {
  height: 32px;
  width: auto;
  max-width: 168px;
  object-fit: contain;
  filter: invert(1);
  opacity: 0.78;
  transition: opacity 0.2s, transform 0.35s var(--ease);
}

.client-logo-sm {
  height: 24px;
  max-width: 132px;
}

.client-logo-lg {
  height: 44px;
  max-width: 220px;
}

.client-logo:hover {
  opacity: 1;
  transform: translateY(-2px);
}

[data-theme="light"] .client-logo {
  filter: none;
  opacity: 0.72;
}

@keyframes clientsScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- sections ---------- */

.section { padding: clamp(80px, 10vw, 140px) 0; }
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head { max-width: 640px; margin-bottom: clamp(44px, 6vw, 72px); }

/* ---------- pipeline ---------- */

.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.pipe-node {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
  min-width: 0;
}
.pipe-node:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.pipe-source {
  background: transparent;
  border-style: dashed;
}

.pipe-index { color: var(--accent); margin-bottom: 12px; }
.pipe-node h3 { margin-bottom: 8px; }
.pipe-node p:last-child { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

.pipe-arrow {
  width: 34px;
  flex-shrink: 0;
  position: relative;
  align-self: center;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), var(--accent));
}
.pipe-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  border-left: 5px solid var(--accent);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}

/* ---------- malaysia ---------- */

.my-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 7vw, 96px);
  align-items: start;
}

.context-feature {
  margin-top: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

.context-quote {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.context-verdict {
  color: var(--neg);
  font-weight: 600;
  font-size: 1.15rem;
  margin-top: 14px;
}

.context-note { color: var(--faint); margin-top: 6px; }

.my-examples { display: flex; flex-direction: column; gap: 12px; }
.my-examples > .panel-label { margin-bottom: 6px; }

.classify-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

.classify-text { font-size: 1rem; }

.chip {
  border-radius: 99px;
  padding: 4px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid;
}
.chip-pos { color: var(--pos); border-color: rgba(var(--pos-rgb), 0.4); background: rgba(var(--pos-rgb), 0.08); }
.chip-neg { color: var(--chip-neg); border-color: rgba(229, 101, 79, 0.4); background: rgba(229, 101, 79, 0.08); }
.chip-mild { color: var(--mild); border-color: rgba(201, 214, 79, 0.32); background: rgba(201, 214, 79, 0.06); }

/* ---------- search ---------- */

.search-shell { max-width: 820px; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--panel);
  padding: 8px 8px 8px 18px;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: rgba(var(--accent-rgb), 0.55); }

.search-icon { width: 20px; height: 20px; color: var(--faint); flex-shrink: 0; }

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font-sans);
  min-width: 0;
}
.search-bar input::placeholder { color: var(--faint); }

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.chip-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 99px;
  padding: 7px 15px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chip-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chip-btn.active {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.07);
}

.result-panel { margin-top: 24px; min-height: 200px; }

.result-empty {
  min-height: 152px;
  display: grid;
  place-items: center;
  color: var(--faint);
  text-align: center;
  padding: 20px;
}
.result-empty .mono { text-transform: none; letter-spacing: 0.03em; }

.result-body { animation: resultIn 0.45s var(--ease); }

@keyframes resultIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.result-title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.result-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  margin-top: 22px;
}

.result-block h4 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  margin-bottom: 12px;
}

.sent-rows { display: flex; flex-direction: column; gap: 10px; }

.sent-row {
  display: grid;
  grid-template-columns: 72px 1fr 44px;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--muted);
}
.sent-row .val { text-align: right; color: var(--text); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }

.meter {
  height: 6px;
  background: var(--meter-track);
  border-radius: 99px;
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width 0.9s var(--ease) 0.15s;
}
.meter-pos > i { background: var(--pos); }
.meter-neu > i { background: var(--neu); }
.meter-neg > i { background: var(--neg); }

.result-move {
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.result-move .stat-value { font-size: 1.6rem; }

.narr-list {
  list-style: none;
  counter-reset: narr;
  display: flex;
  flex-direction: column;
}
.narr-list li {
  counter-increment: narr;
  display: flex;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.narr-list li:last-child { border-bottom: none; }
.narr-list li::before {
  content: counter(narr, decimal-leading-zero);
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}

.result-fastest {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  padding: 13px 16px;
  background: rgba(var(--accent-rgb), 0.03);
}
.result-fastest .mono { color: var(--faint); margin-bottom: 3px; }
.result-fastest p:last-child { font-weight: 550; }

.result-meta {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

/* ---------- ask bafe ---------- */

.ask-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(48px, 6vw, 80px);
  align-items: start;
}

.ask-questions {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ask-q {
  text-align: left;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 13px 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ask-q:hover { color: var(--text); border-color: var(--border-strong); }
.ask-q.active {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.05);
}

.ask-panel { min-height: 380px; display: flex; flex-direction: column; }

.ask-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ask-hint { color: var(--faint); text-transform: none; letter-spacing: 0.03em; margin: auto; }

.msg { max-width: 92%; animation: resultIn 0.35s var(--ease); }

.msg-user {
  align-self: flex-end;
  background: var(--msg-user-bg);
  border: 1px solid var(--border);
  border-radius: 10px 10px 2px 10px;
  padding: 11px 15px;
  font-size: 0.95rem;
}

.msg-bafe {
  align-self: flex-start;
  width: 100%;
}
.msg-bafe .msg-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.msg-bafe .msg-text {
  font-size: 0.98rem;
  color: var(--text);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  min-height: 24px;
}

.caret {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 0.85s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.evidence {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.evidence-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 13px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.evidence-row.show { opacity: 1; transform: none; }
.evidence-row .ev-val { font-size: 13px; font-weight: 500; color: var(--pos); white-space: nowrap; font-variant-numeric: tabular-nums; }
.evidence-row .ev-val.down { color: var(--neg); }

.ask-source {
  color: var(--faint);
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---------- history ---------- */

.history-panel { padding-bottom: 16px; }

.history-scroll { overflow-x: auto; }
.history-chart { width: 100%; min-width: 640px; height: auto; }

.hist-line {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
}
.hist-area { opacity: 0; transition: opacity 1s ease 1.4s; }

.hist-event { opacity: 0; transition: opacity 0.6s ease; }

.charts-on .hist-line { animation: drawLong 2.2s var(--ease) 0.2s forwards; }
.charts-on .hist-area { opacity: 1; }
.charts-on .hist-event { opacity: 1; }
.charts-on .hist-event:nth-child(1) { transition-delay: 0.7s; }
.charts-on .hist-event:nth-child(2) { transition-delay: 1.1s; }
.charts-on .hist-event:nth-child(3) { transition-delay: 1.5s; }
.charts-on .hist-event:nth-child(4) { transition-delay: 1.9s; }

@keyframes drawLong { to { stroke-dashoffset: 0; } }

/* ---------- snapshot ---------- */

.section-snapshot {
  border-top: 1px solid var(--border);
  background:
    linear-gradient(var(--snapshot-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--snapshot-grid) 1px, transparent 1px),
    var(--bg-alt);
  background-size: 56px 56px, 56px 56px, auto;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--snapshot-bg);
}

.hist-grid { stroke: var(--chart-grid); }
.hist-event line { stroke: var(--chart-event); }
.hist-events,
.hist-axis { fill: var(--faint); }

.snap {
  padding: 40px 32px;
  border-right: 1px solid var(--border);
}
.snap:last-child { border-right: none; }

.snap-value {
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.snap-label { color: var(--muted); margin-top: 12px; }

/* ---------- closing / footer ---------- */

.closing { padding-bottom: clamp(64px, 8vw, 100px); }

.closing-title { font-size: clamp(2.1rem, 5vw, 3.4rem); }

.closing .section-sub { margin-inline: auto; }

.footer {
  padding: 28px 0 36px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-logo {
  height: 28px;
  width: auto;
  opacity: 0.42;
}

[data-theme="light"] .footer-logo {
  filter: invert(1);
  opacity: 0.45;
}

.footer-copy {
  color: var(--faint);
  font-size: 13px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.footer-links { display: flex; gap: 20px; }
.footer-links a {
  color: var(--faint);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.03);
}

.theme-opt {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.theme-opt svg { width: 15px; height: 15px; }
.theme-opt:hover { color: var(--text); }
.theme-opt[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

[data-theme="light"] .theme-switch {
  background: rgba(18, 16, 12, 0.03);
}
[data-theme="light"] .theme-opt[aria-pressed="true"] {
  background: rgba(18, 16, 12, 0.08);
}

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
.reveal[data-delay="5"] { transition-delay: 0.5s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel-wrap { max-width: 560px; }

  .pipeline { flex-direction: column; }
  .pipe-arrow {
    width: 1px;
    height: 30px;
    margin-left: 32px;
    align-self: flex-start;
    background: linear-gradient(180deg, var(--border-strong), var(--accent));
  }
  .pipe-arrow::after {
    top: auto;
    bottom: 0;
    right: -3px;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 5px solid var(--accent);
    border-bottom: none;
  }

  .my-grid, .ask-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .snapshot-grid { grid-template-columns: 1fr 1fr; }
  .snap { border-bottom: 1px solid var(--border); }
  .snap:nth-child(even) { border-right: none; }
  .snap:nth-last-child(-n+2) { border-bottom: none; }
}

@media (max-width: 720px) {
  .search-bar { flex-wrap: wrap; padding: 12px 14px; }
  .search-bar .btn { width: 100%; }
  .search-icon { display: none; }

  .stat-row { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .snapshot-grid { grid-template-columns: 1fr; }
  .snap { border-right: none; border-bottom: 1px solid var(--border); }
  .snap:last-child { border-bottom: none; }
  .snap:nth-last-child(-n+2):not(:last-child) { border-bottom: 1px solid var(--border); }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .reveal { opacity: 1; transform: none; }
  .spark-line, .hist-line { stroke-dashoffset: 0; }
  .spark-area, .hist-area, .hist-event { opacity: 1; }
  .evidence-row { opacity: 1; transform: none; }
  .hero-scan { animation: none; display: none; }
  .clients-track { animation: none; }
  .clients-marquee { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }
  .menu-overlay-inner a:not(.btn),
  .menu-cta { opacity: 1; transform: none; }
}
