:root {
  --bg: #0E1116;
  --bg-2: #161B22;
  --panel: #12161D;
  --border: #232B36;
  --text: #F3F5F8;
  --muted: #8A93A6;
  --blue: #5B6EF5;
  --amber: #F2A93C;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at center, rgba(243,245,248,0.06) 1px, transparent 1.6px),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-size: 26px 26px, 100% 100%;
  background-attachment: fixed, fixed;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  overflow-x: hidden;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--blue); }
::selection { background: var(--blue); color: var(--bg); }

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes bootUp { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: scale(1); } }
@keyframes glowDrift {
  0% { transform: translate(-10%, -8%); }
  50% { transform: translate(8%, 12%); }
  100% { transform: translate(-10%, -8%); }
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.gradient-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  background: linear-gradient(90deg, var(--blue), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  animation: glowDrift 18s ease-in-out infinite;
}
.glow-top {
  width: min(700px, 60vw);
  height: min(700px, 60vw);
  background: radial-gradient(circle, rgba(91,110,245,0.35), rgba(242,169,60,0.18) 60%, transparent 72%);
  top: -15%;
  left: 50%;
  transform: translateX(-50%);
}
.glow-bottom {
  width: min(600px, 55vw);
  height: min(600px, 55vw);
  background: radial-gradient(circle, rgba(242,169,60,0.28), rgba(91,110,245,0.2) 60%, transparent 72%);
  bottom: -15%;
  left: 50%;
  transform: translateX(-50%);
  animation-duration: 20s;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Hero */
#hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: clamp(24px, 6vw, 64px);
  overflow: hidden;
  text-align: center;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vw, 30px);
  max-width: 920px;
}
.prompt-row { display: flex; align-items: center; gap: 8px; }
.boot-up { animation: bootUp .9s cubic-bezier(.22,1,.36,1) both; }
.prompt-caret {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(48px, 7vw, 80px);
  line-height: 1;
  background: linear-gradient(90deg, var(--blue), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cta-caret { font-size: clamp(40px, 6vw, 64px); }
.blink-block {
  width: 0.28em;
  height: 0.6em;
  margin-top: 0.08em;
  background: var(--amber);
  display: inline-block;
  animation: blink 1.1s steps(1) infinite;
  border-radius: 1px;
}
.kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(11px, 1.4vw, 13px);
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}
h1 {
  text-transform: uppercase;
  font-size: clamp(2.3rem, 7vw, 5.2rem);
  line-height: 1.03;
  letter-spacing: -0.01em;
  margin: 0;
}
.lead { font-size: clamp(1rem, 2vw, 1.3rem); color: var(--muted); margin: 0; max-width: 620px; }
.typed-row {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(14px, 2vw, 18px);
  color: var(--amber);
  min-height: 1.6em;
  display: flex;
  align-items: center;
  gap: 2px;
}
.type-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--amber);
  animation: blink 0.9s steps(1) infinite;
  margin-left: 2px;
}

.btn-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
}
.btn-primary {
  color: var(--bg);
  background-image: linear-gradient(90deg, var(--blue), var(--amber));
  background-size: 200% 100%;
  background-position: 0% 50%;
  transition: background-position .5s ease, transform .3s ease;
}
.btn-primary:hover { background-position: 100% 50%; transform: translateY(-2px); color: var(--bg); }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color .3s ease, color .3s ease;
}
.btn-outline:hover { border-color: var(--amber); color: var(--amber); }
.btn-accent-outline {
  border: 1px solid var(--amber);
  color: var(--amber);
  transition: background .3s ease, color .3s ease;
}
.btn-accent-outline:hover { background: var(--amber); color: var(--bg); }

/* Credibilidad */
#credibilidad {
  padding: clamp(40px, 6vw, 72px) clamp(20px, 6vw, 64px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}
.center { text-align: center; }
.logo-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(24px, 5vw, 64px); }
.logo-text {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(18px, 2.4vw, 26px);
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.85;
}

/* Metricas */
#metricas { padding: clamp(64px, 10vw, 120px) clamp(20px, 6vw, 64px); }
.metrics-intro {
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  color: var(--text);
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(32px, 4vw, 48px);
  max-width: 1100px;
  margin: 0 auto;
}
.metric { text-align: center; }
.metric-value { font-size: clamp(2.6rem, 7vw, 4.3rem); line-height: 1; }
.metric-suffix { font-size: 0.5em; }
.metric-label { font-size: 14px; color: var(--muted); margin-top: 16px; line-height: 1.5; }

/* Caso */
#caso {
  padding: clamp(64px, 10vw, 120px) clamp(20px, 6vw, 64px);
  background: linear-gradient(180deg, transparent, rgba(91,110,245,0.05), transparent);
}
.case-wrap { max-width: 1080px; margin: 0 auto; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(32px, 5vw, 56px); align-items: start; }
.rule { width: 64px; height: 2px; background: linear-gradient(90deg, var(--blue), var(--amber)); margin-bottom: 20px; }
.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber); margin-bottom: 12px; }
.section-title {
  text-transform: uppercase;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 16px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}
.case-desc { font-size: 16px; color: var(--muted); line-height: 1.6; margin: 0 0 28px; max-width: 440px; }
.live-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); display: inline-block; animation: blink 1.2s steps(1) infinite; }
.live-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.15em; color: var(--muted); text-transform: uppercase; }

.chat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(18px, 3vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 360px;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 4px;
}
.chat-header .dot { width: 7px; height: 7px; animation-duration: 1.4s; }
.chat-title { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.08em; color: var(--text); }
.chat-status { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); margin-left: auto; }
.chat-body { display: flex; flex-direction: column; gap: 12px; }

.msg-row { display: flex; }
.msg-row.meta { justify-content: center; }
.msg-row.client { justify-content: flex-start; }
.msg-row.agent { justify-content: flex-end; }

.bubble {
  animation: bubbleIn .45s ease both;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  text-align: left;
  padding: 12px 16px;
  line-height: 1.5;
  border-radius: 14px 14px 14px 4px;
  max-width: 82%;
  color: var(--text);
  background: #1B212B;
}
.msg-row.agent .bubble {
  background: linear-gradient(135deg, rgba(91,110,245,0.28), rgba(242,169,60,0.2));
  border: 1px solid rgba(91,110,245,0.35);
  border-radius: 14px 14px 4px 14px;
}
.msg-row.meta .bubble {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0;
  background: none;
}

/* Servicios */
#servicios { padding: clamp(64px, 10vw, 120px) clamp(20px, 6vw, 64px); }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.card-border {
  padding: 1px;
  border-radius: 16px;
  background: var(--border);
  transition: background .4s ease, transform .4s ease;
  height: 100%;
}
.card-border:hover { background: linear-gradient(135deg, var(--blue), var(--amber)); transform: translateY(-6px); }
.card { background: var(--panel); border-radius: 15px; padding: clamp(26px, 3vw, 34px); height: 100%; }
.card-tag { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.card-title {
  text-transform: uppercase;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  margin: 14px 0 12px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}
.card-desc { font-size: 15px; color: var(--muted); line-height: 1.6; margin: 0; }

/* Sobre mi */
#sobre-mi { padding: clamp(64px, 10vw, 120px) clamp(20px, 6vw, 64px); }
.about-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.portrait { width: 100%; aspect-ratio: 4/5; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(0.15) contrast(1.05); }
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute;
  left: -32.5px;
  top: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--blue), var(--amber));
}
.timeline-tag { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--amber); letter-spacing: 0.15em; }
.timeline-title {
  text-transform: uppercase;
  font-size: 1.1rem;
  margin: 8px 0 6px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}
.timeline-desc { font-size: 15px; color: var(--muted); line-height: 1.6; margin: 0; max-width: 520px; }

/* CTA final */
#contacto {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(24px, 6vw, 64px);
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
}
.cta-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.cta-title { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0; text-transform: uppercase; }
.cta-lead { font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 520px; }

/* Footer */
footer {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  border-top: 1px solid var(--border);
}
.social-row { display: flex; gap: 16px; align-items: center; }
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color .3s ease, background .3s ease;
}
.social-btn:hover { border-color: var(--amber); background: rgba(242,169,60,0.1); color: var(--text); }
.footer-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
