/* ============================================================
   WORKFLOW / PROCESS SECTION — Industrial Engineering Timeline
   ============================================================ */

.workflow {
  background: var(--c-bg-section);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent, transparent 40px,
      rgba(31, 41, 51, 0.028) 40px,
      rgba(31, 41, 51, 0.028) 41px
    ),
    repeating-linear-gradient(
      90deg,
      transparent, transparent 40px,
      rgba(31, 41, 51, 0.028) 40px,
      rgba(31, 41, 51, 0.028) 41px
    );
  padding: var(--section-py-sm) 0;
}

.workflow__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}


/* ── Steps List ── */

.workflow__steps {
  list-style: none;
  display: flex;
  flex-direction: column;
}


/* ── Step — Mobile: dot left, card right ── */

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
  position: relative;
}

/* Mobile vertical connector — directional gradient top→down */
.workflow-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 56px;
  bottom: 0;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    rgba(217, 119, 6, 0.28) 0%,
    rgba(15, 23, 42, 0.10) 100%
  );
  z-index: 0;
}


/* ── Dot (timeline circle) ── */

.workflow-step__dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  /* Light industrial surface — subtle warm hint */
  background: #FAFAF8;
  border: 2px solid rgba(217, 119, 6, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow:
    inset 0 1px 3px rgba(15, 23, 42, 0.07),
    inset 0 -1px 2px rgba(15, 23, 42, 0.04),
    0 2px 6px rgba(15, 23, 42, 0.08),
    0 1px 2px rgba(15, 23, 42, 0.05);
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.workflow-step:hover .workflow-step__dot {
  background: var(--c-amber);
  border-color: #D97706;
  box-shadow:
    0 0 0 4px rgba(217, 119, 6, 0.10),
    0 3px 10px rgba(217, 119, 6, 0.14),
    0 2px 6px rgba(15, 23, 42, 0.06);
}


/* ── Step Number ── */

.workflow-step__num {
  font-size: 13px;
  font-weight: 800;
  color: rgba(217, 119, 6, 0.90);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.workflow-step:hover .workflow-step__num {
  color: #fff;
}


/* ── Card ── */

.workflow-step__card {
  flex: 1;
  position: relative;
  overflow: hidden;
  /* Premium light industrial surface — barely warm, clean and airy */
  background: #FCFCFA;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 3px 10px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition:
    box-shadow 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.35s ease;
}

/* Left amber accent line — same as service cards */
.workflow-step__card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: rgba(217, 119, 6, 0.22);
  border-radius: 0 2px 2px 0;
  transition:
    background 0.35s ease,
    top 0.35s ease,
    bottom 0.35s ease;
}

.workflow-step:hover .workflow-step__card {
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.05),
    0 8px 24px rgba(15, 23, 42, 0.09),
    0 0 0 1px rgba(217, 119, 6, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  border-color: rgba(217, 119, 6, 0.16);
  transform: translateX(3px);
}

.workflow-step:hover .workflow-step__card::before {
  background: #F59E0B;
  top: 14%;
  bottom: 14%;
}


/* ── Title & Desc ── */

.workflow-step__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--c-graphite);
  line-height: 1.3;
}

.workflow-step__desc {
  font-size: var(--text-sm);
  /* Slightly darker than c-steel — cleaner industrial readability */
  color: rgba(22, 32, 50, 0.68);
  line-height: 1.65;
}


/* ════════════════════════════════════════
   MOBILE (max 767px): Premium process flow
   Philosophy: cards = engineering steps.
   Step context lives inside card.
   Connectors = thin line + chevron — flow without timeline.
   ════════════════════════════════════════ */

@media (max-width: 767px) {

  /* ── CSS counter for embedded step numbers ── */
  .workflow__steps {
    counter-reset: wf-step;
  }

  .workflow-step {
    counter-increment: wf-step;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-bottom: 0;
  }

  /* ── Remove old left-side vertical connector ── */
  .workflow-step:not(:last-child)::before {
    display: none;
  }

  /*
    Flow connector: thin vertical line + downward chevron.

    Two background layers:
    1. SVG chevron — anchored 2px from bottom, communicates direction
    2. Linear gradient line — amber origin fading to warm-gray,
       height calc(100% - 10px) leaves space for chevron

    The amber→gray fade reads as "progress moving forward".
    1.5px width = engineering precision, not a heavy timeline.
  */
  .workflow-step:not(:last-child)::after {
    content: '';
    display: block;
    height: 32px;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='rgba(180%2C100%2C10%2C0.45)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C%2Fsvg%3E")
        center bottom 2px / 10px 6px no-repeat,
      linear-gradient(
        to bottom,
        rgba(217, 119, 6, 0.24) 0%,
        rgba(180, 140, 90, 0.10) 100%
      )
        center top / 1.5px calc(100% - 10px) no-repeat;
  }

  /* ── Hide timeline circle ── */
  .workflow-step__dot {
    display: none;
  }

  /*
    Premium industrial card.

    Top + left amber edges: subtle corner bracket.
    Two orthogonal lines read as an engineering annotation,
    not a generic card border. Very low opacity — supports
    without competing.

    Warm micro-gradient background: barely perceptible warmth
    that separates from generic SaaS white.

    Layered shadow: three depths — near/mid/far.
    Inset top highlight: surface reflection, tactile premium feel.
  */
  .workflow-step__card {
    background: linear-gradient(150deg, rgba(255,253,247,1) 0%, #FCFCFA 60%);
    border-top: 2px solid rgba(217, 119, 6, 0.14);
    border-left-width: 3px;
    border-left-color: rgba(217, 119, 6, 0.28);
    padding: 18px 20px 22px 18px;
    box-shadow:
      0 1px 3px rgba(15, 23, 42, 0.05),
      0 4px 14px rgba(15, 23, 42, 0.08),
      0 10px 28px rgba(15, 23, 42, 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 0.96);
  }

  /*
    Step number via CSS counter.

    position: static → exits absolute flow → first flex item in card.
    border-bottom separator: thin amber rule below number text only.
    align-self: flex-start → separator width = text width (≈ "01").
    Looks like a technical annotation underline, not a generic divider.

    font-variant-numeric: tabular-nums → digits align cleanly.
    letter-spacing: 0.12em → engineering/monospaced vibe.
  */
  .workflow-step__card::before {
    position: static;
    display: block;
    content: counter(wf-step, decimal-leading-zero);
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    transition: none;
    /* Step badge */
    font-size: 12px;
    font-weight: 700;
    color: rgba(217, 119, 6, 0.75);
    letter-spacing: 0.12em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    /* Annotation underline — spans text width only */
    align-self: flex-start;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(217, 119, 6, 0.18);
    min-width: 26px; /* wider than "01" text for cleaner bracket */
  }

  /* Prevent hover from restoring amber gradient on ::before */
  .workflow-step:hover .workflow-step__card::before {
    background: none;
  }

  /*
    Hover: deepen accents, no translateX.
    Amber edges intensify slightly — card "activates".
    Shadow gains amber warmth halo.
  */
  .workflow-step:hover .workflow-step__card {
    transform: none;
    border-left-color: rgba(217, 119, 6, 0.44);
    border-top-color: rgba(217, 119, 6, 0.22);
    box-shadow:
      0 2px 5px rgba(15, 23, 42, 0.06),
      0 6px 20px rgba(15, 23, 42, 0.10),
      0 12px 32px rgba(15, 23, 42, 0.05),
      0 0 0 1px rgba(217, 119, 6, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.96);
  }

  /* ── Title: decisive, strong hierarchy ── */
  .workflow-step__title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.24;
    letter-spacing: -0.012em;
    color: #0C1520;
  }

  /* ── Description: secondary, comfortable ── */
  .workflow-step__desc {
    font-size: 13.5px;
    line-height: 1.56;
    color: rgba(22, 32, 50, 0.58);
  }
}


/* ── Reveal ── */

.workflow__header[data-reveal],
.workflow__steps[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.workflow__header[data-reveal].is-visible,
.workflow__steps[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .workflow__header[data-reveal],
  .workflow__steps[data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* ── Tablet (768px+) ── */

@media (min-width: 768px) {
  .workflow {
    padding: var(--section-py-md) 0;
  }

  .workflow-step__card {
    padding: var(--sp-6) var(--sp-8);
  }

  .workflow-step__title {
    font-size: var(--text-md);
  }
}


/* ── Desktop (1024px+): horizontal timeline ── */

@media (min-width: 1024px) {
  .workflow {
    padding: var(--section-py-lg) 0;
  }

  /* Horizontal flex, dots on top, cards below */
  .workflow__steps {
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
  }

  /* Each step = equal column, centered content */
  .workflow-step {
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-5);
    padding-bottom: 0;
    padding-left: var(--sp-3);
    padding-right: var(--sp-3);
    position: relative;
  }

  .workflow-step:first-child { padding-left: 0; }
  .workflow-step:last-child  { padding-right: 0; }

  /* Hide mobile vertical connector */
  .workflow-step:not(:last-child)::before {
    display: none;
  }

  /*
    Horizontal connector — technical engineering rail
    Directional gradient left→right: amber origin → neutral end
    Simulates "process flow" reading direction
  */
  .workflow-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 27px;
    left: 50%;
    width: 100%;
    height: 2px;
    /* Two-layer: main line + subtle tick rhythm */
    background:
      repeating-linear-gradient(
        to right,
        transparent 0px,
        transparent 18px,
        rgba(15, 23, 42, 0.05) 18px,
        rgba(15, 23, 42, 0.05) 20px
      ),
      linear-gradient(
        to right,
        rgba(217, 119, 6, 0.20) 0%,
        rgba(15, 23, 42, 0.10) 60%,
        rgba(15, 23, 42, 0.07) 100%
      );
    z-index: 0;
  }

  /* Card: full width, centered text */
  .workflow-step__card {
    width: 100%;
    text-align: center;
    padding: var(--sp-5);
  }

  .workflow-step:hover .workflow-step__card {
    transform: translateY(-4px);
    box-shadow:
      0 2px 4px rgba(15, 23, 42, 0.05),
      0 10px 28px rgba(15, 23, 42, 0.10),
      0 0 0 1px rgba(217, 119, 6, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  /* Progressive visual hierarchy — very subtle amber intensity increase left→right */
  .workflow-step:nth-child(1) .workflow-step__dot { border-color: rgba(217, 119, 6, 0.48); }
  .workflow-step:nth-child(2) .workflow-step__dot { border-color: rgba(217, 119, 6, 0.54); }
  .workflow-step:nth-child(3) .workflow-step__dot { border-color: rgba(217, 119, 6, 0.60); }
  .workflow-step:nth-child(4) .workflow-step__dot { border-color: rgba(217, 119, 6, 0.66); }
  .workflow-step:nth-child(5) .workflow-step__dot { border-color: rgba(217, 119, 6, 0.72); }
}


/* ── Large Desktop (1280px+) ── */

@media (min-width: 1280px) {
  .workflow-step {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .workflow-step__card {
    padding: var(--sp-6);
  }

  .workflow-step__title {
    font-size: var(--text-base);
  }
}
