/* The four scenes share one pinned frame so the dashboard pieces stay in place. */
#process {
  --journey-ease: cubic-bezier(.16, 1, .3, 1);
  --travel-gap: min(38vw, 400px);
  --journey-ink: #18231e;
  --journey-accent: var(--orange, #f36036);
  position: relative;
  height: 670vh;
  height: 670svh;
  min-height: 0;
  color: var(--journey-ink);
}
#process .stage { display: block; position: sticky; top: 0; height: 100svh; min-height: 0; overflow: hidden; }
.jp-shell { height: 100%; padding-top: min(7.12svh, 64px); display: flex; flex-direction: column; gap: min(2.67svh,24px); }
.jp-rail { height: min(8.89svh,80px); position: relative; flex: none; overflow: hidden; }
.jp-rail::before, .jp-track::before {
  content: ""; position: absolute; height: 4px; background: radial-gradient(circle, #bcc5bf 1px, transparent 1.5px) repeat-x left center / 6px 4px;
  top: min(6.9svh,62px);
}
.jp-rail::before { inset-inline: 0; opacity: .7; }
.jp-track { position: absolute; left: 50%; height: 100%; transform: translateX(calc(-1 * var(--rail-offset, 0) * var(--travel-gap))); }
.jp-track::before { right: calc(-1 * var(--rail-fill, 0) * var(--travel-gap)); width: 200vw; background-image: radial-gradient(circle, var(--journey-accent) 1.1px, transparent 1.7px); }
.jp-track button, .jp-stop { position: absolute; left: calc(var(--station) * var(--travel-gap)); transform: translateX(-50%); }
.jp-track button { top: 0; height: min(7.77svh,70px); border: 0; color: #68716b; background: none; display: flex; flex-flow: column; align-items: center; gap: 1px; padding: 4px 8px; }
.jp-track button b { font-size: .94rem; font-weight: 550; }
.jp-track button small { font-size: .78rem; }
.jp-track button i, .jp-stop { height: 8px; width: 8px; border-radius: 50%; position: absolute; top: min(6.68svh,60px); background: #b9c3bc; }
.jp-track button i { width: 12px; height: 12px; top: min(6.46svh,58px); }
.jp-track button[data-reached] i, .jp-stop[data-reached] { background: var(--journey-accent); }
.jp-track button[aria-pressed=true] { color: var(--journey-ink); }
.jp-track button[aria-pressed=true] i { box-shadow: 0 0 0 4px #f56d3920,0 0 14px #f56d3959; }
.jp-headings { flex: none; height: min(17.56svh,158px); display: grid; align-content: start; text-align: center; margin-inline: auto; width: min(800px, calc(100% - 32px)); }
.jp-headings h2 { grid-area: 1 / 1; margin: 0; font-size: clamp(2.1rem, 3.6vw, 3.25rem); line-height: 1.02; letter-spacing: -.055em; opacity: 0; transform: translateY(8px); transition: opacity .4s var(--journey-ease),transform .8s var(--journey-ease); }
.jp-headings h2 em { font-style: normal; color: #68716b; }
.jp-headings h2[data-current] { opacity: 1; transform: translateY(0); }
.jp-bench { width: min(1200px, 100%); min-height: 0; margin-inline: auto; flex: 1; display: flex; justify-content: center; }
.jp-screen { position: relative; width: min(1040px, calc(100% - 32px)); height: calc(100% - min(7.11svh,64px)); min-height: 0; }
.jp-mail,.jp-app,.jp-grid { position: absolute; inset: 0; }
.jp-app,.jp-mail,.jp-skeleton,.jp-detail {
  opacity: 0; transform: translateY(16px) scale(.97);
  transition: opacity .8s var(--journey-ease),transform .8s var(--journey-ease);
}
.jp-app,.jp-mail,.jp-detail { border: 1px solid #d7dfda; background: #fff; border-radius: 18px; }
.jp-mail { pointer-events: none; height: fit-content; width: min(640px,100%); margin-inline: auto; padding: 24px; box-shadow: 0 15px 44px #1a30271a; }
#process[data-journey="0"] .jp-mail,.jp-grid[data-visible] .jp-skeleton,.jp-grid[data-detail] .jp-detail,#process[data-journey="3"] .jp-app { opacity: 1; transform: none; }
.jp-recipient { padding-bottom: 12px; border-bottom: 1px solid #e3e8e4; color: #74827a; font-size: .92rem; }
.jp-recipient strong { color: var(--journey-ink); margin-left: .5em; }
.jp-message { margin: 22px 0; font-size: 1.18rem; line-height: 1.45; min-height: 2.9em; }
.jp-message span { opacity: 0; }
#process[data-write] .jp-message span { opacity: 1; animation: jp-key 1ms linear backwards; animation-delay: calc(var(--character) * 36ms); }
@keyframes jp-key { from { opacity: 0; } to { opacity: 1; } }
.jp-send { display: flex; align-items: center; justify-content: space-between; }
.jp-send span { padding: 6px 10px; border-radius: 12px; background: #f0f4f0; color: #435249; font-size: .8rem; }
.jp-send b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--journey-accent); }
.jp-app { overflow: hidden; box-shadow: 0 18px 50px #21362b19; pointer-events: none; }
.jp-app:not([inert]) { pointer-events: auto; }
.jp-chrome { height: 10%; min-height: 22px; border-bottom: 1px solid #e2e7e3; display: flex; align-items: center; gap: 4px; padding-inline: 12px; }
.jp-chrome i { background: #c8d2cb; width: 6px; height: 6px; border-radius: 50%; }
.jp-chrome span { margin-inline: auto; padding-right: 30px; font-size: .7rem; color: #839087; }
.jp-side { position: absolute; left: 0; top: 10%; bottom: 0; width: 23%; padding: 15px; border-right: 1px solid #e3e9e4; display: grid; align-content: start; gap: 10px; font-size: .8rem; }
.jp-side strong { font-size: 1rem; margin-bottom: .4rem; }.jp-side strong span { color: var(--journey-accent); }
.jp-side > span { padding: 6px 9px; }.jp-side > span:nth-child(2) { background: #edf2ee; border-radius: 6px; }
.jp-apphead { margin-left: 24%; height: 14%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px; }
.jp-grid { display: grid; grid-template: repeat(2,minmax(0,1fr)) / repeat(4,minmax(0,1fr)); gap: 16px; padding: 0 16px 16px; pointer-events: none; transform-origin: right bottom; transition: transform .8s var(--journey-ease); }
.jp-grid[data-docked] { transform: scale(.76); }
.jp-card { position: relative; min-width: 0; min-height: 0; }
.jp-card:nth-child(3n + 2) { grid-column: span 2; }
.jp-skeleton,.jp-detail { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(10px,1.1vw,18px); overflow: hidden; transition-delay: calc(var(--order) * 80ms); }
.jp-skeleton { gap: 8px; border: 1px solid #d9e1db; border-radius: 14px; background: #fff9; }
.jp-skeleton i,.jp-skeleton b { display:block; border-radius: 8px; background: #dce2de; height: 7px; width: 40%; }
.jp-skeleton i:first-child { width: 32%; margin-bottom: auto; }
.jp-skeleton b { display: none; }.jp-card:nth-child(2) .jp-skeleton b { display: block; width: 100%; flex: 1; min-height: 20px; }
.jp-detail { font-size: .9rem; color: #36473c; border-radius: 16px; }
.jp-detail small { color: #66746b; font-size: .85rem; }
.jp-detail > div { min-height: 0; }
.jp-card:nth-child(2) .jp-detail > div { height: 76%; display: flex; flex-direction: column; justify-content: flex-end; }
.jp-number { color: var(--journey-ink); font-size: clamp(1rem,2.4vw,2.5rem); font-weight: 600; letter-spacing: -.055em; }
#change { color: #51712c; }.jp-insight { font-size: clamp(.9rem,1.7vw,1.6rem); font-weight: 500; }
.jp-bars { display: flex; align-items: flex-end; flex: 1; min-height: 20px; gap: 2%; background: repeating-linear-gradient(to top,#e7ece8 0 1px,transparent 1px 33%); }
.jp-bars i { width: 100%; height: var(--h); background: var(--journey-accent); border-radius: 3px 3px 0 0; transform-origin: center bottom; }
.jp-grid[data-detail] .jp-bars i { animation: jp-rise .8s var(--journey-ease) both; animation-delay: calc(.16s + var(--bar,0) * 60ms); }
@keyframes jp-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.jp-region { display: flex; align-items: center; gap: 6px; font-size: .72rem; margin-top: 7px; }
.jp-region b { width: 2em; font-weight: 400; }.jp-region i { width: calc(var(--ratio) * .65); height: 6px; border-radius: 3px; background: #7c936b; }
.jp-grid[data-detail] .jp-region i {
  transform-origin: left;
  animation: jp-width 1s var(--journey-ease) .24s both;
}
@keyframes jp-width { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.jp-grid[data-detail] .jp-number,.jp-grid[data-detail] .jp-insight {
  animation: jp-type-reveal 1.2s .15s var(--journey-ease) both;
}
@keyframes jp-type-reveal { from { opacity: 0; } to { opacity: 1; } }
.jp-mix { display: flex; align-items: center; gap: 8px; }.jp-mix i { width: 36px; height: 36px; border-radius: 50%; border: 4px solid #e7ece6; border-top-color: var(--journey-accent); border-right-color: var(--journey-accent); }
.jp-source { font-size: .8rem; margin: .2em 0; }
.jp-toast { pointer-events: none; position: absolute; left: 50%; bottom: 16px; padding: 9px 15px; display: flex; align-items: center; gap: 8px; white-space: nowrap; border-radius: 30px; background: #15201c; color: white; transform: translate(-50%,10px); opacity: 0; font-size: .86rem; }
.jp-toast i { width: 14px; height: 14px; border-radius: 50%; background: var(--journey-accent); }
.jp-toast span:last-child { display: none; }
#process[data-journey="3"] .jp-toast span:last-child { display: inline; }
#process[data-journey="3"] .jp-toast span:nth-child(2) { display: none; }
#process[data-sent] .jp-toast { animation: jp-notice 1.6s var(--journey-ease) both; }
#process[data-journey="3"] .jp-toast { animation: jp-shipped 1.6s .4s var(--journey-ease) both; }
@keyframes jp-notice { 18%,76% { opacity: 1; transform: translate(-50%,0); } }
@keyframes jp-shipped { 18%,76% { opacity: 1; transform: translate(-50%,0); } }

@media(max-width:767px),(max-height:500px),(prefers-reduced-motion:reduce) {
  #process { height: auto; }
  #process .stage { position: relative; height: auto; min-height: 0; }
  .jp-shell { padding-top: 64px; gap: 16px; }
  .jp-rail { height: auto; padding-inline: 12px; }
  .jp-track { position: static; transform: none; height: auto; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
  .jp-track::before,.jp-rail::before,.jp-stop,.jp-track button small { display: none; }
  .jp-track button { position: static; transform: none; height: auto; flex-direction: row-reverse; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #d8dfda; border-radius: 100px; background: #f8faf8; }
  .jp-track button i { position: static; width: 8px; height: 8px; }
  .jp-track button[aria-pressed=true] { border-color: var(--journey-accent); }
  .jp-headings { height: 79px; width: calc(100% - 24px); }
  .jp-headings h2 { font-size: clamp(1.5rem,4.2vw,2.45rem); line-height: 1.1; }
  .jp-bench { flex: none; height: clamp(320px,80vw,500px); padding-bottom: 40px; }
  .jp-screen { width: min(100% - 24px,740px); height: 100%; }
}
@media(max-width:767px) {
  .jp-bench { height: 400px; }
  .jp-screen { height: 87%; }
  .jp-mail { padding: 18px; }.jp-message { min-height: 4.35em; font-size: 1rem; }
  .jp-grid { grid-template: repeat(2,minmax(0,1fr)) / repeat(2,minmax(0,1fr)); gap: 11px; padding: 0 12px 12px; }
  .jp-card:nth-child(3n + 2) { grid-column: auto; }
  .jp-card:nth-child(n + 5),.jp-side { display: none; }
  .jp-grid[data-docked] { transform-origin: center bottom; transform: scale(.72); }
  .jp-apphead { margin: 0; font-size: .85rem; padding-inline: 8px; }
  .jp-apphead .period button { padding: 4px 7px; font-size: .7rem; }
  .jp-mix i { width: 26px; height: 26px; }.jp-detail { font-size: .78rem; }
  .jp-toast { bottom: 12px; }
}
@media(prefers-reduced-motion:reduce) {
  #process .jp-message span { opacity: 1; animation: none!important; }
  #process .jp-toast { display: none; }
  #process .jp-skeleton,#process .jp-detail { transition-delay: 0s; }
}
