/* ==========================================================================
   Servicios — "Cuatro círculos, cuatro servicios"
   El isotipo es el mapa: cada círculo es un servicio y se transforma en su
   figura (rombo, cuadro, play, hexágono). Ver docs/plan/2026-11-27-servicios-propuesta.md
   ========================================================================== */

/* Figuras: mismas 6 esquinas que la portada para que la transición sea suave */
:root {
  --shape-circle: polygon(0 0, 100% 0, 100% 50%, 100% 100%, 0 100%, 0 50%);
  --shape-diamond: polygon(50% 0, 50% 0, 100% 50%, 50% 100%, 50% 100%, 0 50%);
  --shape-square: polygon(6% 6%, 94% 6%, 94% 50%, 94% 94%, 6% 94%, 6% 50%);
  --shape-play: polygon(14% 2%, 14% 2%, 100% 50%, 100% 50%, 14% 98%, 14% 50%);
  --shape-hexagon: polygon(25% 7%, 75% 7%, 100% 50%, 75% 93%, 25% 93%, 0 50%);
  --svc-dot: clamp(92px, 15vw, 190px);
  --svc-morph: 0.7s;
  --svc-cycle: 8s;
}

.svc--red, .svc-map__item--red, .svc-pick__dot--red, .svc-process__step--red { --c: var(--brand-red); --shape: var(--shape-diamond); }
.svc--green, .svc-map__item--green, .svc-pick__dot--green, .svc-process__step--green { --c: var(--brand-green); --shape: var(--shape-square); }
.svc--blue, .svc-map__item--blue, .svc-pick__dot--blue, .svc-process__step--blue { --c: var(--brand-blue); --shape: var(--shape-play); }
.svc--yellow, .svc-map__item--yellow, .svc-pick__dot--yellow, .svc-process__step--yellow { --c: var(--brand-yellow); --shape: var(--shape-hexagon); }

/* --- 1. Portada --- */
.svc-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 120px 0 var(--section-y);
  text-align: center;
}

.svc-hero .label--dot { justify-content: center; }

.svc-hero__title {
  margin: 20px 0 0;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 600;
  line-height: 1.3;
}

.svc-map {
  display: grid;
  grid-template-columns: repeat(2, var(--svc-dot));
  gap: calc(var(--svc-dot) * 0.41) calc(var(--svc-dot) * 0.6);
  margin-top: 72px;
}

.svc-map__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--color-text);
  text-decoration: none;
}

.svc-map__dot,
.svc-pick__dot::before {
  display: block;
  width: var(--svc-dot);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  clip-path: var(--shape-circle);
  transition: clip-path var(--svc-morph) var(--ease-out), border-radius var(--svc-morph) var(--ease-out);
}

.svc-map__item:hover .svc-map__dot,
.svc-map__item:focus-visible .svc-map__dot {
  border-radius: 0;
  clip-path: var(--shape);
}

.svc-map__name {
  max-width: 16ch;
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.svc-hero__hint {
  margin: 56px 0 0;
  font-size: var(--fs-label);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* --- 2. Un servicio por sección --- */
.svc {
  display: grid;
  gap: 40px;
  padding: var(--section-y) 0;
  border-top: 1px solid var(--color-line);
  scroll-margin-top: 40px;
}

.svc__num {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.svc__shape {
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--c);
  clip-path: var(--shape);
}

.svc__question {
  margin: 24px 0 0;
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 600;
  line-height: 1.15;
}

.svc__answer {
  margin: 20px 0 0;
  max-width: 44ch;
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--color-muted);
}

.svc__includes-title {
  margin: 40px 0 8px;
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-muted);
}

.svc__includes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.svc__includes li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line);
  font-size: var(--fs-body);
}

.svc__includes li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--c);
}

.svc__case {
  display: inline-block;
  margin-top: 28px;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--c);
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
}

.svc__case:hover { color: var(--c); }

.svc__media {
  position: relative;
  margin: 0;
}

.svc__media img,
.svc__media video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Estrategia: foto + patrocinadores que se sumaron */
.svc__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  margin-top: 24px;
}

.svc__logos-label {
  width: 100%;
  font-size: var(--fs-label);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-muted);
}

.svc__media .svc__logos img {
  width: auto;
  height: 28px;
  border-radius: 0;
}

/* Producción: foto horizontal con un retrato encimado */
.svc__media--stack {
  padding-bottom: 18%;
}

.svc__media--stack .svc__img-small {
  position: absolute;
  right: 6%;
  bottom: 0;
  width: 30%;
  outline: 8px solid var(--color-bg);
}

/* Documental: video con marca de grabación */
.svc__media--film video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-text);
}

.svc__rec {
  position: absolute;
  top: 16px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--color-bg);
}

.svc__rec::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-red);
  animation: svc-rec 1.2s steps(2, jump-none) infinite;
}

@keyframes svc-rec { 50% { opacity: 0; } }

/* Redes: tres verticales escalonados, como un feed */
.svc__media--phones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}

.svc__media--phones img {
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 20px;
}

.svc__media--phones img:nth-child(2) { margin-top: 48px; }
.svc__media--phones img:nth-child(3) { margin-top: 24px; }

/* --- 3. Cómo trabajamos --- */
.svc-process {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--color-line);
}

.svc-process__title,
.svc-pick__title {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 600;
  text-align: center;
}

.svc-process__steps {
  display: grid;
  gap: 40px;
  margin: 64px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: paso;
}

.svc-process__step {
  position: relative;
  counter-increment: paso;
}

.svc-process__dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
}

.svc-process__step h3 {
  margin: 20px 0 0;
  font-size: var(--fs-h3);
  font-weight: 600;
}

.svc-process__step h3::before {
  content: "0" counter(paso) " · ";
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--color-muted);
}

.svc-process__step p {
  margin: 8px 0 0;
  max-width: 30ch;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--color-muted);
}

/* --- 4. ¿Cuál es tu círculo? --- */
.svc-pick {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--color-line);
  text-align: center;
}

.svc-pick__dots {
  --svc-dot: clamp(40px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  max-width: 640px;
  margin: 56px auto 0;
}

.svc-pick__dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--color-text);
  text-decoration: none;
}

.svc-pick__dot::before { content: ""; }

.svc-pick__dot:hover::before,
.svc-pick__dot:focus-visible::before {
  border-radius: 0;
  clip-path: var(--shape);
}

.svc-pick__name {
  max-width: 12ch;
  font-size: var(--fs-small);
  line-height: 1.35;
}

.svc-pick__unsure {
  display: inline-block;
  margin-top: 56px;
  font-size: var(--fs-body);
  color: var(--color-muted);
}

.svc-pick__unsure:hover { color: var(--color-text); }

/* --- Computadora --- */
@media (min-width: 900px) {
  .svc {
    grid-template-columns: 5fr 7fr;
    gap: 80px;
    align-items: start;
  }

  .svc--flip .svc__text { order: 2; }

  .svc__text {
    position: sticky;
    top: 96px;
  }

  .svc-process__steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }

  /* Línea que une los cuatro pasos, a la altura de los puntos */
  .svc-process__steps {
    background: linear-gradient(var(--color-line), var(--color-line)) 0 7px / 100% 1px no-repeat;
  }
}

@media (prefers-reduced-motion: reduce) {
  .svc__rec::before { animation: none; }
}

/* ==========================================================================
   Con JS: los círculos flotan por la página y cada servicio se abre encima
   (sin JS todo se ve en una sola página, con anclas)
   ========================================================================== */

/* El espacio donde flotan */
.js .svc-map[data-svc-float] {
  --svc-dot: clamp(112px, 13vw, 176px);
  position: relative;
  display: block;
  width: 100%;
  /* Que los cuatro quepan en la primera pantalla.
     Primero con vh: navegadores dentro de apps (Instagram) no conocen svh
     y sin esta línea el espacio quedaba en 0 px */
  min-height: 400px;
  height: clamp(400px, calc(100vh - 330px), 640px);
  height: clamp(400px, calc(100svh - 330px), 640px);
  margin-top: 24px;
  touch-action: pan-y;
}

/* Cada círculo es un cuerpo: el nombre del servicio va adentro, en blanco */
.js .svc-map[data-svc-float] .svc-map__item {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: var(--svc-dot);
  height: var(--svc-dot);
  will-change: transform;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.js .svc-map[data-svc-float] .svc-map__item.is-grabbed { cursor: grabbing; }

/* No se muestran hasta que la física los acomoda */
.js .svc-map[data-svc-float]:not(.is-ready) .svc-map__item { visibility: hidden; }

.js .svc-map[data-svc-float] .svc-map__dot {
  position: absolute;
  inset: 0;
  width: auto;
  transition: clip-path var(--svc-morph) var(--ease-out),
    border-radius var(--svc-morph) var(--ease-out),
    transform var(--dur-hover) var(--ease-out);
}

.js .svc-map[data-svc-float] .svc-map__item.is-grabbed .svc-map__dot {
  transform: scale(1.06);
}

.js .svc-map[data-svc-float] .svc-map__name {
  position: relative;
  max-width: 78%;
  font-size: clamp(11px, 0.95vw, 13px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.2px;
  color: #FFFFFF;
  text-align: center;
  pointer-events: none;
}

.js .svc-hero {
  min-height: 0;
  padding-top: 96px;
  padding-bottom: 72px;
}

.js .svc-hero__hint { margin-top: 16px; }

/* Cada servicio es un panel que se abre desde el círculo */
.js .svc[data-svc-panel] {
  display: none;
}

.js .svc[data-svc-panel].is-open {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  align-content: start;
  margin: 0;
  padding: 96px var(--gutter) 72px;
  border: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-bg);
  clip-path: circle(0 at var(--ox, 50%) var(--oy, 50%));
  transition: clip-path 0.7s var(--ease-out);
}

.js .svc[data-svc-panel].is-revealed {
  clip-path: circle(150vmax at var(--ox, 50%) var(--oy, 50%));
}

.has-svc-open {
  overflow: hidden;
}

.svc__close {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 1;
  translate: -50% 0;
  min-height: var(--target-min);
  padding: 4px 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--q-ink, var(--color-bg));
  background: var(--c);
  cursor: pointer;
}

.svc--yellow .svc__close { color: var(--color-text); }

.svc__quote {
  display: flex;
  width: fit-content;
  margin-top: 20px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-bg);
  background: var(--c);
  text-decoration: none;
}

.svc--yellow .svc__quote { color: var(--color-text); }

@media (min-width: 900px) {
  .js .svc[data-svc-panel].is-open {
    grid-template-columns: 5fr 7fr;
    gap: 80px;
    padding: 120px max(var(--gutter), calc((100vw - var(--container)) / 2)) 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .svc[data-svc-panel].is-open { transition: none; }
}

/* Flotando son cuerpos redondos: no cambian de figura (el nombre va adentro) */
.js .svc-map[data-svc-float] .svc-map__item:hover .svc-map__dot,
.js .svc-map[data-svc-float] .svc-map__item:focus-visible .svc-map__dot {
  border-radius: 50%;
  clip-path: var(--shape-circle);
}

.js .svc-map[data-svc-float] .svc-map__item:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
  border-radius: 50%;
}
