/* ============================================================================
   BASE — reset acotado, superficies del navegador y tipografía de documento
   ========================================================================== */

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

/* El atributo hidden manda sobre cualquier display de clase. Sin este !important
   una regla como `.view--full { display: block }` deja la vista siempre visible:
   el enrutador cambia el atributo y no pasa nada. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper-10);
  color: var(--ink-10);
  font-family: var(--font-text);
  font-size: var(--t-base);
  line-height: 1.62;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-00);
  line-height: 1.08;
  letter-spacing: var(--track-display);
  text-wrap: balance;
  font-variation-settings: "SOFT" 22, "WONK" 1, "opsz" 40;
}

p { margin: 0 0 var(--s-4); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--pv-50);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: rgba(107, 63, 160, 0.40);
  text-decoration-color: color-mix(in oklab, var(--pv-50) 40%, transparent);
  transition: text-decoration-color var(--dur-micro) var(--ease-out),
              color var(--dur-micro) var(--ease-out);
}
a:hover { color: var(--pv-70); text-decoration-color: var(--pv-50); }

strong { font-weight: 600; color: var(--ink-00); }
em { font-style: italic; }

/* --- Superficies del navegador ---------------------------------------------
   Lo que no se dibuja también lleva el diseño. */
::selection { background: var(--pv-15); color: var(--ink-00); }
:root { caret-color: var(--pv-50); accent-color: var(--pv-50); }

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--pv-50);
  outline-offset: 3px;
  border-radius: 2px;
}
:where(a, button, summary):focus:not(:focus-visible) { outline: none; }

@supports (scrollbar-width: thin) {
  html { scrollbar-width: thin; scrollbar-color: var(--pv-30) var(--paper-20); }
}
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--paper-20); }
::-webkit-scrollbar-thumb {
  background: var(--pv-30);
  border: 3px solid var(--paper-20);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--pv-50); }

/* --- Grano de papel ---------------------------------------------------------
   Pseudo-elemento fijo, nunca sobre un contenedor con scroll. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.34;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.42'/%3E%3C/svg%3E");
}

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

.skip-link {
  position: absolute; top: var(--s-3); left: var(--s-3);
  z-index: var(--z-skip);
  transform: translateY(-160%);
  background: var(--pv-70); color: var(--paper-00);
  padding: var(--s-3) var(--s-5);
  font-size: var(--t-sm); font-weight: 600;
  text-decoration: none; border-radius: 3px;
  transition: transform var(--dur-micro) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); color: var(--paper-00); }

/* --- Modo de movimiento reducido -------------------------------------------
   Se desactivan deriva, parallax y el lienzo animado. Se conservan las
   transiciones de opacidad, que no producen vestíbulo. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
