/* ==========================================================================
   Base: reset, tipografía, layout, utilidades
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-variation-settings: "wdth" var(--wdth-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd, address { margin: 0; }
ul, ol { padding: 0; list-style: none; }
address { font-style: normal; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: normal; }

::selection { background: var(--pmv-neon); color: var(--pmv-forest); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 1px;
}

/* ---------- Tipografía de sistema ---------- */

.display,
h1, h2, h3 {
  font-weight: 800;
  font-variation-settings: "wdth" var(--wdth-display);
  text-transform: uppercase;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

.label {
  font-size: var(--fs-label);
  font-weight: 600;
  font-variation-settings: "wdth" var(--wdth-label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.3;
  color: var(--muted);
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--pmv-neon);
  color: var(--pmv-forest);
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform var(--dur-s) var(--ease-out);
}
.skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Estados iniciales de animación (solo con JS y motion activos) ---------- */
/* Si main.js no arranca en 4 s, head activa .motion-off y todo queda visible. */

html.js:not(.motion-off) [data-reveal],
html.js:not(.motion-off) [data-hero-in] { opacity: 0; }

html.js:not(.motion-off) [data-split],
html.js:not(.motion-off) [data-hero-title] { visibility: hidden; }

/* "El pliegue": máscara triangular a 45° desde la esquina inferior izquierda.
   --f = 0 oculto · 1 visible (JS lo anima; sin JS queda visible). */
[data-fold],
.story__shot {
  --f: 1;
  clip-path: polygon(0 100%, 0 calc(100% - var(--f) * 200%), calc(var(--f) * 200%) 100%);
}

/* Titular del hero: cada línea enmascarada (margen extra para el brillo del neón) */
.hero__line { overflow: clip; overflow-clip-margin: 0.25em; }
.hero__line-in { display: inline-block; }

/* Split: cada línea es una máscara */
.split-line { display: block; overflow: clip; overflow-clip-margin: 0.12em; padding-bottom: 0.04em; }
.split-line > * { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html.js [data-reveal], html.js [data-hero-in] { opacity: 1; }
  html.js [data-split], html.js [data-hero-title] { visibility: visible; }
}
