/* =========================================================================
   SOLET — Base: reset, tipografía, retícula y utilidades
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--ink-400) var(--paper-2);
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Textura de fondo: halos fríos de marca sobre papel. Nunca blanco plano. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 80% -12%, rgba(0, 133, 200, 0.07), transparent 62%),
    radial-gradient(900px 620px at 4% 6%, rgba(68, 172, 52, 0.055), transparent 60%),
    linear-gradient(180deg, var(--paper-0) 0%, var(--paper-1) 55%, var(--paper-2) 100%);
}

/* Grano finísimo para que el degradado no “bandee” */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Grano de papel: rompe el degradado y evita el aspecto "plantilla".
     Sin mix-blend-mode: al ser una capa fija, mezclarla rompe el compositing
     de las secciones que llevan will-change y dejaba huecos sin pintar. */
  opacity: 0.03;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text-hi);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.05;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); letter-spacing: -0.012em; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

strong, b { color: var(--text-hi); font-weight: 600; }

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

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

/* ---------------- Retícula ---------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: 900px; }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--flush-top { padding-top: 0; }

.grid { display: grid; gap: clamp(1.25rem, 3vw, 2.5rem); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------- Tipografía de apoyo ---------------- */

/* Etiqueta técnica monoespaciada con “LED” de acento */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65em;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 1.25rem;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: led 2.8s var(--ease-in-out) infinite;
  transform: rotate(45deg);
  flex: none;
}
@keyframes led {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%      { box-shadow: 0 0 0 4px var(--accent-soft); }
}

.lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text);
  max-width: 62ch;
}

.muted { color: var(--text-mid); }
.measure { max-width: 64ch; }
.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

/* Palabra resaltada con subrayado de “tensión”.
   box-decoration-break: clone repite el subrayado en cada línea cuando la
   frase resaltada se parte en varias, en lugar de desbordar el contenedor. */
.hl {
  color: var(--text-hi);
  padding-bottom: 0.06em;
  background-image: linear-gradient(90deg, transparent, var(--accent) 16%, var(--accent) 84%, transparent);
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 100%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* En texto SIEMPRE la variante oscurecida: el verde puro no contrasta
   lo suficiente sobre papel para leerse cómodo. */
.accent-text { color: var(--accent-ink); }

/* Divisor con nodo central, tipo esquema eléctrico */
.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline) 15%, var(--hairline) 85%, transparent);
  border: 0;
  margin: 0;
  position: relative;
}

/* ---------------- Utilidades ---------------- */

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

.skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.7rem 1.2rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); }

.notch {
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, var(--notch) 100%, 0 calc(100% - var(--notch)));
}

.stack > * + * { margin-top: var(--stack-gap, 1rem); }

@media (max-width: 760px) { .hide-sm { display: none !important; } }
@media (min-width: 761px) { .hide-lg { display: none !important; } }

/* ---------------- Aparición al hacer scroll ---------------- */
/* Sin JS todo queda visible: los estilos sólo se aplican con .js en <html> */

.js .reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity 900ms var(--ease-out) var(--reveal-delay, 0ms),
    transform 900ms var(--ease-out) var(--reveal-delay, 0ms),
    clip-path 900ms var(--ease-out) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js .reveal.is-in { opacity: 1; transform: none; }

.js .reveal--wipe { clip-path: inset(0 100% 0 0); transform: none; opacity: 1; }
.js .reveal--wipe.is-in { clip-path: inset(0 0 0 0); }

.js .reveal--scale { transform: scale(1.06); opacity: 0; }
.js .reveal--scale.is-in { transform: scale(1); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal--wipe, .js .reveal--scale {
    opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
