* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  background: var(--color-surface-2);
  border-radius: 100px;
  padding: 6px 16px;
  margin-bottom: 20px;
}
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(36px, 5.5vw, 72px); line-height: 1.05; }
h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.12; }
h3 { font-size: 22px; line-height: 1.3; }
p { color: var(--color-text-muted); font-size: 17px; }
.lede { font-size: 20px; color: var(--color-text-muted); max-width: 640px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a { font-size: 15px; font-weight: 500; color: var(--color-text); white-space: nowrap; }
@media (min-width: 1101px) and (max-width: 1320px) { .nav-links { gap: 18px; } .nav-links a { font-size: 14px; } .nav-cta { white-space: nowrap; padding: 10px 16px; } }
.nav-links a:hover { color: var(--color-accent); }
.nav-cta {
  background: var(--gradient-brand);
  color: #fff !important;
  padding: 11px 22px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-md);
}
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: var(--shadow-md); }
.btn-secondary { background: #fff; color: var(--color-text); border: 1.5px solid var(--color-border); }
.btn-block { width: 100%; }

/* Hero */
.hero {
  padding: 88px 0 64px;
  background:
    radial-gradient(60% 50% at 85% 0%, rgba(152,17,251,0.10) 0%, rgba(152,17,251,0) 60%),
    radial-gradient(50% 40% at 10% 10%, rgba(230,0,118,0.08) 0%, rgba(230,0,118,0) 60%),
    var(--color-bg);
}
.hero-inner { max-width: 760px; }
.hero-cta-row { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }

/* Hero — dark, animated settlement-network background (home only) */
.hero--map {
  position: relative;
  overflow: hidden;
  padding: 96px 0 64px;
  color: #f4f1fb;
  background:
    radial-gradient(120% 90% at 15% 100%, rgba(230,0,118,0.35) 0%, rgba(230,0,118,0) 55%),
    radial-gradient(120% 90% at 85% 100%, rgba(152,17,251,0.35) 0%, rgba(152,17,251,0) 55%),
    radial-gradient(140% 100% at 50% 0%, rgba(88,22,141,0.55) 0%, var(--color-hero-void) 60%),
    linear-gradient(180deg, var(--color-hero-gradient-1) 0%, var(--color-hero-gradient-2) 35%, var(--color-hero-gradient-3) 70%, var(--color-hero-gradient-4) 100%);
}
.hero--map #hero-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  mix-blend-mode: screen;
}
.hero--map .hero-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 20%, rgba(0,0,0,0) 40%, rgba(10,6,28,0.55) 100%);
  pointer-events: none;
}
.hero--map .container { position: relative; z-index: 2; }
/* Compact terminal-style tag (same look as .ai-closing, smaller) */
.hero--map .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  gap: 0;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  color: #f4f1fb;
}
.hero--map .eyebrow::before { content: "> "; white-space: pre; color: var(--color-accent-2); font-weight: 700; }
.hero--map .eyebrow::after {
  content: "";
  width: 6px;
  height: 1em;
  margin-left: 6px;
  background: var(--color-accent);
  animation: ai-blink 1.1s steps(2, start) infinite;
}
.hero--map h1 { color: #fff; }
.hero--map .lede { color: rgba(244,241,251,0.82); }
.hero--map .btn-secondary { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.25); }
.hero--map .stats-bar { border-top-color: rgba(255,255,255,0.18); }
.hero--map .stat-label { color: rgba(244,241,251,0.7); }

/* Marquee — horizontal scrolling word strip */
.marquee {
  overflow: hidden;
  background: var(--color-bg);
  padding: 64px 0 20px;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 44s linear infinite;
}
.marquee-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.marquee-group span {
  font-size: clamp(18px, 2.75vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--color-text);
  white-space: nowrap;
  padding: 0 40px;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--color-border);
}
.stat .stat-num {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .stat-label { font-size: 14px; color: var(--color-text-muted); margin-top: 4px; }

/* Feature grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}
.card h3 { margin-bottom: 10px; }
.card p { font-size: 15px; }

.section-header { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-header.left { margin: 0 0 56px; text-align: left; }

/* Segments (who we serve) */
.segment-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}
.segment-pill .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--gradient-brand); flex: none; }
.segment-pill strong { font-size: 15px; }

.network-map {
  margin-top: 48px;
  padding: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.network-map img { display: block; width: 100%; height: auto; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step-num {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: var(--gradient-brand);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}

/* Calculator */
.calc {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.calc-form label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px; color: var(--color-text); }
.calc-form label:first-child { margin-top: 0; }
.calc-form input, .calc-form select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  font-family: var(--font-sans);
  font-size: 15px;
  background: #fff;
}
.calc-result { text-align: center; }
.calc-result .big-num { font-size: 48px; font-weight: 800; color: var(--color-accent-dark); }
.calc-result .sub { color: var(--color-text-muted); margin-top: 8px; font-size: 14px; }

/* Compliance list */
.compliance-list { list-style: none; }
.compliance-list li {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
  color: var(--color-text);
}
.compliance-list li:last-child { border-bottom: none; }
.compliance-list .check {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-surface-2); color: var(--color-accent-dark);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}

.partners-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.partner-chip {
  padding: 12px 22px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-muted);
  background: #fff;
}

.badge-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent-dark);
  background: var(--color-surface-2);
  padding: 8px 16px;
  border-radius: 100px;
}

/* CTA band */
.cta-band {
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  padding: 64px;
  color: #fff;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.85); margin: 12px auto 32px; }
.cta-band .btn-secondary { background: #fff; color: var(--color-accent-dark); border: none; }

/* Contact form */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.contact-grid label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.contact-grid input, .contact-grid select, .contact-grid textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  font-family: var(--font-sans);
  font-size: 15px;
}
.contact-grid textarea { min-height: 100px; resize: vertical; }

/* Specialized AI Projects — dark, tech-styled section (home) */
.ai-section {
  position: relative;
  overflow: hidden;
  color: #f4f1fb;
  background: linear-gradient(180deg, var(--color-hero-gradient-1) 0%, var(--color-hero-void) 100%);
}
.ai-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(50% 40% at 85% 8%, rgba(152,17,251,0.35) 0%, rgba(152,17,251,0) 70%),
    radial-gradient(45% 35% at 8% 70%, rgba(230,0,118,0.22) 0%, rgba(230,0,118,0) 70%),
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}
.ai-inner { position: relative; z-index: 1; }
.ai-section p { color: rgba(244,241,251,0.78); }
.ai-section h2, .ai-section h3, .ai-section h4 { color: #fff; }
.ai-head { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.ai-head h2 {
  background: linear-gradient(120deg, #fff 30%, #d9b3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ai-sub { font-size: 20px; margin-top: 16px; color: #fff !important; }
.ai-desc { margin-top: 16px; }

.ai-grid {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.ai-card {
  flex: 1 1 calc((100% - 40px) / 3);
  position: relative;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.12);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.ai-card::before {
  content: "";
  position: absolute;
  top: 0; left: 28px; right: 28px;
  height: 1px;
  background: var(--gradient-brand);
  opacity: 0.8;
}
.ai-card:hover {
  transform: translateY(-3px);
  border-color: rgba(152,17,251,0.7);
  box-shadow: 0 0 0 1px rgba(152,17,251,0.35), 0 16px 48px rgba(152,17,251,0.28);
}
.ai-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: 0 0 24px rgba(152,17,251,0.55);
}
.ai-card h3 { font-size: 20px; margin-bottom: 8px; }
.ai-card p { font-size: 15px; }

.ai-closing {
  margin: 40px auto 0;
  max-width: 760px;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  color: #fff !important;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
}
.ai-closing::before { content: "> "; color: var(--color-accent-2); font-weight: 700; }
.ai-closing::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 6px;
  vertical-align: text-bottom;
  background: var(--color-accent);
  animation: ai-blink 1.1s steps(2, start) infinite;
}
@keyframes ai-blink { to { visibility: hidden; } }

.ai-how { text-align: center; margin: 88px 0 40px; font-size: 28px; }
.ai-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}
.ai-step { position: relative; }
.ai-step::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 56px;
  right: -24px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
  opacity: 0.55;
}
.ai-step:last-child::before { display: none; }
.ai-step-num {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--color-hero-void);
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 20px rgba(152,17,251,0.55), inset 0 0 12px rgba(152,17,251,0.35);
}
.ai-step h4 { font-size: 18px; line-height: 1.3; margin-bottom: 8px; letter-spacing: -0.01em; }
.ai-step p { font-size: 15px; }

.ai-cta {
  margin: 88px auto 0;
  max-width: 760px;
  text-align: center;
}
.ai-cta p { font-size: 22px; line-height: 1.4; color: #fff; margin-bottom: 28px; }

.ai-small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 64px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.04);
}
.ai-small h3 { font-size: 20px; margin-bottom: 6px; }
.ai-small p { font-size: 15px; }
.ai-section .btn-secondary { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.3); flex: none; }
.ai-section .btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .ai-card, .ai-section .btn { transition: none; }
  .ai-closing::after, .hero--map .eyebrow::after { animation: none; }
}
@media (max-width: 900px) {
  .ai-card { flex-basis: calc(50% - 10px); }
  .ai-steps { grid-template-columns: 1fr; gap: 0; }
  .ai-step { padding: 0 0 32px 72px; }
  .ai-step:last-child { padding-bottom: 0; }
  .ai-step .ai-step-num { position: absolute; left: 0; top: 0; margin: 0; }
  .ai-step::before { top: 48px; bottom: 0; left: 23px; right: auto; width: 2px; height: auto; }
  .ai-how { margin-top: 64px; }
  .ai-cta { margin-top: 64px; }
  .ai-small { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .ai-head { margin-bottom: 40px; }
  .ai-head h2 { line-height: 1.2; }
  .ai-sub { font-size: 18px; line-height: 1.5; margin-top: 20px; }
  .ai-desc { line-height: 1.65; margin-top: 20px; }
  .ai-grid { gap: 16px; }
  .ai-card { padding: 24px; }
  .ai-card p, .ai-step p, .ai-small p { line-height: 1.65; }
  .ai-closing { font-size: 14px; line-height: 1.7; margin-top: 32px; }
  .ai-how { margin: 56px 0 32px; font-size: 24px; }
  .ai-step { padding-bottom: 36px; }
  .ai-step h4 { margin-bottom: 10px; }
  .ai-cta { margin-top: 56px; }
  .ai-cta p { line-height: 1.5; margin-bottom: 24px; }
  .ai-small { margin-top: 48px; gap: 20px; }
  .ai-card { flex-basis: 100%; }
  .ai-cta p { font-size: 19px; }
  .ai-small { padding: 24px; }
  .ai-small .btn { width: 100%; }
}

/* Footer */
footer {
  background: #16101c;
  color: rgba(255,255,255,0.7);
  padding: 72px 0 32px;
}
footer .logo { -webkit-text-fill-color: unset; background: none; color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-grid h4 { color: #fff; font-size: 14px; margin-bottom: 18px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 12px; }
.footer-grid a { font-size: 14px; color: rgba(255,255,255,0.65); }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px; font-size: 13px; color: rgba(255,255,255,0.5); flex-wrap: wrap; gap: 12px;
}

/* Legal pages */
.legal-content { max-width: 760px; }
.legal-content h2 { margin-top: 40px; margin-bottom: 14px; font-size: 22px; }
.legal-content p, .legal-content li { color: var(--color-text-muted); margin-bottom: 14px; font-size: 16px; }
.legal-content .updated { color: var(--color-text-muted); font-size: 14px; margin-bottom: 40px; }

/* Language switcher */
.lang-switch { display: flex; align-items: center; gap: 4px; }
.nav-links .lang-switch a {
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
  width: auto;
  border-radius: 100px;
  color: var(--color-text-muted);
}
.nav-links .lang-switch a:hover { color: var(--color-accent); }
.nav-links .lang-switch a[aria-current="true"] { background: var(--color-surface-2); color: var(--color-accent-dark); }

/* Chinese: no negative tracking on CJK glyphs */
:root:lang(zh) h1, :root:lang(zh) h2, :root:lang(zh) h3, :root:lang(zh) h4 { letter-spacing: 0; }
:root:lang(zh) .eyebrow { letter-spacing: 0.02em; }
:root:lang(zh) h1 { line-height: 1.25; }
:root:lang(zh) h2 { line-height: 1.3; }
:root:lang(zh) h1, :root:lang(zh) h2, :root:lang(zh) h3 { text-wrap: balance; }
:root:lang(zh) body { line-break: strict; line-height: 1.6; }

/* Nav collapses to the hamburger below 1100px (labels + language switcher + CTA need the room) */
@media (max-width: 1100px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 20px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 0; width: 100%; }
  .lang-switch { padding: 8px 0 4px; }
  .nav-toggle { display: block; font-size: 20px; }
}

/* Small phones: keep the (longer PT/ES) CTA on one line next to logo + hamburger */
@media (max-width: 420px) {
  .nav-inner { padding: 0 16px; gap: 8px; }
  .logo { font-size: 19px; }
  .nav-cta { padding: 9px 12px; font-size: 12px; white-space: nowrap; }
  .nav-toggle { padding: 0 4px; }
}

/* Mobile */
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .steps { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .calc { grid-template-columns: 1fr; padding: 28px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { padding: 40px 24px; }
  .section { padding: 64px 0; }
}
