.process {
  padding: 50px 0px 20px 0px;
  /* margin-top: -50px; */
  overflow: hidden;
  display: flex;
  flex-direction: column;

  /* background: var(--bg); */
  /* background-color: red; */
}

.process-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  /* background-color: teal; */
}

.process-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  /* background-color: red; */
}

.process-inner {
  position: relative;
  aspect-ratio: 1400 / 600;
  /* background-color: rebeccapurple; */
}

.process-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.process-title {
  position: absolute;
  left: 420px;
  top: 224px;
  width: 160px;
  text-align: center;
  z-index: 2;
}

.process-title h2 {
  font-size: 1.6rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  margin: 0;
  font-weight: 500;
  letter-spacing: 1px;
}

.process-circle {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.process-circle-1 {
  left: 600px;
  top: 100px;
}

.process-circle-2 {
  left: 500px;
  top: 380px;
}

.process-circle-3 {
  left: 300px;
  top: 200px;
}

.process-text-left {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.6;
}

.process-text-tr {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.6;
}

.process-text-br {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* --- SVG ANIMATIONS --- */
.process-group {
  transition-delay: var(--delay, 0s);
}

.process-svg line,
.process-svg polyline {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--delay, 0s) + 0.3s);
}

.process-group.visible line,
.process-group.visible polyline {
  stroke-dashoffset: 0;
}

.process-svg circle {
  transform: scale(0);
  transform-origin: center;
  transform-box: fill-box;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: calc(var(--delay, 0s) + 0.8s);
}

.process-group.visible circle {
  transform: scale(1);
}

.process-svg rect {
  transform: scaleY(0);
  transform-origin: center;
  transform-box: fill-box;
  transition: transform 0.4s ease;
  transition-delay: calc(var(--delay, 0s) + 1s);
}

.process-group.visible rect {
  transform: scaleY(1);
}

/* --- MOBILE TIMELINE --- */
.mobile-process {
  display: none;
  width: 100%;
  padding: 40px 0;
}

.mobile-process-header {
  text-align: center;
  margin-bottom: 48px;
}

.mobile-process-header h2 {
  font-size: 2.5rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.5px;
}

/* Header fade-up reveal */
.mobile-process-header.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.mobile-process-header.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.mobile-timeline {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
  padding-left: 20px;
}

/* Static background track */
.mobile-timeline-line {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 36px;
  width: 2px;
  background: var(--border-light);
  z-index: 1;
  overflow: hidden;
}

/* Animated fill bar that draws downward */
.mobile-timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: var(--text-primary);
  transition: height 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-timeline.all-visible .mobile-timeline-progress {
  height: 100%;
}

/* ── STEP BASE STATE (hidden) ── */
.mobile-step {
  position: relative;
  display: flex;
  gap: 24px;
  margin-bottom: 48px;
  z-index: 2;
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered delays per step index */
.mobile-step[data-step="0"] {
  transition-delay: 0s;
}

.mobile-step[data-step="1"] {
  transition-delay: 0.18s;
}

.mobile-step[data-step="2"] {
  transition-delay: 0.36s;
}

.mobile-step:last-child {
  margin-bottom: 0;
}

/* ── STEP VISIBLE STATE ── */
.mobile-step.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ── DOT ── */
.mobile-step-dot {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  transform: scale(0.5);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s ease, background 0.4s ease;
  /* dot delay is slightly after the step slides in */
  transition-delay: inherit;
}

.mobile-step.visible .mobile-step-dot {
  transform: scale(1);
}

/* Active (first / highlighted) step dot */
.mobile-step[data-step="0"] .mobile-step-dot {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

/* ── CONTENT ── */
.mobile-step-content {
  padding-top: 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  transition-delay: calc(inherit + 0.12s);
}

/* Use a class approach for content too */
.mobile-step.visible .mobile-step-content {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.14s;
}

.mobile-step-content h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0 0 10px 0;
  font-family: var(--font-sans);
  font-weight: 600;
}

.mobile-step-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
  font-family: var(--font-mono);
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .desktop-process {
    display: none;
  }

  .mobile-process {
    display: block;
  }

  .process {
    padding: 60px 20px;
    margin-top: 0;
  }
}