/* ==========================================================================
   FungaTec — Manual de Identidad Corporativa & Sitio Web Oficial
   ========================================================================== */

:root {
  /* ---------- 🎨 COLORES OFICIALES DE MARCA (MANUAL DE IDENTIDAD) ---------- */
  --bg:           #053043;   /* Azul Oscuro Corporativo (C100 M71 Y48 K51) */
  --bg-dark:      #031E2B;   /* Tono profundo de apoyo */
  --primary:      #25A9E0;   /* Azul FungaTec Principal (C72 M14 Y1 K0) */
  --accent:       #45AC4D;   /* Verde FungaTec / ADN (C72 M1 Y87 K0) */
  --sky:          #A7E0F3;   /* Azul Celeste Claro (C37 M0 Y6 K0) */
  --orange:       #F3A856;   /* Naranja Cálido (C2 M40 Y71 K0) */
  --gray-corp:    #4C4B4B;   /* Gris Corporativo (C62 M53 Y51 K49) */
  --text:         #FFFFFF;   /* Blanco puro */
  --muted:        #A7E0F3;   /* Celeste claro para textos secundarios */
  --text-dim:     rgba(255, 255, 255, 0.82);
  /* ------------------------------------------------------------------ */

  --surface:      rgba(255, 255, 255, 0.05);
  --surface-hi:   rgba(255, 255, 255, 0.1);
  --border:       rgba(167, 224, 243, 0.18);
  --border-hi:    rgba(37, 169, 224, 0.5);
  --glow:         rgba(37, 169, 224, 0.35);
  --glow-green:   rgba(69, 172, 77, 0.35);

  --font-family:  'Montserrat', system-ui, -apple-system, sans-serif;

  --radius:       20px;
  --radius-sm:    14px;
  --maxw:         1120px;
  --ease:         cubic-bezier(.22, 1, .36, 1);
}

/* ========== BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  font-family: var(--font-family);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--primary); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 6px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 40%, transparent);
  border-radius: 10px;
  border: 3px solid var(--bg);
}

/* ========== PANTALLA DE CARGA ========== */
.loader {
  position: fixed; inset: 0; z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  background: var(--bg);
  transition: opacity .7s var(--ease), visibility .7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }

.loader__ring { stroke: color-mix(in srgb, var(--primary) 30%, transparent); }
.loader__dot { fill: var(--primary); transform-origin: 50px 50px; animation: orbit 1.15s linear infinite; }
.loader__mark { filter: drop-shadow(0 0 12px var(--glow)); }

.loader__text {
  font-family: var(--font-family); font-weight: 700; font-size: .9rem;
  letter-spacing: .4em; text-transform: uppercase;
  color: var(--sky); animation: pulse 1.8s ease-in-out infinite;
}

@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .4 } 50% { opacity: 1 } }

/* ========== FONDO DE MICELIO & AURORA ========== */
.mycelium {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 15% 15%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 65%),
    radial-gradient(55vw 55vw at 85% 30%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 60%),
    radial-gradient(70vw 50vw at 50% 95%, color-mix(in srgb, var(--orange) 10%, transparent), transparent 65%),
    linear-gradient(180deg, var(--bg-dark) 0%, var(--bg) 50%, var(--bg-dark) 100%);
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: scale(1) translateY(0); }
  to   { transform: scale(1.1) translateY(-20px); }
}

.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0,0) } 20% { transform: translate(-4%,3%) }
  40% { transform: translate(3%,-4%) } 60% { transform: translate(-3%,-3%) }
  80% { transform: translate(4%,4%) }
}

/* ========== BARRA DE PROGRESO ========== */
.progress {
  position: fixed; top: 0; left: 0; z-index: 100;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 0 14px var(--glow);
  transition: width .08s linear;
}

/* ========== LAYOUT ========== */
.wrap {
  position: relative; z-index: 2;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 24px;
}

.section { padding: clamp(70px, 10vw, 120px) 0; }

.section__title {
  font-family: var(--font-family);
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 800; letter-spacing: -.02em;
  text-align: center; margin-bottom: 14px;
  color: var(--text);
}
.section__title::after {
  content: ''; display: block;
  width: 64px; height: 4px; margin: 18px auto 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.section__sub {
  text-align: center; color: var(--sky);
  font-size: clamp(0.98rem, 2vw, 1.1rem);
  max-width: 58ch; margin: 0 auto clamp(36px, 5vw, 54px);
  font-weight: 400;
}

/* ========== PORTADA / HERO ========== */
.hero {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 80px 0 60px;
  position: relative;
}

.logo-wrapper {
  margin-bottom: 24px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 26px var(--glow));
}

.brand-logo-img {
  width: clamp(220px, 35vw, 320px);
  height: auto;
  animation: float 6s ease-in-out infinite;
  transition: transform 0.4s var(--ease);
}
@keyframes float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }

.eyebrow {
  font-size: .82rem; font-weight: 700;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}

.tagline-hero {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 600;
  max-width: 54ch;
  color: var(--sky);
  margin-bottom: 34px;
  line-height: 1.45;
}
.tagline-hero span {
  color: inherit;
}

/* ========== BOTONES ========== */
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px;
  border-radius: 100px;
  font-weight: 700; font-size: .95rem;
  border: 1px solid transparent;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              background .3s var(--ease), border-color .3s var(--ease);
  will-change: transform;
}
.btn--primary {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  color: #031E2B;
  box-shadow: 0 8px 30px var(--glow);
}
.btn--primary:hover {
  box-shadow: 0 14px 44px var(--glow);
  transform: translateY(-2px);
}
.btn--primary svg { transition: transform .3s var(--ease); }
.btn--primary:hover svg { transform: translateY(3px); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  backdrop-filter: blur(14px);
  color: var(--text);
}
.btn--ghost:hover {
  background: var(--surface-hi);
  border-color: var(--border-hi);
  transform: translateY(-2px);
}

/* Indicador de scroll */
.scroll-hint {
  position: absolute; bottom: 30px; left: 50%; translate: -50% 0;
  width: 24px; height: 38px;
  border: 2px solid color-mix(in srgb, var(--sky) 40%, transparent);
  border-radius: 14px;
}
.scroll-hint span {
  position: absolute; top: 8px; left: 50%; translate: -50% 0;
  width: 3px; height: 7px; border-radius: 3px;
  background: var(--primary);
  animation: wheel 1.9s ease-in-out infinite;
}
@keyframes wheel {
  0%   { transform: translateY(0);   opacity: 0 }
  30%  { opacity: 1 }
  100% { transform: translateY(14px); opacity: 0 }
}

/* ========== TARJETA DESTACADA (FugiDocs) ========== */
.feature-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 26px;
  padding: 32px 36px;
  margin-bottom: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--primary) 12%, transparent),
      color-mix(in srgb, var(--accent) 8%, transparent)),
    var(--surface);
  backdrop-filter: blur(16px);
  transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.feature-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 22px 60px -20px var(--glow);
}
.feature-card__glow {
  position: absolute; width: 340px; height: 340px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  opacity: 0; transition: opacity .4s;
  translate: -50% -50%;
}
.feature-card:hover .feature-card__glow { opacity: 1; }

.feature-card__logo {
  flex-shrink: 0;
  width: 72px; height: 72px;
  border-radius: 18px;
  display: grid; place-items: center;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  padding: 8px;
  box-shadow: 0 8px 24px var(--glow);
}
.feature-card__logo img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.feature-card__body { flex: 1; min-width: 0; }
.feature-card__body h3 {
  font-family: var(--font-family); font-size: 1.6rem; font-weight: 800;
  margin: 6px 0 5px; color: var(--text);
}
.feature-card__body p { color: var(--text-dim); font-size: .96rem; }

.badge {
  display: inline-block;
  padding: 4px 12px; border-radius: 100px;
  font-size: .7rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--orange);
  background: color-mix(in srgb, var(--orange) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent);
}

.feature-card__arrow {
  flex-shrink: 0; color: var(--primary);
  transition: transform .35s var(--ease);
}
.feature-card:hover .feature-card__arrow { transform: translate(4px,-4px); }

/* ========== REJILLA DE REDES SOCIALES ========== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.link-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  backdrop-filter: blur(14px);
  transition: transform .4s var(--ease), border-color .4s var(--ease),
              background .4s var(--ease), box-shadow .4s var(--ease);
}
.link-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--brand);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .4s var(--ease);
}
.link-card:hover {
  background: var(--surface-hi);
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  box-shadow: 0 16px 44px -22px var(--brand);
}
.link-card:hover::before { transform: scaleY(1); transform-origin: top; }

.link-card__icon {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  transition: color .35s var(--ease), background .35s var(--ease), transform .35s var(--ease);
}
.link-card:hover .link-card__icon {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 25%, transparent);
  transform: scale(1.08) rotate(-4deg);
}

.link-card__text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.link-card__text strong { font-family: var(--font-family); font-weight: 700; font-size: 1.05rem; }
.link-card__text small { color: var(--sky); font-size: .84rem; }

.link-card__go {
  margin-left: auto; color: var(--sky);
  font-size: 1.15rem;
  transition: transform .35s var(--ease), color .35s var(--ease);
}
.link-card:hover .link-card__go { transform: translateX(5px); color: var(--brand); }

/* ========== SECCIÓN CONÓCENOS ========== */
.about-intro-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 50px;
}

.about-hero-box {
  padding: 36px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  background: linear-gradient(135deg, rgba(37, 169, 224, 0.08), rgba(69, 172, 77, 0.06)), var(--surface);
  backdrop-filter: blur(14px);
  position: relative;
}
.about-hero-box::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.about-hero-box p {
  color: var(--text-dim);
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.7;
  margin-bottom: 16px;
}
.about-hero-box p:last-child { margin-bottom: 0; }
.about-hero-box strong { color: var(--text); font-weight: 700; }
.highlight-text { color: var(--primary); font-weight: 700; }

/* MISIÓN Y VISIÓN (GRID DUAL) */
.mission-vision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.mv-card {
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.mv-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px -20px var(--glow);
}

.mv-card__header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
}
.mv-card__icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  color: #031E2B; font-weight: 800; font-size: 1.2rem;
}
.mv-card__icon--mission { background: linear-gradient(135deg, var(--primary), var(--sky)); }
.mv-card__icon--vision { background: linear-gradient(135deg, var(--accent), var(--orange)); }

.mv-card h3 {
  font-family: var(--font-family); font-size: 1.4rem; font-weight: 800;
  color: var(--text);
}
.mv-card p {
  color: var(--text-dim); font-size: .98rem; line-height: 1.65;
}

/* VALORES CORPORATIVOS (7 VALORES) */
.values-header {
  text-align: center;
  margin-bottom: 30px;
}
.values-header h3 {
  font-family: var(--font-family);
  font-size: 1.8rem; font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.values-header p { color: var(--sky); font-size: 1rem; }

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.value-card {
  padding: 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.value-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -18px var(--glow);
}

.value-card__tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.value-card__tag::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}

.value-card h4 {
  font-family: var(--font-family); font-size: 1.15rem; font-weight: 700;
  color: var(--text); margin-bottom: 10px;
}
.value-card p {
  color: var(--text-dim); font-size: .92rem; line-height: 1.6;
}

/* MANIFIESTO DE MARCA */
.manifesto-box {
  position: relative; overflow: hidden;
  padding: 40px clamp(24px, 5vw, 48px);
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  background: linear-gradient(165deg, rgba(5, 48, 67, 0.9), rgba(3, 30, 43, 0.95)), var(--surface);
  backdrop-filter: blur(16px);
  margin-bottom: 60px;
}
.manifesto-box::after {
  content: ''; position: absolute; top: -50%; right: -20%; width: 400px; height: 400px;
  background: radial-gradient(circle, var(--glow-green), transparent 70%);
  pointer-events: none; opacity: .4;
}

.manifesto-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.manifesto-header h3 {
  font-family: var(--font-family); font-size: 1.6rem; font-weight: 800;
  color: var(--text);
  display: flex; align-items: center; gap: 12px;
}
.manifesto-badge {
  padding: 4px 14px; border-radius: 100px;
  font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--primary);
  background: rgba(37, 169, 224, 0.12);
  border: 1px solid rgba(37, 169, 224, 0.3);
}

.manifesto-content p {
  color: var(--text-dim);
  font-size: clamp(.96rem, 1.8vw, 1.05rem);
  line-height: 1.75;
  margin-bottom: 18px;
}
.manifesto-content p:last-child { margin-bottom: 0; }

/* MENSAJE DE CIERRE MICELIAL */
.mycelial-closing {
  text-align: center;
  padding: 34px 28px;
  border-radius: var(--radius);
  border: 1px stroke var(--border);
  background: linear-gradient(135deg, rgba(69, 172, 77, 0.1), rgba(37, 169, 224, 0.1));
  backdrop-filter: blur(12px);
}
.mycelial-closing p {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 600;
  color: var(--text);
  max-width: 50ch; margin: 0 auto;
  line-height: 1.55;
}
.mycelial-closing p strong {
  color: var(--primary);
}

/* ========== MÉTRICAS ========== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 20px;
  margin-top: 40px;
  padding: 34px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(14px);
}
.stat { text-align: center; }
.stat__num {
  display: block;
  font-family: var(--font-family); font-weight: 800;
  font-size: clamp(2.2rem, 5.5vw, 2.9rem);
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__label { font-size: .84rem; color: var(--sky); font-weight: 500; letter-spacing: .04em; }

/* ========== PIE DE PÁGINA ========== */
.footer {
  padding: 60px 0 40px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.footer__logo {
  width: 140px; height: auto;
  margin: 0 auto 20px;
  filter: drop-shadow(0 0 14px var(--glow));
}
.footer__text { font-size: .9rem; color: var(--sky); }
.footer__made { font-size: .8rem; color: rgba(167, 224, 243, 0.6); margin-top: 6px; }

/* ========== AVISO FLOTANTE (TOAST) ========== */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 200;
  translate: -50% 20px;
  padding: 12px 24px; border-radius: 100px;
  font-size: .9rem; font-weight: 600;
  color: #031E2B;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  box-shadow: 0 10px 34px var(--glow);
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease), translate .35s var(--ease);
}
.toast.is-visible { opacity: 1; translate: -50% 0; }

/* ========== ANIMACIÓN DE APARICIÓN ========== */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ========== MÓVIL ========== */
@media (max-width: 650px) {
  .wrap { padding: 0 18px; }
  .feature-card { flex-wrap: wrap; gap: 18px; padding: 24px; }
  .feature-card__arrow { position: absolute; top: 24px; right: 24px; }
  .cta-row .btn { flex: 1 1 auto; justify-content: center; }
  .scroll-hint { display: none; }
  .about-hero-box, .manifesto-box, .mv-card { padding: 24px 20px; }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .mycelium { display: none; }
}
