:root {
  --nav-h: 76px;
  --brand-dark: #1F5216;
  --brand-mid: #2E741E;
  --brand-light: #97D13F;
  --brand-gold: #97D13F;
}
html { scroll-padding-top: calc(var(--nav-h) + 12px); scroll-behavior: smooth; }
body { font-family: "Poppins", system-ui, sans-serif; color: #1B2E17; background: #fff; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .font-display { font-family: "Poppins", system-ui, sans-serif; letter-spacing: -0.02em; }

/* Barra sutil de progreso de scroll (CSS Scroll-Driven nativo con fallback JS) */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: linear-gradient(90deg, var(--brand-light), var(--brand-gold));
  transform-origin: 0 50%; transform: scaleX(0); will-change: transform; pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes grow-progress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
    .scroll-progress {
      animation: grow-progress auto linear;
      animation-timeline: scroll();
    }
  }
}

/* Diferir renderizado de secciones pesadas bajo el pliegue (content-visibility) */
.heavy-section-deferred {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 650px;
}

/* Enlace de salto (accesibilidad WCAG) */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; color: var(--brand-dark); padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip-link:focus { left: 12px; }

:focus-visible { outline: 3px solid var(--brand-gold); outline-offset: 2px; border-radius: 6px; }

/* Revelado bidireccional GPU (al bajar y al subir con el scroll) */
.reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.985);
  transition: opacity .65s cubic-bezier(.22, 1, .36, 1), transform .65s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}
.reveal[data-reveal-dir="up"] {
  transform: translate3d(0, -26px, 0) scale(0.985);
}
.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Transición fluida para números con conteo animado (sin saltos horizontales) */
.num-live {
  font-variant-numeric: tabular-nums;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1), opacity .35s ease;
}
.num-updating {
  transform: translate3d(0, -1px, 0) scale(1.03);
}

/* Física táctil universal para botones, chips, tabs y enlaces CTA (nada seco) */
button,
[role="tab"],
a[class*="rounded-full"],
summary {
  transition:
    transform .22s cubic-bezier(.22, 1, .36, 1),
    background-color .22s ease,
    color .22s ease,
    border-color .22s ease,
    box-shadow .25s ease,
    opacity .2s ease;
}
button:not(:disabled):active,
[role="tab"]:active,
a[class*="rounded-full"]:active,
summary:active {
  transform: translate3d(0, 1px, 0) scale(0.96);
}

/* Entrada escalonada fluida para listas, paneles y tarjetas al filtrar o cambiar tab */
@keyframes uiSlideIn {
  from { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.ui-item-in {
  animation: uiSlideIn .38s cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: var(--d, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  .ui-item-in { animation: none !important; }
  button:active, [role="tab"]:active, a[class*="rounded-full"]:active, summary:active { transform: none !important; }
}

/* Menú desplegable de opciones (#mobile-menu) con apertura y cierre suave (0fr -> 1fr) */
#menu-btn svg { transition: transform .32s cubic-bezier(.22, 1, .36, 1); }
#menu-btn[aria-expanded="true"] svg { transform: rotate(90deg) scale(1.06); }
#mobile-menu {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  border-top-width: 0;
  pointer-events: none;
  transition:
    grid-template-rows .36s cubic-bezier(.22, 1, .36, 1),
    opacity .28s ease;
}
#mobile-menu > ul {
  width: 100%;
  justify-self: stretch;
  text-align: left;
  overflow: hidden;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  transform: translate3d(0, -10px, 0);
  transition:
    padding .36s cubic-bezier(.22, 1, .36, 1),
    transform .36s cubic-bezier(.22, 1, .36, 1);
}
#mobile-menu.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  border-top-width: 1px;
  pointer-events: auto;
}
#mobile-menu.is-open > ul {
  padding-top: 1rem;
  padding-bottom: 1rem;
  transform: translate3d(0, 0, 0);
}
@media (min-width: 1280px) {
  #mobile-menu { display: none !important; }
}

/* Selects desplegables animados (Zona/sector, Año, Motivo) con appearance: base-select */
@supports (appearance: base-select) {
  select, select::picker(select) { appearance: base-select; }
  select { align-items: center; justify-content: space-between; cursor: pointer; }
  select::picker-icon { transition: transform .28s cubic-bezier(.22, 1, .36, 1); color: #2A430A; }
  select:open::picker-icon { transform: rotate(180deg); }
  select::picker(select) {
    background: #fff; color: #1E293B; border: 1px solid #cbd5e1; border-radius: 14px;
    padding: 4px; margin-top: 4px; box-shadow: 0 18px 36px -10px rgba(15, 23, 42, .24);
    opacity: 0; transform: translate3d(0, -6px, 0) scale(0.97);
    transition-property: opacity, transform, display, overlay;
    transition-duration: .24s; transition-timing-function: cubic-bezier(.22, 1, .36, 1);
    transition-behavior: allow-discrete;
  }
  select::picker(select):popover-open { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  @starting-style {
    select::picker(select):popover-open { opacity: 0; transform: translate3d(0, -6px, 0) scale(0.97); }
  }
  select option { border-radius: 10px; padding: 8px 10px; transition: background-color .16s ease, color .16s ease; }
  select option:hover, select option:checked { background: #F5F8F0; color: #2A430A; font-weight: 600; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal[data-reveal-dir="up"] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .float-y, .marquee-track, h1, h2, h3, .text-grad-anim, .praderas-sky-real, .praderas-bird, .praderas-tree, .praderas-leaf { animation: none !important; }
}
@keyframes floatY { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -8px, 0); } }
.float-y { animation: floatY 6s ease-in-out infinite; will-change: transform; }

/* Tipografía con degradado animado en todo el sitio (verde activo + lima Poppins) */
@keyframes textGradFlow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
h1, h2, h3, .text-grad-anim {
  background-image: linear-gradient(110deg, #1B4812 0%, #2E741E 35%, #6DB528 65%, #2E741E 100%);
  background-size: 240% auto; -webkit-background-clip: text; background-clip: text; color: transparent !important;
  animation: textGradFlow 6.5s ease-in-out infinite;
}
:is(section.bg-bosque, aside.bg-bosque, footer, .bg-bosque, [class*="bg-[#0F2A1F]"]) :is(h1, h2, h3, .text-grad-anim) {
  background-image: linear-gradient(110deg, #ffffff 0%, #edfad6 36%, #a4dc4a 66%, #ffffff 100%);
}
:is(h1, h2, h3).text-oro-light {
  background-image: linear-gradient(110deg, #a4dc4a 0%, #f1fce0 42%, #97d13f 78%, #ffffff 100%);
}

.bg-dots { background-image: radial-gradient(rgba(151, 209, 63, .28) 1.3px, transparent 1.3px); background-size: 22px 22px; }
.bg-grid-dark { background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 44px 44px; }

/* Nav link activo */
.nav-link { position: relative; padding: 8px 2px; font-size: .875rem; font-weight: 500; color: #3F543C; transition: color .2s; }
.nav-link:hover { color: var(--brand-dark); }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #97D13F; transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--brand-dark); font-weight: 600; }
