/* css/globals.css — base typography, container, modos de fondo, focus. */

body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  color: var(--fg-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Red de seguridad contra scroll horizontal por elementos decorativos
     (polígonos, marquee, etc.). overflow-x:clip evita el scroll sin
     romper position:sticky en hijos como overflow:hidden lo haría. */
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: inherit;
}

p { line-height: 1.6; }

/* === Tipografía utility === */

.h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.body-lg {
  font-size: clamp(18px, 1.4vw, 20px);
  line-height: 1.6;
  color: var(--fg-muted);
}

.body {
  font-size: 16px;
  line-height: 1.6;
}

.body-sm {
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-muted);
}

.mono {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 500;
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-magenta);
}

.eyebrow-burgundy { color: var(--brand-burgundy); }
.eyebrow-light    { color: rgba(255, 255, 255, 0.7); }

/* === Container === */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

@media (min-width: 769px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* === Selection === */

::selection {
  background: var(--brand-magenta);
  color: #FFFFFF;
}

/* === Focus visible accesible === */

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-magenta);
  outline-offset: 3px;
  border-radius: 4px;
}

/* === Modos de fondo === */

/* Plan A — bg-mode-blocks: las clases helper quedan disponibles
   y se aplican explícitamente solo donde el diseño lo pide. */
body.bg-mode-blocks .section-magenta  { background: var(--brand-magenta);  color: #FFFFFF; }
body.bg-mode-blocks .section-orange   { background: var(--brand-orange);   color: #FFFFFF; }
body.bg-mode-blocks .section-yellow   { background: var(--brand-yellow);   color: var(--fg-primary); }
body.bg-mode-blocks .section-cyan     { background: var(--brand-cyan);     color: #FFFFFF; }
body.bg-mode-blocks .section-burgundy { background: var(--brand-burgundy); color: #FFFFFF; }
body.bg-mode-blocks .section-dark     { background: var(--bg-dark);        color: #FFFFFF; }
body.bg-mode-blocks .section-soft     { background: var(--bg-soft);        color: var(--fg-primary); }

/* Plan B — bg-mode-tint: tinte global cíclico sutil. */
body.bg-mode-tint::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(135deg,
    rgba(233, 30, 99, 0.06)  0%,
    rgba(243, 146, 0, 0.06)  25%,
    rgba(251, 188, 4, 0.06)  50%,
    rgba(41, 182, 246, 0.06) 75%,
    rgba(126, 26, 45, 0.06)  100%);
  background-size: 400% 400%;
  animation: chameleon-tint 60s ease infinite;
}

@keyframes chameleon-tint {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* === 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;
  }
  html { scroll-behavior: auto; }
  body.bg-mode-tint::before { animation: none; }
}

/* === Scroll lock cuando el drawer está abierto === */

body.drawer-open { overflow: hidden; }
