/* ============================================================
   DPEPPERIA — Portafolio 16-bit
   Estética: pixel art, paleta retro consola, CRT scanlines
   ============================================================ */

:root {
  --bg:        #0d0b1f;
  --bg-2:      #171334;
  --panel:     #1e1a44;
  --ink:       #e8e6ff;
  --muted:     #8f8ac9;
  --accent:    #ff5d5d;   /* rojo pimienta */
  --accent-2:  #ffd23f;   /* amarillo */
  --green:     #4ee36b;
  --cyan:      #37d5ff;
  --grid:      #2a2560;
  --shadow:    0 0 0 3px #000, 4px 4px 0 0 #000;
  --font-pixel: 'Press Start 2P', monospace;
  --font-body:  'VT323', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% -10%, #241a52 0, transparent 45%),
    radial-gradient(circle at 90% 10%, #3a1030 0, transparent 40%),
    var(--bg);
  overflow-x: hidden;
  image-rendering: pixelated;
}

/* ---------- CRT / scanline overlay ---------- */
.crt-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.16) 3px, rgba(0,0,0,0) 4px);
  mix-blend-mode: multiply;
  animation: flicker 6s infinite;
}
@keyframes flicker { 0%,97%,100%{opacity:1} 98%{opacity:.85} }

/* ---------- Accents ---------- */
.accent { color: var(--accent); }
h1,h2,h3,h4 { font-family: var(--font-pixel); line-height: 1.5; }

/* ---------- Pixel cube logo (CSS box-shadow art) ---------- */
.pixel-cube {
  display: inline-block; width: 16px; height: 16px; position: relative;
  background: var(--accent-2);
  box-shadow:
    0 -6px var(--accent-2), 0 6px var(--accent-2),
    -6px 0 var(--accent), 6px 0 var(--cyan),
    -6px -6px var(--accent), 6px 6px var(--cyan);
  animation: bob 1.6s ease-in-out infinite;
  margin-right: 14px;
}
.pixel-cube--sm { transform: scale(.6); }
@keyframes bob { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-4px) } }

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(13,11,31,.85);
  backdrop-filter: blur(4px);
  border-bottom: 3px solid #000;
}
.nav__logo { display: flex; align-items: center; }
.nav__brand { font-family: var(--font-pixel); font-size: 13px; letter-spacing: 1px; }
.nav__links { display: flex; gap: 14px; flex: 1; justify-content: center; }
.nav__links a {
  font-family: var(--font-pixel); font-size: 9px; text-decoration: none;
  color: var(--muted); transition: color .15s, transform .1s; white-space: nowrap;
}
.nav__links a:hover { color: var(--accent-2); transform: translateY(-2px); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 30px;
  align-items: center;
  max-width: 1100px; margin: 0 auto; padding: 70px 28px 60px;
}
.hero__eyebrow { font-family: var(--font-pixel); font-size: 9px; color: var(--cyan); letter-spacing: 2px; }
.hero__title { font-size: 34px; margin: 12px 0 20px; text-shadow: var(--shadow); }
.hero__sub { font-size: 22px; color: var(--ink); max-width: 46ch; }
.hero__cta { display: flex; gap: 16px; margin: 26px 0; flex-wrap: wrap; }
.hero__stats { display: flex; gap: 30px; margin-top: 10px; }
.hero__stats strong { font-family: var(--font-pixel); font-size: 22px; color: var(--accent-2); display: block; }
.hero__stats span { font-size: 17px; color: var(--muted); }
.hero__art { display: flex; justify-content: center; }
#heroCube { image-rendering: pixelated; filter: drop-shadow(6px 6px 0 #000); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-pixel); font-size: 11px; text-decoration: none;
  padding: 14px 18px; display: inline-block; cursor: pointer;
  border: 3px solid #000; color: #000;
  transition: transform .08s, box-shadow .08s;
  box-shadow: 4px 4px 0 #000;
}
.btn:active { transform: translate(4px,4px); box-shadow: 0 0 0 #000; }
.btn--primary { background: var(--accent-2); }
.btn--primary:hover { background: #ffe06b; }
.btn--ghost { background: var(--cyan); }
.btn--ghost:hover { background: #66e0ff; }
.btn--small { font-size: 9px; padding: 10px 12px; background: var(--panel); color: var(--ink); }
.btn--small:hover { background: var(--grid); }
.btn--wa { background: var(--green); color: #04140a; }
.btn--wa:hover { background: #6bf587; }

/* ============================================================
   SECTION HEADS
   ============================================================ */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; padding: 0 20px; }
.section-head h2 { font-size: 20px; text-shadow: var(--shadow); }
.section-head p { font-size: 21px; color: var(--muted); }
section { padding: 60px 0; }

/* ============================================================
   SIMULACIÓN
   ============================================================ */
.sim__frame {
  max-width: 760px; margin: 0 auto; background: var(--panel);
  border: 3px solid #000; box-shadow: 8px 8px 0 #000; padding: 14px;
}
.sim__hud {
  display: flex; align-items: center; gap: 16px; padding: 6px 8px 12px;
  font-family: var(--font-pixel); font-size: 9px;
}
.sim__badge { color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.sim__status { color: var(--cyan); flex: 1; }
.sim__count { color: var(--accent-2); }
.sim__hud--order { padding-top: 0; gap: 20px; }
.sim__order { color: var(--green); }
.sim__dispatch { color: var(--muted); }
#warehouse {
  width: 100%; height: auto; display: block;
  image-rendering: pixelated; background: #05040f;
  border: 3px solid #000;
}
.sim__controls { display: flex; align-items: center; gap: 14px; padding-top: 14px; flex-wrap: wrap; }
.sim__toggle { font-family: var(--font-pixel); font-size: 8px; color: var(--muted); cursor: pointer; }

/* ============================================================
   CARDS (servicios)
   ============================================================ */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr));
  gap: 22px; max-width: 1080px; margin: 0 auto; padding: 0 28px;
}
.card {
  background: var(--panel); border: 3px solid #000; padding: 22px;
  box-shadow: 6px 6px 0 #000; transition: transform .12s;
}
.card:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 #000; }
.card h3 { font-size: 12px; margin: 14px 0 8px; color: var(--accent-2); }
.card p { font-size: 19px; color: var(--muted); margin: 0; }
.card__icon {
  width: 48px; height: 48px; image-rendering: pixelated;
  background-repeat: no-repeat; background-size: contain;
}
/* Pixel icons via inline SVG data-URIs */
.card__icon[data-icon="eye"]  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Cpath fill='%2337d5ff' d='M3 7h10v1H3zM2 8h1v1H2zM13 8h1v1h-1zM4 6h8v1H4zM4 9h8v1H4zM6 7h4v3H6z'/%3E%3Cpath fill='%230d0b1f' d='M7 7h2v2H7z'/%3E%3C/svg%3E"); }
.card__icon[data-icon="brain"]{ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Cpath fill='%23ff5d5d' d='M5 3h6v1H5zM4 4h8v1H4zM3 5h10v6H3zM4 11h8v1H4zM5 12h6v1H5z'/%3E%3Cpath fill='%230d0b1f' d='M8 4v9H7V4z M5 7h2v1H5z M9 7h2v1H9z M5 9h2v1H5z M9 9h2v1H9z'/%3E%3C/svg%3E"); }
.card__icon[data-icon="link"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Cpath fill='%234ee36b' d='M3 6h5v1H3zM3 9h5v1H3zM3 6h1v4H3zM7 6h1v4H7zM8 6h5v1H8zM8 9h5v1H8zM12 6h1v4h-1z'/%3E%3C/svg%3E"); }
.card__icon[data-icon="box"]  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffd23f' d='M3 5h10v8H3z'/%3E%3Cpath fill='%230d0b1f' d='M3 5h10v1H3zM7 6h2v7H7z'/%3E%3C/svg%3E"); }

/* ============================================================
   PROYECTOS
   ============================================================ */
.proj {
  background: var(--panel); border: 3px solid #000; box-shadow: 6px 6px 0 #000;
  overflow: hidden; transition: transform .12s;
}
.proj:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 #000; }
.proj__thumb {
  height: 150px; image-rendering: pixelated; border-bottom: 3px solid #000;
  background: #05040f;
}
.proj__body { padding: 18px; }
.proj__body h3 { font-size: 11px; margin: 10px 0 8px; }
.proj__body p { font-size: 18px; color: var(--muted); margin: 0; }
.tag {
  font-family: var(--font-pixel); font-size: 8px; background: var(--accent);
  color: #000; padding: 4px 8px; display: inline-block; border: 2px solid #000;
}

/* ============================================================
   KPIs
   ============================================================ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: 20px; max-width: 1080px; margin: 0 auto; padding: 0 28px;
}
.kpi { background: var(--panel); border: 3px solid #000; padding: 18px; box-shadow: 5px 5px 0 #000; }
.kpi__id { font-family: var(--font-pixel); font-size: 8px; color: var(--cyan); }
.kpi h4 { font-size: 11px; margin: 10px 0; }
.kpi__val { font-size: 18px; color: var(--accent-2); }
.bar { height: 16px; background: var(--bg); border: 2px solid #000; margin-bottom: 8px; overflow: hidden; }
.bar i {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--green) 0 6px, #3bbf57 6px 8px);
  animation: fill 1.4s ease forwards;
}
@keyframes fill { to { width: var(--v); } }

/* ============================================================
   CONTACTO
   ============================================================ */
.contact { display: flex; justify-content: center; padding: 70px 28px; }
.contact__box {
  background: linear-gradient(135deg, var(--bg-2), var(--panel));
  border: 3px solid #000; box-shadow: 10px 10px 0 #000;
  padding: 46px; text-align: center; max-width: 680px;
}
.contact__box h2 { font-size: 18px; text-shadow: var(--shadow); }
.contact__box p { font-size: 21px; color: var(--muted); }
.contact__info { margin-top: 24px; }
.contact__addr { font-size: 17px; margin-top: 18px; }

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 26px; border-top: 3px solid #000; background: var(--bg-2);
  font-size: 17px; color: var(--muted);
}

/* ============================================================
   CASOS DE USO (emoji) + CTA
   ============================================================ */
.card__emoji {
  font-size: 30px; line-height: 1; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 3px solid #000;
}
.usecases__cta {
  max-width: 620px; margin: 40px auto 0; text-align: center; padding: 0 28px;
}
.usecases__cta p { font-size: 21px; color: var(--muted); margin-bottom: 18px; }

/* ============================================================
   WHATSAPP FLOTANTE
   ============================================================ */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 999;
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; text-decoration: none; background: var(--green); color: #04140a;
  border: 3px solid #000; box-shadow: 4px 4px 0 #000;
  image-rendering: pixelated; animation: bob 1.6s ease-in-out infinite;
}
.wa-float:hover { background: #6bf587; transform: translateY(-2px); }

/* ============================================================
   REORGANIZACIÓN COMERCIAL (orden de secciones)
   ============================================================ */
body { display: flex; flex-direction: column; }
.nav      { order: 1; }
.hero     { order: 2; }
.usecases { order: 3; }
.sim      { order: 4; }
.services { order: 5; }
.kpis     { order: 6; }
.projects { order: 7; }
.contact  { order: 8; }
.foot     { order: 9; }

/* ============================================================
   SELECTOR DE IDIOMA
   ============================================================ */
.lang { display: flex; gap: 4px; margin-left: 16px; }
.lang__btn {
  font-family: var(--font-pixel); font-size: 8px; cursor: pointer;
  padding: 7px 8px; color: var(--muted); background: var(--panel);
  border: 3px solid #000; box-shadow: 2px 2px 0 #000;
}
.lang__btn:hover { color: var(--ink); }
.lang__btn.is-active { background: var(--accent-2); color: #000; }

/* ============================================================
   CASOS DE USO — CATEGORÍAS Y TARJETAS ANIMADAS
   ============================================================ */
.uc-cat { max-width: 1080px; margin: 0 auto 28px; padding: 0 28px; }
.uc-cat__head { border-left: 6px solid var(--accent); padding-left: 14px; margin: 26px 0 18px; }
.uc-cat__head h3 { font-size: 13px; margin: 0 0 6px; color: var(--accent-2); }
.uc-cat__head p { font-size: 18px; color: var(--muted); margin: 0; }
.uc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px;
}
.uc {
  background: var(--panel); border: 3px solid #000; box-shadow: 5px 5px 0 #000;
  overflow: hidden; transition: transform .12s;
}
.uc:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #000; }
.uc__art {
  width: 100%; height: auto; display: block; image-rendering: pixelated;
  background: #05040f; border-bottom: 3px solid #000;
}
.uc h4 { font-size: 10px; margin: 12px 14px 8px; color: var(--ink); line-height: 1.5; }
.uc p { font-size: 17px; margin: 0 14px 14px; color: var(--muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero__art { order: -1; }
  .hero__sub { margin: 0 auto; }
  .hero__cta, .hero__stats { justify-content: center; }
  .nav__links { display: none; }
  .hero__title { font-size: 26px; }
  .lang { margin-left: auto; }
}
