/* ============================================
   PORTAFOLIO V2 — sistema de diseño
   Base, layout, navegación, componentes compartidos.
   ============================================ */
:root {
  --ink: #060a14;
  --ink-2: #080e1b;
  --surface: #0d1524;
  --surface-2: #111c30;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.3);
  --txt: #e9effb;
  --muted: #93a3b8;
  --cyan: #22d3ee;
  --mint: #34d399;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --grad: linear-gradient(115deg, #22d3ee 0%, #34d399 60%, #a3e635 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --max: 1160px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--txt);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 78% -8%, rgba(34, 211, 238, 0.13), transparent 60%),
    radial-gradient(700px 420px at 8% 4%, rgba(52, 211, 153, 0.08), transparent 60%);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.02em; font-weight: 650; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.3rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding: 0; list-style: none; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--cyan); color: #04121a; padding: 0.6rem 1rem; font-weight: 700;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}
.wrap.narrow { width: min(820px, calc(100% - 2.5rem)); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(6, 10, 20, 0.78);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  width: min(var(--max), calc(100% - 2.5rem));
  margin-inline: auto;
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 68px;
}
.brand { display: flex; align-items: center; gap: 0.7rem; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px;
  background: var(--grad);
  color: #04121a; font-weight: 800; font-size: 0.86rem; letter-spacing: -0.03em;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt strong { font-size: 0.98rem; letter-spacing: -0.01em; }
.brand-txt small { color: var(--muted); font-size: 0.72rem; }

.nav { display: flex; align-items: center; gap: 1.15rem; }
.nav a { font-size: 0.88rem; color: var(--muted); padding: 0.4rem 0; transition: color 0.18s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--txt); }
.nav a[aria-current="page"] { position: relative; }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--grad);
}
.nav-cta {
  color: #04121a !important;
  background: var(--grad);
  padding: 0.5rem 0.95rem !important;
  border-radius: 999px;
  font-weight: 700;
}
.menu-btn {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: 1px solid var(--line); border-radius: 9px;
  padding: 0.55rem 0.5rem; cursor: pointer;
}
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--txt); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.72rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 650; font-size: 0.93rem; font-family: inherit;
  cursor: pointer; transition: transform 0.16s, filter 0.16s, background 0.16s, border-color 0.16s;
  white-space: nowrap;
}
.btn .ico { width: 17px; height: 17px; flex: 0 0 17px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #04121a; font-weight: 750; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line-strong); color: var(--txt); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { border-color: var(--cyan); }
.btn-soft { background: var(--surface-2); border-color: var(--line); color: var(--txt); }
.btn-soft:hover { border-color: var(--line-strong); }
.btn-lg { padding: 0.9rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.2rem 0 0.8rem; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--cyan); font-size: 0.88rem; font-weight: 600;
}
.link-arrow .ico { width: 15px; height: 15px; transition: transform 0.18s; }
.link-arrow:hover .ico { transform: translateX(3px); }
.ico { width: 18px; height: 18px; }

/* ---------- secciones ---------- */
.sec { padding: 4.5rem 0; position: relative; z-index: 1; }
.sec-alt { background: var(--ink-2); border-block: 1px solid var(--line); }
.sec-head { margin-bottom: 2.6rem; max-width: 760px; }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head h2 { margin-bottom: 0.6rem; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.73rem;
  font-weight: 700; color: var(--cyan); margin: 0 0 0.7rem;
}
.lead { color: var(--muted); font-size: 1.06rem; }
.note {
  color: var(--muted); font-size: 0.9rem;
  border-left: 2px solid var(--line-strong); padding-left: 0.9rem; margin-top: 1.6rem;
}
.note .ico { width: 15px; height: 15px; vertical-align: -2px; color: var(--cyan); }

.grid { display: grid; gap: 1.1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(13, 21, 36, 0.7) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}
.card h3 { margin-bottom: 0.55rem; }
.card p:last-child { margin-bottom: 0; }
.card:hover { border-color: var(--line-strong); }
.card-ico {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(34, 211, 238, 0.1); color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.22);
  margin-bottom: 1rem;
}
.card-ico .ico { width: 21px; height: 21px; }
.service { display: flex; flex-direction: column; }
.service .who { color: var(--muted); font-size: 0.83rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.7rem; }
.service .outcome {
  margin-top: auto; padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
  font-size: 0.88rem; color: var(--txt);
}
.service .outcome .ico { width: 15px; height: 15px; color: var(--mint); vertical-align: -2px; }
.service .link-arrow { margin-top: 0.9rem; }

/* listas */
.checks li { position: relative; padding-left: 1.6rem; margin-bottom: 0.55rem; color: #cbd6e6; }
.checks .ico { position: absolute; left: 0; top: 4px; width: 15px; height: 15px; color: var(--mint); }
.plain li { margin-bottom: 0.5rem; color: var(--muted); }
.tight li { margin-bottom: 0.3rem; }
.pain li { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.9rem; color: #c9d4e4; }
.pain .ico { width: 18px; height: 18px; flex: 0 0 18px; color: var(--amber); margin-top: 3px; }
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 2.5rem; align-items: start; }
.split h2 { margin-top: 0.2rem; }
.stack-col { display: flex; flex-direction: column; gap: 1rem; }
.card-warn { border-color: rgba(251, 191, 36, 0.28); background: rgba(251, 191, 36, 0.05); }
.card-soft { background: rgba(34, 211, 238, 0.05); border-color: rgba(34, 211, 238, 0.2); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--ink-2); padding: 3rem 0 1.5rem; position: relative; z-index: 1; }
.foot-inner {
  width: min(var(--max), calc(100% - 2.5rem)); margin-inline: auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem;
}
.foot-brand { display: flex; gap: 0.8rem; }
.foot-brand p { margin: 0.2rem 0 0; font-size: 0.86rem; color: var(--muted); }
.foot-col h4 { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--muted); margin-bottom: 0.9rem; }
.foot-col a { display: flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; color: #cbd6e6; margin-bottom: 0.55rem; }
.foot-col a:hover { color: var(--cyan); }
.foot-col .ico { width: 15px; height: 15px; }
.foot-base {
  width: min(var(--max), calc(100% - 2.5rem)); margin: 2.2rem auto 0;
  border-top: 1px solid var(--line); padding-top: 1.2rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--muted);
}
.foot-links a:hover { color: var(--cyan); }

/* ---------- band CTA ---------- */
.band { padding: 4.2rem 0; background: linear-gradient(120deg, rgba(34, 211, 238, 0.1), rgba(52, 211, 153, 0.06) 55%, transparent); border-block: 1px solid var(--line); position: relative; z-index: 1; }
.band-inner { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2rem; align-items: center; }
.band h2 { max-width: 24ch; }
.band p { color: var(--muted); margin-bottom: 0; }
.band-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: flex-end; }
.band-cta small { width: 100%; text-align: right; color: var(--muted); font-size: 0.8rem; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; gap: 1.8rem; }
  .band-inner { grid-template-columns: 1fr; }
  .band-cta { justify-content: flex-start; }
  .band-cta small { text-align: left; }
  .foot-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .sec { padding: 3.2rem 0; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .menu-btn { display: flex; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink-2); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.7rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav-cta { margin-top: 0.7rem; text-align: center; }
  .brand-txt small { display: none; }
  .foot-inner { grid-template-columns: 1fr; }
  .cta-row .btn { flex: 1 1 100%; }
}
