/* =========================================================
   Fundación Ingenia — Design System
   ========================================================= */

:root {
  --cream: #FDF6EC;
  --cream-2: #F7ECDB;
  --teal: #1A4D5C;
  --teal-dark: #123640;
  --teal-ink: #0D262E;
  --coral: #E0673F;
  --coral-dark: #C4502C;
  --gold: #F4B942;
  --white: #FFFFFF;

  --text-main: var(--teal-ink);
  --text-soft: #4A6670;
  --text-on-dark: #FDF6EC;
  --text-on-dark-soft: #B9CDD1;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 32px;
  --radius-pill: 999px;

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --shadow-soft: 0 20px 50px -25px rgba(13, 38, 46, 0.35);
  --shadow-card: 0 12px 30px -18px rgba(13, 38, 46, 0.28);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.6s;

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

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 1em;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--coral);
  display: inline-block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.9em 1.7em;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), color 0.35s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--coral); color: var(--white); box-shadow: var(--shadow-card); }
.btn-primary:hover { background: var(--coral-dark); transform: translateY(-2px); }
.btn-ghost { border-color: currentColor; color: var(--teal); background: transparent; }
.btn-ghost:hover { background: var(--teal); color: var(--cream); transform: translateY(-2px); }
.btn-on-dark { border-color: var(--gold); color: var(--gold); }
.btn-on-dark:hover { background: var(--gold); color: var(--teal-ink); }
.btn-disabled {
  background: transparent;
  border-color: rgba(74, 102, 112, 0.35);
  color: var(--text-soft);
  cursor: not-allowed;
}
.btn-disabled:hover { transform: none; }
.btn-sm { padding: 0.6em 1.2em; font-size: 0.85rem; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(253, 246, 236, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(26, 77, 92, 0.08);
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65em;
  font-family: var(--font-head);
}
.brand img { height: 42px; width: auto; }
.brand-word {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--teal);
  line-height: 1;
}
.brand-sub {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  color: var(--coral);
  font-weight: 700;
  margin-top: 0.2em;
}

.nav-main { display: flex; align-items: center; gap: 2.1rem; }
.nav-main a {
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-main);
  position: relative;
  padding: 0.3em 0;
}
.nav-main a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--coral);
  transition: width 0.35s var(--ease);
}
.nav-main a:hover::after,
.nav-main a[aria-current="page"]::after { width: 100%; }
.nav-main a[aria-current="page"] { color: var(--coral); }

.nav-actions { display: flex; align-items: center; gap: 0.8rem; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 42px; height: 42px;
  position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  position: absolute;
  left: 9px; right: 9px;
  height: 2px;
  background: var(--teal);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), top 0.3s var(--ease);
}
.nav-toggle span { top: 20px; }
.nav-toggle span::before { top: -8px; }
.nav-toggle span::after { top: 8px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .nav-main {
    position: fixed;
    top: 84px;
    left: 0;
    right: 0;
    height: calc(100vh - 84px);
    height: calc(100dvh - 84px);
    background: var(--cream);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2.5rem var(--gutter);
    gap: 1.6rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.45s var(--ease);
  }
  .nav-main.open { transform: translateX(0); }
  .nav-main a { font-size: 1.3rem; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 168px 0 96px;
  background: radial-gradient(ellipse 90% 70% at 50% -10%, rgba(244, 185, 66, 0.28), transparent 60%), var(--cream);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 { font-size: clamp(2.3rem, 4.4vw, 3.6rem); color: var(--teal); }
.hero .lede { font-size: 1.15rem; color: var(--text-soft); max-width: 46ch; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.8rem; }
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-bulb {
  position: relative;
  z-index: 1;
  width: min(420px, 80vw);
  height: auto;
  filter: drop-shadow(var(--shadow-soft)) drop-shadow(0 0 0 rgba(244,185,66,0));
  animation: float 5s var(--ease) infinite alternate, glow-pulse 3.2s ease-in-out infinite;
}
@keyframes float {
  from { transform: translateY(-8px); }
  to { transform: translateY(8px); }
}
@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(var(--shadow-soft)) drop-shadow(0 0 10px rgba(244,185,66,0.25)); }
  50% { filter: drop-shadow(var(--shadow-soft)) drop-shadow(0 0 34px rgba(244,185,66,0.65)); }
}
.glow-halo {
  position: absolute;
  width: min(360px, 65vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,185,66,0.55) 0%, rgba(244,185,66,0.15) 45%, transparent 72%);
  filter: blur(6px);
  animation: halo-pulse 3.2s ease-in-out infinite;
}
@keyframes halo-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}
.mini-spark {
  position: absolute;
  width: 10px; height: 10px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px 2px rgba(244,185,66,0.8);
  opacity: 0;
  animation: spark-pop 3.2s ease-in-out infinite;
}
.mini-spark-1 { top: 14%; left: 18%; animation-delay: 0.2s; }
.mini-spark-2 { top: 62%; right: 14%; animation-delay: 1.1s; }
.mini-spark-3 { bottom: 10%; left: 32%; animation-delay: 2s; }
@keyframes spark-pop {
  0%, 60%, 100% { opacity: 0; transform: scale(0.4); }
  75% { opacity: 1; transform: scale(1.2); }
  90% { opacity: 0.6; transform: scale(0.8); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-bulb, .glow-halo, .mini-spark { animation: none; }
  .glow-halo { opacity: 0.7; }
}

/* ---------- Decorative spark accents (scattered "idea" motif) ---------- */
.section-head { position: relative; }
.spark-accent {
  position: absolute;
  width: 46px;
  height: 46px;
  opacity: 0.85;
  animation: twinkle 2.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes twinkle {
  0%, 100% { transform: scale(0.9) rotate(-4deg); opacity: 0.5; }
  50% { transform: scale(1.1) rotate(4deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .spark-accent { animation: none; }
}

/* ---------- Sections ---------- */
section { padding: 5.5rem 0; }
.section-head { max-width: 720px; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--teal); }
.section-head p { color: var(--text-soft); font-size: 1.05rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.section-dark {
  background: linear-gradient(160deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: var(--text-on-dark);
}
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: var(--text-on-dark-soft); }
.section-dark .eyebrow { color: var(--gold); }
.section-dark .eyebrow::before { background: var(--gold); }

.section-cream2 { background: var(--cream-2); }

/* ---------- Grids & Cards ---------- */
.grid { display: grid; gap: 1.75rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2.1rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card:hover { transform: translateY(-6px); }
.card .icon-dot {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(224, 103, 63, 0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--coral);
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
}
.card h3 { font-size: 1.15rem; color: var(--teal); }
.card p { color: var(--text-soft); font-size: 0.96rem; margin-bottom: 0; }

.card-outline {
  border: 1.5px solid rgba(26, 77, 92, 0.15);
  border-radius: var(--radius-md);
  padding: 2rem;
  background: var(--white);
}

/* ---------- Stats ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
@media (max-width: 760px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 1rem; }
.stat .num {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 700;
  color: var(--gold);
  display: block;
}
.stat .label { font-size: 0.85rem; color: var(--text-on-dark-soft); }
.section-dark .stat .label { color: var(--text-on-dark-soft); }
body:not(.dark-context) .stat .num { color: var(--coral); }

/* ---------- Timeline (origin story) ---------- */
.timeline {
  position: relative;
  padding-left: 2.5rem;
  border-left: 3px solid rgba(224, 103, 63, 0.35);
}
.timeline-item { position: relative; padding-bottom: 2.6rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.94rem; top: 0.3rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid var(--cream);
  box-shadow: 0 0 0 3px rgba(224, 103, 63, 0.35);
}
.timeline-item .t-time {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--coral);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}
.timeline-item h3 { margin-top: 0.3em; color: var(--teal); font-size: 1.15rem; }
.timeline-item p { color: var(--text-soft); }

/* ---------- Values ---------- */
.value-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(244, 185, 66, 0.35);
  padding: 0.25em 0.7em;
  border-radius: var(--radius-pill);
  margin-bottom: 0.9rem;
}
.value-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.75rem;
}
.value-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: rgba(244, 185, 66, 0.14);
  border: 1px solid rgba(244, 185, 66, 0.4);
  color: var(--white);
  padding: 0.6em 1.15em;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.92rem;
  font-family: var(--font-head);
}

/* ---------- Placeholder / pending pill ---------- */
.pending {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--coral-dark);
  background: rgba(224, 103, 63, 0.1);
  border: 1px dashed rgba(224, 103, 63, 0.5);
  padding: 0.35em 0.9em;
  border-radius: var(--radius-pill);
}
.pending::before { content: "⏳"; font-size: 0.9em; }

/* ---------- Project (SOS Connect) ---------- */
.project-hero {
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--teal) 10%, var(--teal-dark) 100%);
  color: var(--white);
  padding: clamp(2rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
}
.project-hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,185,66,0.35), transparent 70%);
}
.tag-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.35em 0.9em;
  border-radius: var(--radius-pill);
  background: rgba(244, 185, 66, 0.16);
  color: var(--gold);
  border: 1px solid rgba(244, 185, 66, 0.4);
}

.route-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.route-chip {
  font-size: 0.82rem;
  padding: 0.4em 1em;
  border-radius: var(--radius-pill);
  background: rgba(26, 77, 92, 0.08);
  color: var(--teal);
  font-weight: 600;
}

/* ---------- Photo placeholder (pending real images) ---------- */
.photo-placeholder {
  border: 2px dashed rgba(224, 103, 63, 0.4);
  border-radius: var(--radius-md);
  background: rgba(224, 103, 63, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  min-height: 140px;
  text-align: center;
  color: var(--coral-dark);
  font-size: 0.85rem;
  font-weight: 600;
}
.photo-placeholder .icon { font-size: 1.8rem; }

/* ---------- Carousel (Proyectos) ---------- */
.carousel-controls { display: flex; gap: 0.75rem; justify-content: flex-end; margin-bottom: 1.25rem; }
.carousel-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(26, 77, 92, 0.25);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: var(--teal);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.carousel-btn:hover { background: var(--teal); color: var(--cream); }
.carousel {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}
.carousel-slide {
  flex: 0 0 min(680px, 88vw);
  scroll-snap-align: start;
}

/* ---------- Ways to help ---------- */
.help-way {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  padding: 1.6rem 0;
  border-bottom: 1px solid rgba(26, 77, 92, 0.1);
}
.help-way:last-child { border-bottom: none; }
.help-way .num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--coral);
  min-width: 2.2ch;
}
.help-way h3 { color: var(--teal); font-size: 1.1rem; margin-bottom: 0.3em; }
.help-way p { color: var(--text-soft); margin: 0; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 1.3rem; }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label { font-family: var(--font-head); font-weight: 600; font-size: 0.9rem; color: var(--teal); }
.field input, .field textarea, .field select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85em 1em;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(26, 77, 92, 0.22);
  background: var(--white);
  color: var(--text-main);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(224, 103, 63, 0.14);
}
.field textarea { resize: vertical; min-height: 140px; }
.form-note { font-size: 0.85rem; color: var(--text-soft); }
.form-success {
  display: none;
  background: rgba(26, 77, 92, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  color: var(--teal);
  font-weight: 600;
}
.form-success.visible { display: block; }

/* ---------- Contact info list ---------- */
.info-list { display: grid; gap: 1.4rem; }
.info-item { display: flex; gap: 1rem; align-items: flex-start; }
.info-item .icon-dot { flex-shrink: 0; }
.info-item h3 { font-size: 1rem; color: var(--teal); margin-bottom: 0.2em; }
.info-item p { color: var(--text-soft); margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--teal-ink);
  color: var(--text-on-dark-soft);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(253, 246, 236, 0.12);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 0.6em; margin-bottom: 1rem; }
.footer-brand img { height: 34px; }
.footer-brand span { font-family: var(--font-head); font-size: 1.2rem; color: var(--white); font-weight: 600; }
.footer-col h4 {
  font-family: var(--font-head);
  color: var(--white);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.footer-col li { margin-bottom: 0.65rem; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.8rem;
  font-size: 0.85rem;
}
.social-row { display: flex; gap: 0.9rem; }
.social-row a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(253, 246, 236, 0.25);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.social-row a:hover { background: var(--coral); border-color: var(--coral); }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal[data-split] { opacity: 1; transform: none; } /* defensive: never hide text if JS fails */

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: 160px 0 4rem;
  background: var(--cream-2);
}
.page-hero h1 { color: var(--teal); font-size: clamp(2rem, 4vw, 3rem); }
.page-hero .lede { color: var(--text-soft); max-width: 60ch; font-size: 1.08rem; }
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 1rem;
}
.breadcrumb a:hover { color: var(--coral); }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.narrow { max-width: 760px; }
[data-i18n-target] {}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--teal);
  color: var(--cream);
  padding: 0.8em 1.2em;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
