/* servicios.css — estilos específicos de servicios */

/* ---- HERO ---- */
.servicios-hero {
  padding-top: calc(72px + 28px);
  padding-bottom: 20px;
  overflow-x: clip;
}
.servicios-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}
.servicios-hero-text {
  min-width: 0;
}
.servicios-hero h1 {
  margin-bottom: var(--space-md);
  font-size: clamp(2.25rem, 4.4vw, 3.25rem);
  line-height: 1.08;
}
.servicios-hero h1 em { color: var(--accent); font-style: italic; }
.servicios-hero p {
  max-width: 52ch;
  font-size: 16px;
}
.servicios-hero-visual {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: visible;
}

/* Glass diagnostic plate — frames hero image without replacing asset */
.servicios-hero-plate {
  position: relative;
  width: 100%;
  max-width: min(100%, 500px);
  isolation: isolate;
}

.servicios-hero-plate__glow {
  position: absolute;
  z-index: 0;
  inset: -14% -10% -10% -12%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 72% 58% at 48% 42%, rgba(168, 212, 41, 0.11), transparent 58%),
    radial-gradient(ellipse 48% 42% at 78% 72%, rgba(232, 96, 10, 0.09), transparent 52%);
  filter: blur(32px);
  opacity: 0.9;
}

.servicios-hero-plate__frame {
  position: relative;
  z-index: 1;
  border-radius: 11px;
  padding: 9px 9px 10px;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(10, 12, 18, 0.55), rgba(10, 12, 18, 0.46)) padding-box,
    linear-gradient(
      128deg,
      rgba(168, 212, 41, 0.2),
      rgba(232, 96, 10, 0.08) 42%,
      rgba(168, 212, 41, 0.05)
    )
      border-box;
  background-clip: padding-box, border-box;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.38);
}

/* Path language: lime node + short orange trace (top-left) */
.servicios-hero-plate__path-node {
  position: absolute;
  z-index: 2;
  top: 11px;
  left: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.72;
  box-shadow: 0 0 10px rgba(168, 212, 41, 0.28);
  pointer-events: none;
}

.servicios-hero-plate__path-line {
  position: absolute;
  z-index: 2;
  top: 13px;
  left: 19px;
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, rgba(232, 112, 45, 0.5), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.servicios-hero-plate__media {
  position: relative;
  z-index: 1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 2px 28px rgba(0, 0, 0, 0.42);
}

.servicios-hero-plate__media img {
  display: block;
  width: 115%;
  max-width: none;
  height: auto;
  max-height: min(340px, 38vh);
  object-fit: contain;
  transform: translateX(-4%);
  filter: contrast(1.05) saturate(1.08);
}

/* ---- GRID BASE DE SERVICIOS ---- */
.servicio-section {
  padding: var(--space-lg) 0;
  border-top: 0.5px solid var(--border);
}
.servicio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

/* CTA link fuera del grid — alineación por sección */
#blueprint .container > a.detalle-cta:last-child {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  box-sizing: border-box;
  margin-top: var(--space-md);
}
#stack .container > a.detalle-cta:last-child {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
  margin-top: var(--space-md);
}
#build .container > a.detalle-cta:last-child {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  box-sizing: border-box;
  margin-top: var(--space-md);
}

/* ---- COPY / DETALLE ---- */
.servicio-copy h2 { margin-bottom: var(--space-md); }
.servicio-copy p {
  font-size: 15px;
  line-height: 1.75;
}

/* reverse: detalle LEFT, copy RIGHT — DOM semánticamente correcto */
.reverse .servicio-copy { order: 2; }
.reverse .servicio-detalle { order: 1; }

.servicio-section > .container > a.detalle-cta:last-child {
  margin-top: var(--space-lg);
  display: inline-flex;
}
.servicio-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--space-md);
}
.servicio-tagline {
  color: var(--text-primary);
  font-style: italic;
  margin-top: var(--space-md);
  border-left: 2px solid var(--accent-border);
  padding-left: var(--space-md);
}
.servicio-detalle {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-lg);
}
.servicio-detalle p {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}
.detalle-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.detalle-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.detalle-item {
  display: flex;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-secondary);
}
.detalle-item::before {
  content: "→";
  color: var(--accent);
  flex: 0 0 auto;
}
.detalle-cta {
  display: inline-flex;
  color: var(--accent);
  font-size: 13px;
  margin-top: var(--space-xs);
  transition: opacity var(--ease);
}
.detalle-cta:hover { opacity: 0.75; }

/* ---- NOTA ---- */
.servicios-nota {
  background: var(--bg-surface);
  padding: var(--space-xl) 0;
}
.nota-inner {
  max-width: 600px;
}
.nota-statement {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: var(--space-lg);
}
.nota-body {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-secondary);
  max-width: 44ch;
}
.nota-remote {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.10));
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-tertiary, rgba(255,255,255,0.45));
  max-width: 44ch;
  letter-spacing: 0.01em;
}

/* ---- CTA FINAL ---- */
.servicios-cta {
  padding: var(--space-xl) 0;
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  border-top: 0.5px solid var(--border);
  padding-top: var(--space-xl);
}
.servicios-cta h2 { margin-bottom: 0; }

/* ---- MOBILE ---- */
@media (max-width: 768px) {
  .servicios-hero {
    padding-top: calc(72px + var(--space-lg));
    padding-bottom: var(--space-lg);
  }

  .servicios-hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    min-width: 0;
  }
  .servicios-hero h1 {
    max-width: 12ch;
    font-size: clamp(1.8rem, 8vw, 2.15rem);
  }
  .servicios-hero p {
    width: 100%;
    max-width: 34ch;
    font-size: 14px;
    overflow-wrap: normal;
  }
  .servicios-hero-visual {
    justify-content: flex-start;
    min-width: 0;
  }
  .servicios-hero-plate {
    max-width: min(100%, 340px);
    min-width: 0;
  }
  .servicios-hero-plate__glow {
    inset: -10% -6% -8% -6%;
    filter: blur(24px);
  }
  .servicios-hero-plate__media img {
    width: 100%;
    transform: none;
    max-height: 280px;
  }
  .servicio-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .reverse .servicio-detalle { order: 2; }
  .reverse .servicio-copy { order: 1; }
  #blueprint .container > a.detalle-cta:last-child,
  #stack .container > a.detalle-cta:last-child,
  #build .container > a.detalle-cta:last-child {
    justify-content: center;
  }
  .cta-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
  }
}

/* ---- Método HME84 — diagrama Path (trazo naranja único + nodos fusionados) ---- */
.servicios-metodo {
  position: relative;
  padding-top: 24px;
  padding-bottom: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(232, 112, 45, 0.05), transparent 55%),
    var(--bg);
}

.servicios-metodo .hme84-method-heading {
  margin-bottom: var(--space-sm);
  font-size: clamp(1.45rem, 2.8vw, 2rem);
}

.servicios-metodo-summary {
  max-width: 58ch;
  margin: 0 0 var(--space-sm);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.servicios-metodo-flow {
  position: relative;
  margin-top: var(--space-sm);
  max-width: 100%;
  overflow-x: hidden;
}

.servicios-metodo-flow__canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 100%;
  min-height: 0;
}

/* —— Path module —— */
.metodo-path {
  --metodo-orange: rgb(232, 96, 10);
  --metodo-orange-soft: rgba(232, 112, 45, 0.34);
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 78px;
  padding: 0.2rem 0 0;
}

.metodo-path__svg-wrap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 62px;
  pointer-events: none;
  z-index: 0;
}

.metodo-path__svg {
  display: block;
  width: 100%;
  height: 100%;
}

.metodo-path__svg--mobile {
  display: none;
}

.metodo-path__track {
  fill: none;
  stroke: var(--metodo-orange-soft);
  stroke-width: 3.4;
}

.metodo-path__progress {
  fill: none;
  stroke: var(--metodo-orange);
  stroke-width: 3.65;
  opacity: 0.98;
  filter: drop-shadow(0 0 5px rgba(232, 96, 10, 0.28));
  transition: stroke-dashoffset 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.metodo-path__nodes {
  position: relative;
  z-index: 2;
  list-style: none;
  margin: 0;
  padding: 0;
  padding-inline-start: 0;
  min-height: 78px;
}

.metodo-path__nodes > li::marker {
  content: none;
}

.metodo-path__slot {
  position: absolute;
  transform: translate(-50%, -50%);
  top: 43%;
}

.metodo-path__slot--1 {
  left: 8.5%;
}
.metodo-path__slot--2 {
  left: 27.5%;
}
.metodo-path__slot--3 {
  left: 47%;
}
.metodo-path__slot--4 {
  left: 66.5%;
}
.metodo-path__slot--5 {
  left: 86%;
}

.servicios-metodo-flow__hit.metodo-path__hit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 4px 7px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  border-radius: var(--r-sm);
  transition: transform 0.26s ease;
}

.servicios-metodo-flow__hit.metodo-path__hit:focus-visible {
  outline: 2px solid rgba(232, 112, 45, 0.65);
  outline-offset: 4px;
}

.metodo-path__nub {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-sizing: border-box;
  background: radial-gradient(circle at 45% 35%, rgba(22, 24, 32, 0.55), rgba(10, 12, 18, 0.92));
  border: 2px solid rgba(232, 112, 45, 0.45);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    border-color 0.26s ease,
    box-shadow 0.26s ease,
    transform 0.26s ease;
}

.metodo-path__glyph {
  width: 13px;
  height: 13px;
  color: rgba(255, 255, 255, 0.42);
  transition: color 0.26s ease, transform 0.26s ease;
}

.metodo-path__label {
  display: block;
  min-width: 68px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  transition: color 0.26s ease;
}

#blueprint {
  padding-top: var(--space-md);
}

.servicios-metodo-flow__hit.is-path-focus .metodo-path__label,
.servicios-metodo-flow__hit.is-pinned-node .metodo-path__label {
  color: var(--text-secondary);
}

.servicios-metodo-flow__hit.is-path-focus .metodo-path__nub {
  border-color: rgba(232, 96, 10, 0.88);
  box-shadow:
    0 0 0 1px rgba(232, 96, 10, 0.2),
    0 0 20px rgba(232, 96, 10, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: scale(1.06);
}

.servicios-metodo-flow__hit.is-path-focus .metodo-path__glyph {
  color: rgba(255, 255, 255, 0.88);
}

.servicios-metodo-flow__hit.is-pinned-node .metodo-path__nub {
  border-color: var(--metodo-orange);
  box-shadow:
    0 0 0 2px rgba(232, 96, 10, 0.15),
    0 0 24px rgba(232, 96, 10, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.servicios-metodo-flow__hit.is-pinned-node .metodo-path__glyph {
  color: rgba(255, 255, 255, 0.95);
}

/* Panel de detalle: flujo normal, contenido en el módulo */
.servicios-metodo-flow__detail {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.26s ease,
    visibility 0.26s ease;
}

.servicios-metodo-flow.is-card-open .servicios-metodo-flow__detail {
  max-height: min(42vh, 320px);
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: var(--space-md);
  padding-bottom: 2px;
}

.servicios-metodo-flow__detail-inner {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-md) calc(var(--space-lg) - 4px);
  padding-top: calc(var(--space-md) + 2px);
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
  background: color-mix(in srgb, var(--bg-card) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.servicios-metodo-flow.is-card-ephemeral .servicios-metodo-flow__detail-inner {
  background: color-mix(in srgb, var(--bg-card) 78%, transparent);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.26);
}

.servicios-metodo-flow__detail-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(28, 32, 48, 0.65);
  color: var(--text-secondary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.servicios-metodo-flow.is-pinned-card .servicios-metodo-flow__detail-close {
  opacity: 1;
  pointer-events: auto;
}

.servicios-metodo-flow__detail-close:hover {
  border-color: rgba(232, 112, 45, 0.45);
  color: var(--text-primary);
}

.servicios-metodo-flow__detail-title {
  font-family: var(--font-serif);
  font-size: clamp(0.98rem, 1.35vw, 1.12rem);
  font-weight: 400;
  color: var(--text-primary);
  margin: 0 1.75rem 0 0;
  line-height: 1.28;
  max-width: 42ch;
  letter-spacing: 0.01em;
}

.servicios-metodo-flow__desc {
  margin: 10px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.68;
  color: var(--text-secondary);
  max-width: 60ch;
}

.servicios-metodo-flow__related {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  max-width: 60ch;
  font-size: 11.5px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .servicios-metodo {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
  }

  .metodo-path {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0.25rem 0.5rem;
    align-items: stretch;
    min-height: 0;
    min-width: 0;
    padding: 0.25rem 0;
    overflow-x: hidden;
  }

  .metodo-path__svg-wrap {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    height: auto;
    min-height: 220px;
    align-self: stretch;
    top: auto;
  }

  .metodo-path__svg--desktop {
    display: none;
  }

  .metodo-path__svg--mobile {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
  }

  .metodo-path__nodes {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    padding: 6px 0;
    box-sizing: border-box;
  }

  .metodo-path__slot {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }

  .servicios-metodo-flow__hit.metodo-path__hit {
    flex-direction: row;
    gap: 9px;
    justify-content: flex-start;
  }

  .metodo-path__label {
    min-width: 0;
    text-align: left;
  }

  .servicios-metodo-flow.is-card-open .servicios-metodo-flow__detail {
    max-height: min(52vh, 360px);
  }

  .servicios-metodo-flow__detail-title {
    margin-right: 2rem;
  }
}

@supports not (background: color-mix(in srgb, black 50%, transparent)) {
  .servicios-metodo-flow__detail-inner {
    background: rgba(22, 25, 34, 0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .metodo-path__progress {
    transition: none !important;
  }

  .servicios-metodo-flow__detail,
  .servicios-metodo-flow__hit.metodo-path__hit,
  .metodo-path__nub,
  .metodo-path__glyph,
  .servicios-metodo-flow__detail-close {
    transition: none !important;
  }
}
