/* ============================================================
   Caipi Tech — estilos compartidos
   ============================================================ */

:root {
  --noir: #1c1c1c;
  --noir-2: #0f0f0f;
  --paper: #ffffff;
  --paper-2: #efeee9;
  --accent: #8b5cf6;
  --accent-2: #c4b5fd;
  --accent-dim: #6d28d9;
  --ink: #f5f4f0;

  --ink-dim: rgba(245, 244, 240, 0.68);
  --ink-faint: rgba(245, 244, 240, 0.4);
  --line-dark: rgba(245, 244, 240, 0.12);

  --text: #17151a;
  --text-dim: rgba(23, 21, 26, 0.66);
  --text-faint: rgba(23, 21, 26, 0.42);
  --line-light: rgba(23, 21, 26, 0.1);

  --font-display: "Bricolage Grotesque", "Helvetica Neue", sans-serif;
  --font-mega: "Barlow Condensed", "Helvetica Neue", sans-serif;
  --font-body: "Inter", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --container: 1180px;
  --radius: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

section[id] {
  scroll-margin-top: 84px;
}

/* ---------- kicker / eyebrow ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}
.on-dark .kicker {
  color: var(--accent-2);
}
.on-dark .kicker::before {
  background: var(--accent-2);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.5);
}
.btn-primary:hover {
  background: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(139, 92, 246, 0.65);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-dark);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: translateY(-2px);
}
.on-light .btn-ghost {
  border-color: var(--line-light);
  color: var(--text);
}
.on-light .btn-ghost:hover {
  border-color: var(--accent-dim);
  color: var(--accent-dim);
}

/* ---------- outline-arrow button (SpaceX-style rectangular CTA) ---------- */
.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border: 1px solid rgba(245, 244, 240, 0.35);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.btn-arrow svg {
  width: 15px;
  height: 15px;
  transition: transform 0.3s var(--ease);
}
.btn-arrow:hover {
  border-color: var(--ink);
  background: rgba(245, 244, 240, 0.06);
}
.btn-arrow:hover svg {
  transform: translateX(4px);
}
.on-light .btn-arrow {
  border-color: rgba(23, 21, 26, 0.3);
  color: var(--text);
}
.on-light .btn-arrow:hover {
  border-color: var(--text);
  background: rgba(23, 21, 26, 0.05);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease);
}
/* backdrop-filter lives on a pseudo-element (not the header itself) so that
   position:fixed children (the mobile nav overlay) aren't reparented into a
   containing block by the filter — filter/backdrop-filter on an ancestor of a
   fixed element hijacks its positioning context otherwise. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(15, 15, 15, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: background 0.4s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--line-dark);
}
.site-header.scrolled::before {
  background: rgba(12, 12, 12, 0.82);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1500px;
  height: 76px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.brand img {
  width: 44px;
  height: auto;
  flex-shrink: 0;
}
.brand-lockup {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-lockup span {
  color: var(--ink-faint);
  font-weight: 400;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.main-nav a:not(.btn) {
  font-size: 14.5px;
  color: var(--ink-dim);
  position: relative;
  padding: 4px 0;
  transition: color 0.25s ease;
}
.main-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent-2);
  transition: right 0.3s var(--ease);
}
.main-nav a:not(.btn):hover {
  color: var(--ink);
}
.main-nav a:not(.btn):hover::after {
  right: 0;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.lang-toggle a {
  padding: 3px 8px;
  border-radius: 6px;
  transition: color 0.25s ease, background 0.25s ease;
}
.lang-toggle a.active {
  color: var(--noir);
  background: var(--accent-2);
}
.lang-toggle a:not(.active):hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease;
}
.nav-toggle:active {
  transform: scale(0.88);
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle span {
  top: 19px;
}
.nav-toggle span::before {
  top: -7px;
}
.nav-toggle span::after {
  top: 7px;
}
.nav-toggle.open span {
  background: transparent;
}
.nav-toggle.open span::before {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   Section shells
   ============================================================ */
.section {
  position: relative;
  padding: 128px 0;
}
.section-tight {
  padding: 96px 0;
}
.on-dark {
  background: var(--noir);
  color: var(--ink);
}
.on-light {
  background: var(--paper);
  color: var(--text);
}
.on-light-2 {
  background: var(--paper-2);
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}
.section-head h2 {
  margin-top: 18px;
  font-size: clamp(28px, 3.6vw, 40px);
}
.section-head p {
  margin-top: 16px;
  font-size: 17px;
  color: var(--text-dim);
}
.on-dark .section-head p {
  color: var(--ink-dim);
}

/* ---------- noise / gradient texture ---------- */
.noise::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 140px;
  background: #0a0a0a;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 620px at 12% -10%, rgba(139, 92, 246, 0.26), transparent 60%),
    radial-gradient(ellipse 750px 650px at 92% 35%, rgba(109, 40, 217, 0.2), transparent 55%),
    radial-gradient(circle at 50% 100%, #241c2e, #150f1c 46%, #0a0a0a 100%);
}
.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-deco img {
  position: absolute;
  height: auto;
  opacity: 0.5;
  animation: float 9s ease-in-out infinite;
}
.hero-deco img:nth-child(1) {
  width: 60px;
  top: 18%;
  right: 12%;
  animation-delay: 0s;
  opacity: 0.35;
}
.hero-deco img:nth-child(2) {
  width: 34px;
  top: 62%;
  right: 22%;
  animation-delay: 1.4s;
  opacity: 0.22;
}
.hero-deco img:nth-child(3) {
  width: 90px;
  top: 68%;
  left: 6%;
  animation-delay: 2.6s;
  opacity: 0.18;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(8deg); }
}

.hero-grid {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 90px;
  max-width: 1500px;
  padding-bottom: 60px;
}
.hero-inner {
  max-width: 700px;
}
.hero h1 {
  margin-top: 22px;
  font-family: var(--font-mega);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 0.98;
  font-size: clamp(42px, 7.4vw, 92px);
  color: var(--ink);
}
.hero h1 .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em);
  animation: word-in 0.5s var(--ease) forwards;
  animation-delay: calc(var(--wi, 0) * 30ms + 0.05s);
}
@keyframes word-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent-2), var(--accent) 60%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin-top: 26px;
  font-size: clamp(16.5px, 1.6vw, 19px);
  color: var(--ink-dim);
  max-width: 620px;
}
.hero-actions {
  margin-top: 42px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.hero-actions .hint {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* ---------- hero visual: live vision-agent demo ---------- */
.hero-visual {
  flex-shrink: 0;
  width: 460px;
  max-width: 100%;
  opacity: 0;
  transform: translateY(16px);
  animation: hero-visual-in 0.7s var(--ease) forwards;
  animation-delay: 0.55s;
}
@keyframes hero-visual-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hero-visual .chat-mock {
  max-width: none;
  margin: 0;
}
.hero-visual .chat-bubble.media {
  align-self: flex-start;
  max-width: 90%;
  padding: 7px;
}
.hero-visual .chat-bubble {
  opacity: 0;
  animation: bubble-in 0.45s var(--ease) forwards;
}
.hero-visual .chat-mock-body > *:nth-child(1) {
  animation-delay: 0.45s;
}
.hero-visual .chat-mock-body > *:nth-child(2) {
  animation-delay: 0.95s;
}
.hero-visual .chat-mock-body > *:nth-child(3) {
  animation-delay: 1.55s;
}
.hero-visual .chat-mock-body > *:nth-child(4) {
  animation-delay: 2.95s;
}
@keyframes bubble-in {
  to {
    opacity: 1;
  }
}
.vision-mock-frame {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  width: 100%;
}
.vision-mock-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vision-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 2%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  box-shadow: 0 0 14px 2px rgba(196, 181, 253, 0.65);
  animation: vision-scan 2.6s ease-in-out infinite;
}
@keyframes vision-scan {
  0% { top: 2%; opacity: 0; }
  10% { opacity: 1; }
  48% { top: 96%; opacity: 1; }
  58%, 100% { top: 96%; opacity: 0; }
}
.vision-box {
  position: absolute;
  left: 21%;
  top: 52%;
  width: 36%;
  height: 30%;
  border: 2px solid var(--accent-2);
  border-radius: 6px;
  opacity: 0;
  transform: scale(0.92);
  animation: vision-box-in 0.5s var(--ease) forwards;
  animation-delay: 2s;
}
@keyframes vision-box-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.vision-tag {
  position: absolute;
  left: 21%;
  top: calc(52% - 27px);
  background: var(--accent);
  color: #0a0a0a;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  opacity: 0;
  transform: translateY(6px);
  animation: vision-tag-in 0.5s var(--ease) forwards;
  animation-delay: 2.2s;
  white-space: nowrap;
}
@keyframes vision-tag-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.vision-mock-caption {
  display: block;
  margin-top: 18px;
  max-width: 340px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ink-dim);
}

/* ============================================================
   Trust bar
   ============================================================ */
.hero-trustbar {
  position: relative;
  z-index: 2;
  padding: 20px 32px;
  border-top: 1px solid var(--line-dark);
}
.trust-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  text-align: center;
}
.trust-item {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.trust-sep {
  color: var(--line-dark);
  font-size: 14px;
}

/* ============================================================
   Cover sections — full-bleed photo statements
   ============================================================ */
.cover {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0a0a0a;
  color: var(--ink);
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #0a0a0a 0%, rgba(10, 10, 10, 0.9) 38%, rgba(10, 10, 10, 0.58) 66%, rgba(10, 10, 10, 0.6) 100%);
}
.cover-mission::before {
  background-image: url("img/mission-ai.jpg");
  background-position: center 60%;
}
.cover-scale::before {
  background-image: url("img/scale-city.jpg");
}
.cover-inner {
  position: relative;
  z-index: 2;
  padding: 90px 0;
  max-width: 760px;
}
.mega {
  font-family: var(--font-mega);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 0.98;
  font-size: clamp(34px, 6vw, 68px);
  color: var(--ink);
  margin-top: 18px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}
.cover-inner p {
  margin-top: 22px;
  font-size: clamp(16px, 1.4vw, 18.5px);
  color: var(--ink-dim);
  max-width: 560px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
.cover-inner .btn-arrow {
  margin-top: 34px;
}

/* ============================================================
   Reveal on scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.stagger > * {
  transition-delay: calc(var(--i, 0) * 90ms);
}

/* ============================================================
   Challenge (before / after)
   ============================================================ */
.challenge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  position: relative;
}
.challenge-grid::before {
  content: "→";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--noir);
  color: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 3;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.35);
}
.challenge-card {
  border-radius: var(--radius);
  padding: 40px 36px;
  border: 1px solid var(--line-light);
}
.challenge-card.is-before {
  background: var(--paper-2);
}
.challenge-card.is-after {
  background: var(--noir);
  color: var(--ink);
  border-color: var(--line-dark);
  position: relative;
  overflow: hidden;
}
.challenge-card.is-after::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 400px 300px at 100% 0%, rgba(139, 92, 246, 0.25), transparent 70%);
  pointer-events: none;
}
.challenge-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 20px;
  display: block;
}
.challenge-card.is-after .challenge-label {
  color: var(--accent-2);
}
.challenge-card li {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line-light);
  font-size: 15px;
}
.challenge-card li:first-of-type {
  border-top: none;
}
.challenge-card.is-after li {
  border-top-color: var(--line-dark);
}
.challenge-card li .mark {
  flex-shrink: 0;
  width: 18px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.challenge-card.is-after li .mark {
  color: var(--accent-2);
}

/* ============================================================
   Services
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.service-card {
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  position: relative;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-dim);
  box-shadow: 0 20px 40px -18px rgba(109, 40, 217, 0.35);
}
.service-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 20px;
  color: var(--accent-dim);
  transition: background 0.3s ease, color 0.3s ease;
}
.service-card:hover .service-icon {
  background: var(--accent);
  color: #0a0a0a;
}
.service-icon svg {
  width: 20px;
  height: 20px;
}
.service-card h3 {
  font-size: 18.5px;
  margin-bottom: 10px;
}
.service-card p {
  font-size: 14.5px;
  color: var(--text-dim);
}

/* ============================================================
   Demo — illustrative chat mock
   ============================================================ */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.demo-copy p {
  margin-top: 16px;
  font-size: 15.5px;
  color: var(--text-dim);
  max-width: 440px;
}
.demo-copy .hint {
  display: block;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.chat-mock {
  background: var(--noir);
  border-radius: 20px;
  padding: 22px;
  max-width: 380px;
  margin: 0 0 0 auto;
  box-shadow: 0 30px 60px -20px rgba(20, 10, 40, 0.3);
}
.chat-mock-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.chat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
}
.chat-mock-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.45;
}
.chat-bubble.in {
  align-self: flex-start;
  background: rgba(245, 244, 240, 0.07);
  color: var(--ink-dim);
  border-bottom-left-radius: 4px;
}
.chat-bubble.out {
  align-self: flex-end;
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.chat-bubble.system {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed var(--line-dark);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-dots {
  display: inline-flex;
  gap: 3px;
}
.chat-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-faint);
  animation: chat-blink 1.2s ease-in-out infinite;
}
.chat-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.chat-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes chat-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

/* ============================================================
   How we work (capability strip)
   ============================================================ */
.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.capability {
  background: var(--noir);
  padding: 30px 26px;
  transition: background 0.35s ease, transform 0.35s var(--ease);
}
.capability:hover {
  background: #221a2c;
  transform: translateY(-3px);
}
.capability-icon {
  width: 34px;
  height: 34px;
  color: var(--accent-2);
  margin-bottom: 18px;
}
.capability-icon svg {
  width: 100%;
  height: 100%;
}
.capability h3 {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 10px;
}
.capability p {
  font-size: 14.5px;
  color: var(--ink-dim);
}

/* ============================================================
   Process timeline
   ============================================================ */
.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  position: relative;
  padding-top: 8px;
}
.timeline-track {
  position: absolute;
  top: 27px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-light);
}
.timeline-track-fill {
  position: absolute;
  top: 27px;
  left: 0;
  height: 1px;
  width: 0%;
  background: var(--accent);
  transition: width 1.1s var(--ease) 0.2s;
}
.timeline.in-view .timeline-track-fill {
  width: 100%;
}
.step {
  position: relative;
  padding-right: 12px;
}
.step-num {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent-dim);
  position: relative;
  z-index: 2;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}
.timeline.in-view .step {
  transition: none;
}
.timeline.in-view .step[data-i="0"] .step-num,
.timeline.in-view .step[data-i="1"] .step-num,
.timeline.in-view .step[data-i="2"] .step-num,
.timeline.in-view .step[data-i="3"] .step-num,
.timeline.in-view .step[data-i="4"] .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0a;
  transition: background 0.5s ease, color 0.5s ease, border-color 0.5s ease;
  transition-delay: calc(var(--i) * 180ms);
}
.step h3 {
  margin-top: 22px;
  font-size: 16.5px;
}
.step p {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-dim);
  padding-right: 8px;
}

/* ============================================================
   Why Caipi Tech
   ============================================================ */
.why-grid {
  columns: 2;
  column-gap: 22px;
}
.why-card {
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  padding: 34px 32px;
  margin-bottom: 22px;
  break-inside: avoid;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.why-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-dim);
  box-shadow: 0 20px 40px -18px rgba(109, 40, 217, 0.35);
}
.why-card h3 {
  font-size: 19px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.why-card h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
  transform: rotate(45deg);
}
.why-card p,
.why-card li {
  font-size: 14.5px;
  color: var(--text-dim);
}
.why-card ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.why-card li {
  padding-left: 18px;
  position: relative;
}
.why-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 1px;
  background: var(--accent-dim);
}
.why-card .use-cases {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  display: inline-flex;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--line-light);
}

/* ============================================================
   Next steps — what happens after you reach out
   ============================================================ */
.next-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.next-step {
  padding: 30px 28px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: var(--paper);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.next-step:hover {
  transform: translateY(-6px);
  border-color: var(--accent-dim);
  box-shadow: 0 20px 40px -18px rgba(109, 40, 217, 0.35);
}
.next-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--accent-dim);
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 18px;
}
.next-step h3 {
  font-size: 18px;
  margin-bottom: 10px;
}
.next-step p {
  font-size: 14.5px;
  color: var(--text-dim);
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-list {
  border-top: 1px solid var(--line-light);
  max-width: 820px;
}
.faq-item {
  border-bottom: 1px solid var(--line-light);
  padding: 22px 0;
}
.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 400;
  color: var(--accent-dim);
  transition: transform 0.3s var(--ease);
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item p {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 680px;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-section {
  position: relative;
  background: #0a0a0a;
}
.contact-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(15deg, #0a0a0a 0%, rgba(10, 10, 10, 0.92) 30%, rgba(10, 10, 10, 0.55) 58%, rgba(10, 10, 10, 0.8) 100%),
    url("img/contact-streaks.jpg");
  background-size: cover;
  background-position: center;
}
.contact-inner {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 48px;
  flex-wrap: wrap;
}
.contact-copy h2 {
  font-family: var(--font-mega);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1;
  font-size: clamp(34px, 5vw, 58px);
  color: var(--ink);
  max-width: 680px;
}
.contact-meta {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}
.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 280px;
}
.contact-actions .btn {
  justify-content: center;
}
.contact-links {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14.5px;
  color: var(--ink-dim);
}
.contact-links a:hover {
  color: var(--accent-2);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--noir-2);
  padding: 30px 0;
  border-top: 1px solid var(--line-dark);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.footer-brand img {
  width: 30px;
  height: auto;
}
.footer-inner small {
  color: var(--ink-faint);
  font-size: 12.5px;
  font-family: var(--font-mono);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .hero-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
  }
  .hero-inner {
    max-width: 100%;
  }
  .hero-visual {
    width: 100%;
    max-width: 460px;
  }
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .capability-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .why-grid {
    columns: 1;
  }
  .demo-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .chat-mock {
    margin: 0 auto;
  }
  .next-steps {
    grid-template-columns: 1fr;
  }
  .timeline {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-left: 27px;
  }
  .timeline-track,
  .timeline-track-fill {
    top: 0;
    bottom: 0;
    left: 27px;
    right: auto;
    width: 1px;
    height: 100%;
  }
  .timeline-track-fill {
    height: 0%;
    width: 1px;
  }
  .timeline.in-view .timeline-track-fill {
    height: 100%;
    width: 1px;
  }
  .step {
    padding-left: 46px;
    padding-right: 0;
  }
  .step-num {
    position: absolute;
    left: -27px;
    top: 0;
    width: 54px;
    height: 54px;
  }
  .step h3 {
    margin-top: 4px;
  }
}

@media (max-width: 1360px) {
  .main-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0c0c0c;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 8px 32px 40px;
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 1, 1);
    overflow-y: auto;
    counter-reset: navlink;
  }
  .main-nav::before {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -50px;
    width: 340px;
    height: 180px;
    background-image: url("logo/sparkle-white.png");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: bottom right;
    opacity: 0.05;
    pointer-events: none;
  }
  .main-nav.open {
    transform: translateX(0);
    transition: transform 0.42s cubic-bezier(0, 0, 0.2, 1);
  }
  .main-nav > a:not(.btn) {
    counter-increment: navlink;
    display: flex;
    align-items: baseline;
    gap: 16px;
    font-family: var(--font-mega);
    text-transform: uppercase;
    font-weight: 700;
    font-size: clamp(28px, 8.5vw, 40px);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--ink-dim);
    padding: 18px 0;
    border-bottom: 1px solid var(--line-dark);
    opacity: 0;
    transform: translateX(20px);
    transition: color 0.25s ease, opacity 0.4s var(--ease), transform 0.4s var(--ease);
  }
  .main-nav > a:not(.btn)::before {
    content: counter(navlink, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-2);
    letter-spacing: 0.03em;
  }
  .main-nav a:not(.btn)::after {
    display: none;
  }
  .main-nav a:not(.btn):hover {
    color: var(--ink);
  }
  .main-nav.open a:not(.btn) {
    opacity: 1;
    transform: translateX(0);
  }
  .main-nav.open a:not(.btn):nth-child(1) { transition-delay: 0.08s; }
  .main-nav.open a:not(.btn):nth-child(2) { transition-delay: 0.13s; }
  .main-nav.open a:not(.btn):nth-child(3) { transition-delay: 0.18s; }
  .main-nav.open a:not(.btn):nth-child(4) { transition-delay: 0.23s; }
  .main-nav.open a:not(.btn):nth-child(5) { transition-delay: 0.28s; }
  .main-nav .btn {
    margin-top: 24px;
    align-self: flex-start;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
    transition-delay: 0.33s;
  }
  .main-nav.open .btn {
    opacity: 1;
    transform: translateX(0);
  }
  .lang-toggle {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line-dark);
    font-size: 14px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
    transition-delay: 0.38s;
  }
  .main-nav.open .lang-toggle {
    opacity: 1;
    transform: translateX(0);
  }
  .nav-toggle {
    display: block;
  }
}

@media (max-width: 860px) {
  .challenge-grid {
    grid-template-columns: 1fr;
  }
  .challenge-grid::before {
    top: 0;
    transform: translate(-50%, -50%) rotate(90deg);
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 20px;
  }
  .section {
    padding: 88px 0;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .capability-grid {
    grid-template-columns: 1fr;
  }
  .chat-mock {
    max-width: 100%;
    padding: 18px;
  }
  .trust-bar-inner {
    gap: 8px;
  }
  .trust-sep {
    display: none;
  }
  .contact-inner {
    align-items: stretch;
  }
  .contact-actions {
    width: 100%;
  }
  .cover {
    min-height: auto;
  }
  .cover-inner {
    padding: 64px 0;
  }
  .hero-bg {
    background-position: 68% center;
  }
}

/* ============================================================
   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;
    scroll-behavior: auto !important;
  }
  .vision-scanline {
    display: none;
  }
}
