/* Huellas Felices · estilos
   Paleta oficial (_marcas/huellasfelices/paleta.md). Para cambiar colores, solo se tocan estas variables. */
@font-face { font-family: "Fredoka"; font-weight: 400; font-display: swap; src: url("/fonts/fredoka-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 500; font-display: swap; src: url("/fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url("/fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 700; font-display: swap; src: url("/fonts/fredoka-latin-700-normal.woff2") format("woff2"); }

:root {
  --verde: #1d7e41;       /* verde principal: botones, elementos principales */
  --hoja: #6db331;        /* verde hoja: detalles */
  --ambar: #f59a25;       /* acento: contador, destacados */
  --blanco: #ffffff;      /* fondo */
  --osc: #0d4022;         /* texto y titulares */
  --azul: #187699;        /* azul planeta */
  --brote: #f1f8ea;       /* fondo alterno (hoja muy clara) */
  --linea: rgba(13, 64, 34, 0.14);
  --suave: rgba(13, 64, 34, 0.74);
  --fuente: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --ancho: 1140px;
  --gutter: clamp(16px, 4vw, 40px);
  --barra: 68px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--barra) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--blanco); color: var(--osc); font: 400 1.0625rem/1.6 var(--fuente); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--fuente); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
p { margin: 0; }
.oculto { position: absolute; width: 0; height: 0; overflow: hidden; }
.oculto-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; border-radius: 6px; }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 30; background: var(--osc); color: var(--blanco); padding: 10px 14px; border-radius: 10px; }
.saltar:focus { top: 12px; }
.contenido { position: relative; z-index: 1; max-width: var(--ancho); margin: 0 auto; }

/* ---------- botones ---------- */
.boton { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--ambar); color: var(--osc); font: 600 1.05rem/1 var(--fuente); text-decoration: none; cursor: pointer; isolation: isolate; transition: transform .15s ease; }
.boton:hover { transform: translateY(-2px); }
.boton:active { transform: translateY(0) scale(.98); }
.boton:disabled { opacity: .6; cursor: wait; transform: none; }
.boton-chico { min-height: 42px; padding: 0 18px; font-size: .98rem; }
.boton-claro { background: transparent; box-shadow: inset 0 0 0 2px var(--osc); }
.boton-verde { background: var(--verde); color: var(--blanco); }
/* brillo que cruza el botón */
.boton-brillo::after { content: ""; position: absolute; inset: -20% auto -20% 0; width: 40%; z-index: -1; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent); transform: translateX(-160%) skewX(-18deg); }

/* ---------- barra ---------- */
.barra { position: sticky; top: 0; z-index: 20; height: var(--barra); display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter); background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--linea); }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.marca-logo { width: 44px; height: 44px; transform-origin: 50% 85%; }
.marca:hover .marca-logo { animation: menea .6s ease-in-out; }
.marca-nombre { font: 700 1.35rem/1 var(--fuente); color: var(--osc); letter-spacing: -0.01em; }
.barra-nav { display: flex; gap: 22px; font-weight: 500; }
.barra-nav a { text-decoration: none; padding: 6px 0; }
.barra-nav a:hover { color: var(--verde); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- portada ---------- */
.portada { position: relative; background: var(--brote); padding: clamp(36px, 7vw, 96px) var(--gutter) clamp(48px, 8vw, 110px); overflow: hidden; }
.portada-int { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.portada-logo { width: clamp(96px, 12vw, 140px); height: auto; margin-bottom: 18px; transform-origin: 50% 90%; }
.portada h1 { font-size: clamp(2.5rem, 6.4vw, 4.6rem); font-weight: 700; max-width: 13ch; }
.portada-lema { margin-top: 18px; font-size: clamp(1.1rem, 2vw, 1.3rem); max-width: 40ch; color: var(--suave); }
.portada-botones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hojas { position: absolute; inset: 0; pointer-events: none; }
.hojas svg { position: absolute; width: var(--t, 34px); height: var(--t, 34px); fill: var(--c, var(--hoja)); opacity: .55; }
.hojas svg:nth-child(1) { left: 4%; top: 10%; --t: 30px; }
.hojas svg:nth-child(2) { left: 44%; top: 6%; --t: 22px; --c: var(--verde); opacity: .35; }
.hojas svg:nth-child(3) { left: 92%; top: 18%; --t: 40px; }
.hojas svg:nth-child(4) { left: 52%; top: 84%; --t: 26px; --c: var(--ambar); opacity: .5; }
.hojas svg:nth-child(5) { left: 8%; top: 78%; --t: 36px; --c: var(--verde); opacity: .3; }
.hojas svg:nth-child(6) { left: 86%; top: 80%; --t: 24px; }
.hojas svg:nth-child(7) { left: 30%; top: 56%; --t: 18px; opacity: .35; }

/* medidor: aro que se llena + número */
.medidor { margin: 0; display: grid; justify-items: center; gap: 16px; text-align: center; }
.medidor-aro { position: relative; width: clamp(250px, 36vw, 420px); aspect-ratio: 1; }
.medidor-aro svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.aro-fondo { fill: var(--blanco); stroke: rgba(13, 64, 34, .08); stroke-width: 14; }
.aro-lleno { fill: none; stroke: var(--ambar); stroke-width: 14; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; opacity: 0; }
.aro-lleno.lleno { opacity: 1; }
.medidor-centro { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; }
.medidor-num { font: 700 clamp(2.6rem, 7.2vw, 5.2rem)/1 var(--fuente); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--osc); }
.medidor-unidad { font: 600 clamp(1.05rem, 2vw, 1.35rem)/1 var(--fuente); color: var(--verde); }
.medidor-titulo { display: block; font: 600 clamp(1.15rem, 2.2vw, 1.4rem)/1.3 var(--fuente); }
.medidor-meta { display: block; margin-top: 4px; font-weight: 500; color: var(--verde); }
figcaption { min-height: 5.4em; }
.medidor-fecha { display: block; margin-top: 4px; font-size: .95rem; color: var(--suave); }

/* ---------- cinta ---------- */
.cinta { background: var(--ambar); color: var(--osc); overflow: hidden; padding: 14px 0; }
.cinta-pista { display: flex; width: max-content; font: 600 clamp(1.2rem, 3vw, 1.75rem)/1 var(--fuente); }
.cinta-pista span { display: inline-flex; align-items: center; gap: 22px; padding-right: 22px; white-space: nowrap; }
.cinta-pista span::after { content: ""; width: .7em; height: .7em; border-radius: 50% 0 50% 0; background: var(--verde); }
.cinta-pista span:nth-child(4n+2)::after { background: var(--blanco); }
.cinta-pista span:nth-child(4n+3)::after { background: var(--azul); }

/* ---------- bloques ---------- */
.bloque { position: relative; padding: clamp(64px, 9vw, 112px) var(--gutter); }
.seccion-intro { margin-top: 10px; color: var(--suave); font-size: 1.1rem; }

.nosotros-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.nosotros-texto p { margin-top: 14px; max-width: 58ch; white-space: pre-line; font-size: 1.1rem; }
.nosotros-texto h3 { margin-top: 36px; color: var(--verde); }
.prototipo { background: var(--brote); border-radius: 32px 32px 32px 8px; padding: clamp(24px, 4vw, 40px); }
.prototipo h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.prototipo p { margin-top: 12px; white-space: pre-line; max-width: 52ch; }
.ciclo { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: paso; }
.ciclo li { display: grid; justify-items: center; gap: 8px; text-align: center; font-weight: 600; position: relative; }
.ciclo li + li::before { content: ""; position: absolute; left: -14%; top: 34px; width: 22%; border-top: 3px dotted var(--hoja); }
.ciclo svg { width: 68px; height: 68px; background: var(--blanco); border-radius: 50%; padding: 10px; }
.i-osc { fill: var(--osc); } .i-ambar { fill: var(--ambar); } .i-claro { fill: var(--hoja); } .i-verde { fill: var(--verde); } .i-hoja { fill: var(--hoja); }

/* ---------- actividades ---------- */
.actividades { background: var(--brote); }
.lista-act { list-style: none; padding: 0; margin: clamp(28px, 5vw, 48px) 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(18px, 3vw, 28px); }
.act { background: var(--blanco); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; }
.act-foto { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--brote); }
.act-sin-foto { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--verde); }
.act-sin-foto svg { width: 34%; height: 34%; fill: rgba(255, 255, 255, .3); }
.act-cuerpo { padding: 20px 22px 24px; display: grid; gap: 8px; }
.act-fecha { display: inline-flex; align-self: start; justify-self: start; background: var(--ambar); color: var(--osc); font-weight: 600; font-size: .92rem; padding: 4px 12px; border-radius: 999px; }
.act h3 { font-size: 1.35rem; }
.act p { white-space: pre-line; color: var(--suave); }
.vacio { margin-top: 32px; display: flex; gap: 22px; align-items: center; background: var(--blanco); border-radius: 24px; padding: 24px; max-width: 620px; }
.vacio svg { flex: none; width: 72px; height: 80px; fill: var(--hoja); }
.vacio p + p { margin-top: 4px; color: var(--suave); }
.vacio .boton { margin-top: 14px; }

/* ---------- participar ---------- */
.participar { background: var(--verde); color: var(--blanco); }
.participar-int { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.participar-intro p { font-size: 1.2rem; max-width: 34ch; margin-top: 14px; }
.participar-puntos { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.participar-puntos li { display: flex; gap: 10px; align-items: flex-start; }
.participar-puntos li::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 6px; border-radius: 50% 0 50% 0; background: var(--ambar); }
.forma { display: grid; gap: 16px; background: var(--blanco); color: var(--osc); border-radius: 28px; padding: clamp(20px, 4vw, 36px); }
.campo { display: grid; gap: 6px; font-weight: 600; }
.campo em { font-weight: 400; font-style: normal; color: var(--suave); }
.campo input, .campo textarea { width: 100%; font: 400 1.05rem/1.4 var(--fuente); color: var(--osc); background: var(--brote); border: 2px solid rgba(13, 64, 34, .45); border-radius: 14px; padding: 12px 14px; }
.campo [aria-invalid="true"] { border-color: #b3261e; }
.campo input:focus, .campo textarea:focus { outline: none; border-color: var(--verde); background: var(--blanco); }
.campo textarea { resize: vertical; min-height: 88px; }
.campo-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.aviso { font-size: .93rem; line-height: 1.5; color: var(--suave); background: var(--brote); border-radius: 14px; padding: 12px 14px; }
.aviso p + p { margin-top: 6px; }
.casilla { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.casilla input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--verde); flex: none; }
.forma .boton { justify-self: start; }
.forma-estado { min-height: 1.6em; font-weight: 600; }
.forma-estado.error { color: #b3261e; }
.forma-estado.ok { color: var(--verde); }

/* ---------- pie ---------- */
.pie { background: var(--osc); color: rgba(255, 255, 255, .86); padding: 28px var(--gutter); font-size: .95rem; }
.pie-int { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center; }
.pie-marca { display: flex; align-items: center; gap: 10px; }
.pie-marca img { width: 32px; height: 32px; }
.pie a { color: var(--ambar); }
.pie :focus-visible, .participar :focus-visible { outline-color: var(--ambar); }
.forma :focus-visible { outline-color: var(--azul); }

/* ---------- camino de huellas (se genera con JS) ---------- */
.camino { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.camino svg { position: absolute; width: 26px; height: 29px; margin: -14px 0 0 -13px; fill: var(--c, var(--hoja)); opacity: 0; transform: rotate(var(--giro, 0deg)) scale(.4); transition: opacity .35s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.camino svg.pisa { opacity: var(--o, .3); transform: rotate(var(--giro, 0deg)) scale(1); }

/* ---------- animaciones (solo con JS y sin "reducir movimiento") ---------- */
@keyframes menea { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 60% { transform: rotate(9deg); } }
@keyframes rebote-entra { 0% { transform: translateY(-46px) scale(.7); opacity: 0; } 55% { transform: translateY(6px) scale(1.04); opacity: 1; } 75% { transform: translateY(-3px) scale(.99); } 100% { transform: none; opacity: 1; } }
@keyframes respira { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-3deg); } }
@keyframes flota { 0% { transform: translate(0, 0) rotate(0); } 33% { transform: translate(14px, -18px) rotate(35deg); } 66% { transform: translate(-10px, -6px) rotate(-25deg); } 100% { transform: translate(0, 0) rotate(0); } }
@keyframes corre { to { transform: translateX(-50%); } }
@keyframes brillo { 0%, 70% { transform: translateX(-160%) skewX(-18deg); } 100% { transform: translateX(360%) skewX(-18deg); } }
@keyframes gira { to { transform: rotate(360deg); } }

.anima .marca-logo { animation: rebote-entra .9s cubic-bezier(.3, .7, .4, 1) .1s both; }
.anima .marca:hover .marca-logo { animation: rebote-entra .9s cubic-bezier(.3, .7, .4, 1) .1s both, menea .6s ease-in-out; }
.anima .portada-logo { animation: rebote-entra 1s cubic-bezier(.3, .7, .4, 1) .25s both, respira 4s ease-in-out 1.4s infinite; }
.anima .hojas svg { animation: flota var(--d, 10s) ease-in-out var(--r, 0s) infinite; }
.anima .hojas svg:nth-child(2n) { --d: 13s; --r: -4s; }
.anima .hojas svg:nth-child(3n) { --d: 16s; --r: -7s; }
.anima .cinta-pista { animation: corre 28s linear infinite; }
.anima .boton-brillo::after { animation: brillo 4s ease-in-out 1.5s infinite; }
.anima .prototipo.visto .gira { animation: gira 6s linear infinite; }
.anima .aro-lleno { transition: stroke-dashoffset 2s cubic-bezier(.16, 1, .3, 1); }
.anima .revela { opacity: 0; transform: translateY(28px); transition: opacity .55s ease, transform .7s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--retraso, 0s); }
.anima .revela.visto { opacity: 1; transform: none; }
.anima .act.revela { transform: translateY(40px) scale(.97); }
.anima .act.revela.visto { transform: none; }
.chispa { position: fixed; z-index: 50; pointer-events: none; width: 24px; height: 26px; }

/* ---------- móvil ---------- */
@media (max-width: 900px) {
  .portada-int, .nosotros-grid, .participar-int { grid-template-columns: 1fr; }
  .portada-texto { text-align: center; display: grid; justify-items: center; }
  .portada h1 { max-width: 14ch; }
  .portada-botones { justify-content: center; }
  .barra-nav { display: none; }
}
@media (max-width: 480px) {
  :root { --barra: 60px; }
  .marca-logo { width: 38px; height: 38px; }
  .marca-nombre { font-size: 1.12rem; }
  .boton-chico { padding: 0 14px; font-size: .9rem; min-height: 40px; }
  .vacio { flex-direction: column; text-align: center; }
  .ciclo { gap: 6px; font-size: .92rem; }
  .ciclo svg { width: 58px; height: 58px; }
  .ciclo li + li::before { top: 29px; }
}
@media (max-width: 360px) {
  .marca-nombre { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
