/* Escena principal: estilo Synthetic Monolith (stitch/DESIGN.md).
   Solo afecta a #scene. La intro, el panel de noticias y el resto del sitio no cambian. */

.scene {
  --st-bg: #12131a;
  --st-surface: #1a1b22;
  --st-card: #1e1f27;
  --st-line: #3a494b;
  --st-text: #e3e1ec;
  --st-muted: #b9cacb;
  --st-cyan: #00f3ff;
  --st-amber: #ffbd58;
  --st-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --st-body: 'Inter', system-ui, sans-serif;
  --st-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  background: var(--st-bg);
  color: var(--st-text);
  font-family: var(--st-body);
  min-height: 100svh;
  padding: 96px clamp(20px, 4vw, 56px) 150px;
}

/* Fondo plano con fábricas pequeñas, sin textura ni cuadrícula */
.scene .scene-image {
  background-color: var(--st-bg) !important;
  background-image: url('assets/factory-scene.svg') !important;
  background-repeat: no-repeat !important;
  background-position: right 0 bottom 2% !important;
  background-size: min(46%, 700px) auto !important;
  animation: none !important;
  filter: none !important;
  opacity: .9;
}
.scene .scene-overlay {
  background: linear-gradient(180deg, rgba(18,19,26,.0) 0%, rgba(18,19,26,.0) 55%, rgba(18,19,26,.85) 100%) !important;
}

/* Quitar capas de efecto que saturaban la escena */
.scene .energy-overlay,
.scene .ambient-overlay,
.scene .energy-mode,
.scene .topline,
.scene .activity,
.scene .core-title,
.scene .scene-helper {
  display: none !important;
}

/* Titular */
.scene .scene-caption {
  position: relative;
  inset: auto;
  top: auto; left: auto; right: auto;
  max-width: 760px;
  padding: 0;
  margin: 0 0 40px;
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.scene .caption-code {
  font-family: var(--st-mono);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--st-cyan);
}
.scene .scene-caption h1 {
  font-family: var(--st-display);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
  margin: 14px 0 16px;
  color: var(--st-text);
  text-shadow: none;
}
.scene .scene-caption p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--st-muted);
  max-width: 640px;
}

/* Panel de estado: tarjeta sobria arriba a la derecha */
.scene .status-panel {
  position: absolute;
  top: 96px;
  right: clamp(20px, 4vw, 56px);
  left: auto;
  width: 260px;
  padding: 16px 18px;
  background: var(--st-surface);
  border: 1px solid var(--st-line);
  border-radius: 4px;
  box-shadow: none;
  backdrop-filter: none;
  font-family: var(--st-mono);
  font-size: 12px;
  color: var(--st-muted);
}
.scene .status-panel .boxhead {
  color: var(--st-cyan);
  border-bottom: 1px solid var(--st-line);
}
.scene .status-panel p b {
  color: var(--st-amber);
}

/* Zonas: 4 arriba, franja central animada y 3 abajo */
.scene .zone-container {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 18px;
  align-content: start;
  pointer-events: auto;
  max-width: 1200px;
}
.scene .zone,
.scene .zone.z1, .scene .zone.z2, .scene .zone.z3, .scene .zone.z4,
.scene .zone.z5, .scene .zone.z6, .scene .zone.z7 {
  position: relative;
  left: auto; right: auto; top: auto; bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 10px;
  min-width: 0;
  min-height: 250px;
  max-width: none;
  padding: 18px 18px 14px;
  overflow: hidden;
  background: var(--st-card);
  color: var(--st-text);
  border: 1px solid #2a3440;
  border-radius: 6px;
  box-shadow: none;
  clip-path: none;
  text-align: left;
  transition: border-color .25s, transform .25s;
}
/* Color de cada módulo */
.scene .zone.z1, .scene .zone.z5 { --c: #00f3ff; }
.scene .zone.z2, .scene .zone.z6 { --c: #ffbd58; }
.scene .zone.z3 { --c: #3dffb0; }
.scene .zone.z4, .scene .zone.z7 { --c: #ff4fa3; }
/* Línea superior animada */
.scene .zone::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c), transparent);
  background-size: 200% 100%;
  animation: stSweep 3.2s linear infinite;
}
@keyframes stSweep {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}
.scene .zone:hover,
.scene .zone:focus-visible {
  transform: translateY(-3px);
  border-color: var(--c);
  box-shadow: none;
}
.scene .zone-n {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--st-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--c);
  border: 1px solid var(--c);
  padding: 4px 8px;
  border-radius: 3px;
}
.scene .zone-body { display: block; }
.scene .zone strong {
  display: block;
  font-family: var(--st-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--st-text);
  margin-top: 8px;
  white-space: normal;
}
.scene .zone small {
  display: block;
  font-family: var(--st-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--st-muted);
  margin-top: 6px;
}
.scene .zone-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--st-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: #849495;
  padding-top: 10px;
  border-top: 1px solid #2a3440;
}
.scene .zone-foot::after {
  content: "→";
  color: var(--c);
  font-size: 14px;
}

/* Franja central: líneas punteadas animadas que conectan las dos filas */
.scene .flow-lines {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  height: 110px;
  overflow: visible;
  display: block;
}
.scene .flow-lines .fl {
  fill: none;
  stroke-width: 2;
  stroke-dasharray: 6 8;
  stroke-linecap: round;
  animation: stFlow 1.4s linear infinite;
  vector-effect: non-scaling-stroke;
}
.scene .flow-lines .fl.c { stroke: #00f3ff; }
.scene .flow-lines .fl.a { stroke: #ffbd58; }
.scene .flow-lines .fl.g { stroke: #3dffb0; }
.scene .flow-lines .fl.p { stroke: #ff4fa3; }
@keyframes stFlow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -28; }
}

/* Tablet y escritorio pequeño */
@media (max-width: 1024px) {
  .scene .zone-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scene .flow-lines { display: none; }
  .scene .status-panel { position: relative; top: auto; right: auto; width: 100%; max-width: 420px; margin-bottom: 28px; }
}

/* Móvil */
@media (max-width: 600px) {
  .scene { padding: 88px 16px 130px; }
  .scene .scene-image { background-size: 130% auto !important; background-position: center 8% !important; opacity: .55; }
  .scene .scene-caption h1 { font-size: 30px; }
  .scene .scene-caption p { font-size: 15px; }
  .scene .zone-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .scene .flow-lines { display: none; }
  .scene .zone { min-height: 200px; padding: 14px; }
  .scene .zone strong { font-size: 15px; }
  .scene .zone small { font-size: 12px; }
}

/* Nodo central de convergencia */
.scene .convergence-hub {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  align-self: center;
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 280px;
  height: 110px;
  pointer-events: none;
}
.scene .hub-ring {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 1px solid #00f3ff;
  opacity: .5;
  animation: stPulse 2.4s ease-out infinite;
}
@keyframes stPulse {
  0%   { transform: scale(.7); opacity: .6; }
  100% { transform: scale(1.5); opacity: 0; }
}
.scene .hub-core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 200px;
  padding: 12px 14px;
  background: var(--st-surface);
  border: 1px solid #00f3ff;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 0 22px rgba(0,243,255,.18);
}
.scene .hub-kicker {
  font-family: var(--st-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: #00f3ff;
}
.scene .hub-core strong {
  font-family: var(--st-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--st-text);
}
.scene .hub-metrics {
  font-family: var(--st-mono);
  font-size: 11px;
  color: var(--st-muted);
}
.scene .hub-metrics b {
  color: #ffbd58;
  font-weight: 500;
}
@media (max-width: 1024px), (max-width: 600px) {
  .scene .convergence-hub { display: none; }
}

/* Centrado de tarjetas en escritorio: 24 columnas, 4 arriba (6 c/u) y 3 abajo centradas */
@media (min-width: 1025px) {
  .scene .zone-container {
    margin: 0 auto;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    column-gap: 18px;
  }
  .scene .zone.z1 { grid-column: 1 / 7; }
  .scene .zone.z2 { grid-column: 7 / 13; }
  .scene .zone.z3 { grid-column: 13 / 19; }
  .scene .zone.z4 { grid-column: 19 / 25; }
  .scene .zone.z5 { grid-column: 4 / 10; grid-row: 3; }
  .scene .zone.z6 { grid-column: 10 / 16; grid-row: 3; }
  .scene .zone.z7 { grid-column: 16 / 22; grid-row: 3; }
  .scene .flow-lines,
  .scene .convergence-hub { grid-column: 1 / -1; }
}

/* Margen inferior para que el menú fijo no tape la última fila de tarjetas */
@media (min-width: 1025px) {
  .scene { padding-bottom: 220px; }
}

/* Movil: margen al final para que la barra de navegacion inferior no tape las ultimas tarjetas */
@media (max-width: 760px) {
  .scene { padding-bottom: 260px; }
}

/* Tablet y pantallas intermedias: la barra inferior y los enlaces legales ocupan mas alto; la ultima fila queda por encima */
@media (max-width: 1180px) {
  .scene { padding-bottom: 240px; }
}

/* Tablet (761 a 1180 px): 3 tarjetas por fila, la fila final centrada */
@media (min-width: 761px) and (max-width: 1180px) {
  .scene .zone-container { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 14px; }
  .scene .zone { flex: 0 1 calc(33.333% - 10px); max-width: 240px; min-width: 200px; grid-column: auto !important; grid-row: auto !important; }
}

/* Enlaces sociales del encabezado: sin subrayado; en movil se muestran en la seccion de contacto */
.social-link { text-decoration: none; white-space: nowrap; }
@media (max-width: 760px) { .social-link { display: none !important; } }
