/* ================================================
   LEVEL TECH — VALORES — styles.css
   ARQUITECTURA:
   ≥ 1200px + landscape + ≥500px alto → ScrollTrigger cinematic (desktop)
   Resto (portrait/tablet/phone)       → scroll-snap carousel + IO typewriter
   Sin breakpoints intermedios complicados.
   El carrusel escala solo con vw.
================================================ */

/* Variables locales eliminadas — se usan las de core.css:
   --color-green, --color-blue, --color-black, --color-white, --font-body, --font-display
   El standalone.html tiene su propio :root para preview aislado — no tocar. */

/* ══════════════════════════════════════════════
   TYPEWRITER — desktop base
══════════════════════════════════════════════ */
.lt-tw-section { position: relative; z-index: 1; }

.lt-tw-sticky {
  position: sticky; top: 0;
  height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden; padding: 2rem;
}

.lt-tw-text {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 18rem);
  font-weight: 400;
  letter-spacing: .02em;
  text-align: center;
  line-height: .9;
  white-space: nowrap;
  overflow: visible;
  position: relative;
}

.lt-tw-char       { display: inline-block; opacity: 0; }
.lt-tw-char.green { color: var(--color-green); }

.lt-tw-cursor {
  display: inline-block;
  width: clamp(4px, .7vw, 10px);
  height: .82em;
  background: var(--color-green);
  border-radius: 2px;
  box-shadow: 0 0 18px rgba(57,181,74,.9), 0 0 40px rgba(57,181,74,.4);
  animation: lt-blink .5s step-end infinite;
  position: absolute;
  transition: left .04s steps(1), top .04s steps(1);
}
@keyframes lt-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ══════════════════════════════════════════════
   CARDS SECTION — desktop base
══════════════════════════════════════════════ */
.lt-cards-section {
  position: relative;
  z-index: 1;
  /* padding-bottom gestionado por JS — initDesktop agrega FOOTER_GAP dinámico */
}
.lt-cards-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; }

.lt-sec-header {
  position: absolute;
  top: clamp(1.8rem, 3.5vh, 3rem); left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(2.5rem, 6vw, 7rem);
  z-index: 20; pointer-events: none;
  opacity: 0; transition: opacity 0.8s ease;
}
.lt-sec-eyebrow {
  font-size: .78rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.55);
  display: flex; align-items: center; gap: .85rem;
}
.lt-sec-eyebrow::before {
  content: ''; width: 28px; height: 2px;
  background: var(--color-green); border-radius: 2px;
  box-shadow: 0 0 8px rgba(57,181,74,.5);
}
.lt-tanda-indicator { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.lt-tanda-label {
  font-size: .75rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.45); transition: color .4s;
}
.lt-tanda-label.active { color: var(--color-green); }
.lt-tanda-track {
  width: 64px; height: 3px;
  background: rgba(255,255,255,.12); border-radius: 3px;
  position: relative; overflow: hidden;
}
.lt-tanda-fill {
  position: absolute; left: 0; top: 0;
  height: 100%; width: 50%;
  background: var(--color-green); border-radius: 3px;
  transition: width .45s ease; box-shadow: 0 0 10px rgba(57,181,74,.7);
}

.lt-cards-area {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.lt-card-group {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(2rem, 4.5vw, 5.5rem);
  padding: 0 clamp(3rem, 8vw, 10rem);
  opacity: 0; pointer-events: none;
}

/* ── Card base ── */
.lt-card {
  flex: 1;
  /* Subido para mejor presencia en desktop — más ancho, mismo aspect-ratio */
  max-width: clamp(320px, 26vw, 460px);
  aspect-ratio: 2 / 3;
  perspective: 1600px; flex-shrink: 0;
}
.lt-card-wrapper {
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: lt-float 3.4s ease-in-out infinite;
}
.lt-card:nth-child(1) .lt-card-wrapper { animation-delay: 0s; }
.lt-card:nth-child(2) .lt-card-wrapper { animation-delay: .3s; }
.lt-card:nth-child(3) .lt-card-wrapper { animation-delay: .6s; }
@keyframes lt-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.lt-flip-inner {
  width: 100%; height: 100%;
  position: relative; transform-style: preserve-3d; border-radius: 20px;
}

/* Front */
.lt-flip-front {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 28px 70px rgba(0,0,0,.75), 0 0 0 1px rgba(57,181,74,.22), 0 0 45px rgba(2,87,210,.16);
}
.lt-flip-front img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: 20px; user-select: none; pointer-events: none;
}

/* Back */
.lt-flip-back {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  border-radius: 20px; overflow: hidden;
  background: linear-gradient(145deg, rgba(7,16,31,.97) 0%, rgba(5,10,28,.98) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(57,181,74,.18);
  box-shadow: 0 28px 70px rgba(0,0,0,.75), inset 0 0 0 1px rgba(57,181,74,.10);
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-end;
  padding: clamp(1.4rem, 3vw, 2.2rem); text-align: left;
}
.lt-card-bg-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .40; z-index: 0;
  border-radius: 20px; filter: brightness(.50) saturate(.35);
}
.lt-card-bg-overlay {
  position: absolute; inset: 0; z-index: 1; border-radius: 20px;
  background: rgba(2,40,120,.58); mix-blend-mode: color;
}
.lt-card-bg-fade {
  position: absolute; inset: 0; z-index: 2; border-radius: 20px;
  background: linear-gradient(to top, rgba(5,10,28,1) 0%, rgba(5,10,28,.88) 35%, rgba(5,10,28,.28) 62%, transparent 82%);
}
.lt-flip-back::after {
  content: ''; position: absolute; inset: 0; border-radius: 20px;
  background: linear-gradient(115deg, transparent 0%, transparent 18%, rgba(255,255,255,0) 38%, rgba(255,255,255,.60) 50%, rgba(255,255,255,0) 62%, transparent 82%, transparent 100%);
  background-size: 250% 250%; animation: lt-shimmer 3.5s ease-in-out infinite;
  pointer-events: none; z-index: 5; mix-blend-mode: overlay;
}
@keyframes lt-shimmer { 0% { background-position: 200% 0%; } 50% { background-position: -50% 0%; } 100% { background-position: 200% 0%; } }
.lt-flip-back::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  z-index: 10; border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--color-green) 0%, rgba(57,181,74,.3) 60%, transparent 100%);
}

/* Contenido back */
.lt-val-watermark {
  position: absolute; top: -10%; right: -10%; width: 70%; height: 70%;
  /* .07 → .04 — el watermark es decorativo, no debe competir con el ícono */
  opacity: .04; pointer-events: none; z-index: 4;
}
.lt-val-watermark svg { width: 100%; height: 100%; stroke: var(--color-green); fill: none; stroke-width: .6; stroke-linecap: round; stroke-linejoin: round; }
.lt-val-number {
  position: absolute; top: clamp(1rem, 2.5vw, 1.8rem); right: clamp(1rem, 2.5vw, 1.8rem);
  font-family: var(--font-display); font-size: clamp(4.5rem, 8vw, 8rem);
  color: rgba(57,181,74,.14); line-height: 1; letter-spacing: -.02em;
  pointer-events: none; user-select: none; z-index: 5;
}
.lt-val-icon-sm {
  width: clamp(36px, 3.8vw, 50px); height: clamp(36px, 3.8vw, 50px);
  color: var(--color-green); margin-bottom: clamp(.8rem, 1.4vw, 1.2rem);
  position: relative; z-index: 6;
  background: rgba(57,181,74,.10);
  border: 1px solid rgba(57,181,74,.25);
  border-radius: 10px;
  padding: clamp(7px, .7vw, 10px);
  box-sizing: border-box;
  box-shadow: 0 0 18px rgba(57,181,74,.30), inset 0 1px 0 rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
}
.lt-val-icon-sm svg { display: block; width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lt-val-title {
  font-family: var(--font-display); font-size: clamp(2rem, 3.8vw, 2.6rem);
  letter-spacing: .06em; color: var(--color-white); line-height: 1;
  margin-bottom: clamp(.4rem, .9vw, .7rem); position: relative; z-index: 6;
}
.lt-val-divider {
  width: 32px; height: 2px;
  background: linear-gradient(90deg, var(--color-green), rgba(57,181,74,.3));
  border-radius: 2px; flex-shrink: 0;
  margin-bottom: clamp(.5rem, 1vw, .9rem); position: relative; z-index: 6;
}
.lt-val-desc {
  font-size: clamp(.85rem, 1.15vw, 1.05rem); font-weight: 400;
  color: rgba(255,255,255,.75); line-height: 1.72; position: relative; z-index: 6;
}

/* Footer scroll hint */
.lt-sec-footer {
  position: absolute; right: clamp(1.5rem, 3vw, 3.5rem); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  z-index: 20; pointer-events: none;
}
.lt-sec-scroll-hint {
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  font-size: .72rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255,255,255,.55); writing-mode: vertical-rl;
}
.lt-sec-scroll-hint::after {
  content: ''; width: 2px; height: 44px; background: var(--color-green);
  animation: lt-down 2s ease-in-out infinite; transform-origin: top;
  border-radius: 2px; box-shadow: 0 0 10px rgba(57,181,74,.7);
}
@keyframes lt-down { 0% { transform: scaleY(0); opacity: 0; } 20% { opacity: 1; } 65% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* Elementos mobile — ocultos en desktop */
.lt-snap-section,
.lt-snap-header,
.lt-snap-track,
.lt-snap-dots,
.lt-snap-counter { display: none; }

/* ══════════════════════════════════════════════
   DESKTOP AJUSTES — laptop bajo y tablet landscape
   min-width: 900px aplica a ambos
══════════════════════════════════════════════ */
@media (max-height: 780px) and (min-width: 1200px) and (orientation: landscape) {
  .lt-card { max-width: clamp(200px, 22vw, 300px); }
  .lt-card-group { gap: clamp(1.4rem, 3vw, 3.5rem); padding: 0 clamp(2rem, 5vw, 7rem); }
  .lt-val-number  { font-size: clamp(3rem, 5vw, 5.5rem); }
  .lt-val-title   { font-size: clamp(1.3rem, 2vw, 1.7rem); letter-spacing: .03em; }
  .lt-val-desc    { font-size: clamp(.75rem, .95vw, .9rem); }
  .lt-val-icon-sm { width: 28px; height: 28px; margin-bottom: .5rem; padding: 5px; }
  .lt-flip-back   { padding: 1.1rem 1.3rem; }
}

@media (max-width: 1849px) and (min-width: 1200px) and (orientation: landscape) {
  .lt-card { max-width: clamp(240px, 24vw, 380px); }
  .lt-card-group { gap: clamp(1.5rem, 3vw, 4rem); padding: 0 clamp(2rem, 5.5vw, 7rem); }
  .lt-val-title   { font-size: clamp(1.1rem, 2vw, 2rem); letter-spacing: .02em; }
  .lt-val-desc    { font-size: clamp(.78rem, 1vw, .95rem); line-height: 1.65; }
  .lt-val-icon-sm { width: 32px; height: 32px; margin-bottom: .6rem; padding: 6px; }
  .lt-flip-back   { padding: clamp(1rem, 2.2vw, 1.8rem) clamp(.8rem, 1.6vw, 1.4rem); }
  .lt-tw-text     { font-size: clamp(4rem, 12vw, 14rem); }
}

/* ══════════════════════════════════════════════
   MOBILE/TABLET — nuevo sistema 3 criterios
   UN SOLO SISTEMA: scroll-snap + IO typewriter
   Tablets landscape (iPad Mini/Air/Pro) → desktop
   Solo CSS adapta el tamaño de slide con vw
══════════════════════════════════════════════ */
@media not all and (min-width: 1200px) and (orientation: landscape) and (min-height: 500px) {

  /* ── Typewriter — animación de entrada IO, sin ScrollTrigger ── */
  /* JS elimina el style inline de height — no necesitamos !important aquí */
  .lt-tw-section  { height: auto; }
  .lt-tw-sticky   {
    position: relative;
    height: auto;
    min-height: 45svh;
    padding: clamp(1rem, 4vw, 2rem);
  }
  .lt-tw-text {
    font-size: clamp(2.8rem, 11vw, 7rem);
    white-space: normal;
    line-height: 1.0;
    text-align: center;
  }
  /* Cursor — oculto (sin ScrollTrigger no tiene sentido) */
  .lt-tw-cursor { display: none !important; }

  /* Punto final — oculto en mobile */
  .lt-tw-char--dot { display: none; }

  /* Chars — animados por JS via clase */
  .lt-tw-char { transition: opacity .08s ease; }

  /* ── Desktop cinematic — oculto ── */
  .lt-cards-sticky { position: relative; height: auto; overflow: visible; }
  .lt-cards-area   { display: none; }
  .lt-sec-footer   { display: none; }

  /* ── Header — estático, visible ── */
  .lt-sec-header {
    position: relative !important;
    top: auto !important; left: auto !important; right: auto !important;
    opacity: 1 !important;
    padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) clamp(.8rem, 2vw, 1.2rem);
    pointer-events: auto;
  }
  .lt-tanda-indicator { display: none; } /* reemplazado por dots */

  /* ══ SCROLL-SNAP SECTION ══ */
  .lt-snap-section {
    display: block;
    width: 100%;
    padding-bottom: clamp(1.2rem, 3vw, 2rem);
  }

  /* Track con scroll-snap nativo */
  .lt-snap-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Ocultar scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0;
    padding: clamp(.6rem, 2vw, 1rem) 0 clamp(.8rem, 2vw, 1.2rem);
    /* Centra la primera y última slide */
    padding-left: calc(50vw - var(--slide-w) / 2);
    padding-right: calc(50vw - var(--slide-w) / 2);
  }
  .lt-snap-track::-webkit-scrollbar { display: none; }

  /* Slide — ancho controlado por CSS var adaptada por orientation */
  .lt-snap-slide {
    flex: 0 0 var(--slide-w);
    scroll-snap-align: center;
    scroll-snap-stop: always;
    padding: 0 clamp(.4rem, 1.5vw, .8rem);
    transition: transform .3s ease, opacity .3s ease;
  }
  /* Slide inactiva — escala reducida (JS añade .lt-snap-active) */
  .lt-snap-slide { opacity: .5; transform: scale(.92); }
  .lt-snap-slide.lt-snap-active { opacity: 1; transform: scale(1); }

  /* Card dentro del slide */
  .lt-snap-slide .lt-card {
    width: 100%; max-width: 100%;
    flex: none;
    perspective: 1200px;
  }

  /* Flip on tap — JS añade .lt-snap-flipped */
  .lt-snap-slide .lt-flip-inner {
    transition: transform .42s cubic-bezier(.87,0,.13,1);
  }
  .lt-snap-slide.lt-snap-flipped .lt-flip-inner {
    transform: rotateY(180deg);
  }

  /* Ajuste contenido back en mobile */
  .lt-snap-slide .lt-val-title   { font-size: clamp(1.25rem, 5.5vw, 1.75rem); }
  .lt-snap-slide .lt-val-desc    { font-size: clamp(.82rem, 2.8vw, .95rem); line-height: 1.7; }
  .lt-snap-slide .lt-val-number  { font-size: clamp(3rem, 11vw, 5.5rem); }
  .lt-snap-slide .lt-val-icon-sm { width: 38px; height: 38px; margin-bottom: .7rem; padding: 8px; border-radius: 9px; }
  .lt-snap-slide .lt-flip-back {
    padding: clamp(1.2rem, 4vw, 2rem);
    /* backdrop-filter sobre el canvas Three.js animado = re-muestreo GPU cada frame;
       el gradiente casi-opaco (97%) ya provee la misma oscuridad sin el coste */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  /* shimmer continuo innecesario cuando el canvas ya anima detrás — desactivado en mobile */
  .lt-snap-slide .lt-flip-back::after { animation: none; }

  /* ── Dots ── */
  .lt-snap-dots {
    display: flex;
    justify-content: center;
    gap: .5rem;
    pointer-events: none;
    margin-top: .4rem;
  }
  .lt-snap-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: rgba(255,255,255,.2);
    transition: background .3s, width .3s;
    flex-shrink: 0;
  }
  .lt-snap-dot.lt-snap-active {
    background: var(--color-green); width: 20px; border-radius: 4px;
    box-shadow: 0 0 8px rgba(57,181,74,.7);
  }

  /* ── Counter ── */
  .lt-snap-counter {
    display: block;
    text-align: center;
    margin-top: .5rem;
    font-size: .6rem; font-weight: 600;
    letter-spacing: .22em; text-transform: uppercase;
    color: rgba(255,255,255,.28);
  }
}

/* ── Tamaño de slide por orientación — pura CSS, sin JS ── */
/* Portrait: slide más estrecha, card 2/3 */
@media not all and (min-width: 1200px) and (orientation: landscape) and (min-height: 500px) {
  :root { --slide-w: min(82vw, 360px); }
  .lt-snap-slide .lt-card { aspect-ratio: 2 / 3; }
  .lt-tw-text { font-size: clamp(2.8rem, 13vw, 6rem); }
}

/* Landscape mobile: slide más ancha, card 4/3
   max-height:500px excluye tablets landscape (iPad Mini/Air/Pro → desktop) */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --slide-w: min(72vw, 520px); }
  .lt-snap-slide .lt-card { aspect-ratio: 4 / 3; }
  .lt-tw-sticky { min-height: 60svh; }
  .lt-tw-text { white-space: nowrap; font-size: clamp(2.2rem, 8vw, 5rem); }

  /* Back landscape — layout horizontal */
  .lt-snap-slide .lt-flip-back {
    flex-direction: row;
    align-items: flex-end;
    gap: clamp(.8rem, 2vw, 1.4rem);
    padding: clamp(.9rem, 2.5vw, 1.4rem);
  }
  .lt-snap-slide .lt-val-watermark { display: none; }
  .lt-snap-slide .lt-val-number {
    position: static; flex-shrink: 0; align-self: flex-start;
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: rgba(57,181,74,.2);
  }
  .lt-snap-slide .lt-val-icon-sm { width: 32px; height: 32px; margin-bottom: 0; flex-shrink: 0; padding: 6px; border-radius: 8px; }
  .lt-snap-slide .lt-val-title   { font-size: clamp(1.3rem, 4vw, 1.9rem); margin-bottom: .2rem; }
  .lt-snap-slide .lt-val-divider { margin-bottom: .3rem; }
  .lt-snap-slide .lt-val-desc    { font-size: clamp(.75rem, 2vw, .88rem); line-height: 1.5; }
  .lt-card-text-col { display: flex; flex-direction: column; align-items: flex-start; flex: 1; min-width: 0; }
}

/* Tablet portrait (≥600px) — slide más ancha para mejor proporción en iPad.
   360px se ve pequeño en un viewport de 768px+; 60vw cappado a 440px lo equilibra. */
@media (min-width: 600px) and (max-width: 1199px) and (orientation: portrait) {
  :root { --slide-w: min(60vw, 440px); }
  .lt-snap-slide .lt-val-title { font-size: clamp(1.4rem, 3.2vw, 1.75rem); }
  .lt-snap-slide .lt-val-desc  { font-size: clamp(.83rem, 1.6vw, .95rem); line-height: 1.72; }
}

/* Tablet portrait grande (≥900px) — iPad Air/Pro portrait.
   440px en 1024px sigue siendo pequeño (43%); 520px lo lleva a ~51%. */
@media (min-width: 900px) and (max-width: 1199px) and (orientation: portrait) {
  :root { --slide-w: min(55vw, 520px); }
}