/* =========================================================
   PORTAL ECO — Design System
   Tema: tecnología de última generación / futurista
   ========================================================= */

:root {
  /* Paleta base */
  --bg-0: #05060f;
  --bg-1: #0a0c1c;
  --bg-2: #10132a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* Texto */
  --text: #eaf0ff;
  --text-dim: #a6b0d6;
  --text-mute: #6b76a8;

  /* Acentos neón */
  --cyan: #00e5ff;
  --purple: #8b5cf6;
  --magenta: #ff2d95;
  --green: #00ffa3;
  --amber: #ffb020;
  --blue: #3b82f6;

  /* Gradientes */
  --grad-primary: linear-gradient(120deg, #00e5ff 0%, #8b5cf6 50%, #ff2d95 100%);
  --grad-cyan: linear-gradient(120deg, #00e5ff, #3b82f6);
  --grad-purple: linear-gradient(120deg, #8b5cf6, #ff2d95);
  --grad-green: linear-gradient(120deg, #00ffa3, #00e5ff);
  --grad-ar: linear-gradient(120deg, #00ffa3, #00e5ff, #8b5cf6);

  /* Sombras / glow */
  --glow-cyan: 0 0 40px rgba(0, 229, 255, 0.35);
  --glow-purple: 0 0 40px rgba(139, 92, 246, 0.35);
  --glow-magenta: 0 0 40px rgba(255, 45, 149, 0.35);

  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1200px;

  --font: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
canvas { display: block; }

/* ---------- Fondo global animado ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(0, 229, 255, 0.12), transparent 60%),
    radial-gradient(55% 45% at 85% 15%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(60% 60% at 50% 100%, rgba(255, 45, 149, 0.10), transparent 60%),
    var(--bg-0);
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, #000 40%, transparent 100%);
  animation: gridpan 40s linear infinite;
}
@keyframes gridpan {
  from { background-position: 0 0; }
  to { background-position: 46px 46px; }
}

/* ---------- Layout helpers ---------- */
.container { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }
.section { padding: 110px 0; position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 64px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--cyan);
  padding: 7px 16px; border: 1px solid var(--border-strong); border-radius: 100px;
  background: var(--surface); margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: var(--glow-cyan); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

h1, h2, h3 { line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.h-xl { font-size: clamp(2rem, 4.4vw, 3.5rem); }
.h-lg { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.h-md { font-size: clamp(1.3rem, 2vw, 1.7rem); }

.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.lead { color: var(--text-dim); font-size: clamp(1rem, 1.4vw, 1.2rem); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 100px; font-weight: 600; font-size: 0.98rem;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
  position: relative; overflow: hidden;
}
.btn-primary { background: var(--grad-primary); color: #06070f; box-shadow: var(--glow-purple); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 55px rgba(139, 92, 246, 0.6); }
.btn-ghost { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-3px); }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 6, 15, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.15rem; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad-primary);
  display: grid; place-items: center; color: #06070f; font-weight: 800;
  box-shadow: var(--glow-cyan);
}
.brand .logo-img { height: 30px; width: auto; display: block; border-radius: 6px; }
.brand small { display: block; font-family: var(--mono); font-size: 0.56rem; color: var(--text-mute); letter-spacing: 0.04em; font-weight: 400; max-width: 340px; line-height: 1.35; margin-top: 3px; }
.footer .brand small { max-width: 320px; }
@media (max-width: 760px) { .nav .brand small { display: none; } }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { font-size: 0.94rem; color: var(--text-dim); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { padding: 10px 20px; font-size: 0.9rem; }
.nav-toggle { display: none; font-size: 1.6rem; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding-top: 90px; }
#hero-canvas { position: absolute; inset: 0; z-index: 0; opacity: 0.9; }
.hero-inner { position: relative; z-index: 2; max-width: 900px; }
.hero h1 { margin: 22px 0; }
.hero .lead { max-width: 640px; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 60px; flex-wrap: wrap; }
.stat .num { font-size: 2.4rem; font-weight: 700; font-family: var(--mono); }
.stat .label { color: var(--text-mute); font-size: 0.85rem; }
.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--text-mute); font-size: 0.8rem; z-index: 2; display: flex; flex-direction: column;
  align-items: center; gap: 8px; animation: floaty 2.4s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,10px); } }

/* ---------- Systems grid ---------- */
.systems-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 26px; }
.card {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden; transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-8px); border-color: var(--border-strong); box-shadow: 0 30px 60px rgba(0,0,0,0.5); }
.card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.35s;
  background: radial-gradient(400px circle at var(--mx,50%) var(--my,0%), rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card-visual { height: 210px; position: relative; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--bg-1); }
.card-body { padding: 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-tag {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cyan); display: inline-flex; align-items: center; gap: 8px;
}
.card h3 { font-size: 1.35rem; }
.card p { color: var(--text-dim); font-size: 0.95rem; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.card-link { color: var(--text); font-weight: 600; font-size: 0.92rem; display: inline-flex; gap: 8px; align-items: center; transition: gap 0.2s, color 0.2s; }
.card:hover .card-link { gap: 14px; color: var(--cyan); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 0.72rem; padding: 4px 11px; border-radius: 100px; border: 1px solid var(--border); color: var(--text-mute); background: var(--bg-2); }

/* badge realidad aumentada */
.ar-badge {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  padding: 5px 12px; border-radius: 100px; color: #04120c; font-weight: 700;
  background: var(--grad-green); box-shadow: 0 0 22px rgba(0,255,163,0.5);
}

/* ---------- Reveal on scroll (solo si hay JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
.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; }

/* ---------- AR feature band ---------- */
.ar-band { background: linear-gradient(180deg, transparent, rgba(0,255,163,0.04), transparent); }
.ar-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.ar-split.rev { grid-template-columns: 1fr 1.1fr; }
.ar-visual { position: relative; height: 380px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-strong); background: #04060e; }
.ar-text h2 { margin-bottom: 18px; }
.ar-text ul { display: grid; gap: 14px; margin-top: 24px; }
.ar-text li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-dim); }
.ar-text li::before { content: "▸"; color: var(--green); margin-top: 2px; }

/* ---------- Blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px; }
.post {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); transition: transform 0.3s, border-color 0.3s;
  display: flex; flex-direction: column;
}
.post:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.post-cover { height: 180px; position: relative; overflow: hidden; }
.post-cover .grad { position: absolute; inset: 0; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; object-position: left top; display: block; }
.post-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post .meta { font-family: var(--mono); font-size: 0.74rem; color: var(--text-mute); }
.post h3 { font-size: 1.2rem; }
.post p { color: var(--text-dim); font-size: 0.92rem; }
.post .card-link { margin-top: auto; padding-top: 10px; }

/* ---------- CTA / contacto ---------- */
.cta {
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 64px 40px; text-align: center; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(0,229,255,0.08));
}
.cta h2 { margin-bottom: 16px; }
.cta .lead { max-width: 560px; margin: 0 auto 32px; }
.cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-mute); margin-bottom: 16px; }
.footer a { color: var(--text-dim); font-size: 0.92rem; display: block; margin-bottom: 10px; transition: color 0.2s; }
.footer a:hover { color: var(--cyan); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-mute); font-size: 0.85rem; flex-wrap: wrap; gap: 12px; }

/* ---------- Detail pages ---------- */
.detail-hero { padding: 150px 0 60px; position: relative; }
.back-link { color: var(--text-dim); font-size: 0.9rem; display: inline-flex; gap: 8px; margin-bottom: 24px; }
.back-link:hover { color: var(--cyan); }
.detail-hero h1 { margin: 16px 0; }
.detail-stage {
  height: min(64vh, 560px); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  overflow: hidden; position: relative; background: #04060e; margin: 40px 0;
}
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.feature {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; background: var(--surface);
  transition: transform 0.3s, border-color 0.3s;
}
.feature:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px; background: var(--surface-strong); }
.feature h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature p { color: var(--text-dim); font-size: 0.9rem; }

/* ---------- Article ---------- */
.article { max-width: 760px; margin: 0 auto; }
.article-body { font-size: 1.08rem; color: var(--text-dim); }
.article-body h2 { color: var(--text); margin: 40px 0 16px; font-size: 1.6rem; }
.article-body h3 { color: var(--text); margin: 28px 0 12px; font-size: 1.25rem; }
.article-body p { margin-bottom: 20px; }
.article-body ul { list-style: disc; padding-left: 22px; margin-bottom: 20px; display: grid; gap: 8px; }
.article-body a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  border-left: 3px solid var(--purple); padding: 8px 20px; margin: 24px 0;
  background: var(--surface); border-radius: 8px; color: var(--text); font-style: italic;
}
.figure { margin: 32px 0; }
.figure .media {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-strong);
  position: relative; aspect-ratio: 16/9; background: var(--bg-1);
}
.figure figcaption { text-align: center; color: var(--text-mute); font-size: 0.85rem; margin-top: 10px; }
.figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border-strong); }
.figure.cover img { aspect-ratio: auto; }
.embed-note {
  border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 20px;
  color: var(--text-mute); font-family: var(--mono); font-size: 0.82rem; background: var(--surface); margin: 24px 0;
}

/* ---------- Utilidades ---------- */
.center { text-align: center; }
.mt-40 { margin-top: 40px; }
.tag-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .ar-split, .ar-split.rev { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
}
