/* =========================================================
   NexaOne Financial — v1 stylesheet
   Dark-dominant, minimal, operator-tool aesthetic.
   ========================================================= */

:root {
  /* Dark (default) */
  --bg-0:   #0A0A0B;
  --bg-1:   #111216;
  --bg-2:   #181A20;
  --bg-3:   #1E2128;
  --fg-0:   #F5F5F7;
  --fg-1:   #A6AAB3;
  --fg-2:   #6B6F78;
  --line:   rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);
  --accent:     #4F7CFF;
  --accent-hi:  #7A9BFF;
  --accent-ink: #0B1027;
  --accent-soft: rgba(79,124,255,0.12);
  --ok: #10B981;

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --fs-hero:  clamp(2.5rem, 5vw, 4.25rem);
  --fs-h2:    clamp(1.75rem, 2.4vw, 2.5rem);
  --fs-h3:    1.25rem;
  --fs-body:  1rem;
  --fs-sm:    0.875rem;
  --fs-xs:    0.75rem;
  --lh-tight: 1.1;
  --lh-body:  1.55;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;

  --maxw: 1200px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

html[data-theme="light"] {
  --bg-0:   #FAFAFB;
  --bg-1:   #FFFFFF;
  --bg-2:   #F4F5F7;
  --bg-3:   #ECEEF2;
  --fg-0:   #0B0C0F;
  --fg-1:   #3E434C;
  --fg-2:   #6B6F78;
  --line:   rgba(10,10,11,0.09);
  --line-2: rgba(10,10,11,0.16);
  --accent:     #3558D6;
  --accent-hi:  #4F7CFF;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(79,124,255,0.10);
}

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

html {
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-0);
  color: var(--fg-0);
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color .15s var(--ease);
}
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

:is(h1,h2,h3,h4,h5,h6) {
  font-family: var(--font-sans);
  color: var(--fg-0);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  margin: 0 0 .5em 0;
}

p { margin: 0 0 1em; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 12px; }

/* ========== Eyebrow ========== */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 .9rem;
  padding: 0;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--fs-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease),
              border-color .15s var(--ease), transform .15s var(--ease);
  white-space: nowrap;
}
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-hi); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--fg-0);
  border-color: var(--line-2);
}
.btn-secondary:hover { border-color: var(--fg-0); background: var(--bg-2); }
.btn-ghost {
  background: transparent;
  color: var(--fg-1);
  padding: 8px 14px;
}
.btn-ghost:hover { color: var(--fg-0); }

/* ========== Header / Nav ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-0) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  color: var(--fg-0);
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
  transform: translateY(2px);
}
.brand-dot { color: var(--accent-ink); }
.brand-word { font-weight: 700; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: 16px;
}
.nav-links a {
  color: var(--fg-1);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.nav-links a:hover { color: var(--fg-0); }

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: transparent;
  color: var(--fg-1);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.theme-toggle:hover { color: var(--fg-0); border-color: var(--line-2); }
.theme-toggle svg { display: none; }
html[data-theme-pref="system"] .theme-toggle .icon-auto { display: block; }
html[data-theme-pref="light"]  .theme-toggle .icon-sun  { display: block; }
html[data-theme-pref="dark"]   .theme-toggle .icon-moon { display: block; }

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  cursor: pointer;
}
.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--fg-0);
  border-radius: 2px;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--line);
}
.mobile-nav a {
  color: var(--fg-0);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
/* On mobile, the drawer opens when the hidden attr is removed by JS. */
@media (max-width: 820px) {
  .mobile-nav:not([hidden]) { display: flex; }
}

/* Screen-reader-only helper */
.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;
}

/* ========== Hero ========== */
.hero {
  position: relative;
  padding: 84px 0 72px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: -1;
  pointer-events: none;
}
.hero-grid {
  position: absolute; inset: -20%;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 50% 20%, black 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, black 40%, transparent 75%);
  opacity: .7;
}
.hero-glow {
  position: absolute;
  top: -10%; left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 700px;
  background: radial-gradient(60% 50% at 50% 0%, rgba(79,124,255,.28), transparent 70%);
  filter: blur(10px);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: var(--fs-xs);
  color: var(--fg-1);
  background: var(--bg-1);
  margin-bottom: 22px;
}
.status-chip .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(16,185,129,.18);
}

.hero-h1 {
  font-size: var(--fs-hero);
  font-weight: 700;
  max-width: 900px;
  margin-bottom: 22px;
  letter-spacing: -0.025em;
}
.grad {
  background: linear-gradient(100deg, var(--accent) 20%, var(--accent-hi) 55%, #A6BDFF 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 1.125rem;
  color: var(--fg-1);
  max-width: 760px;
  margin-bottom: 32px;
}
.hero-sub strong { color: var(--fg-0); font-weight: 600; }
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.hero-micro {
  font-size: var(--fs-sm);
  color: var(--fg-2);
  margin: 0;
}

/* ========== Stats ========== */
.stats {
  padding: 48px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}
.stats-intro {
  color: var(--fg-1);
  font-size: var(--fs-sm);
  letter-spacing: .02em;
  margin: 0 0 20px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat {
  border-left: 1px solid var(--line);
  padding: 4px 0 4px 20px;
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-num {
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--fg-0);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-size: var(--fs-sm);
  color: var(--fg-1);
}

/* ========== Generic section ========== */
.section {
  padding: 96px 0;
}
.section + .section { border-top: 1px solid var(--line); }
.section-h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  max-width: 820px;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.section-sub {
  color: var(--fg-1);
  max-width: 720px;
  font-size: 1.0625rem;
  margin-bottom: 40px;
}

/* ========== Pillar cards ========== */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 26px;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.card:hover {
  border-color: var(--line-2);
  background: var(--bg-2);
}
.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.pillar-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}
.pillar-title {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.pillar-title .sep {
  color: var(--fg-2);
  font-weight: 400;
  margin: 0 .25em;
}
.pillar-title .lead {
  color: var(--fg-1);
  font-weight: 500;
  font-size: .95em;
}
.bullets {
  margin: 0;
  padding: 0;
  list-style: none;
}
.bullets li {
  position: relative;
  padding-left: 18px;
  font-size: var(--fs-sm);
  color: var(--fg-1);
  margin-bottom: 6px;
}
.bullets li::before {
  content: "";
  position: absolute;
  top: 10px; left: 0;
  width: 8px; height: 1px;
  background: var(--accent);
}

/* ========== Advanced markets chips ========== */
.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.chip {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 18px;
  background: var(--bg-1);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.chip:hover { border-color: var(--line-2); background: var(--bg-2); }
.chip strong {
  display: block;
  font-weight: 700;
  color: var(--fg-0);
  margin-bottom: 6px;
}
.chip span {
  display: block;
  color: var(--fg-1);
  font-size: var(--fs-sm);
}

/* ========== Ecosystem diagram ========== */
.eco-diagram { margin-bottom: 32px; }
.eco-svg {
  width: 100%;
  height: auto;
  max-height: 360px;
  color: var(--fg-1);
}
.eco-svg-desktop { display: block; }
.eco-stack { display: none; }

.eco-node rect {
  fill: var(--bg-1);
  stroke: var(--line-2);
  stroke-width: 1;
}
.eco-node-primary rect {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.eco-node-muted rect {
  fill: var(--bg-0);
  stroke: var(--line);
  stroke-dasharray: 4 4;
}
.eco-node-title {
  font-size: 22px;
  font-weight: 700;
  fill: var(--fg-0);
}
.eco-node-title-sm {
  font-size: 16px;
  font-weight: 700;
  fill: var(--fg-0);
}
.eco-node-sub {
  font-size: 13px;
  fill: var(--fg-1);
}
.eco-arrow {
  stroke: var(--fg-2);
  stroke-width: 1.5;
}

.eco-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 28px;
  color: var(--fg-1);
  font-size: var(--fs-sm);
}
.eco-legend strong { color: var(--fg-0); font-weight: 600; }

/* ========== Personas ========== */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.persona {
  padding: 30px 26px;
}
.persona-pain {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg-0);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  line-height: 1.25;
}
.persona-label {
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}
.persona p {
  color: var(--fg-1);
  font-size: var(--fs-sm);
  margin: 0;
}

/* ========== Final CTA band ========== */
.cta-band {
  background:
    radial-gradient(50% 120% at 50% 0%, rgba(79,124,255,.18), transparent 60%),
    var(--bg-1);
  text-align: center;
}
.cta-band .hero-ctas { justify-content: center; }

/* ========== Footer ========== */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  padding: 64px 0 32px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.foot-brand { margin-bottom: 14px; }
.foot-sub {
  color: var(--fg-1);
  font-size: var(--fs-sm);
  margin-bottom: 8px;
}
.foot-tag {
  font-size: var(--fs-xs);
  color: var(--fg-2);
  letter-spacing: .04em;
}
.foot-col h4 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--fg-2);
  font-weight: 600;
  margin: 0 0 16px;
}
.foot-col ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.foot-col a {
  color: var(--fg-1);
  font-size: var(--fs-sm);
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.foot-col a:hover { color: var(--fg-0); }
.role {
  color: var(--fg-2);
  font-size: var(--fs-xs);
}

.foot-legal {
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}
.compliance {
  font-size: var(--fs-xs);
  color: var(--fg-1);
  max-width: 820px;
  margin: 0;
}
.copyright {
  font-size: var(--fs-xs);
  color: var(--fg-2);
  margin: 0;
}

/* ========== Responsive ========== */
@media (max-width: 960px) {
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .chips { grid-template-columns: repeat(2, 1fr); }
  .persona-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 36px; }
  .eco-legend { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .section { padding: 72px 0; }
  .hero { padding: 64px 0 56px; }
  .nav-links { display: none; }
  .btn-ghost { display: none; }
  .menu-btn { display: flex; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .stat { border-left: 0; padding: 0; }
  .pillars { grid-template-columns: 1fr; }
  .chips { grid-template-columns: 1fr; }
  .eco-svg-desktop { display: none; }
  .eco-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .eco-card {
    border: 1px solid var(--line-2);
    background: var(--bg-1);
    padding: 16px 18px;
    border-radius: var(--r-md);
  }
  .eco-card-primary {
    border-color: var(--accent);
    background: var(--accent-soft);
  }
  .eco-card-muted {
    border-style: dashed;
    border-color: var(--line);
    background: var(--bg-0);
  }
  .eco-head {
    font-weight: 700;
    font-size: 1rem;
    color: var(--fg-0);
    margin-bottom: 4px;
  }
  .eco-desc {
    color: var(--fg-1);
    font-size: var(--fs-sm);
  }
  .eco-arrow-v {
    text-align: center;
    color: var(--fg-2);
    font-size: var(--fs-xs);
  }
}

/* ========== Reveal on scroll ========== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
