/* ==========================================================================
   Nuberina · Base: fuentes, reset, tipografía, foco, utilidades
   ========================================================================== */

/* Fuentes autoalojadas (subset latin) */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../assets/fonts/manrope-200-800-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/caveat-400-700-latin.woff2") format("woff2");
}

/* Reset mínimo */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  /* Las formas pueden salir del viewport sin provocar scroll lateral */
  overflow-x: clip;
}

/* Grano sutil: textura cálida sobre toda la página */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* Tipografía */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h3 {
  font-weight: 700;
  line-height: 1.15;
}

p {
  max-width: 62ch;
}

a {
  color: inherit;
}

::selection {
  background-color: var(--color-navy);
  color: var(--color-cream);
}

/* Acento expresivo: Caveat, solo sobre una palabra o frase muy corta.
   Nunca en navegación, botones, formularios ni párrafos (VOICE.md). */
.script {
  font-family: var(--font-expressive);
  font-weight: 600;
  letter-spacing: 0;
  /* Caveat tiene ojo pequeño: se compensa para igualar presencia óptica */
  font-size: 1.15em;
  line-height: 1;
}

/* Foco visible y consistente */
:focus-visible {
  outline: 3px solid var(--color-navy);
  outline-offset: 3px;
  border-radius: 2px;
}

.on-navy :focus-visible {
  outline-color: var(--color-yellow);
}

/* Layout */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-section);
}

/* Utilidades */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Label pequeño tipo "IDEAS & SOFTWARE" */
.eyebrow {
  font-size: var(--font-small);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Reveal al hacer scroll (entrar / avanzar)
   Solo se oculta contenido si hay JS y el usuario acepta movimiento;
   sin JS o con reduced motion todo es visible desde el principio.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(1.5rem);
    transition:
      opacity var(--duration-editorial) var(--ease-out),
      transform var(--duration-editorial) var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
  }

  .js .reveal.is-inview {
    opacity: 1;
    transform: none;
  }
}

