@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* El nav es fijo (~73px): sin este margen los saltos a #ancla dejan el
     título de la sección tapado bajo la barra. */
  scroll-padding-top: 92px;
}

body {
  background: var(--bg);
  color: var(--text-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    /* Major: highlighted blueprint grid every 200px */
    linear-gradient(var(--grid-line-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-major) 1px, transparent 1px),
    /* Mid: every 40px */
    linear-gradient(var(--grid-line-mid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-mid) 1px, transparent 1px),
    /* Fine: every 8px (millimeter paper) */
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size:
    200px 200px,
    200px 200px,
    40px 40px,
    40px 40px,
    8px 8px,
    8px 8px;
  z-index: 0;
  mask-image:
    radial-gradient(ellipse at 50% 30%, #000 0%, rgba(0,0,0,0.55) 55%, transparent 95%);
  -webkit-mask-image:
    radial-gradient(ellipse at 50% 30%, #000 0%, rgba(0,0,0,0.55) 55%, transparent 95%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

main { position: relative; z-index: 2; }

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

/* Protección de medios: sin selección, sin arrastre y sin menú táctil
   "Guardar imagen" (iOS long-press). Complementa los handlers de main.js. */
img, video {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--cat-yellow); color: var(--graphite-950); }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-hi);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
h1 { font-weight: 800; font-size: var(--text-hero); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); font-weight: 600; }
h4 { font-size: var(--text-lg); font-weight: 600; letter-spacing: var(--tracking-snug); }

p { margin: 0 0 1em; max-width: var(--max-w-prose); }

.tech, .mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "ss01";
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-tech);
  color: var(--cat-yellow);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--cat-yellow);
  display: inline-block;
}

.lead {
  font-size: var(--text-lg);
  color: var(--text-md);
  max-width: 56ch;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--cat-yellow);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}

/* Utilidad: solo lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
