/* ============ TOKENS ============ */
:root {
  --navy-900: #050d1f;
  --navy-800: #0a1733;
  --navy-700: #0e2148;
  --navy-600: #142b5e;
  --navy-500: #1d3d7c;
  --navy-400: #2b5599;

  --cyan-300: #7fd6ff;
  --cyan-400: #4cc1f5;
  --cyan-500: #2da5e0;
  --cyan-600: #1a7fb8;

  --ice: #cfe6ff;
  --ice-dim: #8fb0d6;

  --amber: #ffb454;
  --green: #5cd6a8;
  --rose: #ff6b8a;
  --violet: #b18bff;

  --txt: #e6f1ff;
  --txt-dim: #9bb5d4;
  --txt-mute: #5d7aa1;

  --rule: rgba(127,214,255,0.14);
  --rule-strong: rgba(127,214,255,0.28);

  --shadow-glow: 0 0 40px rgba(76,193,245,0.18);

  --font-sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--navy-900);
  color: var(--txt);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--cyan-400); color: var(--navy-900); }
img, svg { max-width: 100%; }
a { color: inherit; }

/* ============ STARFIELD BG ============ */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(45,165,224,0.18), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(26,127,184,0.12), transparent 60%),
    var(--navy-900);
}
.starfield canvas { width: 100%; height: 100%; display: block; }

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan-400), var(--cyan-300));
  z-index: 200;
  box-shadow: 0 0 8px var(--cyan-400);
}

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(14,33,72,0.92), rgba(14,33,72,0.78));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
  transition: border-color .3s, background .3s;
}
.site-header.scrolled {
  background: linear-gradient(180deg, rgba(14,33,72,0.96), rgba(14,33,72,0.92));
  border-bottom-color: var(--rule-strong);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--txt);
  flex-shrink: 0;
}
.brand-logo { height: 75px; width: auto; flex-shrink: 0; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.brand-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.6px;
  color: var(--ice-dim);
  text-transform: uppercase;
  border-left: 1px solid var(--rule-strong);
  padding-left: 14px;
  line-height: 1.3;
  max-width: 180px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  color: var(--txt);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.nav a:hover { background: rgba(127,214,255,0.08); }
.nav a.active {
  background: rgba(127,214,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(127,214,255,0.2);
}

.cta-demo {
  background: linear-gradient(135deg, rgba(76,193,245,0.22), rgba(45,165,224,0.18));
  color: var(--txt);
  border: 1px solid rgba(127,214,255,0.35);
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .25s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  white-space: nowrap;
}
.cta-demo:hover {
  background: linear-gradient(135deg, rgba(76,193,245,0.4), rgba(45,165,224,0.32));
  border-color: var(--cyan-300);
  box-shadow: 0 0 24px rgba(76,193,245,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}

.lang-divider {
  width: 1px; height: 22px;
  background: var(--rule-strong);
  margin: 0 6px;
}
.lang {
  color: var(--txt-dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.lang:hover { color: var(--txt); }

.mobile-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--txt);
}
.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--txt);
  margin: 4px 0;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

/* ============ LAYOUT ============ */
main { position: relative; z-index: 1; }
section {
  padding: 120px 40px;
  position: relative;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan-300);
  margin-bottom: 24px;
}
.eyebrow::before {
  content: "";
  width: 32px; height: 1px;
  background: var(--cyan-400);
}

h1, h2, h3, h4, h5 { font-family: var(--font-sans); font-weight: 500; margin: 0; line-height: 1.1; }
h1 { font-size: clamp(48px, 6vw, 84px); letter-spacing: -1.5px; }
h2 { font-size: clamp(36px, 4.2vw, 56px); letter-spacing: -1px; line-height: 1.05; }
h3 { font-size: 22px; letter-spacing: -0.3px; line-height: 1.2; }
h4 { font-size: 17px; }
h5 { font-size: 14px; }
p { margin: 0; }

.section-head {
  max-width: 720px;
  margin-bottom: 80px;
}
.section-head p {
  color: var(--txt-dim);
  font-size: 18px;
  margin-top: 20px;
  line-height: 1.6;
}
.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-head.center .eyebrow { justify-content: center; }

/* ============ ANIMATION UTILITIES ============ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .40s; }
.reveal[data-delay="6"] { transition-delay: .48s; }

.reveal-left { transform: translateX(-60px); }
.reveal-left.in { transform: translateX(0); }
.reveal-right { transform: translateX(60px); }
.reveal-right.in { transform: translateX(0); }
.reveal-scale { transform: scale(0.92); }
.reveal-scale.in { transform: scale(1); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all .25s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #4cc1f5, #2da5e0);
  color: var(--navy-900);
  box-shadow: 0 8px 30px rgba(76,193,245,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(76,193,245,0.5);
}
.btn-ghost {
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--rule-strong);
}
.btn-ghost:hover {
  background: rgba(127,214,255,0.06);
  border-color: var(--cyan-400);
}
.btn .arrow { transition: transform .25s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ============ POSTS GRID (shared by home + blog) ============ */
.posts-section { padding: 40px 40px 100px; }
.posts-section .container { max-width: 1280px; margin: 0 auto; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.post-card {
  background: linear-gradient(160deg, rgba(20,43,94,0.4), rgba(10,23,51,0.6));
  border: 1px solid var(--rule);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column;
  transition: all .3s;
  position: relative;
}
.post-card:hover {
  transform: translateY(-6px);
  border-color: var(--cyan-400);
  box-shadow: 0 20px 50px rgba(76,193,245,0.12);
}
.post-illus {
  aspect-ratio: 16/10;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(135deg, rgba(76,193,245,0.10), rgba(20,43,94,0.5));
}
.post-illus img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s;
}
.post-card:hover .post-illus img { transform: scale(1.04); }

.post-cat-pill {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(5,13,31,0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--rule-strong);
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  z-index: 3;
  color: var(--cyan-300);
}
.post-cat-pill.smart { color: var(--cyan-300); border-color: rgba(127,214,255,0.4); }
.post-cat-pill.gis { color: var(--green); border-color: rgba(92,214,168,0.4); }
.post-cat-pill.kpi { color: var(--amber); border-color: rgba(255,180,84,0.4); }
.post-cat-pill.case { color: var(--violet); border-color: rgba(177,139,255,0.4); }
.post-cat-pill.tech { color: var(--rose); border-color: rgba(255,107,138,0.4); }

.post-body {
  padding: 24px 26px 28px;
  display: flex; flex-direction: column;
  gap: 14px;
  flex: 1;
}
.post-meta {
  display: flex; align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--txt-mute);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.post-meta .dot {
  width: 2.5px; height: 2.5px;
  background: var(--cyan-400);
  border-radius: 50%;
}
.post-card h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--txt);
  transition: color .2s;
}
.post-card:hover h3 { color: var(--cyan-300); }
.post-card p {
  color: var(--txt-dim);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}
.read-more {
  display: inline-flex; align-items: center;
  gap: 10px;
  color: var(--cyan-300);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  margin-top: 4px;
}
.read-more svg { transition: transform .2s; }
.featured-card:hover .read-more svg,
.post-card:hover .read-more svg {
  transform: translateX(4px);
}

/* ============ FEATURED CARD ============ */
.featured-section { padding: 60px 40px 40px; position: relative; }
.featured-section .container { max-width: 1280px; margin: 0 auto; }

.featured-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  background: linear-gradient(135deg, rgba(20,43,94,0.5), rgba(10,23,51,0.85));
  border: 1px solid var(--rule-strong);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  transition: transform .4s, border-color .4s;
  text-decoration: none;
  color: inherit;
}
.featured-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan-400);
}
.featured-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 200px; height: 200px;
  background: radial-gradient(circle at top right, rgba(76,193,245,0.18), transparent 70%);
  pointer-events: none;
}
.featured-illus {
  position: relative;
  min-height: 380px;
  background: linear-gradient(135deg, rgba(76,193,245,0.15), rgba(45,165,224,0.05));
  overflow: hidden;
}
.featured-illus img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
  transition: transform .6s;
}
.featured-card:hover .featured-illus img { transform: scale(1.04); }

.featured-tag-overlay {
  position: absolute;
  top: 20px; left: 20px;
  display: flex; gap: 8px;
  z-index: 4;
}
.featured-pill {
  background: rgba(5,13,31,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--rule-strong);
  color: var(--cyan-300);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.featured-pill.hot {
  background: linear-gradient(135deg, rgba(255,107,138,0.25), rgba(177,139,255,0.2));
  border-color: rgba(255,107,138,0.4);
  color: #ffb1c2;
}
.featured-content {
  padding: 56px;
  display: flex; flex-direction: column;
  justify-content: center;
  gap: 22px;
}
.featured-meta {
  display: flex; align-items: center;
  gap: 16px;
  color: var(--txt-mute);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.featured-meta .dot {
  width: 3px; height: 3px;
  background: var(--cyan-400);
  border-radius: 50%;
}
.featured-card h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(28px, 2.6vw, 38px);
  color: var(--txt);
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.featured-card p {
  color: var(--txt-dim);
  font-size: 15px;
  line-height: 1.65;
}

/* ============ HOME POSTS BLOCK ============ */
.home-posts-section {
  padding: 100px 40px;
  border-top: 1px solid var(--rule);
  background: radial-gradient(ellipse at 50% 0%, rgba(45,165,224,0.06), transparent 60%);
}
.home-posts-section .container { max-width: 1280px; margin: 0 auto; }
.home-posts-section .section-head { margin-bottom: 56px; }
.home-posts-section .home-posts-cta {
  text-align: center;
  margin-top: 56px;
}
.home-posts-section .featured-card { margin-bottom: 28px; }

/* ============ FINAL CTA ============ */
.final-cta {
  margin: 0 40px 80px;
  padding: 80px 60px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(76,193,245,0.18), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(45,165,224,0.18), transparent 60%),
    linear-gradient(135deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--rule-strong);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.final-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(127,214,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127,214,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.final-cta > * { position: relative; }
.final-cta h2 { margin-bottom: 16px; }
.final-cta p {
  color: var(--txt-dim);
  font-size: 18px;
  max-width: 540px;
  margin: 0 auto 32px;
}
.final-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 60px 40px 32px;
  background: rgba(5,13,31,0.8);
  position: relative;
  z-index: 1;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand p {
  color: var(--txt-dim);
  font-size: 13px;
  margin-top: 16px;
  max-width: 280px;
  line-height: 1.6;
}
.footer-contact {
  margin-top: 16px;
  font-size: 13px;
  color: var(--txt-dim);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-contact a {
  color: var(--cyan-300);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-contact a:hover { color: var(--cyan-400); }
.footer-address {
  font-style: normal;
  color: var(--txt-dim);
  font-size: 13px;
  margin-top: 14px;
  line-height: 1.6;
}
.footer-col h5 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cyan-300);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer-col a {
  display: block;
  color: var(--txt-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
  transition: color .2s;
}
.footer-col a:hover { color: var(--txt); }
.footer-col button {
  display: block;
  color: var(--txt-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
  transition: color .2s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.footer-col button:hover { color: var(--txt); }

.footer-bottom {
  max-width: 1280px;
  margin: 48px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  color: var(--txt-mute);
  font-size: 12px;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom a {
  color: inherit;
  text-decoration: none;
  margin-left: 16px;
}
.footer-bottom a:hover { color: var(--cyan-300); }

/* ============ CONTENT-CARD (legales, glosario, artículos genéricos) ============ */
.content-section {
  padding: 80px 40px 100px;
  position: relative;
  z-index: 1;
}
.content-card {
  max-width: 880px;
  margin: 0 auto;
  background: linear-gradient(160deg, rgba(20,43,94,0.45), rgba(10,23,51,0.7));
  border: 1px solid var(--rule);
  border-radius: 24px;
  padding: 56px 64px;
  color: var(--txt-dim);
  font-size: 15px;
  line-height: 1.75;
}
.content-card h1 {
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -0.5px;
  color: var(--txt);
  margin-bottom: 24px;
  line-height: 1.1;
}
.content-card h2 {
  font-size: 26px;
  margin-top: 36px;
  margin-bottom: 14px;
  color: var(--txt);
  letter-spacing: -0.3px;
}
.content-card h3 {
  font-size: 19px;
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--cyan-300);
}
.content-card p { margin-bottom: 14px; }
.content-card ul, .content-card ol {
  padding-left: 22px;
  margin-bottom: 18px;
}
.content-card li { margin-bottom: 8px; }
.content-card a { color: var(--cyan-300); text-decoration: underline; }
.content-card a:hover { color: var(--cyan-400); }
.content-card strong { color: var(--txt); font-weight: 600; }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .header-inner { padding: 12px 20px; gap: 12px; }
  .brand-logo { height: 60px; }
  .brand-tag { display: none; }
  .nav { display: none; position: fixed; top: 70px; left: 0; right: 0; flex-direction: column; background: rgba(5,13,31,0.98); backdrop-filter: blur(14px); padding: 24px; border-bottom: 1px solid var(--rule); gap: 4px; }
  .nav.open { display: flex; }
  .nav a { width: 100%; }
  .mobile-toggle { display: inline-flex; flex-direction: column; }
  .cta-demo { display: none; }
  .lang-divider { display: none; }
  section { padding: 80px 24px; }
  .posts-section { padding: 24px 24px 80px; }
  .featured-section { padding: 40px 24px; }
  .home-posts-section { padding: 80px 24px; }
  .final-cta { padding: 48px 24px; margin: 0 20px 60px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .content-card { padding: 36px 28px; }
  .content-section { padding: 40px 16px 80px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-illus { aspect-ratio: 16/9; min-height: 0; }
  .featured-content { padding: 36px 32px; }
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .section-head { margin-bottom: 60px; }
}
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-bottom a { margin-left: 0; margin-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1; transform: none; transition: none;
  }
  body { opacity: 1 !important; transform: none !important; }
}

/* ============ PAGE TRANSITIONS ============ */
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
body {
  animation: page-in .55s cubic-bezier(.2,.7,.2,1) both;
}
body.page-leaving {
  animation: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .22s ease-out, transform .22s ease-out;
}

/* Soften hover/active transitions on common interactive elements */
a, button, .btn, .post-card, .featured-card, .module-card, .glossary-card, .feat-card, .sector-card, .plan-card, .nav a, .cta-demo {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .35s ease, transform .35s cubic-bezier(.2,.7,.2,1);
}

/* Image fade-in when load() fires */
img {
  opacity: 0;
  transition: opacity .5s ease;
}
img.img-loaded { opacity: 1; }
/* logo loads instantly (avoid blink in header) */
.brand-logo { opacity: 1; }

/* Subtle parallax-friendly behavior: hero visuals get GPU-friendly layer */
.hero-visual,
.starfield,
[data-parallax] {
  will-change: transform;
}
