/* ==========================================================================
   Base: reset, tipografía y layout. Depende de tokens.css.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 96px;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Fondo vivo: degradado radial cuyos colores recorre js/motion-kit.js
   (pageGradient) según el scroll, como si bajaras por un solo degradado. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(90% 70% at 50% 55%, var(--bg-glow) 0%, var(--bg-mid) 55%, var(--bg-edge) 100%);
  pointer-events: none;
}
/* Patrón "$ GRINGA": una sola pieza a pantalla completa (sin costuras),
   en amarillo Gringa (#FFE810) al 6 %. */
body::after {
  content: "";
  position: fixed;
  inset: -4%;
  z-index: -1;
  background: url("../assets/img/patron-amarillo-ligero.webp") center / cover no-repeat;
  opacity: var(--pattern-opacity, .06);
  pointer-events: none;
}
/* Móvil: la capa es más alta que la pantalla (cubre también cuando la barra
   del navegador se esconde) y el patrón se ve más grande, sin cortes. */
@media (max-width: 768px) {
  body::after {
    inset: auto;
    top: -10vh; left: 50%;
    width: 150vh; height: 130lvh;
    transform: translateX(-50%);
    background-size: cover;
  }
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

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

::selection { background: var(--accent); color: var(--text-on-accent); }

/* ---- Tipografía ------------------------------------------------------- */
.display, h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  text-transform: uppercase;
  text-wrap: balance;
}
.t-hero { font-size: var(--fs-hero); }
h1, .t-h1 { font-size: var(--fs-h1); }
h2, .t-h2 { font-size: var(--fs-h2); }
h3, .t-h3 { font-size: var(--fs-h3); line-height: 1; }

.lead { font-size: var(--fs-lead); color: var(--text-muted); max-width: 52ch; text-wrap: pretty; }
p { text-wrap: pretty; }
.t-sm { font-size: var(--fs-sm); }
.t-xs { font-size: var(--fs-xs); }
.t-muted { color: var(--text-muted); }
.t-subtle { color: var(--text-subtle); }
.t-strong { font-weight: 700; }

/* Palabra destacada en titulares */
.hl       { color: var(--highlight); }
.hl-neon  { color: var(--accent); }

/* Palabra destacada sobre fondo claro: tinta verde con marcador amarillo */
.hl-ink {
  color: var(--atg-forest);
  background: linear-gradient(transparent 62%, var(--atg-yellow) 62%, var(--atg-yellow) 92%, transparent 92%);
  padding: 0 .08em;
}

/* Sección clara: redefine los roles de color y los componentes se adaptan solos */
.theme-light {
  --text:          #0B2614;   /* 15.9:1 sobre #F3FCF0 */
  --text-muted:    #3B5A45;   /* 7.4:1 */
  --text-subtle:   #5E7A66;   /* 4.6:1 */
  --surface:       #fff;
  --surface-strong:#E4F9DF;
  --border:        rgba(13, 64, 32, .12);
  --border-strong: rgba(13, 64, 32, .24);
  --accent:        var(--atg-forest);
  --eyebrow:       var(--atg-forest);
  color: var(--text);
  background: var(--green-50);
}

/* Etiqueta encima del titular: solo cuando aporta un dato que el titular no dice.
   Texto normal, sin raya delante ni mayúsculas espaciadas. */
.eyebrow {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--eyebrow);
}

/* ---- Layout ------------------------------------------------------------ */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.section { padding-block: var(--section-y); position: relative; }
.section-head {
  display: grid;
  gap: var(--sp-4);
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}
.section-head--center { text-align: center; justify-items: center; }
.section-head--center .lead { margin-inline: auto; }

.stack   { display: grid; gap: var(--stack-gap, var(--sp-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--sp-3)); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: var(--z-overlay);
  background: var(--highlight); color: var(--text-on-accent);
  padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); font-weight: 700;
}
.skip-link:focus { top: var(--sp-4); }

/* Barra de desplazamiento de Tu Gringa */
@media (forced-colors: none) {
  @supports selector(::-webkit-scrollbar) {
    html::-webkit-scrollbar { width: 11px; }
    html::-webkit-scrollbar-track { background: var(--atg-forest); }
    html::-webkit-scrollbar-thumb {
      background: linear-gradient(180deg, var(--atg-neon), var(--atg-yellow));
      border: 2px solid var(--atg-forest);
      border-radius: 999px;
    }
    @media (hover: hover) {
      html::-webkit-scrollbar-thumb:hover { background: var(--atg-neon); }
    }
  }
  @supports not selector(::-webkit-scrollbar) {
    html { scrollbar-color: var(--atg-yellow) var(--atg-forest); }
  }
}
