/* =========================================================
   ZARIA · MacBook animado + panel de revenue (pieza reservada)
   Preparado para la futura página Growth Marketing.
   ACABADO VISUAL PENDIENTE DE REVISIÓN.
   Uso: piezas/growth-marketing/macbook.html (marcado y notas),
        assets/js/macbook.js (apertura),
        assets/img/marketing/macbook-lid.png y macbook-base.png
        (capas recortadas de «Macbook air.webp», en la raíz).
   Escala: --u (tokens.css). Las imágenes se enlazan desde el HTML.
   ========================================================= */

/* ---------- MacBook (fotografía en capas + 3D) ----------
   Capas de «Macbook air.webp», en px de la foto × --f:
   · tapa 815 × 555 (macbook-lid.png): x 100–915, y 88–643
   · base 958 × 28  (macbook-base.png): x 28–986, y 643–671
   Abierto, las dos capas quedan exactamente como en la foto
   (vista frontal). La cámara está a la altura de la bisagra, como
   en la fotografía. La tapa gira con rotateX(--lid): −90° cerrada,
   +4° abierta (ligeramente hacia atrás). La base no se mueve. */
.mbk {
  --f: calc(.6 * var(--u));        /* escala: 1 px de la foto */
  --hinge: calc(400 * var(--u));   /* altura de la bisagra en el bloque */
  --lid: -90;                      /* ángulo (revenue.js) */
  position: relative;
  height: calc(480 * var(--u));    /* espacio reservado desde el inicio */
  perspective: calc(3000 * var(--u));
  perspective-origin: 50% var(--hinge);
}
.mbk__laptop {
  position: absolute;
  left: 50%; top: var(--hinge);
  width: calc(815 * var(--f));
  margin-left: calc(815 * var(--f) / -2);
  transform-style: preserve-3d;
}
.mbk__laptop > *,
.mbk__lid > *,
.mbk__screen > * { position: absolute; }

/* Sombra de apoyo bajo la base (plana, sin geometría añadida) */
.mbk__shadow {
  left: calc(-60 * var(--f)); right: calc(-60 * var(--f));
  top: calc(18 * var(--f));
  height: calc(26 * var(--f));
  border-radius: 50%;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(40, 20, 8, .5), transparent 72%);
  filter: blur(calc(5 * var(--u)));
}

/* Base (fotografía): justo bajo la tapa, como en la foto */
.mbk__base {
  left: calc(-72 * var(--f)); top: 0;
  width: calc(958 * var(--f)); height: calc(28 * var(--f));
  max-width: none;
}

/* Tapa (fotografía): gira sobre la bisagra (borde inferior) */
.mbk__lid {
  left: 0;
  top: calc(-555 * var(--f));
  width: calc(815 * var(--f)); height: calc(555 * var(--f));
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--lid) * 1deg));
}
.mbk__screen {
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.mbk__lid-img { left: 0; top: 0; width: 100%; height: 100%; max-width: none; }
/* Canto superior de la tapa: es lo que se ve de ella cuando está cerrada */
.mbk__lid-edge {
  /* Pegado al borde superior real de la tapa (y 91 de la foto) */
  left: calc(8 * var(--f)); right: calc(8 * var(--f)); top: calc(3 * var(--f));
  height: calc(8 * var(--f));
  transform-origin: 50% 0;
  transform: rotateX(-90deg);
  border-radius: calc(4 * var(--f));
  background: linear-gradient(180deg, #2c3240, #1d222c);
}
/* Pantalla: el panel ocupa solo la superficie de la pantalla
   (x 118–897, y 106–610 de la foto), dentro del marco */
.mbk__display {
  left: 2.209%; top: 3.243%;
  width: 95.583%; height: 90.811%;
  overflow: hidden;
  border-radius: calc(9 * var(--f)) calc(9 * var(--f)) calc(2 * var(--f)) calc(2 * var(--f));
  background: #fbf7f1;
}
/* Muesca de la cámara (x 475–549, hasta y 120 de la foto) */
.mbk__notch {
  position: absolute;
  left: 45.83%; top: 0;
  width: 9.5%; height: 2.78%;
  border-radius: 0 0 calc(7 * var(--f)) calc(7 * var(--f));
  background: #050608;
  z-index: 3;
}
.mbk__glare,
.mbk__dim { position: absolute; inset: 0; pointer-events: none; }
.mbk__glare { background: linear-gradient(115deg, rgba(255, 255, 255, .06) 0 32%, rgba(255, 255, 255, 0) 32.5%); }
.mbk__dim { background: #050608; opacity: var(--dim, 1); }

/* ---------- Panel de revenue (dentro de la pantalla) ---------- */
.rvd {
  display: flex; flex-direction: column;
  height: 100%;
  padding: calc(20 * var(--u)) calc(12 * var(--u)) calc(10 * var(--u));
  font-family: var(--font-sans);
  color: #2f1a10;
}
.rvd__top { display: flex; align-items: center; justify-content: space-between; }
.rvd__title { font-size: calc(11.5 * var(--u)); font-weight: 600; }
.rvd__tag {
  padding: calc(3 * var(--u)) calc(7 * var(--u));
  border-radius: 999px;
  background: #f1e2d3;
  font-size: calc(8 * var(--u));
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a3e1f;
}
.rvd__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(136 * var(--u));
  gap: calc(10 * var(--u));
  flex: 1;
  margin-top: calc(10 * var(--u));
}
.rvd__chart {
  display: flex; flex-direction: column;
  padding: calc(10 * var(--u)) calc(10 * var(--u)) calc(8 * var(--u));
  border: 1px solid rgba(67, 21, 6, .1);
  border-radius: calc(6 * var(--u));
  background: #fff;
}
.rvd__chart-title { font-size: calc(9.5 * var(--u)); font-weight: 600; color: rgba(47, 26, 16, .7); }
.rvd__svg { display: block; width: 100%; height: auto; margin-top: calc(6 * var(--u)); overflow: visible; }
.rvd__chart { justify-content: space-between; }
.rvd__grid line { stroke: rgba(67, 21, 6, .1); stroke-width: 1; }
.rvd__grid .rvd__cap { stroke: rgba(67, 21, 6, .3); stroke-dasharray: 2 3; }
.rvd__ylab text, .rvd__xlab text, .rvd__today-lab, .rvd__cap-lab {
  font: 500 9px var(--font-sans);
  fill: rgba(47, 26, 16, .55);
}
.rvd__ylab text { text-anchor: end; }
.rvd__xlab text { text-anchor: middle; }
.rvd__xlab text:first-child { text-anchor: start; }
.rvd__xlab text:last-child { text-anchor: end; }
.rvd__cap-lab { text-anchor: end; }
.rvd__fc { fill: none; stroke: #5b3726; stroke-width: 1.6; stroke-dasharray: 5 4; }
.rvd__ob { fill: none; stroke: #a4512f; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.rvd__ob-area { fill: rgba(164, 81, 47, .12); }
.rvd__today { stroke: rgba(47, 26, 16, .4); stroke-width: 1; stroke-dasharray: 2 2; }
.rvd__dot { fill: #a4512f; stroke: #fff; stroke-width: 1.5; }
.rvd__today-lab { fill: #2f1a10; font-weight: 600; }
.rvd__legend {
  display: flex; gap: calc(14 * var(--u));
  margin-top: calc(4 * var(--u));
  font-size: calc(8.5 * var(--u));
  color: rgba(47, 26, 16, .7);
}
.rvd__legend span { display: inline-flex; align-items: center; gap: calc(5 * var(--u)); }
.rvd__key { display: inline-block; width: calc(14 * var(--u)); height: 0; border-top: 2px solid #a4512f; }
.rvd__key--fc { border-top: 2px dashed #5b3726; }
.rvd__kpis { display: flex; flex-direction: column; gap: calc(7 * var(--u)); margin: 0; }
.rvd__kpis > div {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(6 * var(--u)) calc(10 * var(--u));
  border: 1px solid rgba(67, 21, 6, .1);
  border-radius: calc(6 * var(--u));
  background: #fff;
}
.rvd__kpis dt { font-size: calc(8 * var(--u)); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(47, 26, 16, .55); }
.rvd__kpis dd { margin: calc(2 * var(--u)) 0 0; font-family: var(--font-serif); font-size: calc(21 * var(--u)); line-height: 1.1; }
.rvd__kpis span { font-size: calc(8 * var(--u)); color: rgba(47, 26, 16, .6); }
.rvd__kpis > div:first-child dd { color: #a4512f; }

@media (max-width: 1023px) {
  .mbk { --u: .62px; height: 360px; }
}
