/* ============================================================
   CUDE · Portal — Estilos personalizados
   Paleta:  Primary #041147   ·   Secondary #ff8300
   ============================================================ */

:root {
  /* Marca */
  --primary: #041147;
  --primary-900: #030d38;
  --primary-800: #0a1c5e;
  --primary-700: #1b2c74;
  --primary-600: #33437f; /* tono medio */
  --primary-100: #e7e9f1;
  --primary-050: #f3f4f9;

  --secondary: #ff8300;
  --secondary-700: #d86e00;
  --secondary-100: #ffedd8;

  /* Degradado de marca: izquierda→derecha  rojo → naranja */
  --brand-red: #d32326;
  --grad-brand: linear-gradient(90deg, #d32326 0%, #ff8300 100%);
  --grad-brand-hover: linear-gradient(90deg, #b71d20 0%, #e97600 100%);
  /* Degradado oscuro para secciones con texto claro */
  --grad-dark: linear-gradient(150deg, var(--primary-900), var(--primary) 60%, var(--primary-800));

  /* Neutros */
  --ink: #0c1230;
  --body: #3a3f52;
  --muted: #6b7080;
  --line: #e4e6ee;
  --white: #ffffff;
  --bg: #ffffff;

  /* Sistema */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 4px 14px rgba(4, 17, 71, 0.08);
  --shadow-md: 0 18px 45px rgba(4, 17, 71, 0.14);
  --container: 1160px;
  --header-h: 74px;

  --font-head: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* ---------- Reset base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 22px;
}

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--secondary);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .2px;
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(4, 17, 71, .3); }
.btn--primary { background: var(--grad-brand); background-size: 140% 100%; }
.btn--primary:hover { background: var(--grad-brand-hover); background-size: 140% 100%; }
.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .55);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .12); box-shadow: none; }
.btn--small { padding: 9px 18px; font-size: .85rem; }

.section--tint .btn--ghost,
.section .btn--ghost { color: var(--primary); border-color: var(--primary-600); }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s ease, background .25s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; }
.brand__logo {
  height: 44px;
  width: auto;
  display: block;
}
.brand__mark {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 1px;
  color: var(--primary);
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav__link {
  position: relative;
  padding: 8px 14px;
  font-weight: 500;
  font-size: .92rem;
  color: var(--primary-700);
  border-radius: 8px;
  transition: color .18s ease, background .18s ease;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 2px;
  background: var(--secondary);
  transform: scaleX(0);
  transition: transform .22s ease;
  transform-origin: left;
}
.nav__link:hover { color: var(--primary); }
.nav__link.is-active { color: var(--primary); }
.nav__link.is-active::after { transform: scaleX(1); }
.nav__link--cta {
  background: var(--grad-brand);
  color: #fff;
  margin-left: 6px;
}
.nav__link--cta::after { display: none; }
.nav__link--cta:hover { background: var(--grad-brand-hover); color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 10px;
  background: var(--primary-050);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--primary);
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  color: #fff;
  padding: clamp(90px, 16vh, 170px) 0 clamp(90px, 16vh, 150px);
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 560px at 88% 6%, rgba(255, 131, 0, .34), transparent 56%),
    radial-gradient(760px 520px at 68% 14%, rgba(211, 35, 38, .34), transparent 55%),
    radial-gradient(900px 700px at 4% 94%, rgba(51, 67, 127, .55), transparent 55%),
    linear-gradient(150deg, var(--primary-900), var(--primary) 58%, var(--primary-800));
}
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
}
.hero__inner { max-width: 1100px; }
.hero__eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 1.1rem;
}
.hero__title {
  color: #fff;
  font-size: clamp(2.2rem, 5.4vw, 3.7rem);
  font-weight: 800;
  margin-bottom: 1.1rem;
}
.hero__title span { color: var(--secondary); }
.hero__text {
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: rgba(255, 255, 255, .86);
  max-width: 620px;
  margin-bottom: 2rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
}
.hero__scroll span {
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: #fff;
  border-radius: 2px;
  animation: scrolldot 1.6s ease-in-out infinite;
}
@keyframes scrolldot { 0%,100% { opacity: 0; transform: translateY(0); } 50% { opacity: 1; transform: translateY(10px); } }

/* ============================================================
   SECCIONES GENÉRICAS
   ============================================================ */
.section { padding: clamp(64px, 10vw, 110px) 0; }
.section--tint { background: var(--primary-050); }
.section--dark {
  background: var(--grad-dark);
  color: #fff;
  border: 0;
  border-top: 4px solid transparent;
  border-image: var(--grad-brand) 1;
}
/* Banda de marca: degradado rojo→naranja con texto oscuro */
.section--brand {
  background: var(--grad-brand);
  color: var(--primary);
}
.section--brand .section__title { color: var(--primary); }
.section--brand .kicker { color: var(--primary-900); }
.section--brand .section__lead { color: rgba(4, 17, 71, .82); }
.section--brand .btn--ghost { color: var(--primary); border-color: var(--primary); }
.section--brand .btn--ghost:hover { background: rgba(4, 17, 71, .1); }
.section--brand .btn--primary { background: var(--primary); }
.section--brand .btn--primary:hover { background: var(--primary-800); }

.section__head { max-width: 680px; margin-bottom: 48px; }
.section__head--light .section__title,
.section--dark .section__title { color: #fff; }
.kicker {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: .8rem;
}
.section__title { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 700; }
.section__lead { font-size: 1.05rem; color: var(--muted); }
.section--dark .section__lead { color: rgba(255, 255, 255, .78); }

/* ---------- Nosotros ---------- */
.about {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 46px;
  align-items: start;
}
.about__text p { font-size: 1.05rem; }
.about__text strong { color: var(--primary); }
.about__stats { display: grid; gap: 16px; }
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--secondary);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat__num {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
}
.stat__label { font-size: .9rem; color: var(--muted); }

.video { margin-top: 50px; }
.video__frame {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  background: var(--primary-900);
}
.video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ---------- Objetivos ---------- */
.objetivos {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 26px;
}
.objetivo-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow-sm);
}
.objetivo-card h3 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 1rem;
}
.objetivo-card--main {
  background: var(--grad-dark);
  color: #fff;
  border-color: transparent;
  position: relative;
  overflow: hidden;
}
.objetivo-card--main::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--grad-brand);
}
.objetivo-card--main h3 { color: var(--secondary); }
.objetivo-card--main p { color: rgba(255, 255, 255, .9); margin: 0; }

.check-list li {
  position: relative;
  padding-left: 34px;
  margin-bottom: 14px;
  font-size: .98rem;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 3px;
  width: 20px; height: 20px;
  border-radius: 6px;
  background: var(--secondary-100);
  border: 1.5px solid var(--secondary);
}
.check-list li::after {
  content: "";
  position: absolute;
  left: 7px; top: 7px;
  width: 5px; height: 10px;
  border: solid var(--secondary-700);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- Servicios ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}
.service-card__icon {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  border-radius: 14px;
  background: var(--primary-050);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}
.service-card h3 { font-size: 1.16rem; color: var(--primary); }
.service-card p { font-size: .95rem; color: var(--body); margin-bottom: .8rem; }
.link-more {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .9rem;
  color: var(--secondary-700);
}
.link-more:hover { color: var(--secondary); }

/* ============================================================
   RESULTADOS DE IMPACTO
   ============================================================ */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.impact-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 38px 22px 30px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.impact-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.impact-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5px;
  background: var(--grad-brand);
}
.impact-card__num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  line-height: 1;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.impact-card__label {
  margin: 14px 0 0;
  font-size: .95rem;
  color: var(--muted);
}
.impact-note {
  margin: 24px 0 0;
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
}

/* ============================================================
   ACTIVIDADES · CAROUSEL
   ============================================================ */
.carousel {
  position: relative;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 22px;
}
.carousel__viewport { overflow: hidden; }
.carousel__track {
  display: flex;
  gap: 22px;
  transition: transform .7s cubic-bezier(.6, .05, .2, 1);
  will-change: transform;
}
.activity-card {
  position: relative;
  flex: 0 0 calc((100% - 44px) / 3); /* 3 tarjetas visibles */
  height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--primary-800);
  background-image: var(--img);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-md);
  isolation: isolate;
}
.activity-card::before { /* degradado negro transparente */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .45) 42%, rgba(0, 0, 0, 0) 78%);
}
.activity-card__date {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  background: var(--secondary);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .5px;
  padding: 7px 13px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}
.activity-card__body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 22px;
}
.activity-card__title {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .18s ease, color .18s ease, transform .18s ease;
  z-index: 3;
}
.carousel__btn:hover { background: var(--secondary); color: #fff; }
.carousel__btn--prev { left: -6px; }
.carousel__btn--next { right: -6px; }

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 26px;
}
.carousel__dots button {
  width: 9px; height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.carousel__dots button.is-active { background: var(--secondary); transform: scale(1.35); }

/* ============================================================
   BLOG
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.post-card__img {
  height: 190px;
  background-color: var(--primary-100);
  background-size: cover;
  background-position: center;
}
.post-card__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.post-card__tag {
  align-self: flex-start;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--secondary-700);
  background: var(--secondary-100);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.post-card h3 { font-size: 1.15rem; color: var(--primary); }
.post-card p { font-size: .94rem; color: var(--body); flex: 1; }
.post-card .btn { align-self: flex-start; margin-top: 6px; }

/* ============================================================
   ALIADOS
   ============================================================ */
.allies {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.allies li {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 96px;
  padding: 18px;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--primary-700);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease, color .2s ease;
}
.allies li:hover { transform: translateY(-4px); border-color: var(--secondary); color: var(--primary); }

/* ============================================================
   CTA
   ============================================================ */
.cta { text-align: center; max-width: 720px; margin-inline: auto; }
.cta .section__title { margin-bottom: .6rem; }
.cta__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--primary-900);
  color: rgba(255, 255, 255, .8);
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap;
  padding-top: 54px;
  padding-bottom: 34px;
}
.site-footer__brand { max-width: 440px; }
.footer-logo {
  display: inline-block;
  background: #fff;
  padding: 12px 16px;
  border-radius: 12px;
}
.footer-logo img { height: 40px; width: auto; display: block; }
.site-footer__brand p { font-size: .9rem; margin-top: .9rem; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer__nav a { font-size: .92rem; transition: color .18s ease; }
.site-footer__nav a:hover { color: var(--secondary); }
.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 18px 0;
  font-size: .82rem;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #fff;
  background: var(--grad-brand);
  border-radius: 50%;
  box-shadow: 0 12px 26px rgba(211, 35, 38, .38);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  z-index: 40;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .about { grid-template-columns: 1fr; }
  .objetivos { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: 1fr 1fr; }
  .allies { grid-template-columns: repeat(3, 1fr); }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-card { flex-basis: calc((100% - 22px) / 2); } /* 2 visibles */
}

@media (max-width: 860px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px 18px 22px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-140%);
    transition: transform .3s ease;
  }
  .nav.is-open { transform: translateY(0); }
  .nav__link { padding: 13px 12px; font-size: 1rem; border-radius: 10px; }
  .nav__link::after { display: none; }
  .nav__link.is-active { background: var(--primary-050); }
  .nav__link--cta { margin-left: 0; text-align: center; margin-top: 6px; }
  .nav-toggle { display: flex; }
}

@media (max-width: 640px) {
  .brand__logo { height: 38px; }
  .cards-grid { grid-template-columns: 1fr; }
  .impact-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .allies { grid-template-columns: repeat(2, 1fr); }
  .activity-card { flex-basis: 100%; height: 380px; } /* 1 visible */
  .carousel__btn--prev { left: 2px; }
  .carousel__btn--next { right: 2px; }
  .hero__actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .carousel__track { transition: none; }
  .hero__scroll span { animation: none; }
}
