/* ============================================================================
   PAU ALDEA BATISTA — Base
   ----------------------------------------------------------------------------
   Reset moderno + tipografía base. Todo lo demás se construye encima.
   ============================================================================ */

/* ── Box model & reset ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  font-weight: 400;
  overflow-x: hidden;
}

/* Subtle film grain (mantenemos, baja opacidad) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ── Tipografía · jerarquía clara ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-1);
  overflow-wrap: break-word;
  word-break: break-word;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, var(--text-6xl));
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.875rem, 4vw, var(--text-3xl));
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-lg);
  font-weight: 600;
}

h5 {
  font-size: var(--text-md);
  font-weight: 600;
}

h6 {
  font-size: var(--text-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-2);
}

p {
  color: var(--text-2);
  line-height: var(--leading-relaxed);
  max-width: 68ch;
}

p + p {
  margin-top: var(--space-3);
}

a {
  color: var(--blue-300);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--blue-200);
}

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

em, .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--blue-200);
}

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

small {
  font-size: var(--text-sm);
  color: var(--text-2);
}

ul, ol {
  padding-left: 1.2em;
}

li {
  margin-bottom: var(--space-2);
  color: var(--text-2);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ── Skip link · accesibilidad ──────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  background: var(--blue-500);
  color: var(--bg-0);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-4);
  color: var(--bg-0);
}

/* ── Selection ───────────────────────────────────────────────────────────── */
::selection {
  background: var(--blue-500);
  color: var(--bg-0);
}

/* ── Scrollbar · discreta ───────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-0);
}

::-webkit-scrollbar-thumb {
  background: var(--border-3);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--blue-500);
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@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;
  }
}
