/* ============================================================
   IMPERIVM — GLOBAL.CSS
   Reset · Base · Tipografía · Layout · Grain texture
   ============================================================ */

/* ----------------------------------------------------------
   1. RESET Y BASE
   ---------------------------------------------------------- */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg-primary);
  color: var(--color-gray-100);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 300;
  line-height: 1.75;
  overflow-x: hidden;
  /* Grain texture sobre todo el body */
  position: relative;
}

/* Grain sutil — efecto de material sobre todos los fondos oscuros */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.6;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base), opacity var(--transition-base);
}

ul, ol {
  list-style: none;
}

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

/* ----------------------------------------------------------
   2. TIPOGRAFÍA — ESCALA JERÁRQUICA
   ---------------------------------------------------------- */

/* Display / H1 — Cormorant Garamond */
h1, .h1,
h2, .h2,
h3, .h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-gray-100);
}

h1, .h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2, .h2 {
  font-size: var(--text-h2);
}

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

/* Subtítulos y cuerpo — Jost */
p, li, td, th, label, input, textarea, select {
  font-family: var(--font-body);
}

p {
  max-width: 68ch;
  color: var(--color-gray-300);
  font-weight: 300;
  line-height: 1.8;
}

p + p {
  margin-top: 1rem;
}

/* Texto dorado — para subtítulos decorativos sobre los H */
.text-gold {
  color: var(--color-gold-primary);
}

.text-gold-light {
  color: var(--color-gold-light);
}

/* Eyebrow label — encima de títulos principales */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold-primary);
  display: block;
  margin-bottom: 0.75rem;
}

/* Héroe específico */
.hero-title {
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* ----------------------------------------------------------
   3. LAYOUT — CONTENEDOR Y GRID
   ---------------------------------------------------------- */

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

.container--narrow {
  max-width: 860px;
}

.section {
  padding-block: var(--section-padding);
}

/* Sección con fondo alternado */
.section--alt {
  background-color: var(--color-bg-section);
  position: relative;
}

/* Grid de 2 columnas */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

/* Grid de 3 columnas */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

/* Grid de 4 columnas */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
}

/* Flex utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ----------------------------------------------------------
   4. SEPARADOR ORNAMENTAL — marca visual de IMPERIVM
   ---------------------------------------------------------- */

.ornament {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-block: clamp(2.5rem, 5vw, 4rem);
}

.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-gold-muted) 30%,
    var(--color-gold-primary) 50%,
    var(--color-gold-muted) 70%,
    transparent
  );
}

.ornament::after {
  background: linear-gradient(
    to left,
    transparent,
    var(--color-gold-muted) 30%,
    var(--color-gold-primary) 50%,
    var(--color-gold-muted) 70%,
    transparent
  );
}

.ornament__diamond {
  width: 8px;
  height: 8px;
  background: var(--color-gold-primary);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* Separador simple (solo línea) */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-gold-muted) 20%,
    var(--color-gold-muted) 80%,
    transparent
  );
  margin-block: clamp(2rem, 4vw, 3rem);
}

/* ----------------------------------------------------------
   5. IMÁGENES CON OVERLAY EDITORIAL
   ---------------------------------------------------------- */

.img-editorial {
  position: relative;
  overflow: hidden;
}

.img-editorial img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
  /* Ligero desaturado para tono editorial */
  filter: brightness(0.92) contrast(1.05) saturate(0.85);
}

.img-editorial:hover img {
  transform: scale(1.04);
}

/* Overlay oscuro sobre imágenes */
.img-editorial::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,10,0.1) 0%,
    rgba(10,10,10,0.45) 100%
  );
  pointer-events: none;
}

/* ----------------------------------------------------------
   6. BACKGROUNDS Y SECCIONES ESPECIALES
   ---------------------------------------------------------- */

/* Sección con imagen de fondo tipo héroe */
.bg-hero {
  position: relative;
  background-color: var(--color-bg-primary);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10,10,10,0.88) 0%,
    rgba(10,10,10,0.65) 50%,
    rgba(10,10,10,0.82) 100%
  );
  z-index: 1;
}

.bg-hero > * {
  position: relative;
  z-index: 2;
}

/* Sección CTA — fondo dorado muy oscuro */
.bg-cta {
  background-color: #0f0d08;
  background-image: linear-gradient(
    135deg,
    rgba(184,150,62,0.06) 0%,
    transparent 50%,
    rgba(184,150,62,0.04) 100%
  );
  border-top: 1px solid var(--color-gold-muted);
  border-bottom: 1px solid var(--color-gold-muted);
}

/* ----------------------------------------------------------
   7. TEXTO CENTRADO / SECCIONES ENCABEZADO
   ---------------------------------------------------------- */

.section-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  margin-inline: auto;
  max-width: 55ch;
  color: var(--color-gray-500);
}

/* ----------------------------------------------------------
   8. ACCESIBILIDAD
   ---------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--color-gold-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

.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;
}

/* Skip link accesibilidad */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-gold-primary);
  color: #0a0a0a;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 10000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

/* ----------------------------------------------------------
   9. BREADCRUMB
   ---------------------------------------------------------- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--color-gray-500);
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
}

.breadcrumb a {
  color: var(--color-gray-500);
  transition: color var(--transition-base);
}

.breadcrumb a:hover {
  color: var(--color-gold-light);
}

.breadcrumb__sep {
  color: var(--color-gold-muted);
  font-size: 0.65rem;
  transform: rotate(15deg);
  display: inline-block;
}

.breadcrumb__current {
  color: var(--color-gold-light);
}

/* ----------------------------------------------------------
   10. RESPONSIVE — MOBILE FIRST BREAKPOINTS
   ---------------------------------------------------------- */

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------
   11. ANIMACIONES DE ENTRADA (scroll reveal)
   ---------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }
.reveal--delay-4 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
