/* ═══════════════════════════════════════════
   FATAPP IA — css/style.css
   Estética: terminal viva · servidor · HUD
   Fuentes: JetBrains Mono + Archivo Black
════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #060608;
  --bg2:       #0c0c10;
  --bg3:       #111116;
  --green:     #00ff88;
  --green-dim: rgba(0,255,136,0.08);
  --green-mid: rgba(0,255,136,0.18);
  --red:       #ff4444;
  --yellow:    #ffd93d;
  --blue:      #44aaff;
  --text:      #e8e8ee;
  --text2:     #888899;
  --text3:     #444455;
  --border:    rgba(255,255,255,0.06);
  --border2:   rgba(0,255,136,0.15);
  --mono:      'JetBrains Mono', monospace;
  --display:   'Archivo Black', sans-serif;
  --body:      'Archivo', sans-serif;
  --r:         6px;
  --r2:        12px;
}

[data-theme="light"] {
  --bg:        #1e2a48;
  --bg2:       #252f50;
  --bg3:       #2c3660;
  --bg4:       #0e1428;
  --green:     #22d3ee;
  --green-dim: rgba(34,211,238,0.08);
  --green-mid: rgba(34,211,238,0.18);
  --text:      #e2e8f8;
  --text2:     #8899c8;
  --text3:     #4a5880;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(34,211,238,0.20);
}

[data-theme="light"] .section-tag,
[data-theme="light"] .hero-eyebrow { opacity: 1; }
[data-theme="light"] .hero-accent { text-shadow: 0 0 40px rgba(34,211,238,.25); }
[data-theme="light"] .btn-terminal:hover { box-shadow: 0 0 24px rgba(34,211,238,.45); }

html { scroll-behavior: smooth; scroll-padding-top: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
  transition: background .3s, color .3s;
}
@media (pointer: coarse) { body { cursor: auto; } }

/* ── SCANLINES ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
  pointer-events: none;
  z-index: 1000;
}

/* ── NANOBOT CANVAS ── */
#nanobot-canvas {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  opacity: 0.7;
}
[data-theme="light"] #nanobot-canvas { mix-blend-mode: screen; opacity: 0.7; }
@media (pointer: coarse) { #nanobot-canvas { display: none; } }

/* ── CUSTOM CURSOR ── */
#cursor-dot {
  position: fixed;
  width: 7px; height: 7px;
  background: #ffffff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: transform .1s;
}
#cursor-dot::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  mix-blend-mode: difference;
}
body:has(a:hover) #cursor-dot,
body:has(button:hover) #cursor-dot { transform: translate(-50%, -50%) scale(1.5); }
@media (pointer: coarse) { #cursor-dot { display: none; } }

/* ── SCROLL BAR ── */
#scroll-bar {
  position: fixed; top: 0; left: 0;
  height: 1px; width: 0%;
  background: var(--green);
  z-index: 9999;
  transition: width .05s linear;
  box-shadow: 0 0 8px var(--green);
}

/* ── SIDE NAV ── */
#side-nav {
  position: fixed;
  left: 2rem; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column;
  align-items: center; gap: .75rem;
  z-index: 500;
}
.side-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, transparent, var(--border2));
}
.side-anchor {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  position: relative;
  text-decoration: none;
}
.anchor-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text3);
  transition: background .2s, transform .2s, box-shadow .2s;
  display: block;
}
.side-anchor:hover .anchor-dot,
.side-anchor.active .anchor-dot {
  background: var(--green);
  transform: scale(1.6);
  box-shadow: 0 0 8px var(--green);
}
/* Tooltip label */
.side-anchor::after {
  content: attr(data-label);
  position: absolute;
  left: 22px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  background: var(--bg);
  padding: 2px 8px;
  border: 1px solid var(--border2);
  border-radius: 3px;
}
.side-anchor:hover::after { opacity: 1; transform: translateX(0); }
@media (max-width: 900px) { #side-nav { display: none; } }

/* ── CORNER LOGO ── */
#corner-logo {
  position: fixed; top: 1.5rem; left: 4.5rem;
  z-index: 500;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  padding: 6px 12px 6px 8px;
  border-radius: 8px;
  background: transparent;
  backdrop-filter: blur(0px);
  transition: background .3s, backdrop-filter .3s;
}
#corner-logo.scrolled {
  background: rgba(13,13,16,.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="light"] #corner-logo.scrolled { background: rgba(30,42,72,.92); }
@media (max-width: 900px) { #corner-logo { left: 1.5rem; } }
.logo-mark {
  width: 30px; height: 30px;
  background: var(--green);
  color: #000;
  font-family: var(--display);
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.logo-text {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
}
.logo-text em { color: var(--green); font-style: normal; }

/* ── CORNER CTA ── */
@keyframes cc-pulse {
  0%,100% { border-color: rgba(0,255,136,.3); color: var(--text2); box-shadow: none; }
  45%     { border-color: rgba(0,255,136,.85); color: var(--green); box-shadow: 0 0 14px rgba(0,255,136,.28); }
}
@keyframes cc-pulse-light {
  0%,100% { border-color: rgba(34,211,238,.4); color: #5a6a8a; box-shadow: none; }
  45%     { border-color: rgba(34,211,238,.9); color: #22d3ee; box-shadow: 0 0 14px rgba(34,211,238,.3); }
}
#corner-chat {
  position: fixed; top: 1.5rem; right: 13rem;
  z-index: 500;
  background: none;
  border: 1px solid rgba(0,255,136,.3);
  color: var(--text2);
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 16px;
  cursor: none;
  border-radius: 3px;
  transition: color .2s, border-color .2s, background .2s, box-shadow .2s;
  letter-spacing: .05em;
  animation: cc-pulse 3.5s ease-in-out infinite;
}
#corner-chat:hover { color: var(--green); border-color: var(--border2); background: var(--green-dim); animation: none; }
[data-theme="light"] #corner-chat { animation-name: cc-pulse-light; }
@media (pointer: coarse) { #corner-chat { cursor: pointer; } }
@media (max-width: 768px) { #corner-chat { display: none; } }

#corner-cta {
  position: fixed; top: 1.5rem; right: 3rem;
  z-index: 500;
  background: none;
  border: 1px solid var(--border2);
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 16px;
  cursor: none;
  border-radius: 3px;
  transition: background .2s, box-shadow .2s;
  letter-spacing: .05em;
}
#corner-cta:hover { background: var(--green-dim); box-shadow: 0 0 12px rgba(0,255,136,.2); }
@media (pointer: coarse) { #corner-cta { cursor: pointer; } }

[data-theme="light"] #corner-chat,
[data-theme="light"] #corner-cta {
  border-color: rgba(34,211,238,.5);
  color: #22d3ee;
  background: rgba(30,42,72,.72);
  box-shadow: 0 6px 24px rgba(0,10,40,.30);
}
[data-theme="light"] #corner-chat:hover,
[data-theme="light"] #corner-cta:hover {
  background: rgba(34,211,238,.10);
  border-color: rgba(34,211,238,.72);
  box-shadow: 0 10px 30px rgba(34,211,238,.16);
}

#theme-toggle {
  position: fixed; top: 1.5rem; right: 0.75rem;
  z-index: 500;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  color: var(--text2);
  font-size: 17px;
  line-height: 1;
  cursor: none;
  border-radius: 3px;
  opacity: .72;
  transition: color .2s, opacity .2s, transform .2s;
}
#theme-toggle svg {
  width: 19px; height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#theme-toggle:hover { color: var(--green); opacity: 1; transform: scale(1.15); }
@media (pointer: coarse) { #theme-toggle { cursor: pointer; } }

/* ── UTILITY ── */
.mono { font-family: var(--mono); }
.aw   { color: var(--green); }
.blink-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  vertical-align: middle;
  animation: blink 1.2s step-end infinite;
}
.blink-dot.g { background: var(--green); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.section-tag {
  font-size: 11px;
  color: var(--green);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 3rem;
  opacity: .8;
}

/* ── REVEAL ANIMATION ── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: none; }
.sr.reveal   { transition-delay: calc(var(--i, 0) * .07s); }
.pi.reveal   { transition-delay: calc(var(--i, 0) * .1s); }

/* ═══════════════════════════════════════════
   HERO
════════════════════════════════════════════ */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 5rem 7rem 4rem;
  position: relative;
  z-index: 5;
}
@media (max-width: 1100px) { #hero { padding: 7rem 4rem 5rem; } }
@media (max-width: 900px)  { #hero { grid-template-columns: 1fr; padding: 6rem 2rem 3rem; gap: 3rem; } }

.hero-eyebrow {
  font-size: 11px;
  color: var(--green);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  opacity: .8;
}
.hero-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 1.0;
  letter-spacing: -.02em;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.hero-accent {
  color: var(--green);
  display: block;
  text-shadow: 0 0 40px rgba(0,255,136,.25);
}
.hero-body {
  font-size: 1rem;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 420px;
}
.hero-actions { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 3rem; }

/* Terminal button */
.btn-terminal {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--green);
  color: #000;
  border: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 3px;
  cursor: none;
  letter-spacing: .04em;
  transition: box-shadow .2s, transform .15s;
  text-decoration: none;
}
.btn-terminal:hover { box-shadow: 0 0 24px rgba(0,255,136,.45); transform: translateY(-2px); }
.btn-terminal.large { font-size: 14px; padding: 14px 28px; }
.btn-terminal.full  { width: 100%; justify-content: center; margin-top: .5rem; }
@media (pointer: coarse) { .btn-terminal { cursor: pointer; } }
.btn-prefix { font-size: 15px; opacity: .7; }

@keyframes ghost-nudge {
  0%,100% { transform: translateY(0); opacity: 1; }
  40%     { transform: translateY(4px); opacity: .7; }
  55%     { transform: translateY(0); opacity: 1; }
  70%     { transform: translateY(3px); opacity: .8; }
  80%     { transform: translateY(0); }
}
.btn-ghost {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text2);
  text-decoration: none;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--text3);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
  animation: ghost-nudge 4s ease-in-out infinite;
}
.btn-ghost:hover { color: var(--green); border-color: var(--green); animation: none; }

.btn-wa {
  display: inline-flex; align-items: center; gap: 8px;
  background: #1a1a1a;
  color: var(--text);
  border: 1px solid rgba(37,211,102,.3);
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px 22px;
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
}
.btn-wa:hover { background: rgba(37,211,102,.08); box-shadow: 0 0 16px rgba(37,211,102,.2); }
[data-theme="light"] .btn-wa {
  background: #252f50;
  color: #22d3ee;
  border-color: rgba(34,211,238,.42);
  box-shadow: 0 10px 30px rgba(0,10,40,.25);
}
[data-theme="light"] .btn-wa:hover {
  background: rgba(34,211,238,.10);
  box-shadow: 0 12px 34px rgba(34,211,238,.16);
}

/* Stats */
.hero-stats {
  display: flex; align-items: center; gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat-val {
  font-family: var(--display);
  font-size: 1.8rem;
  color: var(--text);
  line-height: 1;
}
.stat-val em { color: var(--green); font-style: normal; font-size: 1.1rem; }
.stat-key { font-size: 11px; color: var(--text3); letter-spacing: .06em; }
.stat-sep { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

/* ── WORKFLOW CARD ── */
.workflow-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,255,136,.05), inset 0 1px 0 rgba(255,255,255,.04);
}
[data-theme="light"] .workflow-card,
[data-theme="light"] .chat-terminal {
  background: #252f50;
  border-color: rgba(34,211,238,.20);
  box-shadow: 0 8px 32px rgba(0,10,40,.40), 0 2px 8px rgba(0,10,40,.20), inset 0 1px 0 rgba(255,255,255,.05);
}
.wf-header {
  display: flex; align-items: center; gap: 6px;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
[data-theme="light"] .wf-header {
  background: #1a2240;
  border-bottom-color: rgba(34,211,238,.15);
}
.wf-dot { width:10px;height:10px;border-radius:50%;flex-shrink:0; }
.wf-dot.r{background:#ff5f57}.wf-dot.y{background:#febc2e}.wf-dot.g{background:#28c840}
.wf-title { font-size: 11px; color: var(--text2); flex: 1; margin-left: 4px; }
.wf-status { font-size: 10px; color: var(--green); display: flex; align-items: center; gap: 4px; }
.wf-canvas-wrap { padding: 1.25rem; height: 175px; }
.wf-edge { stroke: rgba(0,255,136,0.55); stroke-width: 1.5; fill: none; }
[data-theme="light"] .wf-edge { stroke: rgba(34,211,238,0.65); }
#wf-svg { width:100%;height:100%;overflow:visible; }
.wf-log {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  max-height: 120px;
  overflow-y: auto;
  background: #000;
}
[data-theme="light"] .wf-log {
  background: #0e1428;
  border-top-color: rgba(34,211,238,.15);
  box-shadow: inset 0 4px 16px rgba(0,0,0,.30);
}
[data-theme="light"] .lts { color: #3a5070; }
.wf-log::-webkit-scrollbar { width: 3px; }
.wf-log::-webkit-scrollbar-thumb { background: var(--border2); }
.ll { font-size: 10px; color: rgba(0,255,136,.6); line-height: 1.7; }
[data-theme="light"] .ll { color: var(--green); }
.lts { color: var(--text3); margin-right: 6px; }

/* ═══════════════════════════════════════════
   SERVICES
════════════════════════════════════════════ */
#services {
  padding: 7rem 7rem 7rem 7rem;
  position: relative; z-index: 5;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}
@media (max-width: 1100px) { #services { padding: 6rem 4rem; } }
@media (max-width: 900px)  { #services { padding: 5rem 2rem; } }

.services-layout {
  display: grid; grid-template-columns: 1fr 2fr; gap: 6rem; align-items: start;
}
@media (max-width: 900px) { .services-layout { grid-template-columns: 1fr; gap: 3rem; } }

.stl {
  font-family: var(--display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin-bottom: 1.25rem;
}
.stc {
  font-family: var(--display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin-bottom: 4rem;
  text-align: center;
}
.services-sub, .demo-sub, .why-sub {
  font-size: .9rem;
  color: var(--text2);
  line-height: 1.7;
  max-width: 300px;
}

/* Service rows */
.sr {
  display: flex; align-items: flex-start; gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  cursor: default;
  transition: background .2s;
  position: relative;
}
.sr:first-child { border-top: 1px solid var(--border); }
.sr:hover { background: rgba(0,255,136,.03); }
.sr:hover .sr-arr { color: var(--green); transform: translateX(4px); }
.sr-num {
  font-size: 11px; color: var(--text3);
  padding-top: 4px; width: 24px; flex-shrink: 0;
}
.sr-body { flex: 1; }
.sr-title {
  font-family: var(--body);
  font-weight: 500;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: .4rem;
}
.sr-desc { font-size: .875rem; color: var(--text2); line-height: 1.6; margin-bottom: .6rem; }
.sr-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.sr-tags span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
  border: 1px solid rgba(0,255,136,.2);
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--green-dim);
}
[data-theme="light"] .sr-tags span { border-color: rgba(34,211,238,.2); }
.sr-arr { font-size: 14px; color: var(--text3); transition: color .2s, transform .2s; padding-top: 4px; flex-shrink: 0; }

/* ═══════════════════════════════════════════
   DEMO
════════════════════════════════════════════ */
#demo {
  padding: 7rem 7rem;
  position: relative; z-index: 5;
  border-top: 1px solid var(--border);
}
@media (max-width: 1100px) { #demo { padding: 6rem 4rem; } }
@media (max-width: 900px)  { #demo { padding: 5rem 2rem; } }

.demo-layout {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 6rem; align-items: start;
}
@media (max-width: 900px) { .demo-layout { grid-template-columns: 1fr; gap: 3rem; } }

.demo-note {
  margin-top: 2rem;
  font-size: 11px;
  color: var(--text2);
  display: flex; align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border2);
  border-radius: 3px;
  width: fit-content;
  background: var(--green-dim);
}

/* Chat terminal */
.chat-terminal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,255,136,.04);
}
.chat-messages {
  padding: 1rem;
  min-height: 280px;
  max-height: 340px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: .75rem;
}
[data-theme="light"] .chat-messages {
  background: #162040;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border2); }
.msg {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: .875rem; line-height: 1.6;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
.mp { color: var(--green); font-size: 11px; padding-top: 3px; flex-shrink: 0; white-space: nowrap; }
[data-theme="light"] .mp { color: #22d3ee; }
.mt { color: var(--text); }
[data-theme="light"] .mt { color: #c8d4f0; }
.msg.user .mp { color: var(--text2); }
[data-theme="light"] .msg.user .mp { color: #4a5a80; }
.msg.typing .mt { opacity: .5; }
.typing-dots span {
  display: inline-block;
  animation: tdot .9s infinite;
  font-size: 16px;
  line-height: 1;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes tdot { 0%,80%,100%{opacity:.2;transform:translateY(0)} 40%{opacity:1;transform:translateY(-3px)} }
.chat-input-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  background: #000;
}
[data-theme="light"] .chat-input-row {
  background: #0e1428;
  border-top-color: rgba(34,211,238,.15);
  box-shadow: inset 0 4px 16px rgba(0,0,0,.30);
}
.ip { color: var(--green); font-size: 13px; }
[data-theme="light"] .ip { color: #22d3ee; }
.chat-input {
  flex: 1; background: none; border: none;
  color: var(--text); font-size: 13px;
  outline: none;
}
[data-theme="light"] .chat-input { color: #c8d4f0; }
[data-theme="light"] .chat-input::placeholder { color: #3a4e70; }
.chat-input::placeholder { color: var(--text3); }
.chat-send {
  background: none; border: 1px solid var(--border);
  color: var(--text2); font-family: var(--mono);
  font-size: 13px; padding: 4px 10px;
  cursor: pointer; border-radius: 3px;
  transition: border-color .2s, color .2s;
}
.chat-send:hover { border-color: var(--green); color: var(--green); }
[data-theme="light"] .chat-send { border-color: rgba(34,211,238,.2); color: #4a5a80; }
[data-theme="light"] .chat-send:hover { border-color: #22d3ee; color: #22d3ee; }

/* ═══════════════════════════════════════════
   PROCESS
════════════════════════════════════════════ */
#process {
  padding: 7rem 7rem;
  position: relative; z-index: 5;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}
@media (max-width: 1100px) { #process { padding: 6rem 4rem; } }
@media (max-width: 900px)  { #process { padding: 5rem 2rem; } }

.process-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}
@media (max-width: 900px) { .process-track { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 500px) { .process-track { grid-template-columns: 1fr; } }

.pi { position: relative; padding: 0 1.5rem 1.5rem; }
@media (max-width: 900px) { .pi { padding: 1.25rem; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r2); } }

/* Línea horizontal entre pasos */
.pi-line {
  position: absolute;
  top: 20px; left: calc(50% + 16px); right: -50%;
  height: 1px;
  background: linear-gradient(90deg, var(--green-mid), transparent);
}
.pi-line.last, .pi:last-child .pi-line { display: none; }
@media (max-width: 900px) { .pi-line { display: none; } }

.pi-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.5rem;
  position: relative; z-index: 1;
}
.pi-dot span { font-size: 10px; color: var(--green); }

.pi-icon {
  width: 40px; height: 40px;
  margin-bottom: 1rem;
}
.pi-icon svg {
  width: 24px; height: 24px;
  stroke: var(--green); fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.pi-title {
  font-family: var(--body); font-weight: 500;
  font-size: .95rem; margin-bottom: .5rem; color: var(--text);
}
.pi-desc { font-size: .82rem; color: var(--text2); line-height: 1.65; }

/* ═══════════════════════════════════════════
   WHY
════════════════════════════════════════════ */
#why {
  padding: 7rem 7rem;
  position: relative; z-index: 5;
  border-top: 1px solid var(--border);
}
@media (max-width: 1100px) { #why { padding: 6rem 4rem; } }
@media (max-width: 900px)  { #why { padding: 5rem 2rem; } }

.why-layout {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 6rem; align-items: start;
}
@media (max-width: 900px) { .why-layout { grid-template-columns: 1fr; gap: 3rem; } }

.stack-list { margin-top: 2rem; display: flex; flex-direction: column; gap: .5rem; }
.sl {
  font-size: 12px; color: var(--text2);
  display: flex; align-items: center; gap: 10px;
}
.sl-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
}

/* Compare table */
.ct {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
}
.ct-head {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.ct-head .ct-c { padding: .65rem 1rem; font-size: 10px; color: var(--text3); letter-spacing: .08em; text-transform: uppercase; }
.ct-row {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.ct-row:hover { background: rgba(255,255,255,.02); }
.ct-row:last-child { border-bottom: none; }
.ct-c { padding: .75rem 1rem; font-size: .8rem; color: var(--text2); }
.ct-c.bad { color: rgba(255,80,80,.7); font-family: var(--mono); font-size: .75rem; }
.ct-c.good { color: var(--green); font-family: var(--mono); font-size: .75rem; }

/* ═══════════════════════════════════════════
   CONTACT
════════════════════════════════════════════ */
#contact {
  padding: 8rem 7rem;
  position: relative; z-index: 5;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  text-align: center;
}
@media (max-width: 1100px) { #contact { padding: 7rem 4rem; } }
@media (max-width: 900px)  { #contact { padding: 5rem 2rem; } }

.contact-inner { max-width: 640px; margin: 0 auto; }
.contact-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 1.5rem 0 1rem;
}
.contact-sub { font-size: 1rem; color: var(--text2); line-height: 1.7; margin-bottom: 2.5rem; }
.contact-actions { display: flex; align-items: center; justify-content: center; gap: 1.25rem; flex-wrap: wrap; }
.contact-foot { font-size: 11px; color: var(--text3); margin-top: 3rem; letter-spacing: .06em; }

/* ═══════════════════════════════════════════
   MODAL
════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  padding: 2.5rem;
  width: 100%; max-width: 480px;
  max-height: calc(90vh - 3rem);
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform .25s;
  box-shadow: 0 0 80px rgba(0,255,136,.08);
}
.modal-overlay.open .modal { transform: none; }
.modal-close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  background: none; border: none;
  color: var(--text2); cursor: pointer; font-size: 16px;
  transition: color .2s;
}
.modal-close:hover { color: var(--green); }
.modal-tag { font-size: 10px; color: var(--green); letter-spacing: .12em; margin-bottom: 1rem; opacity: .8; }
.modal-title { font-family: var(--display); font-size: 1.8rem; margin-bottom: .4rem; }
.modal-sub { font-size: .875rem; color: var(--text2); margin-bottom: 2rem; }

/* Form */
.fg { margin-bottom: 1rem; }
.fg label { display: block; font-size: 11px; color: var(--green); margin-bottom: 5px; letter-spacing: .06em; }
.fg input, .fg textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  font-family: var(--body);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  resize: none;
}
.fg input:focus, .fg textarea:focus { border-color: var(--green); }
.fg input::placeholder, .fg textarea::placeholder { color: var(--text3); }
.fg textarea { height: 100px; }
.form-msg { margin-top: .75rem; font-size: 13px; padding: 10px 14px; border-radius: var(--r); display: none; }
.form-msg.success { display:block; color: var(--green); background: var(--green-dim); border: 1px solid rgba(0,255,136,.2); }
[data-theme="light"] .form-msg.success { border-color: rgba(34,211,238,.2); }
.form-msg.error   { display:block; color: #ff6b6b; background: rgba(255,80,80,.08); border: 1px solid rgba(255,80,80,.2); }

/* ═══════════════════════════════════════════
   MOBILE — breakpoints consolidados
   480px: teléfonos pequeños
   600px: teléfonos grandes / landscape
   768px: tablets portrait
   900px: tablets landscape (ya cubierto arriba)
════════════════════════════════════════════ */

/* ── 768px ── */
@media (max-width: 768px) {

  /* Header fijo */
  #corner-logo { left: 1rem; top: 1rem; }
  #corner-cta  { right: 1rem; top: 1rem; font-size: 11px; padding: 6px 12px; }
  #theme-toggle { display: flex; top: 1rem; right: 9rem; width: 28px; height: 28px; font-size: 15px; }
  .logo-text   { display: none; }

  /* Hero */
  #hero {
    grid-template-columns: 1fr;
    padding: 5.5rem 1.25rem 3rem;
    gap: 2.5rem;
    min-height: auto;
  }
  .hero-title { font-size: clamp(2.2rem, 9vw, 3rem); }
  .hero-body  { max-width: 100%; font-size: .95rem; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .btn-terminal { width: 100%; justify-content: center; }
  .hero-stats { gap: 1rem; flex-wrap: wrap; }
  .stat-val   { font-size: 1.4rem; }

  /* Workflow card */
  .workflow-card { margin: 0; }
  .wf-canvas-wrap { height: 140px; padding: 1rem; }
  .wf-log { max-height: 90px; }

  /* Sections padding */
  #services, #demo, #process, #why, #contact { padding: 4rem 1.25rem; }

  /* Services */
  .services-layout { grid-template-columns: 1fr; gap: 2rem; }
  .services-sub    { max-width: 100%; }
  .stl { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .stc { font-size: clamp(1.8rem, 7vw, 2.4rem); margin-bottom: 2.5rem; }

  /* Demo */
  .demo-layout { grid-template-columns: 1fr; gap: 2rem; }
  .demo-sub    { max-width: 100%; }
  .chat-messages { min-height: 220px; max-height: 260px; }

  /* Process */
  .process-track { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .pi { padding: 1rem; }

  /* Why */
  .why-layout  { grid-template-columns: 1fr; gap: 2.5rem; }
  .why-sub     { max-width: 100%; }
  .stack-list  { margin-top: 1.5rem; }

  /* Compare table — scroll horizontal */
  .ct { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ct-head, .ct-row { grid-template-columns: 1.2fr .9fr .9fr; min-width: 480px; }
  .ct-c { padding: .6rem .75rem; font-size: .75rem; }

  /* Contact */
  .contact-title  { font-size: clamp(2rem, 8vw, 3rem); }
  .contact-actions { flex-direction: column; align-items: center; gap: 1rem; }
  .btn-terminal.large { width: 100%; max-width: 320px; justify-content: center; }
  .btn-wa { justify-content: center; }
  .contact-foot { font-size: 10px; }

  /* Modal */
  .modal { padding: 1.75rem 1.25rem; }
  .modal-title { font-size: 1.5rem; }
}

/* ── 480px ── */
@media (max-width: 480px) {

  /* Header */
  #corner-cta { display: none; } /* en móvil chico ocultamos el corner CTA para no solapar */
  #theme-toggle { right: 1rem; } /* CTA oculto, toggle puede ir a la derecha */

  /* Hero */
  #hero { padding: 5rem 1rem 2.5rem; }
  .hero-title { font-size: clamp(2rem, 10vw, 2.6rem); }
  .hero-eyebrow { font-size: 10px; margin-bottom: 1.25rem; }
  .hero-stats { gap: .75rem; }
  .stat-val { font-size: 1.25rem; }
  .stat-key { font-size: 10px; }

  /* Section tags */
  .section-tag { font-size: 10px; margin-bottom: 2rem; }

  /* Services rows */
  .sr { flex-wrap: wrap; gap: 1rem; }
  .sr-arr { display: none; }

  /* Process — 1 columna */
  .process-track { grid-template-columns: 1fr; gap: 1rem; }

  /* Workflow log lines */
  .ll { font-size: 9px; }

  /* Compare table en scroll */
  .ct-head, .ct-row { min-width: 400px; }
  .ct-c { font-size: .7rem; padding: .5rem .6rem; }

  /* Chat */
  .chat-input { font-size: 12px; }
  .mp { font-size: 10px; }
  .mt { font-size: .82rem; }

  /* Sections */
  #services, #demo, #process, #why, #contact { padding: 3rem 1rem; }

  /* Contact */
  .btn-terminal.large { font-size: 13px; padding: 12px 20px; }

  /* Modal */
  .modal { padding: 1.5rem 1rem; border-radius: var(--r); }
  .modal-overlay { padding: 1rem; }
}

/* ── Landscape móvil ── */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  #hero { min-height: auto; padding-top: 5rem; }
  .workflow-card { display: none; } /* ocultar en landscape muy chico */
}

/* ── Scroll wrapper para tabla ── */
.ct-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r2);
}
.ct-wrap .ct { border-radius: 0; }

/* ── Cursor visible en footer links y elementos interactivos ── */
a, button, input, textarea, select, label,
.footer-copy a, #site-footer, #site-footer * {
  cursor: auto;
}
a:hover, button:hover { cursor: pointer; }
.modal-overlay, .modal, .modal * { cursor: auto; }
.modal button, .modal a { cursor: pointer; }

/* ── Footer ── */
#site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  position: relative; z-index: 5;
  background: var(--bg);
}
.footer-inner {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  flex-wrap: wrap;
  text-align: center;
  max-width: 100%;
}
.footer-brand {
  font-size: 14px; font-weight: 700;
  color: var(--text);
}
.footer-brand em { color: var(--green); font-style: normal; }
.footer-sep { color: var(--text3); font-size: 12px; }
.footer-copy { font-size: 11px; color: var(--text3); }
.footer-copy a {
  color: var(--green); text-decoration: none;
  border-bottom: 1px solid rgba(0,255,136,.3);
  padding-bottom: 1px;
  transition: border-color .2s;
}
.footer-copy a:hover { border-color: var(--green); }
@media (max-width: 768px) {
  #site-footer { padding: 1.5rem 1.25rem; }
  .footer-inner { gap: .6rem; }
}

/* ── Chat idle state ── */
.chat-messages:empty::after {
  content: 'Hacé foco acá para iniciar la conversación...';
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  padding: 2rem 1rem;
  text-align: center;
  animation: pulse-text 2s ease-in-out infinite;
}
@keyframes pulse-text {
  0%,100% { opacity: .4; }
  50%      { opacity: .8; }
}

/* ── Chat input cursor parpadeante ── */
.chat-input:focus { caret-color: var(--green); }
