/* ============================================================
   Nuevas Ciencias — hoja de estilos principal
   ============================================================ */

/* ===== FUENTES (self-hosted) ===== */
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/playfair-display-v40-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/playfair-display-v40-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/playfair-display-v40-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-v19-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/source-sans-3-v19-latin-600.woff2") format("woff2");
}

/* Variables canónicas del ecosistema viven en assets/tokens.css.
   Aquí solo overrides locales si los hubiera. Decisión 2026-05-06.
   Si necesitas añadir una variable de paleta, hazlo en tokens.css
   (no aquí) para que wiki y Lab también la hereden. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Cinturón de seguridad contra scroll horizontal en mobile:
     candidatos potenciales son el tooltip de la constelación en viewports
     ultra-estrechos y cualquier elemento con `position: fixed/absolute`
     que accidentalmente salga de bounds. No afecta layout normal. */
  overflow-x: hidden;
}

p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  text-wrap: balance;
  line-height: 1.15;
  margin: 0;
  hyphens: none;     /* nunca cortar títulos */
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}
::selection { background: var(--sage); color: var(--text); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--text); color: var(--bg);
  padding: 10px 16px; z-index: 1000;
  font-family: var(--sans);
}
.skip-link:focus { left: 8px; top: 8px; }

/* Contenido visualmente oculto pero accesible a lectores de pantalla */
.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  margin: -1px;
  padding: 0;
  border: 0;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 68px;
  z-index: 100;
  display: flex;
  align-items: center;
  /* Fondo semi-opaco desde el inicio para que los links nunca compitan
     visualmente con el H1 del hero. El blur es ligero para no robar
     peso al hero; se intensifica al hacer scroll. */
  background: rgba(249, 251, 249, 0.72);
  backdrop-filter: saturate(130%) blur(4px);
  -webkit-backdrop-filter: saturate(130%) blur(4px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
.navbar.scrolled {
  background: rgba(249, 251, 249, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.navbar .container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;          /* evita overflow en niños con contenido largo */
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.brand img {
  display: block;
  height: 36px;
  width: auto;
  flex-shrink: 0;
}
.brand-wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  padding: 0; margin: 0;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nav-links a {
  color: var(--text);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}
/* Underline dorado sutil animado desde el centro */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--gold);
  transition: width 0.25s ease, left 0.25s ease;
}
.nav-links a:hover { color: var(--green-dark); }
.nav-links a:hover::after { width: 100%; left: 0; }
.nav-links a[aria-current="page"] {
  color: var(--text);
}
.nav-links a[aria-current="page"]::after {
  width: 100%;
  left: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ecosystem-cta-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.ecosystem-cta-wrap.is-dismissed {
  display: none;
}
.ecosystem-cta {
  white-space: nowrap;
}
.ecosystem-cta-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--green-dark);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.ecosystem-cta-dismiss:hover {
  opacity: 1;
  background: var(--card-hover);
  color: var(--text);
}
.ecosystem-cta-dismiss:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  border-radius: 4px;
  padding: 8px 20px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  text-decoration: none;
  line-height: 1.2;
}
.btn-primary {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold-darker); border-color: var(--gold-darker); }
.btn-secondary {
  background: transparent;
  color: var(--green-dark);
  border: 2px solid var(--sage);
}
.btn-secondary:hover { background: var(--card-hover); }
.btn-lg { padding: 12px 28px; font-size: 16px; }

.nav-toggle { display: none; }

/* ===== HERO ===== */
.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 128px 0 80px;
  position: relative;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(169,200,163,0.18), transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(139,105,20,0.08), transparent 60%),
    var(--bg);
  /* Fallback primero: Safari ≤15 y otros navegadores que no conocen
     `overflow: clip` ignoran esa regla entera y se quedarían con `visible`
     (el hero podría desbordar horizontal). Con `hidden` como base están
     cubiertos. Los navegadores modernos sobreescriben con `clip`, que
     permite `overflow-clip-margin` para que hijos posicionados (tooltips)
     se pinten fuera de la caja por hasta 80px. */
  overflow: hidden;
  overflow: clip;
  overflow-clip-margin: 80px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
  min-width: 0;
}
/* Desktop: copy a la izquierda, constelación a la derecha (DOM va al revés) */
.hero-grid .hero-copy        { order: 1; min-width: 0; }
.hero-grid .constellation-wrap { order: 2; min-width: 0; }
/* Constellation stage */
.constellation {
  position: relative;
  aspect-ratio: 1/1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  justify-self: center;
  touch-action: manipulation;
}
.constellation canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.constellation .origami {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  max-width: 280px;
  height: auto;
  /* Propiedades individuales para que la animación (scale) no pise el centrado (translate).
     Soporte: Chrome 104+, Safari 14.1+, Firefox 72+. */
  translate: -50% -50%;
  pointer-events: none;
  filter: drop-shadow(0 8px 24px rgba(74,103,65,0.18));
  z-index: 2;
  animation: origami-breathe 12s ease-in-out infinite;
  /* oculta el ícono de imagen rota si el archivo no carga */
  color: transparent;
  font-size: 0;
}
.constellation .origami[data-loaded="false"] {
  display: none;
}
.constellation .roots-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52%;
  transform: translate(-50%, 8%);
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: multiply;
}
.constellation .roots-glow path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
  transition: opacity 0.4s ease;
}
.constellation .roots-glow circle {
  fill: var(--gold);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.node-tooltip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.35;
  padding: 8px 12px;
  border-radius: 4px;
  max-width: 220px;
  opacity: 0;
  /* Default: encima del nodo, centrado. JS sobreescribe translate según
     el flip vertical y el offset horizontal exacto. */
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 0.2s ease;
  white-space: normal;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  --tt-arrow-x: 50%;   /* JS ajusta cuando el tooltip se desplaza horizontalmente */
}
/* Cola apuntando hacia abajo (tooltip arriba del nodo) */
.node-tooltip::after {
  content: "";
  position: absolute;
  left: var(--tt-arrow-x);
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}
/* Flip vertical: tooltip debajo del nodo; cola apunta hacia arriba */
.node-tooltip.tt-flip-down::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--text);
}
.node-tooltip.visible { opacity: 1; }
.node-tooltip em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--sage);
}
.constellation-hint {
  position: absolute;
  left: 50%;
  bottom: -34px;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  /* Color un paso más oscuro que --green-dark (#4A6741) para compensar la
     opacidad y cumplir WCAG AA sobre el fondo #F9FBF9 del hero. */
  color: #3A5433;
  opacity: 0.78;
  white-space: nowrap;
  /* Flash suave cuando el JS cambia opacity/texto tras tap con toggle off. */
  transition: opacity 0.25s ease;
}

/* Toggle "Enlaces vivos" — lowkey, off por default. Debajo del hint.
   Opacidades calibradas para cumplir WCAG AA sobre el fondo del hero. */
.links-toggle {
  position: absolute;
  left: 50%;
  bottom: -62px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3A5433;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}
.links-toggle:hover { opacity: 1; }
.links-toggle input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}
.links-toggle-track {
  position: relative;
  width: 26px;
  height: 14px;
  border-radius: 8px;
  background: rgba(74, 103, 65, 0.25);
  transition: background-color 0.25s ease;
  flex-shrink: 0;
}
.links-toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.25s ease;
}
.links-toggle input:checked ~ .links-toggle-track {
  background: var(--gold);
}
.links-toggle input:checked ~ .links-toggle-track::after {
  transform: translateX(12px);
}
.links-toggle input:focus-visible ~ .links-toggle-track {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 1.8rem + 2.8vw, 4rem);
  letter-spacing: 0.005em;
  line-height: 1.05;
  color: var(--text);
  margin: 0 0 10px;
  text-transform: none;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  letter-spacing: 0.005em;
  line-height: 1.25;
  color: var(--green-dark);
  margin-bottom: 14px;
  hyphens: none;
  max-width: 26ch;
}
.rule {
  width: 40px;
  height: 2px;
  background: var(--gold);
  border: none;
  margin: 24px 0;
}
.hero-lead {
  max-width: 520px;
  margin: 0 0 28px;
}

/* ===== HERO CAMPAIGN CTA =====
   Borrar este bloque + el bloque HTML marcado "HERO CAMPAIGN CTA"
   para volver al hero anterior. */
.hero-campaign-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.hero-campaign-cta__button {
  padding: 11px 22px;
  min-height: 48px;
  box-shadow: 0 10px 26px rgba(139, 105, 20, 0.16);
}
.hero-campaign-cta__button span[aria-hidden="true"] {
  transition: transform 0.22s ease;
}
.hero-campaign-cta__button:hover span[aria-hidden="true"] {
  transform: translateX(3px);
}
.hero-campaign-cta__promise {
  max-width: 300px;
  margin: 0;
  color: var(--green-dark);
  font-size: 0.98rem;
  line-height: 1.45;
}
#suscribir {
  scroll-margin-top: 88px;
}
/* ===== /HERO CAMPAIGN CTA ===== */

/* Paw prints easter egg */
.paw-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.paw-print {
  position: absolute;
  width: 22px;
  height: 22px;
  color: var(--green-dark);
  opacity: 0;
  transform-origin: 50% 50%;
  animation: paw-fade 3.2s ease-out forwards;
}
@keyframes paw-fade {
  0%   { opacity: 0; }
  25%  { opacity: 0.22; }
  80%  { opacity: 0.18; }
  100% { opacity: 0; }
}

/* ===== SECTION TITLES ===== */
.section {
  padding: 100px 0;
}
.section-title-wrap {
  text-align: center;
  margin-bottom: 56px;
}
.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
  color: var(--text);
}
.rule-center {
  width: 40px;
  height: 2px;
  background: var(--gold);
  border: none;
  margin: 20px auto 0;
}

/* ===== CARDS ===== */
.card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  overflow: hidden;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: block;
  color: inherit;
}
.card > article {
  display: block;
  height: 100%;
}
.card:hover {
  background: var(--card-hover);
  box-shadow: 0 10px 28px rgba(0,0,0,0.1);
}
/* Zoom sutil al hover.
   Para .float7/.float10/.sway5: la animación usa `translate`/`rotate`, así que
   `scale: 1.035` del hover no compite con ellas y basta con `animation-play-state`.
   Para .breathe: la animación anima `scale`, y según la especificación CSS las
   animaciones (incluso pausadas) ganan sobre reglas normales del cascade. Por eso
   en `.breathe` sacamos la animación del cascade con `animation-name: none`. */
.card:hover .card-img {
  animation-play-state: paused;
  scale: 1.035;
}
.card:hover .card-img.breathe {
  animation-name: none;
  scale: 1.035;
}

.card-hero {
  margin-bottom: 32px;
}
.card-hero > article {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  align-items: stretch;
}
.card-image {
  overflow: hidden;
  position: relative;
  background: #E8E3DA;
}
.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  /* Solo animamos `scale` (propiedad individual); `transform` no cambia aquí. */
  transition: scale 0.8s ease;
}
.card-img-dark { background-color: #0A0E1A; }
.breathe { animation: gentle-breathe 7s ease-in-out infinite; }
.float7  { animation: gentle-float 8s ease-in-out infinite; animation-delay: -2s; }
.sway5   { animation: gentle-sway 6s ease-in-out infinite; animation-delay: -1s; }
.float10 { animation: gentle-float 10s ease-in-out infinite; }
/* Alinear object-position de cada imagen (reemplaza background-position).
   Usamos clases explícitas en vez de [src*="..."] para no romper en silencio
   si alguien renombra un archivo. */
.card-img--placer { object-position: center 28%; }
.card-img--sobre  { object-position: center 20%; }

.card-hero .card-image { aspect-ratio: 4/3; }
.card-body {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.card-body h3 {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
}
.card-hero .subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--text);
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
}
.engagement {
  font-size: clamp(0.8rem, 0.75rem + 0.25vw, 0.9rem);
  color: var(--green-dark);
  letter-spacing: 0.02em;
}
.link-gold {
  color: var(--gold);
  font-weight: 600;
  font-family: var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
}
.link-gold:hover { color: var(--green-dark); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card-sm .card-image { aspect-ratio: 3/2; }
.card-sm .card-body { padding: 24px 24px 28px; gap: 10px; }
.card-sm h3 { font-size: 1.4rem; }
.card-sm .subtitle {
  font-family: var(--sans);
  color: var(--text);
  font-size: 1rem;
  margin: 0;
}

/* ===== ECOSYSTEM ===== */
.eco-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.eco-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px 32px;
  text-align: center;
  background: var(--bg);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: inherit;
}
.eco-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.eco-card h3 { font-size: 1.6rem; }
.eco-card p {
  color: var(--text);
  margin: 0;
}
.eco-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
}
.eco-link {
  margin-top: auto;
  padding-top: 8px;
}
.eco-soon {
  /* Antes tenía `font-style: italic`, pero Source Sans 3 no se carga con
     @font-face italic y el browser generaba un faux italic tosco a 600.
     Distinguimos por letter-spacing + opacity sin sacrificar legibilidad. */
  color: var(--green-dark);
  font-family: var(--sans);
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

/* ===== QUOTE ===== */
.quote {
  background: var(--quote-bg);
  padding: 100px 0;
  text-align: center;
}
.quote .rule-center {
  margin: 0 auto;
  width: 60px;
  height: 1px;
  background: var(--sage);
}
.quote figure { margin: 0; }
.quote blockquote { margin: 0; padding: 0; border: 0; }
.quote-text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem);
  color: var(--text);
  max-width: 820px;
  margin: 40px auto;
  line-height: 1.45;
}
.quote-attr {
  font-family: var(--sans);
  color: var(--green-dark);
  font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1rem);
  margin-bottom: 40px;
}

/* ===== ABOUT ===== */
.about {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 64px;
  align-items: center;
}
.about-photo {
  aspect-ratio: 1/1;
  border-radius: 12px;
  background: #DDE5DD;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.about-photo > .about-photo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  max-width: none;
}
.about-eyebrow {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin: 0 0 10px;
}
.about-quote {
  margin: 0 0 24px;
  padding: 0;
  border: none;
}
.about-quote p {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.2rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
  margin: 0 0 12px;
}
.about-quote cite {
  font-family: var(--sans);
  font-style: normal;
  color: var(--green-dark);
  font-size: 0.95rem;
  display: block;
}
.about-quote cite a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(139, 105, 20, 0.4);
  text-underline-offset: 3px;
}
.about-quote cite a:hover { color: var(--green-dark); }
.about p { margin: 0 0 16px; }
.about .jake-note {
  font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
  color: var(--green-dark);
  margin-top: 14px;
}
.paw {
  display: inline-block;
  margin-left: 6px;
  transform: translateY(1px);
}

/* ===== CTA ===== */
.cta-final {
  padding: 96px 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--warm-tint) 100%);
  border-top: 2px solid var(--gold-soft);
  border-bottom: 2px solid var(--gold-soft);
  text-align: center;
}
.cta-final h2 {
  font-size: clamp(1.8rem, 1.5rem + 2vw, 3rem);
  margin-bottom: 12px;
}
.cta-final .sub {
  color: var(--green-dark);
  margin-bottom: 32px;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.1rem);
}
.subscribe-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  max-width: 560px;
  margin: 0 auto 16px;
  flex-wrap: wrap;
}
.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 0;        /* evita overflow; antes min-width:300px causaba desborde en mobile <340px */
  font: inherit;
  font-family: var(--sans);
  padding: 12px 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.3s ease;
}
@media (min-width: 540px) {
  .subscribe-form input[type="email"] { min-width: 280px; }
}
.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--gold);
}
.subscribe-feedback {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--green-dark);
  transition: opacity 0.3s ease;
}
.subscribe-feedback.success { color: var(--green-dark); }
.subscribe-feedback.error { color: var(--gold); }

.cta-fine {
  font-size: clamp(0.8rem, 0.75rem + 0.25vw, 0.9rem);
  color: var(--green-dark);
  margin-top: 12px;
}

/* ===== FOOTER ===== */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 56px 0 48px;
  text-align: center;
  font-family: var(--sans);
}
.footer-logo {
  display: inline-block;
  margin-bottom: 20px;
}
.footer-logo img {
  height: 112px;
  width: auto;
  opacity: 0.95;
}
footer .flinks ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}
footer .flinks li { display: inline; }
footer .flinks li + li::before {
  content: " · ";
  margin: 0 8px;
  opacity: 0.55;
}
footer .flinks a { color: var(--footer-text); transition: color 0.3s ease; }
footer .flinks a:hover { color: var(--sage); }
footer .copy {
  margin-top: 14px;
  color: var(--footer-text);
  opacity: 0.55;
  font-size: clamp(0.8rem, 0.75rem + 0.25vw, 0.9rem);
}

/* ===== 404 ===== */
.notfound {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 0 80px;
  text-align: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(169,200,163,0.18), transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(139,105,20,0.08), transparent 60%),
    var(--bg);
}
.notfound .container {
  max-width: 680px;
}
.notfound-code {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(4rem, 3rem + 6vw, 8rem);
  color: var(--sage);
  opacity: 0.55;
  margin: 0 0 8px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.notfound-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem);
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.15;
  text-wrap: balance;
}
.notfound .rule {
  margin: 24px auto;
}
.notfound-lead {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
  color: var(--green-dark);
  margin: 0 0 20px;
  line-height: 1.45;
}
.notfound-lead-sm {
  font-family: var(--sans);
  font-style: normal;
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  color: var(--text);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.6;
}
.notfound-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.notfound-fine {
  font-size: 0.9rem;
  color: var(--green-dark);
  opacity: 0.85;
}
.notfound-fine a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(139,105,20,0.35);
  text-underline-offset: 3px;
}
.notfound-fine a:hover { color: var(--green-dark); }

/* ===== REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== KEYFRAMES ===== */
/* Keyframe dedicado al origami: usa la propiedad individual `scale` para no
   pisar el `translate: -50% -50%` que mantiene el centrado del elemento. */
@keyframes origami-breathe {
  0%, 100% { scale: 1; }
  50% { scale: 1.02; }
}
/* Keyframes de las cards: usan propiedades individuales (translate, scale,
   rotate) para poder coexistir con el hover scale de .card:hover .card-img. */
@keyframes gentle-breathe {
  0%, 100% { scale: 1; }
  50% { scale: 1.02; }
}
@keyframes gentle-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}
@keyframes gentle-sway {
  0%, 100% { translate: -2px 0; rotate: -0.2deg; }
  50% { translate: 2px 0; rotate: 0.2deg; }
}

/* ===== RESPONSIVE ===== */
/* Breakpoint a 1024px: incluye tablets portrait (iPad 1024×1366, iPad Mini 768×1024).
   A 900px las dos columnas hero + constellation quedaban apretadas en portrait. */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .constellation { max-width: 420px; }
  .hero { padding-top: 100px; min-height: auto; }
  /* HERO CAMPAIGN CTA: en mobile, copy + CTA antes que la visualización.
     Si se retira la CTA, se puede volver al orden natural del DOM. */
  .hero-grid .hero-copy { order: 1; }
  .hero-grid .constellation-wrap { order: 2; }
  /* Mobile: hint y toggle más cerca del stage. Además reservamos el espacio
     con padding-bottom en .constellation-wrap para que los elementos absolutos
     no se empalmen con el wordmark / la sección "Puertas abiertas" que vienen
     inmediatamente debajo. */
  .constellation-wrap { padding-bottom: 56px; }
  .constellation-hint { bottom: -18px; }
  .links-toggle { bottom: -44px; }
  /* Mobile: tooltip más estrecho para que el clamp horizontal no lo empuje
     drásticamente hacia el lado opuesto cuando un nodo está pegado al borde. */
  .node-tooltip { max-width: 170px; font-size: 12px; padding: 7px 10px; }
  .card-hero > article { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .eco-grid { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about-photo { max-width: 280px; margin: 0 auto; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle {
    display: inline-flex;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text);
  }
  .brand-wordmark { display: none; }
  .ecosystem-cta {
    padding: 7px 14px;
    font-size: 14px;
  }
  .subscribe-form { flex-direction: column; }
  .subscribe-form input[type="email"] { min-width: 0; width: 100%; }
  .subscribe-form button { width: 100%; justify-content: center; }
  .section { padding: 72px 0; }
  .card-body { padding: 28px; }
  .brand img { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
