.feature-tour {
  --tour-light: #fff7e5;
  --tour-muted: #eef0ff;
  --tour-rule: #ffffff46;
  padding-block: clamp(44px, 6.5vw, 94px);
  color: var(--tour-light);
  background: var(--blue);
}

.tour-intro { max-width: 800px; margin-bottom: clamp(24px, 3.75vw, 50px); }
.tour-kicker {
  color: var(--yellow);
  font: 730 .76rem/1.25 var(--mono);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.tour-intro h2 {
  margin-block: 12px 19px;
  font-size: clamp(2.65rem, 5.8vw, 6rem);
  font-weight: 855;
  line-height: .99;
  letter-spacing: -.072em;
  text-wrap: balance;
}

.tour-intro h2 em { color: var(--yellow); font: italic 590 1em/.99 var(--editorial); }
.tour-intro > p:last-child, .tour-chapter-copy > p:not(.tour-kicker) { color: var(--tour-muted); }
.tour-intro > p:last-child { max-width: 54ch; font-size: clamp(.97rem, 1.55vw, 1.22rem); }

.tour-dock {
  position: sticky;
  top: clamp(12px, 3svh, 24px);
  z-index: 1;
  min-width: 0;
}
.tour-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--tour-rule);
  border-radius: 10px;
  background: linear-gradient(#ffffff12, #ffffff12), var(--blue);
}

.tour-nav button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding-inline: 6px;
  color: var(--tour-muted);
  font-size: .86rem;
  font-weight: 775;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.tour-nav button:hover { color: var(--tour-light); background: #ffffff13; }
.tour-nav button[aria-current] { color: var(--ink); background: var(--yellow); box-shadow: 0 2px 0 #6f481c; }
.tour-nav button:active { box-shadow: inset 0 2px 0 #1e20467d; }
.feature-tour :is(a,button,.tour-chapter):focus-visible { outline-color: var(--yellow); }

.tour-progress { display: none; }
.tour-enhanced .tour-progress {
  display: block;
  height: 3px;
  margin: 6px 4px 0;
  overflow: hidden;
  border-radius: 2px;
  background: var(--tour-rule);
}

.tour-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--yellow);
  transform: scaleX(var(--tour-scroll, 0));
  transform-origin: left center;
}

.tour-chapter {
  display: grid;
  align-items: center;
  padding-block: clamp(29px, 5vw, 65px);
  min-width: 0;
  gap: 21px;
  border-bottom: 1px solid var(--tour-rule);
  scroll-margin-top: max(clamp(14px, 5svh, 45px), var(--tour-anchor-space, 0px));
}

.tour-chapter:last-child { padding-bottom: 0; border-bottom: 0; }
.tour-chapter h3 {
  margin-block: 10px 12px;
  max-width: 16ch;
  font-size: clamp(1.85rem, 3.4vw, 3.65rem);
  line-height: 1.04;
  font-weight: 810;
  letter-spacing: -.058em;
  text-wrap: balance;
}

.tour-chapter-copy > p:not(.tour-kicker) { max-width: 39ch; font-size: clamp(.96rem, 1.18vw, 1.09rem); }
.tour-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .5em;
  margin-top: 7px;
  color: var(--tour-light);
  font-size: .89rem;
  font-weight: 730;
  text-underline-offset: .23em;
}

.tour-photo-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tour-photo-options button {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--tour-rule);
  border-radius: 6px;
  color: var(--tour-light);
  background: #ffffff12;
  font-size: .85rem;
  font-weight: 740;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.tour-photo-options button:hover { background: #ffffff24; }
.tour-photo-options button[aria-pressed="true"] { border-color: var(--yellow); background: var(--yellow); color: var(--ink); }
.tour-photo-options button:focus-visible { outline-color: var(--yellow); }
.tour-photo-options button[data-loading] { box-shadow: inset 0 -3px var(--yellow); cursor: progress; }

.tour-photo-feedback { margin-top: 6px; color: var(--tour-light); font-size: .85rem; }
.tour-photo-feedback:not([data-error]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.tour-stage {
  margin-top: 8px;
  padding: clamp(10px, 1.5vw, 18px);
  border: 1px solid var(--tour-rule);
  border-radius: 12px;
  background: var(--blue);
  box-shadow: 0 18px 32px #19244840;
}

.tour-stage-label {
  margin-bottom: 9px;
  color: var(--tour-muted);
  font: 700 .67rem/1.45 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tour-stage-label span { margin-inline: .28em; color: var(--yellow); }
.tour-stage-content { position: relative; min-block-size: clamp(285px, min(31vw, calc(100svh - 194px)), 470px); }
.tour-stage-content .tour-scene { position: absolute; inset: 0; min-block-size: 0; }

.tour-scene {
  position: relative;
  min-block-size: clamp(225px, 52vw, 375px);
  min-width: 0;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--tour-rule);
  border-radius: 9px;
  color: var(--ink);
  background:
    linear-gradient(#ffffff0f 1px, transparent 1px) 0 0 / 27px 27px,
    linear-gradient(90deg, #ffffff0f 1px, transparent 1px) 0 0 / 27px 27px,
    radial-gradient(ellipse at 92% 7%, #ffffff24, transparent 67%), var(--blue);
}

.tour-scene::before {
  position: absolute;
  inset: 7px;
  z-index: -1;
  border: 1px solid #ffffff32;
  border-radius: 6px;
  content: "";
}

.tour-enhanced .tour-scene::after {
  position: absolute;
  inset-block-end: 6px;
  inset-inline-start: calc(9px + (100% - 24px) * var(--tour-scroll, 0));
  inline-size: 6px;
  block-size: 4px;
  border-radius: 2px;
  background: var(--yellow);
  content: "";
}

.tour-scene h4 { margin: 0; color: inherit; font: 700 clamp(1rem, 2.1vw, 2.45rem)/1.02 var(--editorial); letter-spacing: -.045em; }
.tour-sheet-label, .tour-sheet-section {
  font: 760 clamp(.49rem, .81vw, .7rem)/1.25 var(--mono);
  letter-spacing: .065em;
  text-transform: uppercase;
}

.tour-menu-sheet, .tour-special-ticket, .tour-page-editor, .tour-navbar-example, .tour-desktop-preview, .tour-phone-preview {
  position: absolute;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #1b224b4f;
  border-radius: 6px;
  box-shadow: 5px 8px 0 #13214a58, 0 15px 28px #10183b46;
}

.tour-menu-sheet {
  inset: 12% 36% auto 8%;
  padding: clamp(11px, 2.25vw, 35px);
  rotate: -5deg;
  background: var(--ticket);
}

.tour-menu-sheet .tour-sheet-label { margin-bottom: 7px; color: #674d37; }
.tour-sheet-section { margin-top: clamp(10px, 2vw, 24px); padding-bottom: 5px; border-bottom: 1px solid #a7957a; }
.tour-menu-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 3px;
  padding-block: clamp(5px, .94vw, 11px);
  border-bottom: 1px dashed #a7957a85;
  font-size: clamp(.62rem, 1vw, .89rem);
  line-height: 1.18;
  font-weight: 675;
}

.tour-menu-row b { white-space: nowrap; font: 750 .9em/1 var(--mono); }
.tour-special-ticket { inset: 20% 7% 9% 57%; rotate: 6deg; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #ffe4a8; }
.tour-special-ticket img { width: 100%; height: 100%; object-fit: cover; object-position: 54% 50%; }
.tour-special-ticket > div { padding: clamp(7px, 1.65vw, 23px); }
.tour-special-ticket h4 { margin-top: 5px; font-size: clamp(.9rem, 1.85vw, 2.05rem); }

.tour-page-editor {
  inset: 10% 22% 26% 10%;
  padding: clamp(13px, 2.35vw, 33px);
  rotate: -4deg;
  background: var(--ticket);
}

.tour-page-editor h4 { margin-top: 8px; }
.tour-page-editor > p:not(.tour-sheet-label) { margin-top: 6px; max-width: 27ch; font-size: clamp(.64rem, 1vw, .9rem); }
.tour-page-lines { display: grid; gap: 7px; margin-top: clamp(9px, 1.6vw, 20px); }
.tour-page-lines i { width: 85%; height: 3px; border-radius: 6px; background: #8f97af57; }
.tour-page-lines i:nth-child(2) { width: 68%; }
.tour-page-lines i:nth-child(3) { width: 75%; }
.tour-navbar-example {
  inset: auto 7% 13% 22%;
  padding: clamp(9px, 1.85vw, 26px);
  rotate: 4deg;
  color: var(--tour-light);
  background: var(--ink);
}

.tour-nav-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(3px, 1.22vw, 15px);
  margin-top: 6px;
  font-size: clamp(.61rem, 1.05vw, .92rem);
  font-weight: 715;
}

.tour-nav-preview strong { padding: 3px 6px; border-radius: 4px; color: var(--ink); background: var(--yellow); }

.tour-desktop-preview { inset: 9% 18% 20% 7%; display: grid; grid-template-rows: auto minmax(0, 1fr); rotate: -4deg; background: #f5e7d2; }
.tour-browser-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: clamp(5px, 1vw, 11px);
  border-bottom: 1px solid #a09bb44f;
  font: 700 clamp(.5rem, .76vw, .69rem)/1.2 var(--mono);
}

.tour-browser-bar i { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); opacity: .55; }
.tour-browser-bar i:last-of-type { margin-right: 5px; }
.tour-bakery-preview { display: grid; grid-template-columns: .83fr 1fr; min-height: 0; background: #903a31; color: var(--tour-light); }
.tour-bakery-preview > div { align-self: center; padding: clamp(6px, 1.35vw, 20px); }
.tour-bakery-preview p { margin-bottom: 5px; font-size: clamp(.57rem, 1vw, .88rem); font-weight: 800; }
.tour-bakery-preview h4 { font-size: clamp(.86rem, 1.92vw, 2.25rem); }
.tour-bakery-preview img, .tour-phone-screen img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; object-position: center 63%; }
.tour-phone-preview {
  inset: 27% 8% 7% 68%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: clamp(3px, .7vw, 9px);
  border: 2px solid #131b3a;
  border-radius: 10px;
  rotate: 5deg;
  background: var(--ink);
}

.tour-phone-preview > p { padding: 4px 0 5px; color: var(--tour-light); font: 710 clamp(.5rem, .68vw, .65rem)/1.2 var(--mono); text-align: center; }
.tour-phone-screen { display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: #903a31; color: var(--tour-light); }
.tour-phone-screen h4 { padding: clamp(4px, .7vw, 9px); font-size: clamp(.57rem, 1.17vw, 1.15rem); }

/* One completed handoff per chapter change or inline scene entrance. */
.tour-scene:is(.is-current, .is-illustrated) { animation: tour-stage-in 530ms cubic-bezier(.18,.72,.24,1) backwards; }
.tour-stage[data-direction="back"] { --tour-direction: -1; }
.tour-scene:is(.is-current,.is-illustrated) :is(.tour-menu-sheet,.tour-page-editor,.tour-desktop-preview) {
  animation: tour-surface-in 610ms 55ms cubic-bezier(.19,.77,.24,1) backwards;
}
.tour-scene:is(.is-current,.is-illustrated) :is(.tour-special-ticket,.tour-navbar-example,.tour-phone-preview) {
  animation: tour-result-in 660ms 175ms cubic-bezier(.17,.78,.23,1) backwards;
}
.tour-scene:is(.is-current,.is-illustrated) .tour-nav-preview strong {
  animation: tour-nav-in 440ms 315ms cubic-bezier(.16,.79,.24,1) backwards;
}
.tour-scene:is(.is-current,.is-illustrated) .tour-menu-row:first-of-type b {
  animation: tour-price-mark 720ms 145ms ease-out backwards;
}

@keyframes tour-stage-in {
  from { clip-path: inset(6% 0 9%); translate: calc(var(--tour-direction, 1) * 15px) 7px; opacity: .86; }
  to { clip-path: inset(0); }
}
@keyframes tour-surface-in {
  from { translate: calc(var(--tour-direction, 1) * -13%) 11%; scale: .94; rotate: -10deg; opacity: .8; }
}
@keyframes tour-result-in {
  from { translate: calc(var(--tour-direction, 1) * 19%) 13%; scale: .82; rotate: 15deg; opacity: .75; }
}
@keyframes tour-nav-in {
  from { translate: -28px 0; scale: .84; }
}
@keyframes tour-price-mark {
  from, 38% { background: var(--yellow); }
}

@media (min-width: 720px) {
  .tour-chapter { grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr); }
  .tour-enhanced .tour-layout { display: grid; align-items: start; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: clamp(24px, 6vw, 99px); }
  .tour-enhanced .tour-dock { grid-column: 2; grid-row: 1; top: clamp(18px, 8svh, 63px); }
  .tour-enhanced .tour-chapters { grid-column: 1; grid-row: 1; }
  .tour-enhanced .tour-chapter {
    grid-template-columns: minmax(0, 1fr);
    min-block-size: clamp(319px, 55svh, 450px);
    padding-block: clamp(27px, 7svh, 70px);
  }
}

@media (max-width: 480px) {
  .tour-stage-content { min-block-size: 250px; }
  .tour-special-ticket { right: 5%; left: 59%; }
  .tour-menu-sheet { left: 6%; right: 34%; }
  .tour-phone-preview { right: 6%; }
}
