/* ═══════════════════════════════════════════════════════
   ANCESTRAL EVOLUTION — Shared CSS
   Design System: Cosmic · Plasma Accent · Filosófico
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Outfit:wght@300;400;500;600&display=swap');

/* ── VARIABLES ── */
:root {
  --void:        #03020A;
  --cosmos:      #07051A;
  --deep:        #0D0B2B;
  --mid:         #141035;
  --surface:     #1C1845;
  --lift:        #231F55;

  --plasma:      #7B4FFF;
  --plasma-glow: #9B6FFF;
  --plasma-soft: #B49FFF;
  --aurora:      #00E5CC;
  --stellar:     #FFB347;
  --nova:        #FF5C8A;
  --starlight:   #C8BFFF;
  --indigo:      #4A3AFF;

  /* AE accent = Plasma */
  --accent:      #7B4FFF;
  --accent-glow: #9B6FFF;
  --accent-sub:  rgba(123,79,255,0.12);
  --accent-dim:  rgba(123,79,255,0.06);

  --text-primary:   #F0EDFF;
  --text-secondary: #A09CC0;
  --text-muted:     #6B6490;

  --grad-plasma:  linear-gradient(135deg, #7B4FFF 0%, #00E5CC 100%);
  --grad-deep:    linear-gradient(135deg, #4A3AFF 0%, #7B4FFF 100%);
  --grad-nebula:  radial-gradient(ellipse at 50% 0%, #1C1845 0%, #03020A 70%);
  --grad-void:    linear-gradient(180deg, #07051A 0%, #03020A 100%);
  --grad-cosmic:  linear-gradient(135deg, #7B4FFF 0%, #FF5C8A 50%, #FFB347 100%);

  --font-display: 'Syne', sans-serif;
  --font-mono:    'Space Mono', monospace;
  --font-body:    'Outfit', sans-serif;

  --s1:4px; --s2:8px; --s3:12px; --s4:16px;
  --s5:24px; --s6:32px; --s7:48px; --s8:64px;
  --s9:96px; --s10:128px;

  --r1:4px; --r2:8px; --r3:16px; --r4:24px; --r5:9999px;

  --glow-plasma:  0 0 30px rgba(123,79,255,0.5), 0 0 60px rgba(123,79,255,0.2);
  --glow-aurora:  0 0 30px rgba(0,229,204,0.4);
  --glow-nova:    0 0 30px rgba(255,92,138,0.4);
  --glow-soft:    0 0 40px rgba(123,79,255,0.15);

  --border-subtle:  1px solid rgba(123,79,255,0.12);
  --border-soft:    1px solid rgba(123,79,255,0.25);
  --border-bright:  1px solid rgba(123,79,255,0.5);
  --border-aurora:  1px solid rgba(0,229,204,0.2);
  --border-starlight: 1px solid rgba(200,191,255,0.15);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ── LAYOUT ── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--s6);
}
@media (max-width: 768px) { .container { padding: 0 var(--s5); } }

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(3,2,10,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(123,79,255,0.1);
  transition: border-color 0.3s;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--s6);
}

.nav-logo {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-logo-main {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: var(--grad-plasma);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.nav-logo-sub {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s5);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1px;
  background: var(--plasma-glow);
  transform: scaleX(0);
  transition: transform 0.2s var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-primary); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-cta {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: white !important;
  background: var(--grad-plasma);
  padding: 9px 20px;
  border-radius: var(--r5);
  transition: box-shadow 0.2s, transform 0.2s var(--ease-out) !important;
  box-shadow: var(--glow-plasma);
}

.nav-cta::after { display: none !important; }
.nav-cta:hover { transform: translateY(-1px) !important; box-shadow: 0 0 50px rgba(123,79,255,0.7) !important; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: var(--s2);
}
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text-secondary); border-radius: 2px; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: var(--r5);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-plasma {
  background: var(--grad-plasma);
  color: white;
  box-shadow: var(--glow-plasma);
}
.btn-plasma:hover { box-shadow: 0 0 50px rgba(123,79,255,0.7), 0 0 100px rgba(123,79,255,0.25); }

.btn-outline {
  background: transparent;
  color: var(--plasma-glow);
  border: var(--border-bright);
}
.btn-outline:hover { background: rgba(123,79,255,0.08); box-shadow: var(--glow-plasma); }

.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border: var(--border-subtle);
}
.btn-ghost:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }

.btn-aurora {
  background: linear-gradient(135deg, var(--aurora), #00B8A4);
  color: var(--void);
  box-shadow: var(--glow-aurora);
}

.btn-sm { font-size: 11px; padding: 10px 20px; }
.btn-lg { font-size: 14px; padding: 18px 36px; }
.btn-full { width: 100%; }

/* ── TAGS ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--r5);
}
.tag::before { content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.tag-plasma  { background: rgba(123,79,255,0.12); color: var(--plasma-glow); border: 1px solid rgba(123,79,255,0.3); }
.tag-aurora  { background: rgba(0,229,204,0.10); color: var(--aurora); border: 1px solid rgba(0,229,204,0.25); }
.tag-nova    { background: rgba(255,92,138,0.12); color: var(--nova); border: 1px solid rgba(255,92,138,0.3); }
.tag-stellar { background: rgba(255,179,71,0.12); color: var(--stellar); border: 1px solid rgba(255,179,71,0.3); }
.tag-muted   { background: rgba(255,255,255,0.04); color: var(--text-muted); border: var(--border-subtle); }

/* ── SECTION STYLES ── */
.section { padding: var(--s10) 0; }

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--plasma-glow);
  margin-bottom: var(--s3);
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.section-label::before { content: ''; display: block; width: 24px; height: 1px; background: var(--plasma-glow); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: var(--s4);
}
.section-title .accent { color: var(--plasma-glow); }
.section-title .grad {
  background: var(--grad-plasma);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-title em {
  font-style: italic;
  background: var(--grad-plasma);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: var(--s8);
  font-weight: 300;
  line-height: 1.75;
}

/* ── DIVIDER ── */
.divider {
  display: flex;
  align-items: center;
  gap: var(--s4);
  margin: var(--s7) 0;
}
.divider-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(123,79,255,0.25), transparent); }
.divider-glyph { font-family: var(--font-mono); font-size: 12px; color: var(--plasma-glow); opacity: 0.5; letter-spacing: 0.2em; }

/* ── PAGE HEADER ── */
.page-header {
  padding: calc(64px + var(--s9)) 0 var(--s8);
  background: var(--grad-nebula);
  border-bottom: var(--border-subtle);
  position: relative;
  overflow: hidden;
}
.page-header-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--s4);
}
.breadcrumb a { color: var(--text-muted); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--plasma-glow); }
.breadcrumb span { color: var(--plasma-glow); }

/* ── QUOTE BLOCK ── */
.quote-block {
  border-left: 2px solid var(--plasma-glow);
  padding: var(--s4) var(--s6);
  background: rgba(123,79,255,0.05);
  border-radius: 0 var(--r2) var(--r2) 0;
  margin: var(--s6) 0;
}
.quote-text { font-family: var(--font-display); font-size: 18px; font-weight: 600; font-style: italic; color: var(--text-primary); line-height: 1.6; margin-bottom: var(--s2); }
.quote-author { font-family: var(--font-mono); font-size: 10px; color: var(--plasma-glow); letter-spacing: 0.2em; text-transform: uppercase; }

/* ── FEATURE LIST ── */
.feature-list { list-style: none; display: flex; flex-direction: column; gap: var(--s3); }
.feature-list li { display: flex; align-items: flex-start; gap: var(--s3); font-size: 15px; color: var(--text-secondary); line-height: 1.5; }
.feature-list li::before { content: '✦'; color: var(--plasma-glow); font-size: 10px; margin-top: 3px; flex-shrink: 0; }

/* ── CARD ── */
.card {
  background: var(--cosmos);
  border: var(--border-subtle);
  border-radius: var(--r3);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.card:hover { border-color: rgba(123,79,255,0.3); transform: translateY(-4px); box-shadow: 0 20px 60px rgba(0,0,0,0.4), var(--glow-soft); }

/* ── CTA BANNER ── */
.cta-banner {
  background: var(--deep);
  border: var(--border-subtle);
  border-radius: var(--r4);
  padding: var(--s8);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, rgba(123,79,255,0.1) 0%, transparent 60%); pointer-events: none; }
.cta-title { font-family: var(--font-display); font-size: clamp(24px, 4vw, 44px); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: var(--s4); position: relative; z-index: 1; }
.cta-sub { font-size: 17px; color: var(--text-secondary); font-weight: 300; margin-bottom: var(--s6); position: relative; z-index: 1; }
.cta-actions { display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }

/* ── FOOTER ── */
.footer {
  background: var(--cosmos);
  border-top: var(--border-subtle);
  padding: var(--s8) 0 var(--s6);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--s8);
  margin-bottom: var(--s8);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s6); } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand-name { font-family: var(--font-display); font-size: 18px; font-weight: 800; background: var(--grad-plasma); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: var(--s2); }
.footer-brand-sub { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em; color: var(--text-muted); text-transform: uppercase; margin-bottom: var(--s4); }
.footer-brand-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; max-width: 300px; }
.footer-col-title { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: var(--s4); }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: var(--s2); }
.footer-links a { font-size: 14px; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--plasma-glow); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: var(--s5); border-top: var(--border-subtle); flex-wrap: wrap; gap: var(--s3); }
.footer-copy { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); letter-spacing: 0.1em; line-height: 1.6; }

/* ── SCROLL REVEAL ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── NUMBER DISPLAY ── */
.principle-number {
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 800;
  line-height: 1;
  background: var(--grad-plasma);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.15;
  position: absolute;
  top: var(--s4);
  right: var(--s5);
  pointer-events: none;
  user-select: none;
}

/* ── MATH BLOCK ── */
.math-block {
  background: var(--deep);
  border: var(--border-bright);
  border-radius: var(--r3);
  padding: var(--s6);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--plasma-soft);
  line-height: 2;
  overflow-x: auto;
  position: relative;
}
.math-block::before {
  content: 'ECUACIÓN';
  position: absolute;
  top: var(--s3); right: var(--s4);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* ── ECOSYSTEM BAR ── */
.ecosystem-bar { display: flex; gap: var(--s4); justify-content: center; flex-wrap: wrap; padding: var(--s5) 0; border-top: var(--border-subtle); margin-top: var(--s7); }
.eco-link { display: flex; align-items: center; gap: var(--s2); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em; color: var(--text-muted); transition: color 0.2s; padding: 8px 16px; border: var(--border-subtle); border-radius: var(--r5); }
.eco-link:hover { color: var(--plasma-glow); border-color: rgba(123,79,255,0.3); }
.eco-link-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
