/* The stage diagram is the entrance to the atlas. */
#map { padding-top: 0; }
.funnel-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: center;
  min-height: calc(100svh - 76px);
  gap: clamp(22px, 4vw, 64px);
  padding: clamp(14px, 2vw, 32px) 0 clamp(30px, 4vw, 60px);
}
.funnel-intro { max-width: 35em; }
.funnel-intro .home-eyebrow { margin: 0 0 20px; }
.funnel-intro h1 {
  margin: 0;
  font-size: clamp(32px, 3.7vw, 51px);
  letter-spacing: -.065em;
  line-height: 1.27;
  font-weight: 800;
  text-wrap: balance;
}
.funnel-intro h1 span { display: block; white-space: nowrap; }
.funnel-intro h1 em {
  position: relative;
  font-style: normal;
  background: linear-gradient(transparent 80%, #ffe45c 80%, #ffe45c 94%, transparent 94%);
}
.funnel-intro .home-position { margin: 24px 0 12px; max-width: 29em; }
.funnel-intro .home-lead { max-width: 29em; margin-bottom: 0; }

#funnel-map {
  --diagram-edge: rgba(32, 44, 70, .16);
  --band-outline: polygon(0 12%, 4% 5%, 18% 1.5%, 50% 0, 82% 1.5%, 96% 5%, 100% 12%,
                          95.8% 88%, 94% 92%, 82% 97%, 50% 100%, 18% 97%, 6% 92%, 4.2% 88%);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  isolation: isolate;
  top: auto;
  width: 100%;
  margin: 0;
  padding: 17px clamp(19px, 3vw, 42px) 20px;
  border-radius: 24px;
  border: 1px solid #e7e3d3;
  background-color: #faf9ef;
  background-image: radial-gradient(ellipse at 24% 12%, #fff0a875, transparent 57%),
                    radial-gradient(ellipse at 94% 100%, #d2d7c650, transparent 52%),
                    radial-gradient(circle, #35405c20 .8px, transparent 1px);
  background-size: auto, auto, 13px 13px;
  align-items: normal;
  gap: 0;
  color: #202c46;
  scroll-margin-block-start: 12px;
}
#funnel-map .funnel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px;
}
#funnel-map .funnel-title h2 { font-size: 14px; letter-spacing: .04em; }
.funnel-market {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--diagram-edge);
}
.market-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
}
#market-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.market-options {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid #d9d8cb;
  border-radius: 13px;
  background: var(--paper);
}
.market-options button {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: .35em;
  min-height: 40px;
  align-content: center;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.market-options small { font-size: 10px; }
.market-options button[aria-pressed="true"] { background: var(--ink); color: white; }
@media (hover: hover) {
  .market-options button[aria-pressed="false"]:hover { background: var(--cream); }
}
@media (max-width: 700px) {
  .funnel-market { margin-bottom: 7px; padding-bottom: 8px; }
  .market-heading { margin-bottom: 3px; font-size: 13px; }
  .market-options button { flex-direction: column; align-items: center; min-height: 40px; }
}
.funnel-scope {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.funnel-scope button {
  border: 0;
  background: transparent;
  padding: 5px 2px;
  text-decoration: underline;
  text-underline-offset: .2em;
}
#funnel-map .all-stages {
  min-height: 34px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 700;
  border-color: var(--diagram-edge);
}
#funnel-map .whole-stage {
  display: block;
  max-width: none;
  margin: 0 0 10px;
}
#funnel-map .stage-node {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  font-size: 15px;
  font-weight: 740;
  text-align: left;
  color: #202c46;
  line-height: 1.25;
  gap: 8px;
  outline-offset: 2px;
  -webkit-tap-highlight-color: transparent;
}
#funnel-map .stage-node span { letter-spacing: .025em; }
#funnel-map .stage-node small {
  min-width: 29px;
  font: 650 12px/1 ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
#funnel-map .stage-node small::after {
  content: '枚';
  padding-left: 2px;
  font: 550 10px/1 sans-serif;
}
#funnel-map .whole-stage .stage-node,
#funnel-map .cross-stages .stage-node {
  justify-content: space-between;
  min-height: 42px;
  width: 100%;
  margin: 0;
  padding: 8px 15px;
  border: 1px solid #c6c4ae;
  border-radius: 9px;
  color: #28354b;
  background: #fffef6;
  transition: background-color .16s, border-color .16s, transform .16s;
}
#funnel-map .whole-stage .stage-node {
  border-color: #38455a;
  box-shadow: 0 2px 0 #35405624;
}
#funnel-map .whole-stage .stage-node::before,
#funnel-map .cross-stages .stage-node::before { content: none; }
#funnel-map .whole-stage .stage-node small,
#funnel-map .cross-stages .stage-node small {
  padding: 4px 6px;
  background: #edece2;
  border-radius: 12px;
}
#funnel-map .pipeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: none;
  margin: 2px auto 0;
  gap: 2px;
}
#funnel-map .pipeline .stage-node {
  --band-width: calc(100% - var(--step) * 8.8%);
  width: var(--band-width);
  min-height: clamp(43px, 6.7svh, 56px);
  padding: 8px max(8%, 22px);
  border: 0;
  border-radius: 45%;
  background: transparent;
  color: var(--band-ink, #202c46);
  font-size: 16px;
  justify-content: space-between;
  filter: drop-shadow(0 2px 1px #5e563a28);
  transition: transform .2s ease, filter .2s ease;
}
#funnel-map .pipeline .stage-node::before,
#funnel-map .pipeline .stage-node::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 0;
}
#funnel-map .pipeline .stage-node::before {
  inset: 0;
  clip-path: var(--band-outline);
  background:
    linear-gradient(105deg, transparent 24%, #fffbd884 48%, transparent 73%) -160% 0 / 48% 100% no-repeat,
    linear-gradient(98deg, var(--band-side), var(--band-face) 22%, var(--band-face) 59%, var(--band-side));
}
#funnel-map .pipeline .stage-node::after {
  inset: 0 0 auto;
  height: 24%;
  z-index: -1;
  border-radius: 50%;
  background: linear-gradient(98deg, var(--band-rim) 5%, color-mix(in srgb, var(--band-rim), white 45%) 45%, var(--band-rim) 84%);
  box-shadow: inset 0 -1px #ffffff85, 0 1px 1px #26334d18;
}
#funnel-map .pipeline .stage-node:nth-child(1) { --step: 0; --band-rim: #fff2a1; --band-face: #ffe461; --band-side: #eacb48; }
#funnel-map .pipeline .stage-node:nth-child(2) { --step: 1; --band-rim: #fff0b3; --band-face: #e9d88d; --band-side: #cebd77; }
#funnel-map .pipeline .stage-node:nth-child(3) { --step: 2; --band-rim: #eeebc7; --band-face: #d4d2a9; --band-side: #b8b896; }
#funnel-map .pipeline .stage-node:nth-child(4) { --step: 3; --band-rim: #7b8f91; --band-face: #495e68; --band-side: #384d59; --band-ink: #fff; }
#funnel-map .pipeline .stage-node:nth-child(5) { --step: 4; --band-rim: #576679; --band-face: #2b3b54; --band-side: #233149; --band-ink: #fff; }
#funnel-map .pipeline .stage-node small { opacity: .87; }
@media (prefers-reduced-motion: no-preference) {
  #funnel-map .pipeline .stage-node {
    animation: funnel-assemble .43s cubic-bezier(.2,.7,.2,1) backwards;
    animation-delay: calc(var(--step) * 38ms);
  }
  @keyframes funnel-assemble {
    from { translate: 0 -9px; opacity: .45; }
    to { translate: 0 0; opacity: 1; }
  }
}
@supports (clip-path: shape(from 0% 0%, line to 100% 0%, close)) {
  #funnel-map {
    --band-outline: shape(from 0% 12%,
      curve to 50% 0% with 0% 5% / 22% 0%,
      curve to 100% 12% with 78% 0% / 100% 5%,
      line to 95.8% 87%,
      curve to 50% 100% with 95% 95% / 73% 100%,
      curve to 4.2% 87% with 27% 100% / 5% 95%, close);
  }
}
#funnel-map .cross-stages {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.28fr);
  gap: 8px;
  margin: 10px 0 0;
  padding-top: 10px;
  max-width: none;
  border-top: 1px dashed #8f998f;
}
#funnel-map .cross-stages .stage-node { padding-inline: 9px; font-size: 14px; }
@media (max-width: 1150px) {
  #funnel-map .cross-stages button.stage-node {
    flex-direction: column;
    justify-content: center;
    padding: 6px 2px;
    gap: 4px;
    text-align: center;
    font-size: 13px;
  }
  #funnel-map .cross-stages button.stage-node span { letter-spacing: 0; }
}
#funnel-map .whole-stage .stage-node[aria-pressed='true'],
#funnel-map .cross-stages .stage-node[aria-pressed='true'] {
  color: white;
  background: #26354d;
  border-color: #26354d;
}
#funnel-map .stage-node[aria-pressed='true'] small { color: #202c46; background: #ffe45c; }
#funnel-map .pipeline .stage-node[aria-pressed='true'] {
  --band-face: #21324d;
  --band-side: #354a64;
  --band-rim: #ffe45c;
  --band-ink: #fff;
  transform: scaleX(1.025);
  filter: drop-shadow(0 1px 0 #26334d) drop-shadow(0 3px 2px #3a405635);
}
#funnel-map .pipeline .stage-node[aria-pressed='true'] small {
  border-radius: 20px;
  opacity: 1;
  padding: 4px 6px;
}
@media (hover: hover) {
  #funnel-map .pipeline .stage-node:hover { transform: translateY(-2px) scaleX(1.025); filter: drop-shadow(0 3px 2px #43473538); }
  #funnel-map .whole-stage .stage-node:hover:not([aria-pressed='true']),
  #funnel-map .cross-stages .stage-node:hover:not([aria-pressed='true']) { background: #fff2a6; border-color: #738177; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  #funnel-map .pipeline .stage-node:hover::before { animation: funnel-glint .57s ease-out; }
  @keyframes funnel-glint {
    from { background-position: -100% 0, 0 0; }
    to { background-position: 200% 0, 0 0; }
  }
}
#funnel-map .stage-node:focus-visible { outline: 3px solid #916000; outline-offset: 1px; }
#funnel-map .pipeline .stage-node:focus-visible { border-radius: 8px; }
#funnel-map .stage-node:active { transform: scale(.98); }
#funnel-map [data-stage]:disabled { cursor: default; }

#map .map-workspace { display: block; padding: 0; }
#results { padding: clamp(20px, 3vw, 38px) 0 12px; scroll-margin-top: 12px; }
#results .result-head { border-top: 1px solid #d2d5ca; padding-top: 22px; }
#results .result-head h2 { font-size: clamp(27px, 3vw, 43px); }
#results #shown { padding: 6px 12px; background: #fff0aa; color: #26324b; font-weight: 750; }
#map .results-tools { margin: 9px 0 15px; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
#map #choose-stage {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid #c9cdc7;
  border-radius: 22px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  background: #fffefa;
}
#map #choose-stage:hover { border-color: #38455a; background: #fff2a6; }

@media (max-width: 840px) {
  .funnel-hero { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 20px; }
  #funnel-map { padding-inline: 19px; }
}
@media (max-width: 700px) {
  .funnel-hero { display: block; min-height: calc(100svh - 60px); padding-block: 10px 22px; }
  .funnel-intro { max-width: none; margin-bottom: 15px; }
  .funnel-intro .home-eyebrow { font-size: 11px; margin: 0 0 6px; }
  .funnel-intro h1 { font-size: clamp(27px, 5.8vw, 39px); line-height: 1.3; }
  .funnel-intro .home-position { margin: 9px 0 4px; max-width: 39em; font-size: 13px; line-height: 1.5; }
  .funnel-intro .home-lead { max-width: none; font-size: 13px; line-height: 1.5; }
  #funnel-map { max-width: 560px; margin-inline: auto; border-radius: 17px; padding: 11px 15px 13px; }
  #funnel-map .funnel-title { margin-bottom: 6px; }
  #funnel-map .whole-stage { margin-bottom: 6px; }
  #funnel-map .whole-stage .stage-node,
  #funnel-map .cross-stages .stage-node { min-height: 42px; padding: 7px 11px; }
  #funnel-map .pipeline .stage-node { min-height: 43px; padding-inline: 8.5%; font-size: 15px; }
  #funnel-map .cross-stages { margin-top: 7px; padding-top: 7px; gap: 5px; }
  #map .results-tools { margin: 8px 0 12px; }
}
@media (max-width: 370px) {
  #funnel-map { padding-inline: 10px; }
  #funnel-map .pipeline .stage-node { --band-width: calc(100% - var(--step) * 7.5%); padding-inline: 7%; }
  #funnel-map .cross-stages .stage-node { padding-inline: 8px; gap: 3px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  #funnel-map .stage-node { transition: none; }
  #funnel-map .stage-node:is(:hover, :active, [aria-pressed='true']) { transform: none; }
}

#results .map-filter-fold {
  margin: 14px 0 10px;
  background: #f6f5ee;
  border-radius: 11px;
}
#results .map-filter-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 7px 15px;
  list-style: none;
  font-size: 13px;
  font-weight: 700;
}
#results .map-filter-fold > summary::-webkit-details-marker { display: none; }
#results .map-filter-fold > summary::after {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
#results .map-filter-fold[open] > summary::after { transform: rotate(225deg); }
#results .map-filter-fold .filters { background: none; padding: 5px 15px 15px; }

#automation-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
#automation-services a {
  display: grid;
  gap: 5px;
  border: 1px solid #d8d6c8;
  border-radius: 10px 20px 10px 10px;
  padding: 14px 18px;
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  text-decoration: none;
}
#automation-services a:last-child { background: var(--ink); color: var(--paper); }
#automation-design-map { grid-column: 1 / -1; }
#automation-services strong { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; }
#automation-services a:hover strong, #automation-services a:focus-visible strong { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 600px) {
  #automation-services { grid-template-columns: 1fr; gap: 6px; }
  #automation-services a { padding: 10px 13px; }
}
