/* ═══════════════════════════════════════════════════
   CODEXIA HERO BLOCK — style.css (frontend)
   Paleta: violeta #7c2bff / #9b59f5 / #c084fc
   Fondo:  #08060f
   Texto:  #f0ecff
═══════════════════════════════════════════════════ */

/* ── Keyframes ─────────────────────────────────── */
@keyframes cdxCharIn {
  0%   { opacity:0; transform:translateY(110%) rotate(7deg) skewX(-10deg); }
  60%  { opacity:1; transform:translateY(-5%) rotate(-1deg) skewX(1deg); }
  100% { opacity:1; transform:translateY(0) rotate(0) skewX(0); }
}
@keyframes cdxFadeUp {
  from { opacity:0; transform:translateY(30px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes cdxPulse {
  0%,100% { box-shadow:0 0 8px #9b59f5, 0 0 22px rgba(155,89,245,.4); }
  50%     { box-shadow:0 0 18px #c084fc, 0 0 44px rgba(192,132,252,.65); }
}
@keyframes cdxMarquee {
  from { transform:translateX(0); }
  to   { transform:translateX(-33.333%); }
}
@keyframes cdxFloat {
  0%,100% { transform:translateY(0) rotate(0deg); }
  33%     { transform:translateY(-16px) rotate(1.2deg); }
  66%     { transform:translateY(-7px) rotate(-1deg); }
}
@keyframes cdxSpin {
  from { transform:translate(-50%,-50%) rotate(0deg); }
  to   { transform:translate(-50%,-50%) rotate(360deg); }
}
@keyframes cdxGlitch {
  0%,88%,100% { transform:translate(0); clip-path:none; color:#9b59f5; }
  89% { transform:translate(-3px,1px); clip-path:inset(15% 0 55% 0); color:#c084fc; }
  91% { transform:translate(3px,-1px); clip-path:inset(58% 0 8% 0);  color:#7c2bff; }
  93% { transform:translate(-2px,2px); clip-path:inset(35% 0 30% 0); color:#c084fc; }
}
@keyframes cdxLogLine {
  from { opacity:0; transform:translateX(-8px); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes cdxMetricFill {
  from { width:0%; }
}
@keyframes cdxCounterIn {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes cdxScaleIn {
  from { opacity:0; transform:scale(.9) translateY(36px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
@keyframes cdxLineGrow {
  from { transform:scaleY(0); transform-origin:top; }
  to   { transform:scaleY(1); transform-origin:top; }
}

/* ── Reset scoped ──────────────────────────────── */
.cdx-root *, .cdx-root *::before, .cdx-root *::after {
  box-sizing:border-box;
  margin:0;
  padding:0;
}
.cdx-root a { text-decoration:none; }
.cdx-root h1,.cdx-root h2,.cdx-root h3 { font-weight:inherit; }

/* ── Root wrapper ──────────────────────────────── */
.cdx-root {
  --cdx-bg:       #08060f;
  --cdx-accent:   #9b59f5;
  --cdx-bright:   #c084fc;
  --cdx-deep:     #7c2bff;
  --cdx-text:     #f0ecff;
  --cdx-muted:    rgba(240,236,255,.55);
  --cdx-border:   rgba(155,89,245,.12);
  --cdx-card-bg:  rgba(12,8,28,.75);

  background: var(--cdx-bg);
  color: var(--cdx-text);
  font-family: 'Georgia','Times New Roman',serif;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

/* ── Grid overlay ──────────────────────────────── */
.cdx-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(155,89,245,.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155,89,245,.034) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* ── Scroll progress ───────────────────────────── */
.cdx-progress-track {
  position: fixed;
  left: 22px;
  top: 10vh;
  bottom: 10vh;
  width: 2px;
  background: rgba(155,89,245,.08);
  border-radius: 2px;
  z-index: 200;
}
.cdx-progress-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg,#7c2bff,#c084fc);
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(155,89,245,.7);
  transition: height .06s linear;
}
.cdx-progress-dot {
  position: absolute;
  left: 50%;
  top: 0%;
  transform: translate(-50%,-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #c084fc;
  animation: cdxPulse 2s infinite;
  transition: top .06s linear;
}
.cdx-progress-pct {
  position: absolute;
  left: 14px;
  top: 0%;
  transform: translateY(-50%);
  font-size: 9px;
  letter-spacing: 1px;
  color: rgba(192,132,252,.55);
  font-family: monospace;
  transition: top .06s linear;
  white-space: nowrap;
}

/* ── HERO ──────────────────────────────────────── */
.cdx-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 100px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  gap: 60px;
}

.cdx-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.cdx-orb--1 {
  right: -100px; top: 50%;
  width: 680px; height: 680px;
  background: radial-gradient(circle, rgba(124,43,255,.17) 0%, transparent 68%);
  border: 1px solid rgba(155,89,245,.07);
  transform: translateY(-50%);
  animation: cdxFloat 9s ease-in-out infinite;
}
.cdx-orb--2 {
  right: 80px; top: 22%;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(124,43,255,.26) 0%, transparent 65%);
  filter: blur(34px);
  animation: cdxFloat 6s ease-in-out infinite 1.2s;
}

.cdx-ring {
  position: absolute;
  right: 100px; top: 50%;
  width: 480px; height: 480px;
  opacity: .1;
  pointer-events: none;
  transform: translate(0,-50%);
  /* rotation applied via JS */
}

.cdx-hero__content {
  max-width: 780px;
  position: relative;
  z-index: 2;
  flex: 1;
}

/* Badge */
.cdx-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: 1px solid rgba(155,89,245,.28);
  border-radius: 100px;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: rgba(192,132,252,.85);
  background: rgba(124,43,255,.07);
  margin-bottom: 40px;
  opacity: 0;
  animation: cdxFadeUp .7s ease .15s both;
}
.cdx-badge__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #9b59f5;
  box-shadow: 0 0 8px #9b59f5;
  animation: cdxPulse 2s infinite;
  flex-shrink: 0;
}

/* H1 */
.cdx-hero__h1 {
  font-size: clamp(46px, 5.8vw, 82px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -2.5px;
  margin: 0 0 28px 0;
}

/* Char split — JS adds .cdx-char spans */
.cdx-char {
  display: inline-block;
  opacity: 0;
  will-change: transform,opacity;
}
.cdx-char.fired {
  animation: cdxCharIn .65s cubic-bezier(.16,1,.3,1) forwards;
}

/* Accent line — glitch */
.cdx-split-line--accent {
  color: var(--cdx-accent);
  text-shadow: 0 0 70px rgba(155,89,245,.28);
  animation: cdxGlitch 4.5s ease-in-out infinite 2s;
  display: inline-block;
}

/* Desc */
.cdx-hero__desc {
  font-size: 18px;
  line-height: 1.76;
  color: var(--cdx-muted);
  max-width: 580px;
  opacity: 0;
  animation: cdxFadeUp .8s ease .95s both;
}

/* CTA */
.cdx-hero__cta {
  display: flex;
  gap: 14px;
  margin-top: 46px;
  opacity: 0;
  animation: cdxFadeUp .7s ease 1.2s both;
}
.cdx-btn {
  padding: 15px 34px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
  cursor: pointer;
  display: inline-block;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.cdx-btn--primary {
  background: linear-gradient(135deg,#7c2bff,#9b59f5);
  color: #fff;
  border: none;
  box-shadow: 0 0 48px rgba(124,43,255,.35);
}
.cdx-btn--primary:hover {
  transform: translateY(-3px) scale(1.025);
  box-shadow: 0 0 70px rgba(124,43,255,.55);
}
.cdx-btn--ghost {
  background: transparent;
  color: rgba(192,132,252,.88);
  border: 1px solid rgba(155,89,245,.32);
}
.cdx-btn--ghost:hover {
  background: rgba(124,43,255,.1);
  border-color: rgba(155,89,245,.65);
}

/* Stats */
.cdx-stats {
  display: flex;
  gap: 48px;
  margin-top: 60px;
  opacity: 0;
  animation: cdxFadeUp .7s ease 1.5s both;
}
.cdx-stat__n {
  display: block;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: var(--cdx-bright);
  line-height: 1;
  text-shadow: 0 0 30px rgba(192,132,252,.22);
  animation: cdxCounterIn .5s ease both;
}
.cdx-stat__label {
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(240,236,255,.38);
  margin-top: 5px;
  display: block;
}

/* Terminal card */
.cdx-terminal {
  width: 440px;
  flex-shrink: 0;
  background: rgba(12,8,28,.9);
  border: 1px solid rgba(155,89,245,.14);
  border-radius: 20px;
  box-shadow: 0 60px 140px rgba(0,0,0,.75), inset 0 1px 0 rgba(155,89,245,.1);
  backdrop-filter: blur(24px);
  opacity: 0;
  animation: cdxScaleIn .9s cubic-bezier(.16,1,.3,1) .4s both;
}
.cdx-terminal__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(155,89,245,.08);
}
.cdx-terminal__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.cdx-terminal__dot--r { background:#ff5f57; }
.cdx-terminal__dot--y { background:#febc2e; }
.cdx-terminal__dot--g { background:#28c840; }
.cdx-terminal__title {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 1px;
  opacity: .35;
  margin-left: 8px;
}
.cdx-terminal__body { padding: 22px 24px; }
.cdx-terminal__endpoint {
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.cdx-terminal__status {
  font-family: monospace;
  font-size: 12px;
  opacity: .38;
  margin-bottom: 22px;
}
.cdx-terminal__log {
  font-family: monospace;
  font-size: 12px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 22px;
  min-height: 90px;
}
.cdx-log-line {
  opacity: 0;
  transform: translateX(-8px);
  color: rgba(240,236,255,.6);
}
.cdx-log-line.visible {
  animation: cdxLogLine .4s ease forwards;
}
.cdx-log-line--accent { color: var(--cdx-accent); }

/* Metrics */
.cdx-metric { margin-bottom: 12px; }
.cdx-metric__label {
  font-size: 11px;
  opacity: .42;
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}
.cdx-metric__bar {
  height: 4px;
  background: rgba(255,255,255,.05);
  border-radius: 4px;
  overflow: hidden;
}
.cdx-metric__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,#7c2bff,#c084fc);
  box-shadow: 0 0 8px rgba(155,89,245,.5);
  border-radius: 4px;
  transition: width 1.4s cubic-bezier(.16,1,.3,1);
}
.cdx-metric__val {
  font-family: monospace;
  font-size: 11px;
  color: var(--cdx-bright);
  float: right;
  margin-top: -18px;
}

/* Scroll hint */
.cdx-scroll-hint {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 1;
  transition: opacity .4s;
}
.cdx-scroll-hint span {
  font-size: 9px;
  letter-spacing: 3px;
  opacity: .3;
}
.cdx-scroll-hint__line {
  width: 1px;
  height: 38px;
  background: linear-gradient(180deg,rgba(155,89,245,.55),transparent);
}

/* ── Marquee ───────────────────────────────────── */
.cdx-marquee {
  overflow: hidden;
  border-top: 1px solid rgba(155,89,245,.1);
  border-bottom: 1px solid rgba(155,89,245,.1);
  padding: 13px 0;
  background: rgba(124,43,255,.04);
  position: relative;
  z-index: 1;
}
.cdx-marquee__track {
  display: flex;
  width: max-content;
  animation: cdxMarquee 22s linear infinite;
}
.cdx-marquee__item {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(192,132,252,.45);
  padding: 0 32px;
  border-right: 1px solid rgba(155,89,245,.1);
  white-space: nowrap;
}

/* ── Sections ──────────────────────────────────── */
.cdx-section {
  padding: 150px 100px;
  position: relative;
  z-index: 1;
}
.cdx-section--alt {
  background: rgba(124,43,255,.03);
  border-top: 1px solid rgba(155,89,245,.07);
}
.cdx-container { max-width: 1100px; margin: 0 auto; }
.cdx-section__label {
  display: block;
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(192,132,252,.55);
  margin-bottom: 20px;
}
.cdx-section__h2 {
  font-size: clamp(34px,4vw,58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}
.cdx-em {
  font-style: italic;
  color: var(--cdx-accent);
}
.cdx-section__intro {
  font-size: 17px;
  line-height: 1.78;
  color: var(--cdx-muted);
  max-width: 680px;
  margin-bottom: 64px;
}
.cdx-section__body {
  font-size: 16px;
  line-height: 1.82;
  color: var(--cdx-muted);
  margin-bottom: 16px;
}
.cdx-section__body--faded { color: rgba(240,236,255,.38); }

/* Word reveal */
.cdx-word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.12;
}
.cdx-word-inner {
  display: inline-block;
  transform: translateY(108%);
  transition: transform .85s cubic-bezier(.16,1,.3,1);
}
.cdx-word-inner.visible { transform: translateY(0); }

/* Fade-in utility */
.cdx-fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s ease;
}
.cdx-fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── Capability cards ──────────────────────────── */
.cdx-grid-cards {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 20px;
}
.cdx-card {
  position: relative;
  overflow: hidden;
  background: var(--cdx-card-bg);
  border: 1px solid var(--cdx-border);
  border-radius: 16px;
  padding: 30px 26px;
  opacity: 0;
  transform: scale(.92) translateY(44px);
  transition:
    opacity .7s cubic-bezier(.16,1,.3,1),
    transform .7s cubic-bezier(.16,1,.3,1),
    border-color .3s,
    box-shadow .3s;
}
.cdx-card.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.cdx-card:hover {
  border-color: rgba(155,89,245,.35);
  box-shadow: 0 20px 60px rgba(124,43,255,.2);
}
.cdx-card__glow {
  position: absolute;
  top: -40px; right: -40px;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle,rgba(124,43,255,.16) 0%,transparent 70%);
  pointer-events: none;
}
.cdx-card__tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(155,89,245,.08);
  border: 1px solid rgba(155,89,245,.18);
  color: rgba(192,132,252,.72);
  margin-bottom: 14px;
}
.cdx-card__icon {
  font-size: 26px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 10px rgba(155,89,245,.45));
}
.cdx-card__title {
  font-size: 21px;
  font-weight: 800;
  color: var(--cdx-bright);
  margin-bottom: 10px;
  letter-spacing: -.3px;
}
.cdx-card__desc {
  font-size: 14px;
  line-height: 1.72;
  color: var(--cdx-muted);
  margin-bottom: 18px;
}
.cdx-card__badge {
  font-size: 11px;
  letter-spacing: 1px;
  opacity: .32;
  border-top: 1px solid rgba(155,89,245,.07);
  padding-top: 12px;
}

/* ── Process steps ─────────────────────────────── */
.cdx-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.cdx-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cdx-step {
  display: flex;
  gap: 18px;
  position: relative;
  padding-bottom: 30px;
  opacity: 0;
  transform: translateX(28px);
  transition: opacity .65s cubic-bezier(.16,1,.3,1), transform .65s cubic-bezier(.16,1,.3,1);
}
.cdx-step:last-child { padding-bottom: 0; }
.cdx-step.visible { opacity: 1; transform: translateX(0); }

.cdx-step__line {
  position: absolute;
  left: 19px; top: 42px; bottom: 0;
  width: 1px;
  background: rgba(155,89,245,.08);
  overflow: hidden;
}
.cdx-step__line-fill {
  width: 100%; height: 0%;
  background: linear-gradient(180deg,rgba(155,89,245,.4),rgba(155,89,245,.05));
  transition: height 1s cubic-bezier(.16,1,.3,1);
}
.cdx-step.visible .cdx-step__line-fill { height: 100%; }

.cdx-step__num {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(155,89,245,.28);
  background: rgba(155,89,245,.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--cdx-accent);
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(155,89,245,.18);
}
.cdx-step__title {
  font-size: 16px;
  font-weight: 700;
  color: #e0d0ff;
  margin-bottom: 5px;
}
.cdx-step__desc {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(240,236,255,.42);
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 1024px) {
  .cdx-hero { flex-direction: column; padding: 80px 48px; gap: 48px; }
  .cdx-terminal { width: 100%; max-width: 480px; }
  .cdx-ring { display: none; }
  .cdx-section { padding: 100px 48px; }
  .cdx-two-col { grid-template-columns: 1fr; gap: 60px; }
  .cdx-grid-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cdx-hero { padding: 60px 24px; }
  .cdx-hero__h1 { font-size: clamp(36px,9vw,56px); }
  .cdx-hero__cta { flex-direction: column; }
  .cdx-stats { gap: 28px; }
  .cdx-section { padding: 80px 24px; }
  .cdx-progress-track { display: none; }
}
