/* ============================================================
   Probador virtual para proveedores de armazones · v2 "Anatomy of a Sale"
   Tokens de la marca Ingeniería Digital (mismos que la v3), Outfit para títulos,
   Instrument Serif itálica para el acento, cuerpo 18/19 px, botones ≥ 52 px.
   Público: proveedores de ~60 años, de usted. Celular primero (375 px).
   Repaso de textos de Diego (19/10): sin recorrido de escenas, sin comparación ni implementación;
   quedan hero 3D, demostración, "Qué gana usted", modelo, "Cómo funciona", cierre y pie.
   ============================================================ */

:root {
  --navy:        #090D17;
  --navy-2:      #0E1424;
  --navy-3:      #161E33;
  --line-dark:   rgba(159, 178, 214, 0.14);
  --line-dark-2: rgba(159, 178, 214, 0.28);

  --paper:       #ECEEF2;
  --paper-2:     #E3E6EC;
  --line-light:  rgba(14, 20, 36, 0.12);
  --line-light-2:rgba(14, 20, 36, 0.22);

  --amber:       #E3A53A;
  --amber-soft:  #F0BE58;
  --amber-deep:  #7F5409;   /* ámbar oscuro para texto chico sobre claro: contraste AA */

  --ink:         #0C1120;
  --ink-soft:    #343B4D;
  --snow:        #EEF1F6;
  --snow-soft:   #B4BDD2;

  --wa:          #15803D;   /* verde WhatsApp oscurecido: texto blanco con contraste AA */
  --wa-dark:     #0F6A32;

  --display: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif:   "Instrument Serif", Georgia, serif;
  --body:    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:    ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --maxw: 1120px;
  --gutter: 16px;
  --fs: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* overflow-x: clip (no hidden): hidden convierte a body en contenedor de scroll y rompe position: sticky */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

body {
  font-family: var(--body);
  background: var(--navy);
  color: var(--snow);
  line-height: 1.6;
  font-size: var(--fs);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--amber); color: var(--navy); }
a { color: inherit; }
a:not(.btn) { text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:not(.btn):hover { color: var(--amber); }
.sec-light a:not(.btn):hover { color: var(--amber-deep); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 2px; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.nojs { padding: 16px var(--gutter); }
.nojs p { max-width: 40em; color: var(--snow-soft); border: 1px solid var(--line-dark-2); border-radius: 12px; padding: 14px 16px; }

.eyebrow {
  font-family: var(--mono); font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; color: var(--amber); display: flex; align-items: center; gap: 0.7em; flex-wrap: wrap;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--amber); flex: none; }
.sec-light .eyebrow { color: var(--amber-deep); }
.sec-light .eyebrow::before { background: var(--amber-deep); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
h1 .serif, .sec-dark .serif { color: var(--snow-soft); }
.sec-light .serif { color: var(--ink-soft); }

.badge {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px;
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  background: rgba(227, 165, 58, 0.16); color: var(--amber); border: 1px solid rgba(227, 165, 58, 0.45);
}
.sec-light .badge { color: var(--amber-deep); border-color: rgba(127, 84, 9, 0.4); background: rgba(227, 165, 58, 0.18); }

/* Grilla tipo plano para las secciones oscuras */
.blueprint { position: relative; background-color: var(--navy); }
.blueprint::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line-dark) 1px, transparent 1px), linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 78%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 78%);
  pointer-events: none; opacity: 0.8;
}
.blueprint > * { position: relative; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(9, 13, 23, 0.94); border-bottom: 1px solid var(--line-dark);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--header-h); }
.brand {
  font-family: var(--display); font-weight: 700; font-size: 18px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; min-width: 0;
}
.brand .glyph { width: 22px; height: 22px; position: relative; flex: none; }
.brand .glyph::before, .brand .glyph::after { content: ""; position: absolute; inset: 0; border: 1.5px solid var(--amber); }
.brand .glyph::after { transform: rotate(45deg) scale(0.62); border-color: var(--snow-soft); }
.nav-cta {
  font-family: var(--body); font-weight: 600; font-size: 16px; text-decoration: none;
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-dark-2); color: var(--snow); text-align: center; line-height: 1.2; flex: none;
}
.nav-cta:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- Botones (≥ 52 px) ---------- */
.btn {
  font-family: var(--body); font-weight: 600; font-size: 18px; text-decoration: none;
  min-height: 56px; padding: 14px 24px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; text-align: center;
  border: 1px solid transparent; cursor: pointer; line-height: 1.25;
  transition: transform .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
}
.btn svg { width: 24px; height: 24px; flex: none; }
.btn-primary { background: var(--amber); color: var(--navy); }
.btn-primary:hover { background: var(--amber-soft); transform: translateY(-2px); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-dark-2); color: var(--snow); }
.btn-ghost:hover { border-color: var(--snow-soft); background: rgba(255,255,255,0.04); }
.sec-light .btn-ghost { border-color: var(--line-light-2); color: var(--ink); }
.sec-light .btn-ghost:hover { border-color: var(--ink-soft); background: rgba(12,17,32,0.05); }
.ctas { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }
.ctas .btn { width: 100%; padding-inline: 14px; }   /* a 375 px "Escribirnos por WhatsApp" entra en una línea */
.tel { margin-top: 14px; font-size: 18px; }
.sec-dark .tel, .hero .tel { color: var(--snow-soft); }
.sec-light .tel { color: var(--ink-soft); }
.tel a { font-weight: 600; white-space: nowrap; display: inline-block; min-height: 52px; line-height: 52px; }
.sec-light .tel a { color: var(--ink); }
.hero .tel a, .sec-dark .tel a { color: var(--snow); }

.nota { font-size: 17px; line-height: 1.5; color: var(--snow-soft); margin-top: 12px; }
.sec-light .nota { color: var(--ink-soft); }
.credit { font-size: 16px; line-height: 1.45; color: var(--snow-soft); }
.sec-light .credit { color: var(--ink-soft); }
/* enlaces del crédito: área de toque de 44 px sin mover el texto */
.credit a { display: inline-block; padding: 12px 2px; margin: -12px -2px; white-space: nowrap; }

/* ---------- Vistas 3D (canvas 2D destino + imagen de reemplazo) ---------- */
.view3d { position: relative; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; touch-action: pan-y; }
.view3d img.v3d-lite { width: 100%; height: 100%; object-fit: contain; }
.view3d canvas.v3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.view3d canvas.v3d[hidden] { display: none; }
.view3d.is-dragging canvas.v3d { cursor: grabbing; }
.view3d.is-ready img.v3d-lite { visibility: hidden; }
.view3d canvas.v3d[tabindex]:focus-visible { outline-offset: -3px; }
/* versión ligera por conexión o memoria: el 3D del hero se carga solo si el visitante lo pide */
.ver3d {
  position: absolute; right: 10px; bottom: 10px; min-height: 48px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-dark-2); background: rgba(9, 13, 23, 0.86); color: var(--snow); font-weight: 600; font-size: 16px; cursor: pointer;
}
.ver3d[hidden] { display: none; }
.ver3d:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- Hero ---------- */
.hero { padding: 24px 0 48px; overflow: hidden;
  background: radial-gradient(120% 90% at 80% -10%, #14213C 0%, transparent 55%), radial-gradient(90% 80% at 0% 110%, #11182B 0%, transparent 50%), var(--navy);
}
.hero h1 { font-size: clamp(2.1rem, 7.6vw, 3.8rem); margin: 12px 0 12px; }
.hero .sub { font-size: 1em; color: var(--snow); max-width: 34em; }
.hero .ctas { margin-top: 20px; }
.hero-grid { display: grid; gap: 16px; align-items: center; }
.hero-visual { margin: 0; order: -1; }
.hero-visual .view3d { aspect-ratio: 16 / 9; max-height: 200px; margin-inline: auto; }

/* ---------- Secciones ---------- */
section { position: relative; }
.section-pad { padding: 64px 0; }
.sec-light { background: var(--paper); color: var(--ink); }
.sec-dark { background: var(--navy); color: var(--snow); }
.sec-head { max-width: 760px; margin-bottom: 28px; }
.sec-head h2, .contacto h2 { font-size: clamp(1.9rem, 5.4vw, 2.8rem); margin-top: 14px; }
.sec-head p { margin-top: 14px; max-width: 34em; }
.sec-light .sec-head p { color: var(--ink-soft); }
.sec-dark .sec-head p { color: var(--snow-soft); }

/* ---------- Demostración ---------- */
.demo-grid { display: grid; gap: 24px; }
.catalogo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tarjeta-modelo { display: flex; flex-direction: column; gap: 8px; }
.tarjeta-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; width: 100%;
  border: 1px solid var(--line-dark-2); border-radius: 16px; padding: 12px 12px 14px; cursor: pointer;
  background: linear-gradient(180deg, var(--navy-3), var(--navy-2));
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.tarjeta-btn:hover { border-color: var(--snow-soft); }
.tarjeta-btn[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.tarjeta-btn img { width: 100%; height: auto; border-radius: 10px; background: rgba(255,255,255,0.03); }
.tarjeta-btn .nombre { font-family: var(--display); font-weight: 600; font-size: 1.15rem; margin-top: 6px; }
.tarjeta-btn .detalle { font-size: 16px; color: var(--snow-soft); }
.demo-visor { display: flex; flex-direction: column; }
.demo-3d { margin: 0; }
.demo-3d .view3d { aspect-ratio: 4 / 3; border: 1px solid var(--line-dark-2); border-radius: 18px; background: radial-gradient(120% 90% at 50% 0%, #182239 0%, var(--navy-2) 60%, var(--navy) 100%); }
.demo-3d figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-top: 10px; }
.demo-3d .nombre { font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.demo-visor .ctas { margin-top: 16px; }

/* ---------- Modelo para proveedores ---------- */
.pasos { list-style: none; display: flex; flex-direction: column; gap: 24px; }
.pasos li { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; }
.num {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1;
  background: var(--amber); color: var(--navy);
}
.pasos h3 { font-size: 1.3rem; margin: 8px 0 6px; }
.pasos p { color: var(--ink-soft); }

.hecho {
  margin-top: 36px; padding: 24px 22px 24px 26px; max-width: 760px;
  border-left: 4px solid var(--amber); background: var(--navy-2); border-radius: 0 14px 14px 0;
}
.hecho p { font-family: var(--display); font-size: clamp(1.3rem, 3.4vw, 1.7rem); font-weight: 600; line-height: 1.3; color: var(--snow); }

/* ---------- Qué gana usted: tres frases ---------- */
.gana { list-style: none; display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.gana li {
  font-family: var(--display); font-weight: 600; font-size: clamp(1.3rem, 4.4vw, 1.7rem); line-height: 1.25; color: var(--ink);
  padding-left: 34px; position: relative;
}
.gana li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 20px; height: 3px; background: var(--amber-deep); }

/* ---------- Contacto ---------- */
.contacto .sub { margin-top: 14px; color: var(--snow-soft); max-width: 34em; }
.contacto .ctas { margin-top: 24px; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--line-dark); padding: 36px 0 110px; background: var(--navy); }
.foot { display: flex; flex-direction: column; gap: 10px; font-size: 17px; color: var(--snow-soft); }
.foot .fbrand { color: var(--snow); font-family: var(--display); font-weight: 700; font-size: 18px; }
.foot a { display: inline-flex; align-items: center; min-height: 52px; }
.foot .credit { margin-top: 6px; font-size: 16px; }

/* ---------- WhatsApp fijo (se esconde mientras el hero, que ya tiene su botón, está en pantalla) ---------- */
.wa-fijo {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 70;
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; min-width: 56px; padding: 0 18px 0 14px;
  border-radius: 999px; background: var(--wa); color: #fff; text-decoration: none; font-weight: 600; font-size: 17px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s;
}
.wa-fijo svg { width: 28px; height: 28px; }
.wa-fijo:hover { background: var(--wa-dark); color: #fff; }
html.en-hero .wa-fijo { opacity: 0; visibility: hidden; transform: translateY(16px); transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s; }

/* ---------- Pantallas medianas y grandes ---------- */
@media (min-width: 360px) { .brand { white-space: nowrap; } }
@media (min-width: 600px) { .brand { font-size: 19px; } .nav-cta { font-size: 17px; padding: 0 16px; } }
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .ctas { flex-direction: row; flex-wrap: wrap; }
  .ctas .btn { width: auto; min-width: 260px; padding-inline: 24px; }
  .hero-visual .view3d { max-height: 280px; }
  .foot { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .foot .credit { margin-top: 0; width: 100%; }
  .site-footer { padding-bottom: 90px; }
  .catalogo { max-width: 560px; }
}
@media (min-width: 900px) {
  :root { --gutter: 40px; --fs: 19px; }
  .section-pad { padding: 96px 0; }
  .hero { padding: 72px 0 88px; }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 48px; }
  .hero-visual { order: 0; }
  .hero-visual .view3d { aspect-ratio: 4 / 3; max-height: none; }
  .hero h1 { font-size: clamp(2.6rem, 4.2vw, 3.8rem); }
  .hero .ctas { margin-top: 28px; }

  .demo-grid { grid-template-columns: 320px 1fr; gap: 40px; align-items: start; }
  .catalogo { grid-template-columns: 1fr; max-width: none; }

  .pasos { flex-direction: row; gap: 28px; align-items: start; }
  .pasos li { grid-template-columns: 1fr; }
  .pasos .num { margin-bottom: 4px; }
  .gana { gap: 22px; }
  .foot .credit { width: auto; }
  .site-footer { padding-bottom: 60px; }
  .wa-fijo { right: 24px; bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
