/* Tokens tomados de la paleta de Generación Tech (rutanmedellin.org/gen-n-tech) */
:root {
  --green-900: #1d2f2a;
  --green-800: #253d36;
  --green-600: #455a54;
  --lime: #c0d400;
  --orange: #dd4c17;
  --teal: #00b8a3;
  --yellow: #f0c82f;
  --blue: #3b68fa;
  --ink: #0f172a;
  --muted: #55645f;
  --line: #e4e9e7;
  --surface: #ffffff;
  --bg: #f7f9f8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Cabecera */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand img {
  display: block;
  height: 36px;
  width: auto;
}

.brand .n {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--lime);
  color: var(--green-900);
  font-weight: 900;
  font-size: 16px;
}

.nav-link {
  color: var(--green-800);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--green-800);
  white-space: nowrap;
}

.nav-link:hover { background: var(--green-800); color: #fff; }

/* Portada */
.hero {
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(192, 212, 0, 0.22), transparent 60%),
    radial-gradient(700px 360px at -10% 110%, rgba(0, 184, 163, 0.25), transparent 60%),
    var(--green-800);
  color: #fff;
  padding: 72px 0 64px;
  position: relative;
  overflow: hidden;
}

.hero .wrap { position: relative; z-index: 1; }

/* Elementos flotantes decorativos (de rutanmedellin.org/gen-n-tech).
   Se desplazan con el scroll: app.js fija el translateY según data-speed. */
section.block { position: relative; overflow: hidden; }

/* `translate` lo mueve app.js según el scroll; `transform` lo hace flotar en bucle. */
.deco {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  height: auto;
  will-change: translate, transform;
  animation: flotar 6s ease-in-out infinite;
}

.deco-instituciones-b,
.deco-como-b { animation-duration: 7.5s; animation-delay: -2s; }
.float-control,
.deco-instituciones-a { animation-delay: -3s; }

@keyframes flotar {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(2deg); }
}

.deco-instituciones-a { right: -70px; top: 40px; width: 320px; }
.deco-instituciones-b { left: -90px; top: 62%; width: 280px; }
.deco-como-a { right: -20px; top: 18%; width: 320px; }
.deco-como-b { left: -60px; bottom: 6%; width: 280px; }

.float-chica { left: 6%; top: 52%; width: 300px; }
.float-control { right: 6%; top: 56%; width: 280px; }

.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(192, 212, 0, 0.16);
  color: var(--lime);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.02em;
  max-width: 820px;
}

.hl-lime { color: var(--lime); }
.hl-orange { color: #ff7a4d; }

.hero p.lead {
  margin: 0;
  max-width: 640px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.86);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.stat {
  min-width: 150px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.stat strong {
  display: block;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  color: var(--lime);
}

.stat span { font-size: 14px; color: rgba(255, 255, 255, 0.8); }

/* Textos sin cifra: mismo cuadro que los demás, con el texto como etiqueta */
.stat.stat-text {
  flex: 1 1 170px;
  min-height: 104px;
  display: flex;
  align-items: center;
}

.stat.stat-text span {
  font-size: 15px;
  line-height: 1.35;
  color: #fff;
}

/* Secciones */
section.block { padding: 56px 0; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

/* Tarjetas de instituciones */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08), 0 16px 36px rgba(15, 23, 42, 0.14);
  outline: none;
}

.card::before {
  content: "";
  height: 6px;
  background: var(--accent);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 20px 22px;
  flex: 1;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-box {
  flex: 0 0 150px;
  width: 150px;
  height: 150px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.logo-box.initials {
  background: var(--accent);
  color: var(--green-900);
  font-weight: 900;
  font-size: 20px;
  border: none;
}

.card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--ink);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, white);
  color: var(--green-900);
  font-size: 13px;
  font-weight: 800;
}

.go { color: var(--green-800); }

/* Vista de institución */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 24px 0 8px;
  color: var(--green-800);
  font-weight: 700;
  text-decoration: none;
}

.back:hover { text-decoration: underline; }

.inst-head {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 6px solid var(--accent);
  margin-bottom: 8px;
}

.inst-head .logo-box { flex: 0 0 88px; width: 88px; height: 88px; }

.inst-head h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 900;
  line-height: 1.15;
}

.inst-head p { margin: 0; color: var(--muted); max-width: 720px; }

.inst-links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--green-800);
  background: var(--green-800);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: var(--green-900); }

.btn.ghost {
  background: transparent;
  color: var(--green-800);
}

.btn.ghost:hover { background: var(--bg); }

.btn.lime {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--green-900);
}

.btn.lime:hover { background: #cfe300; border-color: #cfe300; }

.project-grid { margin-top: 24px; }

.project {
  padding: 20px;
  gap: 10px;
}

.project .num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--green-900);
  font-weight: 900;
}

.project .team {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-600);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.project .actions {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project .actions .btn { flex: 1 1 auto; min-height: 40px; font-size: 14px; padding: 8px 14px; }

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Cómo participar */
.steps {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

.step {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.step .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  margin-bottom: 14px;
}

.step h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.step p { margin: 0; color: var(--muted); }

/* Pie */
.site-footer {
  background: var(--green-900);
  color: rgba(255, 255, 255, 0.78);
  padding: 32px 0;
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.site-footer a { color: var(--lime); }

/* Accentos por color */
[data-accent="lime"] { --accent: var(--lime); }
[data-accent="orange"] { --accent: #ff7a4d; }
[data-accent="teal"] { --accent: var(--teal); }
[data-accent="yellow"] { --accent: var(--yellow); }
[data-accent="blue"] { --accent: #7b9bff; }

:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
  .deco { animation: none; }
}

@media (max-width: 720px) {
  .deco { opacity: 0.85; animation-duration: 5s; }
  .deco-instituciones-a { width: 180px; right: -50px; top: 10px; }
  .deco-instituciones-b { width: 150px; left: -55px; top: auto; bottom: 10px; }
  .deco-como-a { width: 170px; right: -40px; }
  .deco-como-b { width: 150px; left: -50px; }
  .float-chica { width: 170px; left: -30px; top: auto; bottom: 8px; }
  .float-control { width: 150px; right: -26px; top: auto; bottom: 30px; }
}

@media (max-width: 520px) {
  .hero { padding: 48px 0 44px; }
  .stat { min-width: 0; flex: 1 1 140px; }
  .inst-head { flex-direction: column; align-items: flex-start; }
}
