/* ==========================================================================
   Escenas 3D y portada «escenario» (scene3d.js + views/home.js)
   La portada y la franja del celular son oscuras en modo claro y oscuro:
   es el escenario donde se luce el 3D. El resto del sitio no cambia.
   ========================================================================== */

/* ---------- Escenario oscuro (portada y franja del celular) ---------- */
.hero-stage,
.stage-band,
.page-head-stage {
  --ink: #f2f7f3;
  --ink-2: #d6e2db;
  --muted: #b2c1b9;
  --subtle: #98a89f;
  --line: rgb(255 255 255 / .14);
  --line-strong: rgb(255 255 255 / .3);
  --surface: #14221c;
  --surface-2: #1b2c25;
  --paper: #0a120f;
  --negocio: #5cc59c;
  --negocio-ink: #82d8b5;
  --negocio-soft: rgb(92 197 156 / .14);
  --ok: #6fd09f;
  --piloto-ink: #f6cf78;
  --btn-primary-bg: #5cc59c;
  --btn-primary-fg: #07130e;
  --btn-primary-hover: #82d8b5;
  --focus: #82d8b5;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--ink);
}

.hero-stage {
  padding-block: 56px 72px;
  border-bottom: 0;
  background:
    radial-gradient(900px 560px at 80% 8%, rgb(31 154 115 / .32), transparent 62%),
    radial-gradient(700px 480px at 0% 100%, rgb(196 81 58 / .2), transparent 65%),
    linear-gradient(180deg, #0b1713, #08100d);
}
.hero-stage .dot-grid { background-image: radial-gradient(rgb(255 255 255 / .16) 1px, transparent 1.2px); }
.hero-stage .hero-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 36px; }
.hero-stage .hero-title { font-size: clamp(2.3rem, 4.5vw, 3.8rem); color: #fff; }
.hero-stage .lede { color: var(--ink-2); }
.hero-stage .pioneer-badge { background: rgb(255 255 255 / .07); }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-stage .btn-outline { background: rgb(255 255 255 / .06); }
.hero-stage .btn-outline:hover:not(:disabled) { border-color: var(--piloto); background: rgb(255 255 255 / .1); }
.hero-links { display: flex; flex-wrap: wrap; gap: 4px 26px; margin-top: 8px; }
.hero-links .hero-video-link { color: var(--ink-2); }

/* Cabecera de Servicios con el mismo escenario */
.page-head-stage {
  padding-block: 36px 44px;
  border-bottom: 0;
  background:
    radial-gradient(800px 360px at 85% 0%, rgb(31 154 115 / .32), transparent 62%),
    radial-gradient(600px 320px at 0% 100%, rgb(242 181 58 / .14), transparent 65%),
    linear-gradient(180deg, #0b1713, #08100d);
}
.page-head-stage .aurora { opacity: .35; }
.page-head-stage .shell { position: relative; z-index: 1; }
.page-head-stage .h1 { color: #fff; }

/* ---------- Escena ---------- */
.scene { position: relative; width: 100%; }
.scene::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(123 227 184 / .28), transparent);
  filter: blur(8px);
  transition: opacity .8s ease;
  pointer-events: none;
}
.scene.is-ready::before { opacity: .55; }
.scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  opacity: 0;
  touch-action: pan-y;
  transition: opacity .7s ease;
}
.scene.is-ready .scene-canvas { opacity: 1; }
.scene-canvas:active { cursor: grabbing; }

.scene-hero { aspect-ratio: 1.06 / 1; min-height: 360px; max-height: 620px; }
.scene-phone { aspect-ratio: .92 / 1; min-height: 480px; max-height: 640px; }

.scene-hint {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: rgb(0 0 0 / .28);
  backdrop-filter: blur(6px);
  color: var(--ink-2);
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.scene.no-3d .scene-hint { display: none; }

.scene-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 1px;
  padding: 8px 14px;
  border-radius: 14px;
  background: #fff;
  color: #16201c;
  font-size: .8rem;
  line-height: 1.3;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 14px 30px -10px rgb(0 0 0 / .55);
  pointer-events: none;
}
.scene-tip[hidden] { display: none; }
.scene-tip strong { font-size: .92rem; }
.scene-tip span { color: #5b6761; }

/* Sin 3D: la portada queda con los enlaces y el celular en 2D */
.scene-hero.no-3d { display: none; }
.scene-phone.no-3d { display: grid; place-items: center; min-height: 0; aspect-ratio: auto; }
.scene-phone.no-3d::before { display: none; }
.phone-2d {
  width: min(270px, 74%);
  aspect-ratio: 1 / 2;
  padding: 9px;
  border-radius: 42px;
  background: #0c1612;
  box-shadow: 0 40px 80px -24px rgb(0 0 0 / .7), inset 0 0 0 2px #22332c;
}
.phone-2d canvas { width: 100%; height: 100%; display: block; border-radius: 34px; }

/* ---------- Servicios en fila, bajo la escena ---------- */
.hero-visual { display: grid; gap: 14px; align-content: center; min-width: 0; }
.scene-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; }
.chip-svc {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  background: rgb(255 255 255 / .06);
  color: var(--ink-2);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.chip-svc svg { width: 17px; height: 17px; flex: none; color: var(--negocio); }
.chip-svc:hover, .chip-svc:focus-visible { border-color: var(--piloto); background: rgb(242 181 58 / .14); color: #fff; }
.hero-visual:has(.scene-hero.no-3d) .scene-chips { display: grid; grid-template-columns: 1fr 1fr; }

/* ---------- Franja del celular ---------- */
.stage-band {
  margin-top: 88px;
  padding-block: 72px;
  background:
    radial-gradient(800px 480px at 8% 0%, rgb(242 181 58 / .16), transparent 62%),
    radial-gradient(700px 520px at 100% 100%, rgb(31 154 115 / .3), transparent 62%),
    linear-gradient(180deg, #0b1713, #08100d);
}
.stage-band .aurora { opacity: .35; }
.showcase-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
  gap: 40px;
  align-items: center;
}
.showcase-copy .h2 { color: #fff; text-wrap: balance; }
.showcase-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.showcase-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  background: rgb(255 255 255 / .05);
  color: var(--ink-2);
  font-size: .92rem;
  font-weight: 650;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease;
}
.showcase-tab svg { width: 19px; height: 19px; flex: none; }
.showcase-tab:hover { border-color: var(--piloto); color: #fff; }
.showcase-tab[aria-selected="true"] { border-color: var(--piloto); background: var(--piloto); color: #1b1300; }
.showcase-panel { display: grid; gap: 14px; justify-items: start; margin-top: 26px; animation: show-in .4s ease; }
.showcase-panel[hidden] { display: none; }
.showcase-panel h3 { color: #fff; font-family: var(--font-display); font-size: 1.6rem; font-weight: 720; letter-spacing: -.02em; line-height: 1.15; }
.showcase-panel > p { max-width: 52ch; color: var(--ink-2); font-size: 1.05rem; }
.showcase-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.showcase-price small { color: var(--muted); font-size: .85rem; }
.showcase-price strong { color: #fff; font-family: var(--font-display); font-size: 2.2rem; letter-spacing: -.03em; line-height: 1; }
.showcase-price span { color: var(--muted); font-size: .9rem; }
@keyframes show-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Tarjetas de servicio que se inclinan ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.svc-item { perspective: 900px; }
.svc-tile {
  --rx: 0deg;
  --ry: 0deg;
  --gx: 50%;
  --gy: 0%;
  position: relative;
  height: 100%;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .2s ease, box-shadow .2s ease;
}
.svc-tile.is-tilting { transition: transform .08s linear, border-color .2s ease, box-shadow .2s ease; box-shadow: var(--shadow-3); border-color: var(--negocio); }
.svc-tile:hover { border-color: var(--negocio); }
.svc-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--gx) var(--gy), rgb(255 255 255 / .22), transparent 60%);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.svc-tile.is-tilting::after { opacity: .5; }
.svc-icon {
  width: 54px; height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 16px;
  color: var(--negocio-ink);
  background: var(--negocio-soft);
  transform: translateZ(34px);
}
.svc-icon svg { width: 28px; height: 28px; }
.svc-tile strong { font-size: 1.06rem; line-height: 1.25; transform: translateZ(18px); }
.svc-lema { color: var(--muted); font-size: .88rem; line-height: 1.45; transform: translateZ(8px); }
.svc-price { align-self: end; margin-top: 6px; display: flex; align-items: baseline; gap: 6px; color: var(--negocio-ink); font-family: var(--font-display); font-size: 1.3rem; font-weight: 740; transform: translateZ(22px); }
.svc-price small { color: var(--subtle); font-family: var(--font-body); font-size: .76rem; font-weight: 500; }
.svc-grid .svc-item { display: grid; }
.svc-more { margin-top: 28px; text-align: center; }

/* Las tarjetas de Servicios también se inclinan */
.servicios-grid .mini-card { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .2s ease; }
.servicios-grid .mini-card.is-tilting { transition: transform .08s linear, box-shadow .2s ease; box-shadow: var(--shadow-3); }
.servicios-grid .mini-card[data-tilt]::after { content: none; }

/* ---------- Bloque de ayuda gratis ---------- */
.help-block .ask { max-width: 780px; margin-top: 0; }
.help-block .hero-alt { max-width: 780px; }
.help-block .section-head { margin-bottom: 26px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-stage .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-stage .hero-visual { max-width: 640px; margin-inline: auto; width: 100%; }
  .showcase-grid { grid-template-columns: 1fr; gap: 20px; }
  .scene-phone { max-width: 520px; margin-inline: auto; min-height: 460px; }
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hero-stage { padding-block: 36px 44px; }
  .scene-hero { aspect-ratio: 1 / 1; min-height: 320px; }
  .scene-phone { aspect-ratio: .86 / 1; min-height: 420px; }
  .stage-band { margin-top: 64px; padding-block: 52px; }
  .chip-svc { font-size: .8rem; padding: 5px 10px; }
  .svc-tile { padding: 16px; }
  .svc-lema { display: none; }
  .showcase-panel h3 { font-size: 1.35rem; }
  .hero-cta .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .svc-tile, .svc-tile.is-tilting, .servicios-grid .mini-card { transform: none; transition: none; }
  .showcase-panel { animation: none; }
}
