/* H1-P3 interactive instruments. Public copy lives in components/journey-steps. */
.reading-progress {
  position: fixed;
  z-index: 79;
  top: var(--header-height, 88px);
  left: 0;
  width: 100%;
  height: 2px;
  pointer-events: none;
  background: #c4ac7d18;
}
.reading-progress > span {
  display: block;
  height: 100%;
  background: var(--champagne);
  transform: scaleX(0);
  transform-origin: left;
}
.whatsapp-widget {
  position: fixed;
  z-index: 44;
  left: max(22px, env(safe-area-inset-left));
  bottom: var(--floating-bottom, max(22px, env(safe-area-inset-bottom)));
}
.whatsapp-widget .whatsapp-control {
  position: static;
}
.robot-popover[hidden] {
  display: none !important;
}
.robot-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  display: flex;
  align-items: center;
  gap: 0;
  width: 300px;
  max-width: calc(100vw - 38px);
  filter: drop-shadow(0 8px 18px #0004);
}
.robot-popover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
}
.luwa-robot {
  width: 94px;
  height: 132px;
  flex-shrink: 0;
  overflow: visible;
}
.robot-speech {
  position: relative;
  padding: 17px 17px 10px;
  border: 1px solid var(--champagne);
  background: var(--navy);
  color: var(--ivory);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}
.robot-speech strong {
  display: block;
  color: var(--champagne);
  font-size: 17px;
  font-weight: 600;
}
.robot-speech > span {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
}
.robot-speech button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 6px;
  min-height: 44px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: #d7dce3;
  font-size: 10px;
  cursor: pointer;
}
.robot-speech button:hover {
  color: var(--champagne);
}
.robot-visible .luwa-robot {
  animation: robot-arrive 380ms var(--ease) both;
}
.robot-visible .robot-arm {
  transform-origin: 80px 91px;
  animation: robot-wave 900ms ease-out 1;
}
.robot-visible .robot-eyes {
  animation: robot-blink 1.1s ease-out 1;
}
.robot-visible .robot-speech {
  animation: robot-speak 280ms var(--ease) 100ms both;
}
@keyframes robot-arrive {
  from {
    opacity: 0;
    transform: translateY(8px) rotate(-3deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes robot-wave {
  0%,
  100% {
    transform: rotate(0);
  }
  35% {
    transform: rotate(-18deg);
  }
  65% {
    transform: rotate(6deg);
  }
}
@keyframes robot-blink {
  0%,
  35%,
  55%,
  100% {
    opacity: 1;
  }
  45% {
    opacity: 0.25;
  }
}
@keyframes robot-speak {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
body:has(dialog[open], .masthead.is-menu-open) .whatsapp-widget,
body:has(input:focus, textarea:focus, select:focus) .whatsapp-widget {
  visibility: hidden;
}

/* Scroll-led delivery story. Every stage remains readable without JavaScript. */
.delivery-path {
  --delivery-progress: 0;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 2fr);
  gap: clamp(30px, 5vw, 80px);
  margin-top: 48px;
  padding: clamp(28px, 4vw, 64px);
  background: var(--navy);
  color: var(--ivory);
  border-top: 2px solid var(--champagne);
}
.delivery-path-index {
  align-self: start;
  position: sticky;
  top: calc(var(--header-height, 90px) + 30px);
}
.delivery-path-label {
  margin: 0 0 34px;
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1.5;
  letter-spacing: -0.025em;
  color: var(--ivory);
}
.delivery-path-index ol {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
}
.delivery-path-index ol::before,
.delivery-path-index ol::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 21px;
  bottom: 21px;
  width: 1px;
  background: #ffffff42;
  pointer-events: none;
}
.delivery-path-index ol::after {
  background: var(--champagne);
  transform: scaleY(var(--delivery-progress));
  transform-origin: top;
}
.delivery-path-index li + li {
  margin-top: 26px;
}
.delivery-path-index a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 17px;
  min-height: 44px;
  color: #d0d5dc;
  text-decoration: none;
  font-size: 14px;
}
.delivery-path-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--navy);
  color: var(--ivory);
  border: 1px solid #ffffff65;
  font-size: 11px;
  transition:
    background 180ms,
    color 180ms,
    border-color 180ms;
}
.delivery-path-index .is-current a,
.delivery-path-index a:hover {
  color: var(--champagne);
}
.delivery-path-index .is-current .delivery-path-number {
  background: var(--champagne);
  border-color: var(--champagne);
  color: var(--black);
}
.delivery-path-index .is-complete .delivery-path-number {
  border-color: var(--champagne);
  color: var(--champagne);
}
.delivery-path-index a:focus-visible {
  outline: 2px solid var(--champagne);
  outline-offset: 5px;
}
.delivery-path-hint {
  max-width: 180px;
  font-size: 11px;
  line-height: 1.7;
  color: #d0d5dc;
  margin: 35px 0 0;
}
.delivery-chapter {
  scroll-margin-top: calc(var(--header-height, 90px) + 24px);
  padding-block: 4px 56px;
}
.delivery-chapter + .delivery-chapter {
  padding-top: 54px;
  border-top: 1px solid #ffffff35;
}
.delivery-chapter:last-child {
  padding-bottom: 0;
}
.delivery-chapter header {
  display: flex;
  align-items: start;
  gap: 20px;
  margin-bottom: 32px;
}
.delivery-chapter-number {
  color: var(--champagne);
  font-size: clamp(36px, 4vw, 60px);
  line-height: 1;
  letter-spacing: -0.07em;
}
.delivery-chapter h3 {
  color: var(--ivory);
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 15px;
}
.delivery-chapter header p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: #d0d5dc;
}
.delivery-chapter-stages {
  padding-left: 20px;
  border-left: 1px solid #ffffff35;
}
.delivery-chapter-stages article + article {
  margin-top: 30px;
}
.delivery-stage-label {
  margin: 0 0 9px;
  color: var(--champagne);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.delivery-chapter h4 {
  margin: 0 0 11px;
  color: var(--ivory);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
}
.delivery-chapter-stages article > p:not(.delivery-stage-label) {
  color: #d0d5dc;
  font-size: 13px;
  line-height: 1.85;
  margin: 0;
}
.delivery-chapter-stages article > p.delivery-stage-output {
  color: var(--ivory);
  margin-top: 15px;
  font-size: 11px;
}
.delivery-stage-output span {
  color: var(--champagne);
  margin-right: 10px;
}
@media (max-width: 760px) {
  .delivery-path {
    grid-template-columns: minmax(0, 1fr);
    padding: 27px 22px;
    gap: 38px;
  }
  .delivery-path-index {
    position: static;
  }
  .delivery-path-label {
    font-size: 22px;
    margin-bottom: 25px;
  }
  .delivery-path-index ol {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .delivery-path-index ol::before,
  .delivery-path-index ol::after {
    left: 20px;
    right: calc(25% - 20px);
    top: 20px;
    bottom: auto;
    width: auto;
    height: 1px;
  }
  .delivery-path-index ol::after {
    transform: scaleX(var(--delivery-progress));
    transform-origin: left;
  }
  .delivery-path-index li + li {
    margin: 0;
  }
  .delivery-path-index a {
    flex-direction: column;
    align-items: start;
    gap: 10px;
    font-size: 10px;
  }
  .delivery-path-hint {
    display: none;
  }
  .delivery-chapter {
    padding-bottom: 40px;
  }
  .delivery-chapter + .delivery-chapter {
    padding-top: 37px;
  }
  .delivery-chapter header {
    gap: 16px;
    margin-bottom: 25px;
  }
  .delivery-chapter-number {
    font-size: 38px;
  }
  .delivery-chapter h3 {
    font-size: 29px;
  }
  .delivery-chapter header p {
    font-size: 13px;
  }
  .delivery-chapter-stages {
    padding-left: 16px;
    border-left-color: var(--champagne);
  }
}
@media (max-width: 375px) {
  .delivery-path {
    padding-inline: 17px;
  }
  .delivery-chapter header {
    gap: 12px;
  }
  .delivery-chapter-number {
    font-size: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .delivery-path-number {
    transition: none;
  }
}

@media (max-width: 960px) {
  .reading-progress {
    top: var(--header-height, 75px);
  }
}
@media (max-width: 420px) {
  .robot-popover {
    width: 280px;
  }
  .luwa-robot {
    width: 86px;
  }
  .robot-speech {
    padding: 14px 13px 7px;
  }
  .robot-speech strong {
    font-size: 16px;
  }
  .robot-speech > span {
    font-size: 10px;
  }
  .whatsapp-widget {
    left: max(14px, env(safe-area-inset-left));
    bottom: var(--floating-bottom, max(16px, env(safe-area-inset-bottom)));
  }
}
@media (prefers-reduced-motion: reduce) {
  .robot-visible * {
    animation: none !important;
  }
}

/* The footer dock keeps the invitation beside the action, inside its reserved zone. */
.footer-docked .robot-popover {
  left: 64px;
  bottom: 0;
  width: min(280px, calc(100vw - 104px));
  max-width: none;
}
.footer-docked .luwa-robot {
  width: 64px;
  height: 110px;
}
.footer-docked .robot-speech {
  padding: 12px 11px 6px;
}
.footer-docked .robot-speech strong {
  font-size: 14px;
}
.footer-docked .robot-speech > span {
  font-size: 10px;
}
/* Compact dock version keeps the character readable without an empty footer band. */
.footer-docked .luwa-robot {
  width: 56px;
  height: 88px;
}
.footer-docked .robot-popover {
  align-items: center;
  gap: 0;
}
.footer-docked .robot-speech {
  padding: 12px 32px 12px 11px;
}
.footer-docked .robot-speech strong {
  font-size: 13px;
}
.footer-docked .robot-speech > span {
  font-size: 10px;
  margin-top: 4px;
}
.footer-docked .robot-speech button {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  font-size: 0;
  justify-content: center;
}
.footer-docked .robot-speech button span {
  font-size: 16px;
}
