﻿/* ================================================
   LEVEL TECH — VALORES — styles.css
   ARQUITECTURA:
   ≥1440px → 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: 1440px) or ((min-width: 1200px) and (pointer: fine))) 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: 1440px) or ((min-width: 1200px) and (pointer: fine))) 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); }
}

/* ══════════════════════════════════════════════
   DESKTOP — typewriter sticky override
   GSAP controla el pin; position:sticky CSS retomaba
   el control al soltar el pin y mantenía el texto en
   pantalla mientras las cards ya entraban (overlap).
══════════════════════════════════════════════ */
@media (min-width: 1440px), (min-width: 1200px) and (pointer: fine) {
  .lt-tw-sticky { position: relative; top: auto; }
}

/* ══════════════════════════════════════════════
   MOBILE/TABLET — grid vertical de valores
   CSS grid 2 col + IO entrance animations
   Tablets landscape (iPad Mini/Air/Pro) → desktop
══════════════════════════════════════════════ */
@media not ((min-width: 1440px) or ((min-width: 1200px) and (pointer: fine))) {

  /* ── Typewriter — IO, sin ScrollTrigger ── */
  .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;
  }
  .lt-tw-cursor    { display: none !important; }
  .lt-tw-char--dot { display: none; }
  .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; }
  .lt-snap-dots, .lt-snap-counter { display: none; }

  /* ── Grid section ── */
  .lt-snap-section {
    display: block;
    width: 100%;
    padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
  }

  /* ── Grid container ── */
  .lt-snap-track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(.75rem, 3vw, 1.25rem);
    padding: 0 clamp(1rem, 4vw, 1.75rem) clamp(1rem, 3vw, 1.5rem);
    overflow-x: unset;
    scroll-snap-type: unset;
    -webkit-overflow-scrolling: unset;
    scrollbar-width: unset;
  }

  /* ── Grid item — visual del lt-flip-back ── */
  .lt-grid-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(7,16,31,.97) 0%, rgba(5,10,28,.98) 100%);
    border: 1px solid rgba(57,181,74,.18);
    box-shadow: 0 12px 40px rgba(0,0,0,.65), inset 0 0 0 1px rgba(57,181,74,.08);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: clamp(.9rem, 3vw, 1.4rem);
    aspect-ratio: 2 / 3;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .55s ease, transform .55s ease;
  }
  .lt-grid-item.lt-grid-visible {
    opacity: 1;
    transform: none;
  }
  /* Borde superior verde */
  .lt-grid-item::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, var(--color-green) 0%, rgba(57,181,74,.3) 60%, transparent 100%);
    z-index: 10;
  }
  /* Shimmer desactivado — canvas Three.js ya anima detrás */
  .lt-grid-item::after { content: none; }

  /* Tamaños para 2 columnas */
  .lt-grid-item .lt-val-title   { font-size: clamp(.95rem, 3.8vw, 1.35rem); }
  .lt-grid-item .lt-val-desc    { font-size: clamp(.72rem, 2.2vw, .88rem); line-height: 1.62; }
  .lt-grid-item .lt-val-number  { font-size: clamp(2.2rem, 8vw, 3.5rem); top: clamp(.8rem, 2vw, 1.2rem); right: clamp(.8rem, 2vw, 1.2rem); }
  .lt-grid-item .lt-val-icon-sm { width: 28px; height: 28px; margin-bottom: .5rem; padding: 6px; border-radius: 8px; }
  .lt-grid-item .lt-val-watermark { opacity: .06; }
  .lt-grid-item .lt-card-bg-img   { filter: brightness(.45) saturate(.30); object-position: center 20%; }
  .lt-grid-item:nth-child(2) .lt-card-bg-img { object-position: center; }
  .lt-grid-item:nth-child(1) .lt-card-bg-img,
  .lt-grid-item:nth-child(6) .lt-card-bg-img { object-position: center 65%; }
}

/* Teléfonos pequeños ≤479px — 1 columna */
@media (max-width: 479px) {
  .lt-snap-track { grid-template-columns: 1fr; }
  .lt-grid-item  { aspect-ratio: unset; min-height: 180px; }
  .lt-tw-text    { font-size: clamp(2.8rem, 13vw, 6rem); }
  .lt-grid-item .lt-val-title  { font-size: clamp(1rem, 5vw, 1.4rem); }
  .lt-grid-item .lt-val-desc   { font-size: clamp(.78rem, 3vw, .9rem); }
  .lt-grid-item .lt-val-icon-sm { width: 32px; height: 32px; padding: 7px; }
}

/* Landscape en móvil — 3 columnas, cada fila ~1 viewport de alto
   max-height:500px excluye tablets landscape (iPad Mini/Air/Pro → desktop) */
@media (orientation: landscape) and (max-height: 500px) {
  .lt-snap-track { grid-template-columns: repeat(3, 1fr); }
  .lt-grid-item  { aspect-ratio: unset; min-height: 85dvh; }
  .lt-tw-sticky  { min-height: 60svh; }
  .lt-tw-text    { white-space: nowrap; font-size: clamp(2.2rem, 8vw, 5rem); }
  .lt-grid-item .lt-val-title   { font-size: clamp(1rem, 2.8vw, 1.3rem); }
  .lt-grid-item .lt-val-desc    { font-size: clamp(.75rem, 1.8vw, .9rem); }
  .lt-grid-item .lt-val-icon-sm { width: 28px; height: 28px; padding: 6px; border-radius: 8px; margin-bottom: .6rem; }
}

/* Tablet portrait ≥600px — más espacio */
@media (min-width: 600px) and (max-width: 1199px) and (orientation: portrait) {
  .lt-grid-item .lt-val-title  { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
  .lt-grid-item .lt-val-desc   { font-size: clamp(.8rem, 1.6vw, .95rem); line-height: 1.7; }
  .lt-grid-item .lt-val-icon-sm { width: 34px; height: 34px; padding: 7px; }
  .lt-tw-text { font-size: clamp(3.5rem, 10vw, 7rem); }
}

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  .lt-tw-cursor { animation: none; opacity: 1; }
  .lt-card-wrapper { animation: none; }
  .lt-flip-back::after { animation: none; }
  .lt-sec-scroll-hint::after { animation: none; opacity: 0; }
}