/* Product presentation pages — currently products/ai-business-automation.html.
   Scroll reveals are driven by the IntersectionObserver in js/app.js, which
   tags <html> with .js; without JavaScript everything stays visible. */

/* — entrance reveals — */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.js .reveal-left { transform: translateX(-34px); }
.js .reveal-right { transform: translateX(34px); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }
.reveal-d4 { transition-delay: .4s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* — keyframes used only on this page (ccReveal/ccFade live in style.css) — */
@keyframes ccSpin { to { transform: rotate(360deg); } }
@keyframes ccPulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes ccFlowV {
  0% { top: 0; opacity: 0; }
  14% { opacity: 1; }
  86% { opacity: 1; }
  100% { top: calc(100% - 7px); opacity: 0; }
}
@keyframes ccFlowH {
  0% { left: 0; opacity: 0; }
  14% { opacity: 1; }
  86% { opacity: 1; }
  100% { left: calc(100% - 7px); opacity: 0; }
}

/* — flow connectors: hairline with a data packet travelling along it.
     Vertical by default; .h turns horizontal on wide screens. — */
.dg-conn {
  position: relative;
  width: 14px; height: 44px;
  margin: 0 auto;
  justify-self: center;
}
.dg-conn::before {
  content: ""; position: absolute;
  top: 0; bottom: 0; left: 50%; width: 1px;
  background: var(--color-divider);
}
.dg-conn::after {
  content: ""; position: absolute;
  left: 50%; margin-left: -3.5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-accent);
  animation: ccFlowV 2.8s linear infinite;
}
.dg-conn.rev::after { animation-direction: reverse; }

/* — process step panels — */
.step-panel {
  padding: clamp(22px, 3.4vw, 36px);
  display: grid;
  grid-template-columns: minmax(230px, 5fr) 7fr;
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
}
.step-panel.solo { grid-template-columns: 1fr; }
.step-no {
  display: block;
  font-family: var(--font-heading); font-weight: 600;
  font-size: clamp(44px, 5vw, 64px); line-height: 1;
  color: var(--color-accent-300);
  margin-bottom: 14px;
}
.step-title {
  font-family: var(--font-heading); font-weight: 600;
  font-size: clamp(21px, 2.2vw, 26px); line-height: 1.15;
  text-transform: uppercase; letter-spacing: 0.02em;
  margin: 0 0 10px;
}
.step-note {
  margin: 0; font-size: 15px; line-height: 1.6;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
}
.step-subs { align-self: center; }
.step-sub {
  display: grid; grid-template-columns: max-content 1fr;
  column-gap: 16px; align-items: baseline;
  padding: 13px 0; font-size: 15px;
  border-bottom: 1px solid var(--color-divider);
}
.step-sub:last-child { border-bottom: 0; padding-bottom: 0; }
.step-sub:first-child { padding-top: 0; }
.step-sub-idx {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 13px; letter-spacing: 0.08em;
  color: var(--color-accent-700);
}
@media (max-width: 760px) {
  .step-panel { grid-template-columns: 1fr; }
}

/* — solution diagram: four block groups around the automation core.
     Single column by default, a plus-shaped grid on wide screens. — */
.diagram {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}
.dg-box {
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.dg-label {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-accent-700);
}
.dg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-note {
  margin: 0; font-size: 13px; line-height: 1.5;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}
.dg-core {
  border-color: var(--color-accent);
  align-items: center; text-align: center;
  padding: 24px 18px;
  background: var(--color-bg);
}
.dg-core .dg-label { color: var(--color-accent-900); }
.dg-core-mark { display: block; }
.dg-core-mark .dg-orbit {
  transform-origin: 0 0;
  animation: ccSpin 40s linear infinite;
}
.dg-core-mark .dg-beat { animation: ccPulse 3.2s ease-in-out infinite; }
.dg-core-mark .dg-beat.late { animation-delay: 1.6s; }

.dg-chan { order: 1; }
.dg-conn-chan { order: 2; }
.dg-core { order: 3; }
.dg-conn-data { order: 4; }
.dg-data { order: 5; }
.dg-conn-repr { order: 6; }
.dg-repr { order: 7; }
.dg-conn-task { order: 8; }
.dg-task { order: 9; }

@media (min-width: 901px) {
  .diagram {
    grid-template-columns: minmax(0, 1fr) 56px minmax(240px, 320px) 56px minmax(0, 1fr);
    grid-template-rows: auto 44px auto 44px auto;
  }
  .dg-task { grid-area: 1 / 3; }
  .dg-conn-task { grid-area: 2 / 3; }
  .dg-chan { grid-area: 3 / 1; }
  .dg-conn-chan { grid-area: 3 / 2; }
  .dg-core { grid-area: 3 / 3; }
  .dg-conn-data { grid-area: 3 / 4; }
  .dg-data { grid-area: 3 / 5; }
  .dg-conn-repr { grid-area: 4 / 3; }
  .dg-repr { grid-area: 5 / 3; }

  .dg-conn.h {
    width: auto; height: 14px; margin: 0;
    justify-self: stretch; align-self: center;
  }
  .dg-conn.h::before {
    top: 50%; bottom: auto; left: 0; right: 0;
    width: auto; height: 1px;
  }
  .dg-conn.h::after {
    top: 50%; margin-top: -3.5px;
    left: auto; margin-left: 0;
    animation-name: ccFlowH;
  }
}

/* — result cards — */
.result-card {
  border-top: 2px solid var(--color-accent);
  padding-top: 18px;
}
.result-card h4 {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 20px; text-transform: uppercase; letter-spacing: 0.03em;
  margin: 12px 0 8px;
}
.result-card p {
  margin: 0; font-size: 15px; line-height: 1.6;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}

/* — closing call to action — */
.cta-panel {
  padding: clamp(30px, 5vw, 52px);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.cta-panel h2 {
  font-family: var(--font-heading); font-weight: 600;
  font-size: clamp(26px, 3vw, 38px);
  text-transform: uppercase; letter-spacing: 0.01em;
  margin: 0;
}
.cta-panel p {
  margin: 0; font-size: 16px; line-height: 1.6; max-width: 48ch;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}
.cta-actions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px; margin-top: 18px;
}
