*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:      #060b14;
  --surface: #0d1525;
  --card:    #111e33;
  --border:  #1e3050;
  --accent:  #38bdf8;
  --accent2: #818cf8;
  --green:   #4ade80;
  --yellow:  #fbbf24;
  --pink:    #f472b6;
  --orange:  #fb923c;
  --text:    #e2e8f0;
  --muted:   #64748b;
  --r:       12px;
}
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }

/* ── MATRIX CANVAS ── */
#matrix-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: .07;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; width: 100%; z-index: 200;
  background: rgba(6,11,20,.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 5%; display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.25rem; font-weight: 800; text-decoration: none;
  font-family: 'Courier New', monospace;
  color: var(--accent);
}
.logo .blink { animation: blink 1s step-end infinite; color: var(--green); }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .88rem; transition: color .2s; }
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  padding: .4rem 1.1rem; border-radius: 6px; font-size: .88rem;
  text-decoration: none; font-weight: 600; font-family: 'Courier New', monospace;
  transition: background .2s, color .2s;
}
.nav-cta:hover { background: var(--accent); color: var(--bg); }

/* ── HERO ── */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding: 80px 5% 60px; position: relative; z-index: 1;
  gap: 4rem;
}
.hero-left { flex: 1; min-width: 300px; }
.hero-right { flex: 1; min-width: 300px; }

.badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(56,189,248,.08); border: 1px solid rgba(56,189,248,.25);
  color: var(--accent); font-size: .75rem; font-weight: 700;
  padding: .3rem .8rem; border-radius: 99px; margin-bottom: 1.5rem;
  letter-spacing: .08em; text-transform: uppercase; font-family: 'Courier New', monospace;
}
.badge::before { content: '●'; color: var(--green); animation: blink 1.5s ease infinite; }

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.5rem); font-weight: 800; line-height: 1.15;
  margin-bottom: 1.2rem;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent2), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200%; animation: gradShift 4s ease infinite alternate;
}
@keyframes gradShift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

.hero-desc { font-size: 1rem; color: var(--muted); max-width: 480px; margin-bottom: 2.5rem; }
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--bg); padding: .7rem 1.6rem; border-radius: 8px;
  text-decoration: none; font-weight: 800; font-size: .93rem;
  transition: opacity .2s, transform .15s; box-shadow: 0 0 24px rgba(56,189,248,.3);
}
.btn-primary:hover { opacity: .9; transform: translateY(-2px); box-shadow: 0 0 36px rgba(56,189,248,.5); }
.btn-outline {
  border: 1px solid var(--border); color: var(--text);
  padding: .7rem 1.6rem; border-radius: 8px;
  text-decoration: none; font-weight: 600; font-size: .93rem;
  transition: border-color .2s, background .2s;
}
.btn-outline:hover { border-color: var(--accent); background: rgba(56,189,248,.06); }

/* ── CODE EDITOR WIDGET ── */
.editor-window {
  background: #0d1117; border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(56,189,248,.08);
  position: relative;
}
.editor-topbar {
  background: #161b22; padding: .7rem 1rem;
  display: flex; align-items: center; gap: .5rem;
  border-bottom: 1px solid #21262d;
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.editor-tabs { display: flex; gap: 0; margin-left: 1rem; }
.editor-tab {
  font-family: 'Courier New', monospace; font-size: .72rem;
  padding: .2rem .8rem; border-radius: 4px 4px 0 0;
  cursor: pointer; color: var(--muted);
  border: 1px solid transparent; border-bottom: none;
  transition: color .2s, background .2s;
}
.editor-tab.active { color: var(--accent); background: #0d1117; border-color: var(--border); }

.editor-body {
  display: flex; font-family: 'Courier New', monospace; font-size: .82rem;
  min-height: 340px; position: relative;
}
.line-numbers {
  padding: 1rem .8rem; color: #3d4f66; text-align: right;
  border-right: 1px solid #21262d; user-select: none;
  min-width: 3rem; line-height: 1.7; white-space: pre;
}
.code-area {
  padding: 1rem 1.2rem; flex: 1; line-height: 1.7;
  white-space: pre; overflow: hidden;
}
.code-line { display: block; min-height: 1.4em; }

/* syntax highlight */
.kw   { color: #ff7b72; }
.fn   { color: #d2a8ff; }
.str  { color: #a5d6ff; }
.num  { color: #79c0ff; }
.cm   { color: #8b949e; font-style: italic; }
.cls  { color: #ffa657; }
.var  { color: #e2e8f0; }
.sym  { color: #f0883e; }
.prop { color: #79c0ff; }
.bool { color: #ff7b72; }
.dec  { color: #4ade80; }
.cursor-blink {
  display: inline-block; width: 2px; height: 1em;
  background: var(--accent); animation: blink .8s step-end infinite;
  vertical-align: text-bottom;
}

/* ── FLOATING SNIPPETS ── */
.floating-snippets { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.snippet {
  position: absolute; font-family: 'Courier New', monospace; font-size: .68rem;
  color: rgba(56,189,248,.15); white-space: nowrap;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0%   { transform: translateY(100vh) rotate(-5deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-10vh) rotate(5deg); opacity: 0; }
}

/* ── STATS ── */
.stats {
  position: relative; z-index: 1;
  background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 2.5rem 5%; display: flex; justify-content: center; gap: 4rem; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
  font-size: 2.4rem; font-weight: 800;
  font-family: 'Courier New', monospace; color: var(--accent);
}
.stat-label { font-size: .82rem; color: var(--muted); margin-top: .2rem; }

/* ── SECTIONS ── */
section { padding: 90px 5%; position: relative; z-index: 1; }
.section-title { text-align: center; margin-bottom: 3.5rem; }
.section-title .eyebrow {
  font-size: .75rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .6rem;
  font-family: 'Courier New', monospace;
}
.section-title h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 800; }
.section-title p { color: var(--muted); max-width: 500px; margin: .8rem auto 0; font-size: .95rem; }

/* ── SERVICES ── */
#servicios { background: var(--bg); }
.services-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem; max-width: 1100px; margin: 0 auto;
}
.service-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.8rem;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  position: relative; overflow: hidden;
}
.service-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(135deg, rgba(56,189,248,.05), rgba(129,140,248,.05));
  transition: opacity .25s;
}
.service-card:hover { transform: translateY(-5px); border-color: rgba(56,189,248,.4); box-shadow: 0 12px 40px rgba(56,189,248,.1); }
.service-card:hover::before { opacity: 1; }
.card-terminal {
  background: #060b14; border: 1px solid var(--border); border-radius: 8px;
  padding: .6rem .8rem; margin-bottom: 1.2rem;
  font-family: 'Courier New', monospace; font-size: .72rem; line-height: 1.5;
}
.ct-prompt { color: var(--green); }
.ct-cmd    { color: var(--accent); }
.ct-out    { color: var(--muted); }
.service-card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: .5rem; }
.service-card p  { color: var(--muted); font-size: .88rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .9rem; }
.tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  background: rgba(56,189,248,.08); color: var(--accent);
  border: 1px solid rgba(56,189,248,.18);
  padding: .18rem .55rem; border-radius: 4px;
  font-family: 'Courier New', monospace;
}

/* ── PROCESS ── */
#proceso { background: var(--surface); }
.process-steps { display: flex; max-width: 900px; margin: 0 auto; position: relative; }
.process-steps::before {
  content: ''; position: absolute; top: 26px; left: 26px; right: 26px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--pink)); z-index: 0;
}
.step { flex: 1; text-align: center; position: relative; padding: 0 .8rem; }
.step-num {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--bg); font-weight: 900; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; z-index: 1; position: relative;
  font-family: 'Courier New', monospace;
  box-shadow: 0 0 20px rgba(56,189,248,.5);
  animation: pulseShadow 2.5s ease-in-out infinite;
}
.step:nth-child(2) .step-num { animation-delay: .6s; }
.step:nth-child(3) .step-num { animation-delay: 1.2s; }
.step:nth-child(4) .step-num { animation-delay: 1.8s; }
@keyframes pulseShadow {
  0%,100% { box-shadow: 0 0 16px rgba(56,189,248,.4); }
  50%      { box-shadow: 0 0 32px rgba(56,189,248,.8); }
}
.step h3 { font-size: .95rem; font-weight: 700; margin-bottom: .35rem; }
.step p   { font-size: .8rem; color: var(--muted); }

/* ── LIVE TERMINAL ── */
#terminal-demo { background: var(--bg); padding: 80px 5%; }
.terminal-outer {
  max-width: 780px; margin: 0 auto;
  background: #0d1117; border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 60px rgba(56,189,248,.08);
}
.terminal-bar {
  background: #161b22; padding: .65rem 1rem;
  display: flex; align-items: center; gap: .4rem;
  border-bottom: 1px solid #21262d;
}
.terminal-title { margin-left: .6rem; font-family: 'Courier New', monospace; font-size: .78rem; color: var(--muted); }
.terminal-body { padding: 1.2rem 1.5rem; font-family: 'Courier New', monospace; font-size: .82rem; line-height: 1.8; min-height: 260px; }
.t-prompt { color: var(--green); }
.t-path   { color: var(--accent2); }
.t-cmd    { color: var(--text); }
.t-out    { color: var(--muted); display: block; }
.t-ok     { color: var(--green); }
.t-err    { color: #f87171; }
.t-warn   { color: var(--yellow); }
.t-hl     { color: var(--accent); }
.t-line   { display: flex; align-items: baseline; gap: .4rem; }

/* ── CASOS DE ÉXITO ── */
#casos { background: var(--surface); }
.casos-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem; max-width: 1100px; margin: 0 auto;
}
.caso-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.caso-card:hover { transform: translateY(-5px); border-color: rgba(56,189,248,.35); box-shadow: 0 14px 40px rgba(56,189,248,.1); }
.caso-header {
  padding: 1.4rem 1.6rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.caso-type {
  font-family: 'Courier New', monospace; font-size: .7rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .22rem .65rem; border-radius: 4px;
  white-space: nowrap; margin-top: .1rem;
}
.caso-type.web    { background: rgba(56,189,248,.12);  color: var(--accent);  border: 1px solid rgba(56,189,248,.2); }
.caso-type.devops { background: rgba(129,140,248,.12); color: var(--accent2); border: 1px solid rgba(129,140,248,.2); }
.caso-type.ai     { background: rgba(244,114,182,.12); color: var(--pink);    border: 1px solid rgba(244,114,182,.2); }
.caso-header h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.caso-body { padding: 1.2rem 1.6rem; }
.caso-client {
  font-family: 'Courier New', monospace; font-size: .75rem; color: var(--muted);
  margin-bottom: .8rem;
}
.caso-client span { color: var(--accent); }
.caso-body p { font-size: .88rem; color: var(--muted); margin-bottom: 1.1rem; line-height: 1.6; }
.caso-metrics {
  display: flex; gap: 1.2rem; flex-wrap: wrap;
  padding-top: 1rem; border-top: 1px solid var(--border);
}
.metric { text-align: center; }
.metric-val { font-family: 'Courier New', monospace; font-size: 1.4rem; font-weight: 800; }
.metric-val.c-accent  { color: var(--accent); }
.metric-val.c-accent2 { color: var(--accent2); }
.metric-val.c-pink    { color: var(--pink); }
.metric-val.c-green   { color: var(--green); }
.metric-label { font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.caso-stack { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; }

/* ── TECH STACK ── */
#tecnologias { background: var(--bg); }
.tech-grid { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; max-width: 900px; margin: 0 auto; }
.tech-pill {
  background: var(--card); border: 1px solid var(--border);
  padding: .55rem 1.2rem; border-radius: 8px;
  font-size: .83rem; font-weight: 600;
  display: flex; align-items: center; gap: .4rem;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  font-family: 'Courier New', monospace; cursor: default;
}
.tech-pill:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 18px rgba(56,189,248,.15); }

/* ── CONTACT ── */
#contacto { background: var(--bg); }
.contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; max-width: 1000px; margin: 0 auto; align-items: start; }
.contact-info h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 1rem; }
.contact-info p  { color: var(--muted); margin-bottom: 1.5rem; font-size: .93rem; }
.contact-item { display: flex; align-items: center; gap: .7rem; margin-bottom: .85rem; color: var(--muted); font-size: .9rem; font-family: 'Courier New', monospace; }
.contact-item .ci-label { color: var(--accent); margin-right: .3rem; }
form { display: flex; flex-direction: column; gap: .9rem; }
form input, form textarea, form select {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: .7rem 1rem;
  color: var(--text); font-size: .9rem; font-family: 'Courier New', monospace;
  transition: border-color .2s, box-shadow .2s; outline: none;
}
form input:focus, form textarea:focus, form select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,.1);
}
form input::placeholder, form textarea::placeholder { color: var(--muted); }
form select option { background: var(--card); }
form textarea { resize: vertical; min-height: 120px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.submit-btn {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 8px;
  padding: .8rem; font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: background .2s, color .2s, box-shadow .2s;
  font-family: 'Courier New', monospace; letter-spacing: .04em;
}
.submit-btn:hover { background: var(--accent); color: var(--bg); box-shadow: 0 0 24px rgba(56,189,248,.4); }

/* ── FOOTER ── */
footer {
  position: relative; z-index: 1;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 2rem 5%; text-align: center;
  color: var(--muted); font-size: .82rem; font-family: 'Courier New', monospace;
}
footer strong { color: var(--accent); }

/* ── BACK TO TOP ── */
#back-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 500;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--accent); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s, border-color .2s, box-shadow .2s;
  font-family: 'Courier New', monospace; font-weight: 700;
}
#back-top.visible { opacity: 1; pointer-events: all; }
#back-top:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 6px 20px rgba(56,189,248,.25); }

/* ── SCROLL REVEAL ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero { flex-direction: column; padding-top: 100px; }
  .hero-right { width: 100%; }
  .contact-wrapper { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .process-steps { flex-direction: column; gap: 1.8rem; }
  .process-steps::before { display: none; }
  .nav-links { display: none; }
  .stats { gap: 2rem; }
}
