/* ============================================================
   service-animations.css — animaciones características
   por filial, y motivos SVG decorativos para cada página.
   ============================================================ */

/* =========================================================
   COMMON · hero motif container (top-right SVG glyph)
   ========================================================= */
.hero-motif {
  position: absolute;
  top: 60px;
  right: clamp(-40px, -2vw, 0px);
  width: clamp(220px, 28vw, 360px);
  height: clamp(220px, 28vw, 360px);
  pointer-events: none;
  z-index: 0;
}
.hero-motif svg {
  width: 100%;
  height: 100%;
}
.svc-hero .wrap > :not(.filigree):not(.hero-motif) { position: relative; z-index: 2; }
.svc-hero h1, .svc-hero .summary { position: relative; z-index: 2; }

@media (max-width: 900px) {
  .hero-motif { right: -60px; top: 40px; width: 200px; height: 200px; opacity: 0.45; }
}

/* =========================================================
   CONSULTORÍA · subtle paper-fold + ink-bleed
   ========================================================= */
.brand-consultoria .hero-motif .stack-rect {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
  transform-origin: 50% 50%;
  animation: paper-stack 12s ease-in-out infinite;
}
.brand-consultoria .hero-motif .stack-rect:nth-child(1) { animation-delay: 0s; opacity: 0.18; }
.brand-consultoria .hero-motif .stack-rect:nth-child(2) { animation-delay: 0.4s; opacity: 0.32; }
.brand-consultoria .hero-motif .stack-rect:nth-child(3) { animation-delay: 0.8s; opacity: 0.55; }
.brand-consultoria .hero-motif .stack-rect:nth-child(4) { animation-delay: 1.2s; opacity: 0.85; }
@keyframes paper-stack {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-2px, -3px) rotate(-1.2deg); }
}
.brand-consultoria .hero-motif .stamp-circle {
  fill: var(--accent);
  opacity: 0;
  animation: stamp-press 4.2s ease-out infinite;
}
@keyframes stamp-press {
  0%, 70% { opacity: 0; transform: scale(0.8) translate(20%, -10%); }
  72%, 76% { opacity: 0.85; transform: scale(1) translate(20%, -10%); }
  85%, 100% { opacity: 0.32; transform: scale(1) translate(20%, -10%); }
}

/* =========================================================
   SISTEMAS · schematic line-draw + terminal cursor
   ========================================================= */
.brand-sistemas .hero-motif .grid-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: draw 3.2s ease-out forwards;
  opacity: 0.45;
}
.brand-sistemas .hero-motif .grid-line:nth-child(2) { animation-delay: 0.3s; }
.brand-sistemas .hero-motif .grid-line:nth-child(3) { animation-delay: 0.6s; }
.brand-sistemas .hero-motif .grid-line:nth-child(4) { animation-delay: 0.9s; }
.brand-sistemas .hero-motif .grid-line:nth-child(5) { animation-delay: 1.2s; }
.brand-sistemas .hero-motif .grid-line:nth-child(6) { animation-delay: 1.5s; }
@keyframes draw {
  to { stroke-dashoffset: 0; }
}
.brand-sistemas .hero-motif .node {
  fill: var(--accent);
  opacity: 0;
  animation: node-pop 2.4s ease-out forwards;
}
.brand-sistemas .hero-motif .node:nth-child(7)  { animation-delay: 1.2s; }
.brand-sistemas .hero-motif .node:nth-child(8)  { animation-delay: 1.5s; }
.brand-sistemas .hero-motif .node:nth-child(9)  { animation-delay: 1.8s; }
.brand-sistemas .hero-motif .node:nth-child(10) { animation-delay: 2.1s; }
@keyframes node-pop {
  0% { opacity: 0; transform: scale(0); }
  60% { opacity: 1; transform: scale(1.4); }
  100% { opacity: 0.85; transform: scale(1); }
}

/* terminal cursor used in code blocks */
.term-cursor::after {
  content: "▌";
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   IA · particle/data-flow streams
   ========================================================= */
.brand-ia .hero-motif .orbit {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.45;
}
.brand-ia .hero-motif .particle {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent));
}
.brand-ia .hero-motif .particle.p1 { animation: orbit1 6s linear infinite; transform-origin: center; transform-box: fill-box; }
.brand-ia .hero-motif .particle.p2 { animation: orbit2 9s linear infinite; transform-origin: center; transform-box: fill-box; }
.brand-ia .hero-motif .particle.p3 { animation: orbit3 4.5s linear infinite reverse; transform-origin: center; transform-box: fill-box; }
@keyframes orbit1 { from { transform: rotate(0deg) translateX(70px); } to { transform: rotate(360deg) translateX(70px); } }
@keyframes orbit2 { from { transform: rotate(120deg) translateX(110px); } to { transform: rotate(480deg) translateX(110px); } }
@keyframes orbit3 { from { transform: rotate(240deg) translateX(140px); } to { transform: rotate(600deg) translateX(140px); } }
.brand-ia .hero-motif .core {
  fill: var(--accent);
  animation: pulse-core 3s ease-in-out infinite;
}
@keyframes pulse-core {
  0%, 100% { opacity: 0.55; r: 16; }
  50% { opacity: 1; r: 20; }
}

/* =========================================================
   CALIDAD · stamp + checkmark draw
   ========================================================= */
.brand-calidad .hero-motif .stamp-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}
.brand-calidad .hero-motif .stamp-ring.outer {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: ring-draw 3s ease-out forwards;
}
.brand-calidad .hero-motif .stamp-ring.inner {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: ring-draw 3s ease-out 0.4s forwards;
  opacity: 0.5;
}
@keyframes ring-draw { to { stroke-dashoffset: 0; } }
.brand-calidad .hero-motif .check {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: check-draw 1.6s ease-out 1.2s forwards;
}
@keyframes check-draw { to { stroke-dashoffset: 0; } }
.brand-calidad .hero-motif .stamp-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  fill: var(--accent);
  opacity: 0;
  animation: fade-in 0.6s ease-out 2s forwards;
}
@keyframes fade-in { to { opacity: 1; } }

/* =========================================================
   SHARED · prose entry fade for body text on scroll
   ========================================================= */
html.js-anim .svc-prose p, html.js-anim .svc-coverage ul li,
html.js-anim .svc-step, html.js-anim .svc-cluster .partner {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}
html.js-anim .svc-prose.in p, html.js-anim .svc-coverage.in ul li,
html.js-anim .svc-step.in, html.js-anim .svc-cluster .partner.in {
  opacity: 1;
  transform: translateY(0);
}
.svc-prose.in p:nth-child(2) { transition-delay: 100ms; }
.svc-prose.in p:nth-child(3) { transition-delay: 200ms; }
.svc-prose.in p:nth-child(4) { transition-delay: 300ms; }
.svc-coverage.in ul li:nth-child(2) { transition-delay: 80ms; }
.svc-coverage.in ul li:nth-child(3) { transition-delay: 160ms; }
.svc-coverage.in ul li:nth-child(4) { transition-delay: 240ms; }
.svc-coverage.in ul li:nth-child(5) { transition-delay: 320ms; }
.svc-coverage.in ul li:nth-child(6) { transition-delay: 400ms; }

/* =========================================================
   SECTION DECORATIVE BAND · per-filial sub-band motifs
   ========================================================= */
/* sistemas: subtle "scanline" on process band */
.brand-sistemas .svc-process::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 39px,
    rgba(216, 152, 86, 0.06) 39px,
    rgba(216, 152, 86, 0.06) 40px
  );
  pointer-events: none;
}
.brand-sistemas .svc-process { position: relative; overflow: hidden; }

/* ia: dotted grid */
.brand-ia .svc-process { position: relative; overflow: hidden; }
.brand-ia .svc-process::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle at center,
    rgba(90, 149, 214, 0.18) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  opacity: 0.5;
  pointer-events: none;
}

/* consultoria: faint hairlines */
.brand-consultoria .svc-process { position: relative; overflow: hidden; }
.brand-consultoria .svc-process::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    90deg,
    transparent 50%,
    rgba(10, 10, 10, 0.06) 50%
  );
  background-size: 60px 100%;
  pointer-events: none;
}

/* calidad: rotating accreditation stamp watermark */
.brand-calidad .svc-process { position: relative; overflow: hidden; }
.brand-calidad .svc-process::after {
  content: "";
  position: absolute;
  top: 50%; right: -100px;
  width: 280px; height: 280px;
  border: 1.5px dashed var(--accent);
  border-radius: 50%;
  transform: translateY(-50%);
  opacity: 0.18;
  animation: slow-rotate 60s linear infinite;
  pointer-events: none;
}
@keyframes slow-rotate { to { transform: translateY(-50%) rotate(360deg); } }

/* =========================================================
   ERP SCHEMATIC · for sistemas/erp-* pages — module orbit
   ========================================================= */
.erp-schematic {
  padding: 80px 0;
  background: var(--ink);
  color: var(--inv);
  position: relative;
  overflow: hidden;
}
.erp-schematic .head {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  margin-bottom: 56px;
  align-items: end;
}
.erp-schematic h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 56px);
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 14px 0 0;
  color: var(--inv);
}
.erp-schematic h2 .it { font-family: var(--serif); font-style: italic; color: var(--accent-on-dark, var(--accent)); font-weight: 400; }
.erp-schematic .lead {
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.55;
  color: var(--inv-dim);
  max-width: 52ch;
}

.erp-modules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.erp-mod {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--inv-line);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 130px;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}
.erp-mod:hover {
  transform: translateY(-3px);
  border-color: var(--accent-on-dark, var(--accent));
  background: rgba(255, 255, 255, 0.07);
}
.erp-mod .code {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-on-dark, var(--accent));
}
.erp-mod .nm {
  font-family: var(--display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--inv);
}
.erp-mod .nm .it {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-on-dark, var(--accent));
}
.erp-mod .ds {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--inv-dim);
  margin: 0;
  line-height: 1.4;
}

/* =========================================================
   TERMINAL PANE · for software pages (sistemas)
   ========================================================= */
.term-pane {
  background: #0a0a0a;
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  margin: 32px 0;
  border: 1px solid var(--line-strong);
}
.term-pane .term-bar {
  background: #16140f;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.term-pane .term-bar .dots {
  display: inline-flex;
  gap: 6px;
}
.term-pane .term-bar .dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.term-pane .term-bar .dots span:nth-child(1) { background: #FF5F57; }
.term-pane .term-bar .dots span:nth-child(2) { background: #FEBC2E; }
.term-pane .term-bar .dots span:nth-child(3) { background: #28C840; }
.term-pane .term-bar .path {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(250, 250, 247, 0.45);
  margin-left: 8px;
  letter-spacing: 0.04em;
}
.term-pane .term-body {
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(250, 250, 247, 0.92);
  padding: 20px 22px;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.55;
}
.term-pane .prompt { color: var(--accent); }
.term-pane .ok { color: #5FB394; }
.term-pane .warn { color: #FFD66B; }
.term-pane .err { color: #FF5E1A; }
.term-pane .mute { color: rgba(250, 250, 247, 0.5); }
.term-pane .typing {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent);
  animation: type 3s steps(40) 0.3s 1 forwards, blink 1s steps(2) infinite 3.4s;
  width: 0;
}
@keyframes type { to { width: 100%; } }

/* =========================================================
   SCHEMATIC DIAGRAM · for sistemas detail pages
   ========================================================= */
.schematic {
  padding: 80px 0;
  position: relative;
}
.schematic-stage {
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.schematic-stage svg {
  width: 100%;
  height: auto;
  max-height: 360px;
}
.schematic-stage .node-box {
  fill: var(--paper);
  stroke: var(--line-strong);
  stroke-width: 1;
}
.schematic-stage .node-box.accent {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.schematic-stage .node-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: var(--fg);
}
.schematic-stage .node-sub {
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  fill: var(--accent);
}
.schematic-stage .connector {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  opacity: 0.6;
}
.schematic-stage .arrow-head { fill: var(--accent); }
.schematic-stage .data-flow {
  fill: var(--accent);
  opacity: 0.85;
}
.schematic-stage .data-flow.f1 { animation: flow-1 4s linear infinite; }
.schematic-stage .data-flow.f2 { animation: flow-2 4s linear infinite 1.5s; }
.schematic-stage .data-flow.f3 { animation: flow-3 4s linear infinite 3s; }
@keyframes flow-1 {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(180px); opacity: 0; }
}
@keyframes flow-2 {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(180px); opacity: 0; }
}
@keyframes flow-3 {
  0% { transform: translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateX(180px); opacity: 0; }
}

/* =========================================================
   "CUADERNO DE CAMPO" · field journal entries
   ========================================================= */
.field-journal {
  padding: 80px 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.field-journal .head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
  align-items: end;
}
.field-journal h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 56px);
  letter-spacing: -0.035em;
  margin: 14px 0 0;
}
.field-journal h2 .it { font-family: var(--serif); font-style: italic; color: var(--accent); font-weight: 400; }
.field-journal .lead {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg-dim);
}
.fj-entries { display: grid; gap: 16px; }
.fj-entry {
  background: var(--paper-warm);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 32px;
  align-items: start;
}
.fj-entry .stamp-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border-right: 1px solid var(--line);
  padding-right: 16px;
  line-height: 1.5;
}
.fj-entry .stamp-date b {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-top: 4px;
}
.fj-entry .body h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.fj-entry .body h3 .it { font-family: var(--serif); font-style: italic; color: var(--accent); font-weight: 400; }
.fj-entry .body p {
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-dim);
  margin: 0;
}
.fj-entry .meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  text-align: right;
  line-height: 1.6;
}
.fj-entry .meta .tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  .erp-schematic .head { grid-template-columns: 1fr; gap: 24px; }
  .field-journal .head { grid-template-columns: 1fr; gap: 16px; }
  .fj-entry { grid-template-columns: 1fr; gap: 12px; }
  .fj-entry .meta { text-align: left; }
  .schematic-stage { padding: 24px; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-motif * { animation: none !important; }
  .data-flow { animation: none !important; }
  .slow-rotate { animation: none !important; }
}
