/* ==================================================================
   ENHANCEMENTS — Reveal, Cursor, Counters, Hero motion, Process,
   FAQ, Why-Us, Section transitions, Optionals, Back-to-top, Progress
   ================================================================== */

/* ---------- SCROLL PROGRESS BAR ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), #1aa8b3);
  z-index: 200;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px var(--cyan);
}

/* ---------- REVEAL ON SCROLL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(.22,.61,.36,1), transform 0.9s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }

.reveal-fade {
  opacity: 0;
  transition: opacity 1.2s ease;
}
.reveal-fade.is-visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-fade { opacity: 1; transform: none; transition: none; }
}

/* ---------- CUSTOM CURSOR ---------- */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, input, textarea, select, label, [role="button"] { cursor: none; }

  .cursor-dot, .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: transform, width, height;
  }
  .cursor-dot {
    width: 6px; height: 6px;
    background: var(--cyan);
    transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
  }
  .cursor-ring {
    width: 36px; height: 36px;
    border: 1px solid var(--cyan);
    transition: width 0.25s cubic-bezier(.22,.61,.36,1),
                height 0.25s cubic-bezier(.22,.61,.36,1),
                background 0.25s ease,
                border-color 0.25s ease,
                opacity 0.2s ease;
  }
  body.cursor-hover .cursor-ring {
    width: 64px; height: 64px;
    background: rgba(45, 212, 222, 0.10);
    border-color: var(--cyan);
  }
  body.cursor-hover .cursor-dot {
    opacity: 0;
  }
  body.cursor-hidden .cursor-dot,
  body.cursor-hidden .cursor-ring {
    opacity: 0;
  }
}

/* ---------- MAGNETIC BUTTONS ---------- */
.magnetic { display: inline-flex; transition: transform 0.3s cubic-bezier(.22,.61,.36,1); }

/* ---------- ANIMATED COUNTERS ---------- */
.stat-num[data-counter] .count-target { display: inline-block; }

/* ---------- HERO SVG: stroke-draw + data flow ---------- */
.orb-svg .draw-line {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawLine 2.4s ease forwards;
}
.orb-svg .draw-line.d-1 { animation-delay: 0.6s; }
.orb-svg .draw-line.d-2 { animation-delay: 0.9s; }
.orb-svg .draw-line.d-3 { animation-delay: 1.2s; }
.orb-svg .draw-line.d-4 { animation-delay: 1.5s; }

.orb-svg .draw-circle {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: drawLine 3s ease forwards;
}
.orb-svg .draw-circle.d-r1 { animation-delay: 0.2s; }
.orb-svg .draw-circle.d-r2 { animation-delay: 0.5s; }
.orb-svg .draw-circle.d-r3 { animation-delay: 0.8s; }

.orb-svg .data-pulse {
  fill: var(--cyan);
  filter: drop-shadow(0 0 4px var(--cyan));
}
.orb-svg .data-pulse.p1 { animation: dataPulse1 4s linear infinite; animation-delay: 2s; opacity: 0; }
.orb-svg .data-pulse.p2 { animation: dataPulse2 4s linear infinite; animation-delay: 2.5s; opacity: 0; }
.orb-svg .data-pulse.p3 { animation: dataPulse3 4s linear infinite; animation-delay: 3s; opacity: 0; }
.orb-svg .data-pulse.p4 { animation: dataPulse4 4s linear infinite; animation-delay: 3.5s; opacity: 0; }

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}
@keyframes dataPulse1 {
  0% { opacity: 0; transform: translate(0, -160px); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate(60px, -80px); }
}
@keyframes dataPulse2 {
  0% { opacity: 0; transform: translate(-160px, 0); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate(-80px, -60px); }
}
@keyframes dataPulse3 {
  0% { opacity: 0; transform: translate(0, 160px); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate(-60px, 80px); }
}
@keyframes dataPulse4 {
  0% { opacity: 0; transform: translate(160px, 0); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate(80px, 60px); }
}

/* Hero ambient particles */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.hero-particles .particle {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--cyan);
  border-radius: 50%;
  opacity: 0.3;
  animation: particleFloat 18s linear infinite;
  box-shadow: 0 0 8px var(--cyan);
}
@keyframes particleFloat {
  0% { transform: translate3d(0, 100vh, 0); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { transform: translate3d(40px, -10vh, 0); opacity: 0; }
}

/* ---------- SECTION TRANSITIONS (alternating bg) ---------- */
.section { transition: background-color 0.8s ease; }

/* ---------- SECCIÓN: PROCESO ---------- */
.process { background: var(--bg); }
.process-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
  position: relative;
}
.process-track::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: repeating-linear-gradient(to right, var(--line) 0, var(--line) 6px, transparent 6px, transparent 12px);
  z-index: 0;
}
.process-step {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding: 0 8px;
}
.process-num {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 28px;
  color: var(--cyan);
  margin: 0 auto 24px;
  position: relative;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.process-num::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed var(--line);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.process-step:hover .process-num {
  border-color: var(--cyan);
  transform: scale(1.05);
}
.process-step:hover .process-num::after { opacity: 1; }
.process-step h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  text-align: center;
  color: var(--text);
}
.process-step p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  text-align: center;
  margin: 0;
}
.process-step-meta {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-top: 12px;
}
@media (max-width: 880px) {
  .process-track { grid-template-columns: repeat(2, 1fr); }
  .process-track::before { display: none; }
}
@media (max-width: 480px) {
  .process-track { grid-template-columns: 1fr; }
}

/* ---------- SECCIÓN: WHY US / GARANTÍA ---------- */
.whyus { background: var(--bg-2); }
.whyus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.whyus-card {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color 0.3s ease, transform 0.3s ease;
  position: relative;
  overflow: hidden;
}
.whyus-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0%;
  height: 2px;
  background: var(--cyan);
  transition: width 0.6s cubic-bezier(.22,.61,.36,1);
}
.whyus-card:hover { border-color: var(--cyan); transform: translateY(-4px); }
.whyus-card:hover::before { width: 100%; }
.whyus-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(45, 212, 222, 0.10);
  border: 1px dashed var(--cyan);
  color: var(--cyan);
  display: grid;
  place-items: center;
}
.whyus-icon svg { width: 26px; height: 26px; }
.whyus-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}
.whyus-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}
.whyus-meta {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}
@media (max-width: 900px) { .whyus-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .whyus-grid { grid-template-columns: 1fr; } }

/* ---------- SECCIÓN: FAQ ---------- */
.faq { background: var(--bg); }
.faq-list {
  margin-top: 48px;
  max-width: 880px;
}
.faq-item {
  border-top: 1px solid var(--line);
}
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 8px;
  background: none;
  border: 0;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--text);
  cursor: pointer;
  transition: color 0.2s ease;
}
.faq-trigger:hover { color: var(--cyan); }
.faq-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  position: relative;
}
.faq-icon::before, .faq-icon::after {
  content: '';
  position: absolute;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.faq-icon::before { width: 12px; height: 1px; }
.faq-icon::after  { width: 1px; height: 12px; }
.faq-item.is-open .faq-icon {
  transform: rotate(180deg);
  border-color: var(--cyan);
  background: var(--cyan);
  color: #FAFAF7;
}
.faq-item.is-open .faq-icon::after { transform: scaleY(0); }
.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(.22,.61,.36,1);
}
.faq-item.is-open .faq-body { max-height: 400px; }
.faq-body-inner {
  padding: 0 8px 32px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 760px;
  text-wrap: pretty;
}

/* ---------- BACK TO TOP ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  display: grid;
  place-items: center;
  z-index: 150;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 8px 24px rgba(14,20,24,0.08);
}
.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.back-to-top:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.back-to-top svg { width: 18px; height: 18px; }

/* ---------- SECCIÓN: OPCIONALES ---------- */
.optionals {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  position: relative;
}
.optionals::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: repeating-linear-gradient(to right, var(--cyan) 0, var(--cyan) 12px, transparent 12px, transparent 24px);
  opacity: 0.4;
}
.optionals-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(242, 178, 51, 0.10);
  border: 1px dashed #C99728;
  border-radius: 4px;
  margin-bottom: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #8a6814;
  max-width: max-content;
}
.optionals-banner-icon {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: #F2B233;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  font-family: var(--font-display);
  font-style: italic;
}
.optionals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.optional-card {
  background: var(--bg);
  border: 1px dashed var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.optional-card:hover {
  border-color: var(--cyan);
  border-style: solid;
  transform: translateY(-2px);
}
.optional-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.optional-tag .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}
.optional-card h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.optional-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}
.optional-status {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #C99728;
}
@media (max-width: 900px) { .optionals-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .optionals-grid { grid-template-columns: 1fr; } }
