/* ==========================================================================
   LEGNO NORTE 3D · HOJA DE ESTILOS MODULAR DE PRODUCCIÓN
   Arquitectura: Nitidez Tipográfica Nativa (ClearType/Vector), SoC & Mobile-First
   ========================================================================== */

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
}

body {
  background-color: #161412;
  color: #232624;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
}

/* ==========================================================================
   1. ESCENARIO 3D PRINCIPAL (NITIDEZ CRISTALINA SIN BITMAP BLUR EN TEXTOS)
   ========================================================================== */
#stage-3d-viewport {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: #f7f2eb;
}

#camera-3d-rig {
  width: 100%;
  height: 100%;
  transform: none;
}

.scene-3d-layer {
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Letras 3D extruidas estilo KIDOLOGY en Pared Curva */
.kidology-logo-container {
  font-family: 'Fredoka', sans-serif;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.kidology-logo-container:hover {
  transform: translate(-50%, -54%);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.25));
}

.letra-3d-item {
  display: inline-block;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow:
    0 1px 0 rgba(0,0,0,0.18),
    0 2px 0 rgba(0,0,0,0.18),
    0 3px 0 rgba(0,0,0,0.18),
    0 4px 0 rgba(0,0,0,0.18),
    0 6px 12px rgba(0,0,0,0.22);
}

.letra-3d-item:hover {
  transform: translateY(-8px) rotate(-3deg);
}

/* ==========================================================================
   2. NAVEGACIÓN TÁCTIL 3D Y BOTONERA UNIFORME (TEXTO 100% NÍTIDO)
   ========================================================================== */
.dock-3d-btn {
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.16s ease;
}

.dock-3d-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.tecla-3d-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  padding: 0 0.5rem !important;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  white-space: nowrap !important;
  overflow: hidden;
  border-radius: 1.1rem;
  background: linear-gradient(180deg, #2c2826 0%, #181513 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1.5px solid rgba(255, 255, 255, 0.34);
  border-bottom: 3px solid #090807;
  box-shadow: 0 4px 0 #090807, 0 8px 18px rgba(0, 0, 0, 0.45);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
  flex-shrink: 0;
}

.tecla-3d-btn:hover {
  background: linear-gradient(180deg, #3a3532 0%, #24201e 100%);
  color: #ffffff;
  border-color: rgba(251, 191, 36, 0.55);
  border-top-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #090807, 0 12px 24px rgba(245, 158, 11, 0.25);
}

.tecla-3d-btn:active {
  transform: translateY(2px) !important;
  box-shadow: 0 1px 0 #090807, 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

.tecla-3d-btn.dock-btn-active {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%) !important;
  color: #161412 !important;
  border-color: #fef08a !important;
  border-top: 2px solid #ffffff !important;
  border-bottom: 3px solid #78350f !important;
  box-shadow: 0 4px 0 #78350f, 0 8px 22px rgba(245, 158, 11, 0.55) !important;
  transform: translateY(-1px);
}

.tecla-3d-btn.dock-btn-active:hover {
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%) !important;
  box-shadow: 0 5px 0 #78350f, 0 10px 26px rgba(245, 158, 11, 0.65) !important;
}

.tecla-3d-btn.dock-btn-active:active {
  transform: translateY(2px) !important;
  box-shadow: 0 1px 0 #78350f, 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}

/* ==========================================================================
   3. PORTALES HOTSPOT, SELLO DE AGUA MINIMALISTA Y ESTACIONES HOLO-3D
   ========================================================================== */
.portal-hotspot-frame {
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

/* En reposo transform: none para que el navegador renderice todas las letras en vectores subpíxel */
.estacion-holo-card {
  animation: holoStationIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes holoStationIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* Sello de agua minimalista de marca en esquina */
.brand-watermark-seal {
  transition: opacity 0.28s ease, transform 0.28s ease, background-color 0.28s ease, box-shadow 0.28s ease;
}

.brand-watermark-seal:hover {
  transform: translateY(-2px);
}

/* Scrollbar estilizada para modales internos */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #F7EFE5;
}

::-webkit-scrollbar-thumb {
  background: #C59B6D;
  border-radius: 9999px;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================================================
   4. LIBRO CUENTO INTERACTIVO 3D (UN SOLO MARCO LIMPIO · CERO SCROLL HORIZONTAL)
   ========================================================================== */
.storybook-perspective {
  perspective: 2200px;
  overflow-x: hidden !important;
  width: 100%;
}

.storybook-spread {
  background: #fffdf7;
  position: relative;
  overflow: hidden !important;
  width: 100%;
}

.storybook-page-left {
  background: linear-gradient(90deg, #faf4e8 0%, #fffdf9 88%, #ede3d2 100%);
}

.storybook-page-right {
  background: linear-gradient(90deg, #ede3d2 0%, #fffdf9 12%, #faf4e8 100%);
}

.storybook-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 32px;
  transform: translateX(-50%);
  background: linear-gradient(90deg,
    rgba(60, 40, 20, 0.0) 0%,
    rgba(60, 40, 20, 0.13) 35%,
    rgba(35, 20, 10, 0.28) 50%,
    rgba(60, 40, 20, 0.13) 65%,
    rgba(60, 40, 20, 0.0) 100%);
  pointer-events: none;
  z-index: 25;
}

.storybook-flipping-sheet {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 50%;
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
}

.storybook-flipping-sheet.flip-next-active {
  opacity: 1;
  animation: pageFlipNext3D 0.65s cubic-bezier(0.645, 0.045, 0.355, 1.000) forwards;
}

.storybook-flipping-sheet.flip-prev-active {
  opacity: 1;
  animation: pageFlipPrev3D 0.65s cubic-bezier(0.645, 0.045, 0.355, 1.000) forwards;
}

@keyframes pageFlipNext3D {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(-90deg);
  }
  100% {
    transform: rotateY(-180deg);
  }
}

@keyframes pageFlipPrev3D {
  0% {
    transform: rotateY(-180deg);
  }
  50% {
    transform: rotateY(-90deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

.page-curl-hint {
  position: relative;
  overflow: hidden;
}

.page-curl-hint::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, transparent 48%, #d6c5a9 50%, #fdfaf3 65%, #c59b6d 100%);
  border-top-left-radius: 8px;
  box-shadow: -2px -2px 6px rgba(0,0,0,0.15);
  transition: all 0.25s ease;
  pointer-events: none;
}

.page-curl-hint:hover::after {
  width: 40px;
  height: 40px;
}

.cuento-dropcap::first-letter {
  float: left;
  font-family: 'Fredoka', serif;
  font-size: 2.35rem;
  line-height: 0.85;
  padding-right: 0.45rem;
  padding-top: 0.08rem;
  color: #9C6F3D;
  font-weight: 700;
}

/* ==========================================================================
   5. IMPRESIÓN DE PROFORMA COMERCIAL EN FORMATO A4
   ========================================================================== */
@media print {
  body {
    overflow: visible !important;
    height: auto !important;
    background: white !important;
  }
  body * {
    visibility: hidden;
  }
  #modal-proforma, #modal-proforma * {
    visibility: visible;
  }
  #modal-proforma {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: white !important;
  }
  #proforma-acciones, #btn-cerrar-proforma, #top-nav-center, #top-hud-bar, #bottom-nav-mobile, #toast-container, #lego-mascot-stage, #brand-watermark-seal {
    display: none !important;
  }
  #proforma-contenido-imprimible {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    padding: 0 !important;
  }
}
