:root {
  /* Identidad CTJ */
  --color-navy: #0B1F3A;
  --color-navy-mid: #152D4F;
  --color-navy-light: #1E3A5F;
  --color-gold: #D4A017;
  --color-gold-light: #E8B923;
  --color-gold-dark: #B8890F;
  --color-white: #FFFFFF;
  --color-off-white: #F8F7F4;
  --color-tobacco: #8B6914;
  --color-tobacco-light: #C4A35A;
  --color-earth: #5C4033;
  --color-earth-light: #8B7355;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-400: #9CA3AF;
  --color-gray-600: #4B5563;
  --color-gray-800: #1F2937;
  --color-text: #1F2937;
  --color-text-light: #4B5563;

  /* Roles semánticos (WCAG / B2B) */
  --color-primary: var(--color-navy);
  --color-primary-dark: #071528;
  --color-primary-light: var(--color-navy-light);
  --color-secondary: var(--color-earth);
  --color-accent: var(--color-gold);
  --color-background: var(--color-white);
  --color-surface: var(--color-off-white);
  --color-border: var(--color-gray-200);
  --color-success: #1B7A4E;
  --color-warning: #B45309;
  --color-error: #B91C1C;
  --color-info: #1D4ED8;
  --color-on-dark: #FFFFFF;
  --color-on-dark-muted: rgba(255, 255, 255, 0.88);

  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;

  --header-height: 104px;
  --header-height-scrolled: 80px;
  --container-max: 1440px;
  --container-narrow: 1040px;
  --section-padding: clamp(3.5rem, 6vw, 6rem);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-header: 0 4px 24px rgba(11, 31, 58, 0.15);
  --shadow-card: 0 8px 32px rgba(11, 31, 58, 0.08);
  --line-accent: 3px solid var(--color-gold);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Fondos full-bleed / cajas con cover: llenan el marco sin forzar height:auto */
.hero__video,
.hero__bg-image,
.media-fx img,
.media-fx video,
.site-footer__hero-img img {
  height: 100%;
}

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

ul, ol {
  list-style: none;
}

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

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3.5rem);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section--dark {
  background: var(--color-navy);
  color: var(--color-white);
}

.section--off-white {
  background: var(--color-off-white);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  width: 24px;
  height: var(--line-accent);
  background: var(--color-gold);
}

.section--dark .section-label {
  color: var(--color-gold-light);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 2.8vw + 0.4rem, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-navy);
  margin-bottom: 1.25rem;
}

.section--dark .section-title {
  color: var(--color-white);
}

.section-subtitle {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--color-text-light);
  max-width: 640px;
  line-height: 1.75;
}

.section--dark .section-subtitle {
  color: var(--color-on-dark-muted);
}

.section-header {
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.section-header--center {
  text-align: center;
}

.section-header--center .section-subtitle {
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-gold);
  color: var(--color-navy);
}

.btn--primary:hover {
  background: var(--color-gold-light);
  transform: translateY(-1px);
}

.btn--outline {
  border: 2px solid var(--color-white);
  color: var(--color-white);
  background: transparent;
}

.btn--outline:hover {
  background: var(--color-white);
  color: var(--color-navy);
}

.btn--outline-dark {
  border: 2px solid var(--color-navy);
  color: var(--color-navy);
  background: transparent;
}

.btn--outline-dark:hover {
  background: var(--color-navy);
  color: var(--color-white);
}

.btn--link {
  padding: 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--color-navy);
  position: relative;
}

.btn--link::after {
  content: '→';
  margin-left: 0.35rem;
  transition: transform var(--transition-base);
}

.btn--link:hover::after {
  transform: translateX(4px);
}

.btn--link-gold {
  color: var(--color-gold-dark);
}

/* Placeholder images */
.img-placeholder {
  position: relative;
  background: linear-gradient(135deg, var(--color-navy-mid) 0%, var(--color-earth) 50%, var(--color-tobacco) 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(255,255,255,0.03) 10px,
    rgba(255,255,255,0.03) 20px
  );
}

.img-placeholder__label {
  position: relative;
  z-index: 1;
  padding: 0.75rem 1.25rem;
  background: rgba(11, 31, 58, 0.55);
  color: transparent;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  border: 0;
}

.img-placeholder--public .img-placeholder__label,
.img-placeholder:not(.img-placeholder--labeled) .img-placeholder__label {
  display: none;
}

.img-placeholder--hero {
  min-height: 100%;
}

.img-placeholder--field {
  background: linear-gradient(160deg, #1a472a 0%, #2d5a3d 30%, #8B6914 70%, #5C4033 100%);
}

.img-placeholder--industrial {
  background: linear-gradient(160deg, var(--color-navy) 0%, var(--color-gray-600) 50%, var(--color-earth) 100%);
}

.img-placeholder--product {
  background: linear-gradient(180deg, var(--color-off-white) 0%, #e8dcc8 100%);
}

.img-placeholder--product .img-placeholder__label {
  background: rgba(11, 31, 58, 0.7);
}

.img-placeholder--lab {
  background: linear-gradient(160deg, #e8eef5 0%, var(--color-navy-light) 100%);
}

.img-placeholder--lab .img-placeholder__label {
  color: var(--color-white);
}

/* Media transitions (admin-configurable; fade default) */
.media-fx {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.media-fx img,
.media-fx video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-fx--fade {
  animation: mediaFxFade var(--media-fx-duration, 1.1s) ease both;
}

.media-fx--slide {
  animation: mediaFxSlide var(--media-fx-duration, 1s) ease both;
}

.media-fx--none {
  animation: none;
}

/* Orden: antes = transición al entrar (default). Después = medio visible y luego animación. */
.media-fx-order--after {
  animation: none !important;
  opacity: 1;
}

.media-fx-order--after.is-fx-ready.media-fx--fade {
  animation: mediaFxFade var(--media-fx-duration, 1.1s) ease both !important;
}

.media-fx-order--after.is-fx-ready.media-fx--slide {
  animation: mediaFxSlide var(--media-fx-duration, 1s) ease both !important;
}

.media-fx-order--after.media-fx--none.is-fx-ready {
  animation: none !important;
}

.hero__bg.media-fx--fade .hero__video.is-playing,
.hero__bg.media-fx--fade .hero__bg-fallback {
  animation: mediaFxFade var(--media-fx-duration, 1.4s) ease both;
}

.hero__bg.media-fx--slide .hero__video.is-playing,
.hero__bg.media-fx--slide .hero__bg-fallback {
  animation: mediaFxSlide var(--media-fx-duration, 1.2s) ease both;
}

.hero__bg.media-fx-order--after .hero__video.is-playing,
.hero__bg.media-fx-order--after .hero__bg-fallback {
  animation: none;
}

.hero__bg.media-fx-order--after.is-fx-ready.media-fx--fade .hero__video.is-playing,
.hero__bg.media-fx-order--after.is-fx-ready.media-fx--fade .hero__bg-fallback {
  animation: mediaFxFade var(--media-fx-duration, 1.4s) ease both;
}

.hero__bg.media-fx-order--after.is-fx-ready.media-fx--slide .hero__video.is-playing,
.hero__bg.media-fx-order--after.is-fx-ready.media-fx--slide .hero__bg-fallback {
  animation: mediaFxSlide var(--media-fx-duration, 1.2s) ease both;
}

@keyframes mediaFxFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mediaFxSlide {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .media-fx--fade,
  .media-fx--slide,
  .media-fx-order--after.is-fx-ready.media-fx--fade,
  .media-fx-order--after.is-fx-ready.media-fx--slide,
  .hero__bg.media-fx--fade .hero__video.is-playing,
  .hero__bg.media-fx--fade .hero__bg-fallback,
  .hero__bg.media-fx--slide .hero__video.is-playing,
  .hero__bg.media-fx--slide .hero__bg-fallback,
  .hero__bg.media-fx-order--after.is-fx-ready.media-fx--fade .hero__video.is-playing,
  .hero__bg.media-fx-order--after.is-fx-ready.media-fx--fade .hero__bg-fallback,
  .hero__bg.media-fx-order--after.is-fx-ready.media-fx--slide .hero__video.is-playing,
  .hero__bg.media-fx-order--after.is-fx-ready.media-fx--slide .hero__bg-fallback {
    animation: none;
  }
}

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

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