/* Scene 5 · The route passport. A normal section. Nothing moves until you tap. */
.route { background: #1b1109; }
.route__stage { position: relative; min-height: max(100svh, 780px); overflow: hidden; background: #1b1109; }

/* the picture behind everything: one layer per stop (the farm has two that take turns) */
.route__bg { position: absolute; inset: 0; z-index: 0; }
.route__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  filter: brightness(0.72) saturate(0.95); transition: opacity 0.8s ease;
}
.route__img.on { opacity: 1; }
.route__shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(27, 17, 9, 0.88), rgba(27, 17, 9, 0.1) 34%, rgba(27, 17, 9, 0.3) 60%, rgba(27, 17, 9, 0.96));
}

.route__head { position: relative; z-index: 3; padding: clamp(26px, 5vw, 56px) clamp(20px, 5vw, 64px); }
.route__head h2 { margin: 8px 0 0; font: 500 clamp(2.2rem, 5vw, 3.6rem)/1.05 var(--font-display); color: var(--cream); }
.route__head h2 em { color: var(--butter); }
.route__count { margin: 12px 0 0; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(246, 235, 217, 0.78); }

/* the passport card, with the stamp pressed in its corner */
.route__card {
  position: absolute; z-index: 3; right: clamp(20px, 5vw, 64px); top: clamp(170px, 22vh, 210px); width: min(390px, calc(100% - 40px));
  padding: 24px 26px 20px; border-radius: 6px; background: var(--cream); color: var(--ink);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.route__no { margin: 0; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a6a3c; padding-right: 110px; }
.route__name { margin: 6px 0 4px; font: 600 clamp(2.2rem, 4vw, 2.7rem)/1 var(--font-display); padding-right: 110px; }
.route__tag { margin: 0 0 14px; padding-right: 110px; min-height: 2.7em; font: italic 1rem/1.35 var(--font-display); color: #5a4330; }
.route__facts { margin: 0; }
.route__facts dt { margin-top: 10px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a6a3c; }
.route__facts dd { margin: 3px 0 0; font: 500 0.92rem/1.4 var(--font-mono); }
.route__stamp { position: absolute; top: 14px; right: 16px; width: 98px; height: 98px; color: #B3261E; mix-blend-mode: multiply; transform: rotate(-9deg); opacity: 0.92; }
.route__stamp.press { animation: route-press 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes route-press {
  0% { transform: rotate(-22deg) scale(1.7); opacity: 0; }
  55% { transform: rotate(-9deg) scale(0.93); opacity: 1; }
  100% { transform: rotate(-9deg) scale(1); opacity: 0.92; }
}
.route__card.swap .route__no, .route__card.swap .route__name, .route__card.swap .route__tag, .route__card.swap .route__facts { animation: route-swap 0.4s ease both; }
@keyframes route-swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.route__nav { display: flex; gap: 10px; margin-top: 16px; }
.route__btn {
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--cream); font: 600 0.95rem/1 var(--font-body); flex: 1;
}
.route__btn--ghost { background: transparent; color: var(--ink); border: 1px solid rgba(42, 28, 19, 0.35); flex: 0 0 auto; }
.route__btn:disabled { opacity: 0.4; cursor: default; }
.route__btn:hover:not(:disabled) { filter: brightness(1.15); }
.route__note { margin: 12px 0 0; font-size: 10.5px; letter-spacing: 0.05em; color: #8a6a3c; }

/* the route line along the bottom: dashed, filling with butter up to the stop you are on */
.route__path {
  position: absolute; z-index: 3; left: clamp(20px, 5vw, 64px); right: clamp(20px, 5vw, 64px); bottom: clamp(30px, 5vw, 50px);
  margin: 0; padding: 0; list-style: none; display: flex;
}
.route__path > li:not(.route__line) { flex: 1; text-align: center; }
.route__node {
  display: block; width: 100%; min-height: 64px; padding: 0; border: 0; background: none; cursor: pointer; color: rgba(246, 235, 217, 0.72);
  font: 12px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
}
.route__node i { display: block; width: 18px; height: 18px; margin: 0 auto 10px; border-radius: 50%; border: 2px solid var(--cream); background: #1b1109; position: relative; z-index: 2; transition: background 0.3s, border-color 0.3s, box-shadow 0.3s; }
.route__node.seen i { border-color: var(--butter); }
.route__node[aria-current="step"] { color: var(--butter); }
.route__node[aria-current="step"] i { background: var(--butter); border-color: var(--butter); box-shadow: 0 0 0 7px rgba(243, 215, 122, 0.22); }
.route__node:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; border-radius: 8px; }
.route__line { position: absolute; left: 10%; right: 10%; top: 8px; height: 0; border-top: 2px dashed rgba(246, 235, 217, 0.35); pointer-events: none; }
.route__fill { position: absolute; left: 0; top: -2px; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--butter); transition: width 0.7s ease; }

/* the guide: the cafe's own mark, unchanged, waits on the stop you are on, nudges you toward the next one, and hops along when you tap.
   Four layers so the movements never fight: left = where it stands, hop = the jump, lean = beckon and settle, body = a slow float. */
.route__guide {
  position: absolute; bottom: 12px; left: calc(var(--p, 0) * 100%); width: 58px; height: 48px; margin-left: -29px;
  pointer-events: auto; cursor: pointer; transition: left 0.7s ease; z-index: 4;
}
.route__hop, .route__lean, .route__body { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; }
.route__body { animation: route-float 3s ease-in-out infinite; }
.route__body img { display: block; width: 100%; height: 100%; }
@keyframes route-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.route__bub {
  position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-24%) scale(0.85); transform-origin: 24% 100%;
  white-space: nowrap; background: var(--cream); color: var(--ink); border-radius: 12px; padding: 8px 14px;
  font: 600 14px/1.2 var(--font-body); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.35s, transform 0.35s;
}
.route__bub::after { content: ""; position: absolute; left: 20px; bottom: -7px; border: 7px solid transparent; border-top-color: var(--cream); border-bottom: 0; }
.route__bub.show { opacity: 1; transform: translateX(-24%) scale(1); }
/* on the right-hand stops the bubble grows leftwards so it never leaves the screen */
.route__guide.right .route__bub { left: auto; right: 50%; transform: translateX(24%) scale(0.85); transform-origin: 76% 100%; }
.route__guide.right .route__bub.show { transform: translateX(24%) scale(1); }
.route__guide.right .route__bub::after { left: auto; right: 20px; }

@media (max-width: 700px) {
  .route__stage { min-height: max(100svh, 930px); }
  /* on a phone the picture sits in the top half and fades into the dark, so the card never hides the subject */
  .route__bg { height: 56%; -webkit-mask-image: linear-gradient(#000 68%, transparent); mask-image: linear-gradient(#000 68%, transparent); }
  .route__head { padding-top: 60px; }
  .route__card { left: 16px; right: 16px; width: auto; top: 400px; padding: 18px 20px 16px; transform: none; }
  .route__name { font-size: 2.1rem; }
  .route__tag { font-size: 0.92rem; margin-bottom: 8px; }
  .route__facts dd { font-size: 0.82rem; }
  .route__stamp { width: 82px; height: 82px; top: 10px; right: 12px; }
  .route__no, .route__name, .route__tag { padding-right: 92px; }
  .route__tag { min-height: 2.5em; }
  .route__node { font-size: 9.5px; letter-spacing: 0.06em; }
  .route__path { left: 16px; right: 16px; bottom: 22px; }
  .route__guide { width: 46px; height: 38px; margin-left: -23px; }
  .route__bub { font-size: 12.5px; padding: 7px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .route__img, .route__fill, .route__guide, .route__bub, .route__node i { transition: none; }
  .route__body { animation: none; }
  .route__stamp.press, .route__card.swap * { animation: none; }
}
