/* ==========================================================================
   «Cómo trabajamos» · maqueta animada
   Texto a la izquierda; la maqueta, fija a la derecha, se construye con el
   scroll. En el celular la maqueta queda arriba, bajo la barra del sitio.
   Los --pm-* son los colores que lee la escena (maqueta.js los resuelve).
   ========================================================================== */
.pm {
  --pm-tinta: var(--gx-texto);
  --pm-suave: var(--gx-suave);
  --pm-bronce: var(--clay);
  --pm-linea: color-mix(in srgb, var(--gx-texto) 16%, transparent);
  --pm-cielo: color-mix(in srgb, var(--gx-fondo) 90%, var(--ink) 6%);
  --pm-noche: #121620;
  /* La naturaleza no cambia con el tema del estudio. */
  --pm-cesped: #93A46A; --pm-cesped2: #7F9259; --pm-tierra: #A98B66;
  --pm-suelo1: #4A3A2C; --pm-suelo2: #6E5641; --pm-suelo3: #5C4736;
  --pm-agua: #3E7CC0; --pm-desague: #7A7C82; --pm-elec: #C8893A;
  --pm-sello: #A1402F;
  --pm-tope: 0px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); grid-template-rows: auto 1fr;
  column-gap: clamp(28px, 3.6vw, 64px); max-width: 1500px;
}
.pm-cabeza { grid-column: 1; grid-row: 1; padding-block: clamp(20px, 8vh, 110px) 0; }
.pm-texto { grid-column: 1; grid-row: 2; }
.pm-escena {
  grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 0;
  height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 14px; padding-block: 8px 24px;
}

.pm-titulo {
  font-family: var(--gx-cond); font-weight: 700; font-size: clamp(2.4rem, 4vw, 4.2rem); line-height: .94;
  margin: .25em 0 .45em; text-transform: uppercase; text-wrap: balance;
}
.pm-titulo b { color: var(--clay-ink); font-weight: 700; }
.pm-intro { max-width: 36ch; font-size: 1.2rem; margin: 0; }
.pm-pregunta { margin: 14px 0 28px; font-family: var(--gx-cond); font-size: 1.45rem; letter-spacing: .02em; color: var(--clay-ink); }
.pm-enfoque { margin: 8px 0; padding-block: 16px; border-block: 1px solid var(--pm-linea); }
.pm-enfoque-t {
  margin: 0 0 14px; font-family: var(--gx-cond); font-weight: 500; font-size: .95rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gx-suave);
}
.pm-enfoque ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pm-principio {
  display: grid; grid-template-columns: 2.2em 1fr; gap: 10px; align-items: baseline; width: 100%; text-align: left;
  font: inherit; color: inherit; background: none; border: 0; border-radius: 3px; padding: 8px 10px 10px; margin: 0 -10px;
  cursor: pointer; transition: background .2s;
}
.pm-principio:hover { background: color-mix(in srgb, var(--gx-texto) 6%, transparent); }
.pm-principio:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.pm-principio b { display: block; font-family: var(--gx-cond); font-weight: 700; font-size: 1.2rem; text-transform: uppercase; letter-spacing: .02em; }
.pm-principio-txt { display: block; margin-top: 2px; max-width: 46ch; font-size: .96rem; color: var(--gx-suave); }
.pm-principio-ver {
  display: inline-flex; gap: 6px; margin-top: 6px; font-family: var(--gx-cond); font-size: .88rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--clay-ink); border-bottom: 1px solid currentColor;
}

.pm-modal {
  width: min(1080px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: clamp(24px, 4vw, 52px); border: 0; border-radius: 4px;
  background: var(--gx-fondo); color: var(--gx-texto); overflow: auto; overscroll-behavior: contain;
}
.pm-modal[open] { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.pm-modal::backdrop { background: rgb(18 22 32 / .62); backdrop-filter: blur(3px); }
/* Solo opacidad: un transform haría del modal el marco del puntero fijo. */
.pm-modal[open] { animation: pm-modal-entra .3s ease; }
@keyframes pm-modal-entra { from { opacity: 0; } }
.pm-modal-cerrar {
  position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--pm-linea); background: var(--gx-fondo); color: inherit; font-size: 1.05rem; cursor: pointer; z-index: 1;
}
.pm-modal-texto { display: grid; gap: 12px; }
.pm-modal-texto p { margin: 0; font-size: 1.08rem; max-width: 40ch; }
.pm-modal-fotos { display: grid; gap: 12px; }
.pm-modal-fotos figure { margin: 0; display: grid; gap: 10px; }
.pm-modal-fotos figure[hidden] { display: none; }
.pm-modal-fotos img {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; background: var(--pm-cielo);
}
.pm-modal-fotos figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; font-size: .95rem; color: var(--gx-suave); }
.pm-modal-fotos figcaption a {
  font-family: var(--gx-cond); text-transform: uppercase; letter-spacing: .08em; font-size: .85rem;
  color: var(--clay-ink); text-decoration: none; white-space: nowrap;
}
.pm-modal-fotos figcaption a:hover { text-decoration: underline; }
.pm-modal-nav { display: flex; align-items: center; gap: 14px; }
.pm-modal-nav button {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--pm-linea); background: none; color: inherit; cursor: pointer;
}
.pm-modal-nav button:hover { border-color: var(--gx-texto); }
.pm-modal-cuenta { font-family: var(--gx-cond); font-variant-numeric: tabular-nums; color: var(--gx-suave); }
.pm-pestanas { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.pm-pestanas a {
  font-family: var(--gx-cond); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; font-size: .95rem;
  text-decoration: none; color: var(--gx-texto); padding: 8px 14px 7px; border: 1px solid var(--pm-linea); border-radius: 2px;
  transition: background .25s, color .25s, border-color .25s;
}
.pm-pestanas a:hover { border-color: var(--gx-texto); }
.pm-pestanas a.is-activo { background: var(--gx-texto); color: var(--gx-fondo); border-color: var(--gx-texto); }
.pm-lede { max-width: 34ch; font-size: 1.15rem; color: var(--gx-suave); margin: 0; }
.pm-ejemplo {
  display: inline-block; margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--pm-linea);
  font-family: var(--gx-cond); font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gx-suave);
}
.pm-nota { margin: 12px 0 0; max-width: 40ch; font-size: .92rem; color: var(--gx-suave); }

.pm-paso {
  min-height: 82vh; display: flex; flex-direction: column; justify-content: center; gap: 10px;
  opacity: .32; transition: opacity .45s ease;
}
.pm-paso--sub { min-height: 64vh; }
.pm-paso.is-activo { opacity: 1; }
.pm-paso p, .pm-capitulo p { margin: 0; max-width: 42ch; }
.pm-paso b { font-weight: 500; color: var(--clay-ink); }
.pm-capitulo { display: grid; gap: 6px; padding-bottom: 28px; margin-bottom: 22px; border-bottom: 1px solid var(--pm-linea); }
.pm-num { font-family: var(--gx-cond); font-weight: 500; font-size: 1.25rem; color: var(--clay-ink); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.pm-h2 { font-family: var(--gx-cond); font-weight: 700; font-size: clamp(2.1rem, 3.2vw, 3.2rem); line-height: 1; margin: 0; text-transform: uppercase; text-wrap: balance; }
.pm-h3 { font-family: var(--gx-cond); font-weight: 700; font-size: clamp(1.75rem, 2.5vw, 2.4rem); line-height: 1.02; margin: 0; text-transform: uppercase; text-wrap: balance; }
.pm-ficha { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 10px 0 0; font-size: .94rem; max-width: 44ch; }
.pm-ficha dt { font-family: var(--gx-cond); text-transform: uppercase; letter-spacing: .1em; font-size: .82rem; color: var(--gx-suave); padding-top: 2px; font-weight: 500; }
.pm-ficha dd { margin: 0; }
.pm-leyenda { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .94rem; }
.pm-leyenda li { display: flex; align-items: center; gap: 8px; }
.pm-leyenda i { width: 22px; height: 4px; border-radius: 2px; background: var(--c); }
.pm-cierre { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 18px; padding-block: 40px; }
.pm-cierre p { margin: 0; max-width: 40ch; color: var(--gx-suave); }

.pm-lienzo { position: relative; flex: 1; min-height: 0; border-radius: 3px; background: var(--pm-cielo); overflow: hidden; }
.pm-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pm-svg .tsuelo { font-family: var(--gx-cond); font-weight: 500; }
.pm-tip {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; transform: translate(-50%, calc(-100% - 14px));
  background: var(--gx-texto); color: var(--gx-fondo); font: 500 .88rem/1.3 var(--gx-txt); padding: 6px 10px; border-radius: 2px;
  white-space: nowrap; max-width: 80vw; overflow: hidden; text-overflow: ellipsis;
}
.pm-sello {
  position: absolute; right: 7%; top: 9%; pointer-events: none; opacity: 0; transform: rotate(-9deg) scale(1.6);
  border: 3px solid var(--pm-sello); color: var(--pm-sello); padding: 10px 18px 9px; border-radius: 6px;
  font-family: var(--gx-cond); text-transform: uppercase; text-align: center; letter-spacing: .1em; line-height: 1.1;
}
.pm-sello b { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: .06em; }
.pm-sello span { display: block; font-size: .75rem; }

.pm-hud { display: grid; gap: 8px; font-family: var(--gx-cond); }
.pm-hud-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; min-width: 0; }
.pm-etapa { font-size: 1.3rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-semana, .pm-avance { font-variant-numeric: tabular-nums; color: var(--gx-suave); font-size: 1.05rem; white-space: nowrap; }
.pm-barra { display: flex; gap: 3px; height: 26px; }
.pm-seg {
  flex: var(--w) 1 0; min-width: 24px; position: relative; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--gx-texto) 10%, transparent); border: 0; border-radius: 2px; padding: 0; font: inherit; color: inherit;
}
.pm-seg i { position: absolute; inset: 0 auto 0 0; width: calc(var(--f, 0) * 100%); background: var(--clay); }
.pm-seg span { position: relative; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; }
.pm-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--gx-fondo); opacity: .7; }
.pm-seg:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.pm-llave { display: inline-flex; align-items: center; gap: 8px; color: var(--clay-ink); opacity: 0; font-size: 1.05rem; }

@media (max-width: 860px) {
  .pm { display: block; }
  .pm-cabeza { padding-block: 10px 20px; }
  .pm-escena {
    position: sticky; top: var(--pm-tope); height: auto; z-index: 5; gap: 8px; padding-block: 6px 10px;
    background: var(--gx-fondo);
  }
  .pm-lienzo { flex: none; height: min(42vh, 400px); }
  .pm-paso { min-height: 68vh; }
  .pm-paso--sub { min-height: 52vh; }
  .pm-etapa { font-size: 1.05rem; }
  .pm-semana, .pm-avance { font-size: .92rem; }
  .pm-barra { height: 16px; }
  .pm-seg span { display: none; }
  .pm-sello { padding: 6px 10px; }
  .pm-sello b { font-size: 1.05rem; }
  .pm-modal[open] { grid-template-columns: 1fr; align-items: start; }
  .pm-modal-cerrar { position: sticky; justify-self: end; margin: -12px -12px -40px 0; }
}
@media (prefers-reduced-motion: reduce) { .pm-paso { transition: none; } .pm-modal[open] { animation: none; } }
