/* =========================================================
   Engineering Process page — extends style.css tokens
   ========================================================= */

.eng-hero { padding: 150px 0 60px; border-bottom: 1px solid var(--border-soft); }
.eng-hero h1 { font-size: clamp(2.1rem, 4vw, 2.9rem); margin-bottom: 14px; }
.eng-hero .section-sub { max-width: 700px; }
.eng-motto {
  display: inline-block;
  font-family: 'Sora', sans-serif;
  font-style: italic;
  color: var(--accent-3);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.eng-content { padding: 70px 0 110px; }
.eng-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  align-items: start;
}

.eng-toc {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.eng-toc span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.eng-toc a { font-size: 0.88rem; color: var(--text-muted); padding: 7px 0; transition: color .2s ease; }
.eng-toc a:hover { color: var(--heading); }

.eng-body { max-width: 820px; }
.eng-body > section { margin-bottom: 76px; scroll-margin-top: 96px; }
.eng-body h2 { font-size: 1.6rem; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.eng-body h3 { font-size: 1.15rem; margin: 8px 0 6px; color: var(--heading); }
.eng-body p { color: var(--text-muted); margin-bottom: 14px; }
.eng-body ul { margin: 0 0 16px; padding-left: 20px; }
.eng-body li { color: var(--text-muted); margin-bottom: 6px; font-size: 0.94rem; }
.eng-lead { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 8px; }

.eng-highlight {
  background: linear-gradient(160deg, rgba(47,107,255,0.1) 0%, rgba(23,184,138,0.06) 100%);
  border: 1px solid rgba(47,107,255,0.3);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin: 18px 0 28px;
}
.eng-highlight strong { color: var(--heading); }
.eng-highlight-text { margin-bottom: 0; }
.eng-emphasis { color: var(--heading); }

/* ---- Flow diagram (top-to-bottom) ---- */
.flow-diagram { position: relative; padding-top: 8px; }

.flow-node {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px 26px;
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.flow-node h3 { margin: 0 0 6px; }
.flow-node p { margin: 0; font-size: 0.88rem; }
.flow-start { border-color: rgba(47,107,255,0.4); }

.flow-connector {
  width: 2px;
  height: 40px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--accent), var(--accent-3));
  position: relative;
}

.flow-decision {
  text-align: center;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--heading);
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 10px 22px;
  max-width: 300px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.flow-branch-connectors { height: 44px; position: relative; }
.flow-branch-connectors svg { width: 100%; height: 100%; overflow: visible; }

.flow-branch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 4px;
}
.flow-path-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.flow-path-card.path-a { border-color: rgba(34,224,160,0.3); }
.flow-path-card.path-b { border-color: rgba(47,107,255,0.3); }
.flow-path-card h3 { margin-top: 0; }
.flow-path-card p { font-size: 0.9rem; }
.flow-path-card a.jump-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-3);
}
.flow-path-card.path-b a.jump-link { color: var(--accent); }

.flow-merge-connectors { height: 50px; position: relative; }
.flow-merge-connectors svg { width: 100%; height: 100%; overflow: visible; }

.flow-vertical-wrap { position: relative; }
.flow-vertical-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 140px;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}
.flow-stages { display: flex; flex-direction: column; gap: 40px; position: relative; z-index: 1; }

/* ---- Detailed workflow steps ---- */
.workflow-step { display: flex; gap: 18px; margin-bottom: 26px; }
.workflow-step-index {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(34,224,160,0.12);
  color: var(--accent-3);
}
.path-b-steps .workflow-step-index { background: rgba(47,107,255,0.12); color: var(--accent); }
.workflow-step-body h3 { margin-top: 2px; }

/* ---- Reference architecture diagram ---- */
.arch-diagram { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.arch-layer {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 20px;
  text-align: center;
}
.arch-layer-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 6px; }
.arch-layer-value { font-family: 'Sora', sans-serif; font-weight: 600; color: var(--heading); font-size: 0.95rem; }
.arch-connector { width: 2px; height: 26px; margin: 0 auto; background: var(--border); }
.arch-regions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 4px 0; }
.arch-region { border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.arch-region-title { font-size: 0.82rem; font-weight: 600; color: var(--accent-3); margin-bottom: 10px; text-align: center; }
.arch-region.region-2 .arch-region-title { color: var(--accent); }
.arch-module { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; text-align: center; }
.arch-module:last-child { margin-bottom: 0; }

.eng-back-cta { text-align: center; padding: 30px 0 10px; }

@media (max-width: 980px) {
  .eng-layout { grid-template-columns: 1fr; }
  .eng-toc { position: static; }
  .flow-branch, .arch-regions { grid-template-columns: 1fr; }
  .flow-vertical-line { display: none; }
}

@media (max-width: 760px) {
  .eng-hero { padding: 120px 0 44px; }
  .eng-highlight, .flow-path-card, .arch-region { padding: 20px; }
  .workflow-step { flex-direction: column; gap: 10px; }
}
