/*
 * @castilloenfoca — Dirección editorial premium v1
 *
 * Este archivo es la capa visual final. No cambia contenido ni comportamiento:
 * reduce estímulos simultáneos, conserva la atmósfera de brasa y organiza el
 * recorrido con una escala Fibonacci (8, 13, 21, 34, 55, 89) y composiciones
 * 61.8 / 38.2. La proporción es una herramienta de ritmo, no un efecto decorativo.
 */

:root {
  --editorial-ink: #090706;
  --editorial-coal: #100b09;
  --editorial-surface: rgba(18, 12, 10, 0.91);
  --editorial-surface-raised: rgba(25, 16, 12, 0.94);
  --editorial-ivory: #fff8e9;
  --editorial-muted: #cdbfb6;
  --editorial-amber: #ffb52e;
  --editorial-fire: #ff5a12;
  --editorial-line: rgba(255, 181, 46, 0.22);
  --editorial-radius-sm: 13px;
  --editorial-radius: 21px;
  --editorial-radius-lg: 34px;
  --editorial-shadow: 0 21px 55px rgba(0, 0, 0, 0.38);
  --editorial-section: clamp(55px, 7vw, 89px);
}

body {
  color: var(--editorial-ivory);
  background-color: #120807;
  background-image:
    radial-gradient(ellipse 61.8% 38.2% at 3% 12%, rgba(218, 50, 20, 0.34), transparent 72%),
    radial-gradient(ellipse 38.2% 61.8% at 96% 48%, rgba(142, 34, 20, 0.28), transparent 76%),
    radial-gradient(ellipse 61.8% 38.2% at 10% 86%, rgba(255, 82, 15, 0.2), transparent 75%),
    linear-gradient(112deg, #190b08 0%, #0b0706 38.2%, #160b08 61.8%, #090605 100%);
}

/* La brasa queda como atmósfera. El contenido —no el efecto— vuelve a mandar. */
body::before {
  opacity: 0.3;
  filter: saturate(0.9) contrast(1.02);
  animation-duration: 18s;
}

body > section:not(#hero) {
  position: relative;
  isolation: isolate;
  padding-block: var(--editorial-section) !important;
  background: transparent !important;
}

body > section:not(#hero)::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255, 181, 46, 0.1) 38.2%, transparent 61.8%) top / 100% 1px no-repeat,
    radial-gradient(ellipse 38.2% 61.8% at 0 50%, rgba(255, 84, 18, 0.065), transparent 76%);
}

body > section:nth-of-type(2n + 1):not(#hero)::before {
  transform: scaleX(-1);
}

section[data-editorial-chapter]::after {
  content: attr(data-editorial-chapter);
  position: absolute;
  z-index: -1;
  top: 21px;
  right: max(21px, calc((100vw - var(--content-max)) / 2));
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 213, 142, 0.09);
  font: 900 clamp(5.5rem, 11vw, 10rem)/0.8 var(--font-heading, sans-serif);
  letter-spacing: -0.08em;
  pointer-events: none;
}

/* Un solo lenguaje tipográfico: editorial, firme y sin relieve artificial. */
.display-title,
.hero-headline {
  color: var(--editorial-ivory);
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.gradient-text {
  color: var(--editorial-amber);
  background: linear-gradient(105deg, #ffe09a 0%, #ffb52e 38.2%, #ff6a18 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: none;
  text-shadow: none;
}

/*
 * Contrato permanente de portada:
 * - escritorio: el video ocupa todo el lienzo, grande y cinematográfico;
 * - móvil: conserva el cuadro vertical completo.
 * Esta excepción solo pertenece a #heroVideo y no modifica ninguna otra foto.
 */
@media (min-width: 821px) {
  #hero .hero-bg-media[data-media-frame="full"] #heroVideo[data-layout-contract="cinematic-cover"] {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center 46% !important;
  }

  #hero .hero-bg-media[data-media-frame="full"]::before {
    opacity: 0.42;
  }
}

@media (max-width: 820px) {
  #hero .hero-bg-media[data-media-frame="full"] #heroVideo[data-layout-contract="cinematic-cover"] {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
}

section[data-editorial-chapter] .section-header {
  position: relative;
  width: min(100%, 1040px);
  max-width: none;
  margin: 0 0 clamp(34px, 5vw, 55px);
  padding-left: 21px;
  border-left: 1px solid rgba(255, 181, 46, 0.52);
  text-align: left;
}

section[data-editorial-chapter] .section-header::before {
  content: 'CAPÍTULO ' attr(data-chapter);
  display: block;
  margin-bottom: 13px;
  color: rgba(255, 209, 130, 0.68);
  font: 800 0.65rem/1 var(--font-mono, monospace);
  letter-spacing: 0.2em;
}

section[data-editorial-chapter] .section-header::after {
  width: 89px;
  margin: 21px 0 0;
  background: linear-gradient(90deg, var(--editorial-amber), transparent);
}

section[data-editorial-chapter] .section-header .section-tag {
  width: fit-content;
  margin: 0 0 13px;
  padding: 0;
  border: 0;
  color: #dfc8b8;
  background: transparent;
  box-shadow: none;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
}

section[data-editorial-chapter] .section-header .section-tag .dot {
  width: 5px;
  height: 5px;
  box-shadow: 0 0 13px rgba(255, 92, 18, 0.72);
}

section[data-editorial-chapter] .section-header .display-title {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(2.6rem, 4.8vw, 5rem);
  line-height: 0.94;
  text-align: left;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45) !important;
}

/* Superficies coherentes: profundidad por contraste, no por una docena de glows. */
:where(
  .pillar-panel-display,
  .veo-theater-container,
  .ecosystem-card,
  .player-card,
  .case-card,
  .hardware-showcase-box,
  .service-card,
  .testimonial-card,
  .venue-card,
  .booking-box,
  .faq-item
) {
  border-color: var(--editorial-line) !important;
  background-color: var(--editorial-surface) !important;
  box-shadow: var(--editorial-shadow) !important;
}

:where(.ecosystem-card, .player-card, .case-card, .service-card, .testimonial-card, .venue-card) {
  border-radius: var(--editorial-radius) !important;
}

:where(.ecosystem-card, .player-card, .case-card, .service-card, .testimonial-card, .venue-card):hover {
  border-color: rgba(255, 181, 46, 0.5) !important;
  transform: translateY(-5px);
  box-shadow: 0 34px 72px rgba(0, 0, 0, 0.48) !important;
}

/* Precios: el único capítulo con máxima luminancia. */
#servicios .services-grid {
  align-items: stretch;
  gap: 21px;
}

#servicios .service-card {
  height: 100%;
  padding: 21px;
  background:
    linear-gradient(155deg, rgba(34, 20, 15, 0.98), rgba(13, 10, 9, 0.98)) !important;
}

#servicios .service-card::before {
  height: 2px;
  opacity: 0.72;
  background: linear-gradient(90deg, transparent, var(--editorial-amber), transparent);
  box-shadow: none;
}

#servicios .service-card h3 {
  min-height: 2.15em;
  font-size: clamp(1.2rem, 1.45vw, 1.72rem);
  line-height: 1.05;
}

#servicios .service-card > p {
  min-height: 4.5em;
}

#servicios .service-price-box {
  min-height: 144px;
  padding: 18px 13px;
  border-color: rgba(255, 208, 103, 0.78);
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 194, 71, 0.13), transparent 58%),
    rgba(22, 13, 10, 0.94);
  box-shadow:
    inset 0 1px rgba(255, 250, 228, 0.24),
    0 0 21px rgba(255, 140, 21, 0.18) !important;
}

#servicios .service-price-value {
  font-size: clamp(2.4rem, 3.1vw, 3.45rem);
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.88),
    0 0 21px rgba(255, 195, 81, 0.7),
    0 0 34px rgba(255, 91, 12, 0.38) !important;
}

#servicios .service-price-value.custom-quote {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

#servicios .service-card[data-service-id="fotos"] {
  border-color: rgba(255, 217, 145, 0.74) !important;
  box-shadow:
    inset 0 1px rgba(255, 245, 220, 0.16),
    0 21px 55px rgba(0, 0, 0, 0.44),
    0 0 34px rgba(255, 129, 21, 0.17) !important;
}

/* La dorsal sigue siendo el segundo gran momento: limpia y ceremonial. */
.player-delivery-stage[data-editorial-lead="true"] {
  width: min(calc(100% - 42px), var(--content-max));
  margin-inline: auto;
  border: 1px solid rgba(255, 181, 46, 0.42);
  border-radius: var(--editorial-radius-lg);
  background:
    radial-gradient(ellipse 61.8% 38.2% at 82% 8%, rgba(255, 119, 18, 0.11), transparent 72%),
    rgba(10, 8, 7, 0.78) !important;
  box-shadow: 0 34px 89px rgba(0, 0, 0, 0.5) !important;
}

.player-delivery-stage .player-kit-stage {
  border-radius: 26px;
  box-shadow: 0 21px 55px rgba(0, 0, 0, 0.32);
}

/* El contenido repetido se vuelve exploración horizontal en pantallas grandes. */
@media (min-width: 1180px) {
  #servicios .services-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .scouting-cards-grid,
  .gallery-grid {
    display: grid !important;
    grid-template-columns: none !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(292px, 23.6%);
    gap: 21px !important;
    padding: 8px 3px 21px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-color: rgba(255, 181, 46, 0.52) rgba(255, 255, 255, 0.04);
    scrollbar-width: thin;
  }

  .gallery-grid {
    grid-auto-columns: minmax(310px, 29.2%);
  }

  .scouting-cards-grid > *,
  .gallery-grid > * {
    scroll-snap-align: start;
  }

  .scouting-cards-grid::-webkit-scrollbar,
  .gallery-grid::-webkit-scrollbar {
    height: 6px;
  }

  .scouting-cards-grid::-webkit-scrollbar-thumb,
  .gallery-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--editorial-amber), var(--editorial-fire));
  }

  .scouting-cards-grid::-webkit-scrollbar-track,
  .gallery-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
  }
}

/* Composiciones 61.8 / 38.2 en los momentos de decisión. */
@media (min-width: 821px) {
  section[data-editorial-chapter] .section-header {
    display: block;
  }

  .booking-grid,
  .hardware-showcase-box,
  .pillar-panel-display {
    grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr) !important;
  }

  .pillar-tabs-container {
    gap: 13px;
  }

  .pillar-tab-btn {
    min-height: 144px;
    padding: 21px;
  }

  .success-cases-grid,
  .testimonials-grid,
  .venues-grid,
  .ecosystem-grid {
    gap: 21px;
  }

  #faq .container {
    width: min(calc(100% - 55px), 980px);
  }
}

/* Móvil: una idea por pantalla, texto legible y gesto de exploración evidente. */
@media (max-width: 820px) {
  body::before {
    opacity: 0.2;
    animation: none;
  }

  body > section:not(#hero) {
    padding-block: 55px !important;
  }

  section[data-editorial-chapter]::after {
    top: 18px;
    right: 18px;
    font-size: 4.6rem;
  }

  section[data-editorial-chapter] .section-header {
    width: calc(100% - 8px);
    margin-bottom: 34px;
    padding-left: 13px;
  }

  section[data-editorial-chapter] .section-header .display-title {
    max-width: 11.5ch;
    font-size: clamp(2rem, 10.4vw, 2.72rem);
    line-height: 0.96;
  }

  section[data-editorial-chapter] .section-header .section-tag {
    max-width: 31ch;
    font-size: 0.58rem;
    line-height: 1.45;
  }

  .mobile-rail-guide {
    margin-bottom: 13px;
    color: #baaaa0;
  }

  .mobile-rail-guide > b {
    color: #ffd079;
  }

  .focus-content-rail {
    gap: 13px !important;
    padding-bottom: 13px;
  }

  .focus-content-rail > * {
    box-shadow: 0 13px 34px rgba(0, 0, 0, 0.34) !important;
  }

  #servicios .service-card {
    padding: 21px 18px;
  }

  #servicios .service-card h3,
  #servicios .service-card > p {
    min-height: 0;
  }

  #servicios .service-price-box {
    min-height: 152px;
  }

  .player-delivery-stage[data-editorial-lead="true"] {
    width: calc(100% - 26px);
    border-radius: 24px;
  }

  .gallery-grid {
    display: grid !important;
    grid-template-columns: none !important;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    gap: 13px !important;
    padding-bottom: 13px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .gallery-grid::-webkit-scrollbar {
    display: none;
  }

  .gallery-grid > * {
    scroll-snap-align: start;
  }

  .booking-box,
  .hardware-showcase-box,
  .pillar-panel-display,
  .veo-theater-container {
    border-radius: 21px !important;
  }

  /* La interfaz móvil libera espacio al desplazarse sin alterar el hero inicial. */
  .site-header,
  .site-header .header-inner,
  .site-announcement {
    transition: min-height 180ms ease, height 180ms ease, max-height 180ms ease,
      margin 180ms ease, padding 180ms ease, opacity 140ms ease;
  }

  .site-header.scrolled {
    min-height: 66px;
    padding-bottom: 4px;
  }

  .site-header.scrolled .site-announcement {
    min-height: 0;
    max-height: 0;
    padding-block: 0;
    opacity: 0;
  }

  .site-header.scrolled .header-inner {
    min-height: 56px;
    height: 56px;
    margin-top: 4px;
  }

  .site-header .mobile-menu-toggle,
  .site-header .brand-logo,
  .mobile-nav-item,
  .mobile-detail-toggle,
  .btn-primary-glow,
  .btn-tactical-overlay,
  .tactical-mode-toggle,
  .btn-speed,
  .btn-open-scout,
  .coverage-radius-banner .btn,
  .booking-contact-text a,
  .footer-links a,
  .footer-legal-links a {
    min-height: 44px;
  }

  .site-header .mobile-menu-toggle {
    min-width: 44px;
    width: 44px;
    height: 44px;
  }

  .booking-contact-text a,
  .footer-links a,
  .footer-legal-links a {
    display: inline-flex;
    align-items: center;
  }

  /* En móvil se conserva toda la información, pero se revela cuando aporta valor. */
  .pillar-content-box .pillar-feature-checklist[data-disclosure-content="ready"],
  .booking-grid .booking-form[data-disclosure-content="ready"] {
    display: none;
  }

  .pillar-content-box.is-details-open .pillar-feature-checklist[data-disclosure-content="ready"],
  .booking-grid.is-details-open .booking-form[data-disclosure-content="ready"] {
    display: grid;
  }

  .pillar-content-box > .mobile-detail-toggle {
    margin-top: 18px;
  }

  .booking-grid > .mobile-detail-toggle {
    grid-column: 1 / -1;
    min-height: 52px;
    margin: 4px 0 0;
    padding-inline: 18px;
    border-color: rgba(255, 181, 46, 0.64);
    color: #fff8e9;
    background: linear-gradient(100deg, rgba(255, 90, 18, 0.22), rgba(255, 181, 46, 0.12));
    box-shadow: 0 13px 34px rgba(255, 90, 18, 0.12);
    font-size: 0.72rem;
  }

  .pillar-content-box h3.display-title,
  .pillar-content-box h3 {
    font-size: clamp(1.9rem, 9vw, 2.45rem);
    line-height: 0.98;
  }

  .pillar-content-box > p {
    font-size: 0.94rem;
    line-height: 1.55;
  }

  /* Un estado de carga reconocible evita marcos negros mientras llega el medio HD. */
  .player-card-media,
  .gallery-item {
    background-color: #0b0d0b;
    background-image:
      url('../assets/favicon.svg'),
      radial-gradient(circle at center, rgba(255, 181, 46, 0.13), transparent 48%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 44px, 100% 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}
