/* ============================================================
   OTTEngine - Animated hero workflow (companion to workflow-3d.js)
   The four stage cards are semantic HTML and lay out on their own;
   the Three.js canvas behind them only decorates. Without JS (or
   WebGL) the grid still renders as a static diagram.
   ============================================================ */

.oe-flow {
  position: relative;
  background:
    radial-gradient(ellipse 75% 55% at 50% -12%, rgba(37, 99, 235, 0.16) 0%, transparent 62%),
    linear-gradient(180deg, #0B1123 0%, #0A101F 55%, #080C16 100%);
  border: 1px solid var(--ott-border);
  border-radius: 16px;
  padding: 2.75rem 2.25rem 2.5rem;
  overflow: hidden;
}

.oe-flow__title {
  text-align: center;
  font-weight: 700;
  color: var(--ott-text-primary);
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 2.5rem;
}
.oe-flow__title em {
  font-style: italic;
  color: #38BDF8;
  padding-right: 0.08em; /* italic overhang clipped by background-clip otherwise */
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .oe-flow__title em {
    background: linear-gradient(92deg, #60A5FA 0%, #22D3EE 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.oe-flow__stage { position: relative; }

.oe-flow__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.oe-flow--flat .oe-flow__canvas { display: none; }

/* ---------- Card grid (desktop: 4 columns, evens staggered down) ---------- */

.oe-flow__cards {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.oe-card:nth-child(even) { margin-top: 290px; }

/* ---------- Card ---------- */

.oe-card {
  position: relative;
  background: rgba(13, 18, 32, 0.66);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--ott-border);
  border-radius: 14px;
  padding: 1.1rem 1rem 1rem;
  transition: border-color 0.35s ease, box-shadow 0.35s ease,
              transform 0.35s ease, background 0.35s ease;
}

/* top accent bar: a full-width strip on an overlay that shares the card's
   border box and radius, so the rounded corners clip it - it starts exactly
   at the border curve and can never overhang it */
.oe-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--oe-c), transparent 85%);
  background-size: 100% 3px;
  background-repeat: no-repeat;
  background-position: left top;
  opacity: 0.85;
  pointer-events: none;
}

.oe-card:hover,
.oe-card.is-active {
  border-color: var(--oe-c);
  box-shadow: 0 10px 44px -10px var(--oe-glow);
  transform: translateY(-3px);
  background: rgba(15, 22, 40, 0.78);
}
.oe-card.is-active .oe-card__icon { box-shadow: 0 0 20px var(--oe-glow); }

/* ---------- Card internals ---------- */

.oe-card__head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.oe-card__icon {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--oe-soft);
  border: 1px solid var(--oe-soft);
  color: var(--oe-c);
  font-size: 1.25rem;
  transition: box-shadow 0.35s ease;
}

.oe-card__num {
  position: absolute;
  top: -7px;
  left: -7px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--oe-c);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 0 10px var(--oe-glow);
}

.oe-card__title {
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--oe-c);
  letter-spacing: -0.01em;
  margin: 0;
}

.oe-card__desc {
  color: var(--ott-text-secondary);
  font-size: 0.75rem;
  line-height: 1.55;
  /* reserve two lines so every card is the same height regardless of copy */
  min-height: calc(2 * 1.55em);
  margin: 0 0 0.8rem;
}

.oe-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.oe-card__tags li {
  font-size: 0.675rem;
  font-weight: 500;
  color: #CBD5E1;
  padding: 0.24rem 0.5rem;
  border: 1px solid var(--ott-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

/* narrower 4-col band: columns can't hold two lines, so reserve three
   uniformly to keep all four cards the same height */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .oe-card__desc { min-height: calc(3 * 1.55em); }
}

/* ---------- Below xl: stacked, pipeline runs down the middle ---------- */

@media (max-width: 1199.98px) {
  .oe-flow__cards {
    grid-template-columns: min(100%, 560px);
    justify-content: center;
    row-gap: 4.25rem;
  }
  .oe-card:nth-child(even) { margin-top: 0; }
}

@media (max-width: 767.98px) {
  .oe-flow { padding: 2rem 1.1rem 2rem; }
  .oe-flow__title { margin-bottom: 1.75rem; }
  .oe-flow__cards {
    grid-template-columns: min(100%, 420px);
    row-gap: 4.5rem;
  }
}

/* ---------- Reduced motion: keep transitions minimal ---------- */

@media (prefers-reduced-motion: reduce) {
  .oe-card,
  .oe-card__icon { transition: none; }
  .oe-card:hover,
  .oe-card.is-active { transform: none; }
}
