/* Scoped to the Four-Step Framework; the other page sections keep their styles. */
.home-page .workflow-3d {
  --flow-spread: 330px;
  --flow-ink: #143e55;
  --flow-teal: #2f777b;
  margin-top: 8px;
  margin-bottom: 68px;
}
.workflow-3d [hidden] { display: none !important; }
.workflow-3d .flow-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 38px 38px 25px;
  border: 1px solid #b9d7ce;
  border-radius: 26px;
  background:
    radial-gradient(ellipse at 50% 62%, rgba(118, 177, 161, .23), transparent 52%),
    linear-gradient(135deg, #edf5ee, #e1efea 55%, #eff6f1);
  box-shadow: 0 18px 42px rgba(25, 73, 64, .08);
}
.workflow-3d .framework-intro { position: relative; z-index: 5; max-width: 760px; }
.home-page .workflow-3d .framework-intro h2 { margin: 9px 0 14px; }
.home-page .workflow-3d .framework-intro p { max-width: 700px; }
.workflow-3d .flow-stage { position: relative; margin-top: 25px; outline-offset: -4px; }
.workflow-3d .flow-track {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.workflow-3d .flow-card {
  min-width: 0;
  padding: 28px;
  border: 1px solid #c7dcd1;
  border-radius: 22px;
  background: linear-gradient(145deg, #fffefa, #f1f8f3);
  color: var(--flow-ink);
  box-shadow: 0 16px 35px rgba(22, 64, 53, .10);
}
.workflow-3d .flow-card-number {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 21px;
  color: #286966;
  font: 700 13px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .08em;
}
.workflow-3d .flow-card-number span { color: #829b8e; font-size: 11px; }
.home-page .workflow-3d .flow-card h3 {
  margin: 0 0 15px;
  color: var(--flow-ink);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.035em;
  text-wrap: initial;
}
.workflow-3d .flow-card p { margin: 0; color: #456773; font-size: 16px; line-height: 1.55; }
.workflow-3d .flow-label, .workflow-3d .flow-mountains { display: none; }

/* JavaScript adds the carousel only when motion is allowed. */
.workflow-3d.is-flow-ready .flow-stage {
  overflow: hidden;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  touch-action: pan-y;
}
.workflow-3d.is-flow-ready .flow-track { position: relative; display: block; height: 340px; transform-style: preserve-3d; }
.workflow-3d.is-flow-ready .flow-card {
  position: absolute;
  top: 75px;
  left: 50%;
  width: 340px;
  min-height: 230px;
  padding: 24px;
  margin: 0;
  transform-origin: center;
  backface-visibility: hidden;
  transition: transform 550ms cubic-bezier(.22,.7,.24,1), opacity 450ms ease, border-color 250ms ease, box-shadow 450ms ease;
}
.workflow-3d.is-flow-ready .flow-card[data-position="active"] {
  z-index: 4;
  opacity: 1;
  border-color: #d8ac63;
  transform: translate3d(-50%, 0, 95px);
  box-shadow: 0 24px 45px rgba(22, 64, 53, .18), inset 0 3px 0 #ffa41c;
}
.workflow-3d.is-flow-ready .flow-card[data-position="previous"] {
  z-index: 2;
  opacity: .65;
  transform: translate3d(calc(-50% - var(--flow-spread)), 3px, -150px) rotateY(-48deg) scale(.9);
}
.workflow-3d.is-flow-ready .flow-card[data-position="next"] {
  z-index: 2;
  opacity: .65;
  transform: translate3d(calc(-50% + var(--flow-spread)), 3px, -150px) rotateY(48deg) scale(.9);
}
.workflow-3d.is-flow-ready .flow-card[data-position="back"] {
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(-50%, -12px, -360px) scale(.78);
}
.workflow-3d.is-flow-ready .flow-card:not([data-position="active"]) { pointer-events: none; }
.workflow-3d.is-flow-ready .flow-surface {
  transform: perspective(700px) rotateX(var(--flow-tilt-x, 0deg)) rotateY(var(--flow-tilt-y, 0deg));
  transition: transform 160ms ease-out;
}
/* A plain label and layered mountain artwork sit behind the cards. */
.workflow-3d.is-flow-ready .flow-label {
  position: absolute;
  z-index: 1;
  top: 20px;
  left: 0;
  right: 0;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #2c6862;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: .015em;
  text-align: center;
}
.workflow-3d .flow-label strong { font-weight: 800; }
.workflow-3d.is-flow-ready .flow-mountains {
  position: absolute;
  z-index: 0;
  left: 0;
  bottom: 12px;
  display: block;
  width: 100%;
  height: 104%;
  max-width: none;
  object-fit: fill;
  opacity: .48;
  filter: saturate(.7) brightness(.94);
  transform: skewY(2deg);
  transform-origin: right bottom;
  pointer-events: none;
  user-select: none;
}
.workflow-3d .flow-navigation { display: flex; align-items: center; gap: 20px; margin: 4px auto 0; }
.workflow-3d .flow-step-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  flex: 1 1 auto;
  max-width: 760px;
  margin: 0;
}
.home-page .workflow-3d .flow-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 49px;
  padding: 10px 12px;
  border: 1px solid #b4d0c4;
  border-radius: 12px;
  background: rgba(255,255,255,.68) !important;
  color: #28564f !important;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.workflow-3d .flow-step span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: rgba(47,119,123,.09);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.home-page .workflow-3d .flow-step[aria-pressed="true"] {
  border-color: #143e55;
  background: #143e55 !important;
  color: #fff !important;
}
.workflow-3d .flow-step[aria-pressed="true"] span { background: #ffa41c; color: #173647; }
.home-page .workflow-3d .flow-step:hover { background: #e5f0e8 !important; transform: none; }
.home-page .workflow-3d .flow-step[aria-pressed="true"]:hover { background: #1c5265 !important; }
.workflow-3d .flow-controls { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 14px; margin: 0; }
.home-page .workflow-3d .flow-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #b4d0c4;
  border-radius: 50%;
  background: #f9fcf8 !important;
  color: #245f68 !important;
  box-shadow: none;
}
.home-page .workflow-3d .flow-arrow:hover { background: #dcebe1 !important; transform: none; }
.workflow-3d .flow-count { min-width: 64px; color: #557580; text-align: center; font: 13px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.workflow-3d .flow-count span { color: #173f50; font-weight: 700; }
.workflow-3d .flow-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.workflow-3d .flow-stage:focus-visible { outline: 3px solid #b66b00; }
@media (max-width: 1050px) {
  .home-page .workflow-3d { --flow-spread: 260px; }
  .workflow-3d.is-flow-ready .flow-card { width: 310px; min-height: 245px; padding: 25px; }
  .workflow-3d .flow-navigation { flex-direction: column; gap: 18px; }
  .workflow-3d .flow-step-nav { width: 100%; }
}
@media (max-width: 760px) {
  .workflow-3d .flow-panel { padding: 28px 18px 22px; border-radius: 22px; }
  .workflow-3d .flow-stage { margin-top: 25px; }
  .workflow-3d.is-flow-ready .flow-mountains { left: auto; right: 0; width: 190%; height: 90%; opacity: .4; }
  .workflow-3d .flow-track { grid-template-columns: 1fr; }
  .workflow-3d.is-flow-ready .flow-track { height: 387px; }
  .workflow-3d.is-flow-ready .flow-card { top: 88px; width: min(320px, calc(100% - 22px)); min-height: 265px; padding: 24px; }
  .workflow-3d.is-flow-ready .flow-card[data-position="active"] { transform: translate3d(-50%, 0, 0); }
  .workflow-3d.is-flow-ready .flow-card[data-position="previous"] { transform: translate3d(calc(-50% - 230px), 5px, -180px) rotateY(-48deg) scale(.85); opacity: .4; }
  .workflow-3d.is-flow-ready .flow-card[data-position="next"] { transform: translate3d(calc(-50% + 230px), 5px, -180px) rotateY(48deg) scale(.85); opacity: .4; }
  .home-page .workflow-3d .flow-card h3 { font-size: 31px; }
  .workflow-3d .flow-step-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
  .home-page .workflow-3d .flow-step { justify-content: flex-start; padding-left: 16px; }
}
@media (max-width: 390px) {
  .workflow-3d .flow-panel { padding-left: 14px; padding-right: 14px; }
  .workflow-3d.is-flow-ready .flow-card { padding: 21px; min-height: 275px; }
  .workflow-3d .flow-card p { font-size: 15px; }
  .workflow-3d .flow-card-number { margin-bottom: 18px; }
  .home-page .workflow-3d .flow-step { gap: 7px; padding: 9px 10px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .workflow-3d *, .workflow-3d *::before, .workflow-3d *::after { transition: none !important; animation: none !important; }
}
